qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio-pci: correctly set virtio pci queue mem multiplier
@ 2024-02-12  7:52 Srujana Challa
  2024-02-13 10:47 ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Srujana Challa @ 2024-02-12  7:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst, vattunuru, jerinj, schalla

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 <schalla@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



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-02-19 18:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-12  7:52 [PATCH] virtio-pci: correctly set virtio pci queue mem multiplier Srujana Challa
2024-02-13 10:47 ` Michael S. Tsirkin
2024-02-13 11:50   ` [EXT] " Srujana Challa
2024-02-13 12:03     ` Michael S. Tsirkin
2024-02-13 12:37       ` Srujana Challa
2024-02-13 15:53         ` Michael S. Tsirkin
2024-02-19 18:15           ` Srujana Challa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).