Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt to spec changes #5

Merged
merged 1 commit into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions hw/vfio/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -3437,24 +3437,6 @@ static int vfio_user_dma_write(VFIOPCIDevice *vdev, struct vfio_user_dma_rw *msg
return 0;
}

static int vfio_user_vm_intr(VFIOPCIDevice *vdev, struct vfio_user_vm_intr *msg)
{

/* TODO */
switch (msg->index) {
case VFIO_PCI_INTX_IRQ_INDEX:
case VFIO_PCI_MSI_IRQ_INDEX:
case VFIO_PCI_MSIX_IRQ_INDEX:
default:
break;
}

if ((msg->hdr.flags & VFIO_USER_NO_REPLY) == 0) {
vfio_user_send_reply(vdev->vbasedev.proxy, (char *)msg, 0);
}
return 0;
}

static int vfio_user_pci_process_req(void *opaque, char *buf, VFIOUserFDs *fds)
{
VFIOPCIDevice *vdev = opaque;
Expand All @@ -3471,9 +3453,6 @@ static int vfio_user_pci_process_req(void *opaque, char *buf, VFIOUserFDs *fds)
case VFIO_USER_DMA_WRITE:
ret = vfio_user_dma_write(vdev, (struct vfio_user_dma_rw *)hdr);
break;
case VFIO_USER_VM_INTERRUPT:
ret = vfio_user_vm_intr(vdev, (struct vfio_user_vm_intr *)hdr);
break;
default:
error_printf("vfio_user_process_req unknown cmd %d\n", hdr->command);
ret = -ENOSYS;
Expand Down
2 changes: 1 addition & 1 deletion hw/vfio/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ int vfio_user_dma_unmap(VFIOProxy *proxy,

vfio_user_request_msg(&msgp->msg.hdr, VFIO_USER_DMA_UNMAP, msize, 0);
msgp->msg.argsz = unmap->argsz;
msgp->msg.flags = unmap->size;
msgp->msg.flags = unmap->flags;
msgp->msg.iova = unmap->iova;
msgp->msg.size = unmap->size;

Expand Down
32 changes: 17 additions & 15 deletions hw/vfio/user.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,23 @@ typedef struct vfio_user_hdr {
} vfio_user_hdr_t;

/* commands */
#define VFIO_USER_VERSION 1
#define VFIO_USER_DMA_MAP 2
#define VFIO_USER_DMA_UNMAP 3
#define VFIO_USER_DEVICE_GET_INFO 4
#define VFIO_USER_DEVICE_GET_REGION_INFO 5
#define VFIO_USER_DEVICE_GET_IRQ_INFO 6
#define VFIO_USER_DEVICE_SET_IRQS 7
#define VFIO_USER_REGION_READ 8
#define VFIO_USER_REGION_WRITE 9
#define VFIO_USER_DMA_READ 10
#define VFIO_USER_DMA_WRITE 11
#define VFIO_USER_VM_INTERRUPT 12
#define VFIO_USER_DEVICE_RESET 13
#define VFIO_USER_DIRTY_PAGES 14
#define VFIO_USER_DMA_UNMAP_DIRTY 15
enum vfio_user_command {
VFIO_USER_VERSION = 1,
VFIO_USER_DMA_MAP = 2,
VFIO_USER_DMA_UNMAP = 3,
VFIO_USER_DEVICE_GET_INFO = 4,
VFIO_USER_DEVICE_GET_REGION_INFO = 5,
VFIO_USER_DEVICE_GET_REGION_IO_FDS = 6,
VFIO_USER_DEVICE_GET_IRQ_INFO = 7,
VFIO_USER_DEVICE_SET_IRQS = 8,
VFIO_USER_REGION_READ = 9,
VFIO_USER_REGION_WRITE = 10,
VFIO_USER_DMA_READ = 11,
VFIO_USER_DMA_WRITE = 12,
VFIO_USER_DEVICE_RESET = 13,
VFIO_USER_DIRTY_PAGES = 14,
VFIO_USER_MAX,
};

/* flags */
#define VFIO_USER_REQUEST 0x0
Expand Down