Currently, virtio_pci_queue_mem_mult function returns 4K when VIRTIO_PCI_FLAG_PAGE_PER_VQ is set. But this is not correct when host has page size as 64K. This patch fixes the same.
Signed-off-by: Srujana Challa <scha...@marvell.com> --- hw/virtio/virtio-pci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index e433879542..028df99991 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -316,12 +316,10 @@ static bool virtio_pci_ioeventfd_enabled(DeviceState *d) return (proxy->flags & VIRTIO_PCI_FLAG_USE_IOEVENTFD) != 0; } -#define QEMU_VIRTIO_PCI_QUEUE_MEM_MULT 0x1000 - static inline int virtio_pci_queue_mem_mult(struct VirtIOPCIProxy *proxy) { return (proxy->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ) ? - QEMU_VIRTIO_PCI_QUEUE_MEM_MULT : 4; + qemu_real_host_page_size() : 4; } static int virtio_pci_ioeventfd_assign(DeviceState *d, EventNotifier *notifier, -- 2.25.1