From: Alex Williamson <alex.williamson@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 06/11] vfio/pci: Emulate BARs
Date: Mon, 05 Feb 2018 11:57:36 -0700 [thread overview]
Message-ID: <20180205185736.14391.44601.stgit@gimli.home> (raw)
In-Reply-To: <20180205185416.14391.5739.stgit@gimli.home>
The kernel provides similar emulation of PCI BAR register access to
QEMU, so up until now we've used that for things like BAR sizing and
storing the BAR address. However, if we intend to resize BARs or add
BARs that don't exist on the physical device, we need to switch to the
pure QEMU emulation of the BAR.
Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
hw/vfio/pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 908b8dffca2b..9436ac5cc9ae 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2777,6 +2777,8 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
/* QEMU can choose to expose the ROM or not */
memset(vdev->emulated_config_bits + PCI_ROM_ADDRESS, 0xff, 4);
+ /* QEMU can also add or extend BARs */
+ memset(vdev->emulated_config_bits + PCI_BASE_ADDRESS_0, 0xff, 6 * 4);
/*
* The PCI spec reserves vendor ID 0xffff as an invalid value. The
next prev parent reply other threads:[~2018-02-05 18:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-05 18:56 [Qemu-devel] [PULL 00/11] VFIO updates 2018-02-05 Alex Williamson
2018-02-05 18:56 ` [Qemu-devel] [PULL 01/11] memory/iommu: Add get_attr() Alex Williamson
2018-02-05 18:56 ` [Qemu-devel] [PULL 02/11] vfio/spapr: Use iommu memory region's get_attr() Alex Williamson
2018-02-05 18:57 ` [Qemu-devel] [PULL 03/11] spapr/iommu: Enable in-kernel TCE acceleration via VFIO KVM device Alex Williamson
2018-02-05 18:57 ` [Qemu-devel] [PULL 04/11] vfio/pci: Fixup VFIOMSIXInfo comment Alex Williamson
2018-02-05 18:57 ` [Qemu-devel] [PULL 05/11] vfio/pci: Add base BAR MemoryRegion Alex Williamson
2018-02-05 18:57 ` Alex Williamson [this message]
2018-02-05 18:57 ` [Qemu-devel] [PULL 07/11] qapi: Create DEFINE_PROP_OFF_AUTO_PCIBAR Alex Williamson
2018-02-05 18:57 ` [Qemu-devel] [PULL 08/11] vfio/pci: Allow relocating MSI-X MMIO Alex Williamson
2018-02-05 18:58 ` [Qemu-devel] [PULL 09/11] hw/vfio/platform: Init the interrupt mutex Alex Williamson
2018-02-05 18:58 ` [Qemu-devel] [PULL 10/11] vfio/common: Remove redundant copy of local variable Alex Williamson
2018-02-05 18:58 ` [Qemu-devel] [PULL 11/11] vfio/pci: Add option to disable GeForce quirks Alex Williamson
2018-02-06 17:34 ` [Qemu-devel] [PULL 00/11] VFIO updates 2018-02-05 Peter Maydell
2018-02-06 18:04 ` Alex Williamson
-- strict thread matches above, loose matches on Subject: below --
2018-02-06 18:42 [Qemu-devel] [PULL 00/11] VFIO updates 2018-02-06 Alex Williamson
2018-02-06 18:43 ` [Qemu-devel] [PULL 06/11] vfio/pci: Emulate BARs Alex Williamson
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=20180205185736.14391.44601.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 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).