All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 1/3] vfio/pci: Hide Resizable BAR capability
Date: Thu, 13 Jun 2019 15:33:45 -0600	[thread overview]
Message-ID: <156046162538.26543.2016700244609366109.stgit@gimli.home> (raw)
In-Reply-To: <156046151566.26543.17274661862206856605.stgit@gimli.home>

The resizable BAR capability is currently exposed read-only from the
kernel and we don't yet implement a protocol for virtualizing it to
the VM.  Exposing it to the guest read-only introduces poor behavior
as the guest has no reason to test that a control register write is
accepted by the hardware.  This can lead to cases where the guest OS
assumes the BAR has been resized, but it hasn't.  This has been
observed when assigning AMD Vega GPUs.

Note, this does not preclude future enablement of resizable BARs, but
it's currently incorrect to expose this capability as read-only, so
better to not expose it at all.

Reported-by: James Courtier-Dutton <james.dutton@gmail.com>
Tested-by: James Courtier-Dutton <james.dutton@gmail.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 hw/vfio/pci.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 4a04f795162b..48f4e19a02cf 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2119,6 +2119,7 @@ static void vfio_add_ext_cap(VFIOPCIDevice *vdev)
         case 0: /* kernel masked capability */
         case PCI_EXT_CAP_ID_SRIOV: /* Read-only VF BARs confuse OVMF */
         case PCI_EXT_CAP_ID_ARI: /* XXX Needs next function virtualization */
+        case PCI_EXT_CAP_ID_REBAR: /* Can't expose read-only */
             trace_vfio_add_ext_cap_dropped(vdev->vbasedev.name, cap_id, next);
             break;
         default:



  reply	other threads:[~2019-06-13 21:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 21:33 [Qemu-devel] [PULL 0/3] vfio updates 2019-06-13 Alex Williamson
2019-06-13 21:33 ` Alex Williamson [this message]
2019-06-13 21:33 ` [Qemu-devel] [PULL 2/3] vfio/pci: Allow MSI-X relocation to fixup bogus PBA Alex Williamson
2019-06-13 21:34 ` [Qemu-devel] [PULL 3/3] vfio/common: Introduce vfio_set_irq_signaling helper Alex Williamson
2019-07-02 10:37   ` Peter Maydell
2019-07-02 12:32     ` Auger Eric
2019-07-02 15:55       ` Alex Williamson
2019-07-02 15:58         ` Peter Maydell
2019-07-02 16:30           ` Alex Williamson
2019-07-02 16:33             ` Auger Eric
2019-06-14  9:04 ` [Qemu-devel] [PULL 0/3] vfio updates 2019-06-13 Peter Maydell

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=156046162538.26543.2016700244609366109.stgit@gimli.home \
    --to=alex.williamson@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.