From: Alex Williamson <alex.williamson@redhat.com>
To: qemu-devel@nongnu.org
Cc: eric.auger@redhat.com, aik@ozlabs.ru
Subject: [Qemu-devel] [PATCH v2 3/5] vfio/pci: Emulate BARs
Date: Wed, 10 Jan 2018 12:02:13 -0700 [thread overview]
Message-ID: <20180110190212.5389.67764.stgit@gimli.home> (raw)
In-Reply-To: <20180110190049.5389.12984.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.
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 46f1e7ed9933..20252ea7aeb7 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2773,6 +2773,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-01-10 19:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 19:01 [Qemu-devel] [PATCH v2 0/5] vfio/pci: MSI-X MMIO relocation Alex Williamson
2018-01-10 19:01 ` [Qemu-devel] [PATCH v2 1/5] vfio/pci: Fixup VFIOMSIXInfo comment Alex Williamson
2018-01-10 19:02 ` [Qemu-devel] [PATCH v2 2/5] vfio/pci: Add base BAR MemoryRegion Alex Williamson
2018-02-02 2:19 ` [Qemu-devel] [PATCH v3 " Alex Williamson
2018-01-10 19:02 ` Alex Williamson [this message]
2018-01-10 19:02 ` [Qemu-devel] [PATCH v2 4/5] qapi: Create DEFINE_PROP_OFF_AUTO_PCIBAR Alex Williamson
2018-01-24 15:49 ` Alex Williamson
2018-01-31 13:24 ` Markus Armbruster
2018-01-10 19:02 ` [Qemu-devel] [PATCH v2 5/5] vfio/pci: Allow relocating MSI-X MMIO Alex Williamson
2018-01-19 9:50 ` Auger Eric
2018-01-19 15:23 ` Alex Williamson
2018-01-19 15:27 ` Auger Eric
2018-01-15 3:39 ` [Qemu-devel] [PATCH v2 0/5] vfio/pci: MSI-X MMIO relocation Alexey Kardashevskiy
2018-01-19 10:26 ` Auger Eric
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=20180110190212.5389.67764.stgit@gimli.home \
--to=alex.williamson@redhat.com \
--cc=aik@ozlabs.ru \
--cc=eric.auger@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).