All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Srujana Challa <schalla@marvell.com>
Cc: qemu-devel@nongnu.org, vattunuru@marvell.com, jerinj@marvell.com
Subject: Re: [PATCH] virtio-pci: correctly set virtio pci queue mem multiplier
Date: Tue, 13 Feb 2024 05:47:18 -0500	[thread overview]
Message-ID: <20240213054513-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20240212075233.1507612-1-schalla@marvell.com>

On Mon, Feb 12, 2024 at 01:22:33PM +0530, Srujana Challa wrote:
> 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>

You can't tweak guest visible values like this without
compat machinery. It's also going to consume a ton more
phys memory - can this break any configs?
Why is this a problem? Just with vdpa?

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



  reply	other threads:[~2024-02-13 10:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240213054513-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=jerinj@marvell.com \
    --cc=qemu-devel@nongnu.org \
    --cc=schalla@marvell.com \
    --cc=vattunuru@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.