* [Qemu-devel] [PULL 0/3] VFIO updates 2017-02-10 @ 2017-02-10 21:42 Alex Williamson 2017-02-10 21:43 ` [Qemu-devel] [PULL 1/3] vfio-pci: Fix GTT wrap-around for Skylake+ IGD Alex Williamson ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: Alex Williamson @ 2017-02-10 21:42 UTC (permalink / raw) To: qemu-devel The following changes since commit 98b2faeaee96ab084d0b1669918688d8895c155f: Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging (2017-02-10 18:07:02 +0000) are available in the git repository at: git://github.com/awilliam/qemu-vfio.git tags/vfio-updates-20170210.0 for you to fetch changes up to e197de50c6cfad69d2c26c22693b57678ae99d14: hw/vfio: Add CONFIG switches for calxeda-xgmac and amd-xgbe (2017-02-10 13:12:03 -0700) ---------------------------------------------------------------- VFIO updates 2017-02-10 - Fix GTT wrap-around for Skylake IGD assignment (Alex Williamson) - Tag vfio-pci-igd-lpc-bridge as bridge device category (Thomas Huth) - Don't build calxeda-xgmac or amd-xgbe except on ARM (Thomas Huth) ---------------------------------------------------------------- Alex Williamson (1): vfio-pci: Fix GTT wrap-around for Skylake+ IGD Thomas Huth (2): hw/vfio/pci-quirks: Set category of the "vfio-pci-igd-lpc-bridge" device hw/vfio: Add CONFIG switches for calxeda-xgmac and amd-xgbe default-configs/arm-softmmu.mak | 2 ++ hw/vfio/Makefile.objs | 4 ++-- hw/vfio/pci-quirks.c | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PULL 1/3] vfio-pci: Fix GTT wrap-around for Skylake+ IGD 2017-02-10 21:42 [Qemu-devel] [PULL 0/3] VFIO updates 2017-02-10 Alex Williamson @ 2017-02-10 21:43 ` Alex Williamson 2017-02-10 21:43 ` [Qemu-devel] [PULL 2/3] hw/vfio/pci-quirks: Set category of the "vfio-pci-igd-lpc-bridge" device Alex Williamson ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: Alex Williamson @ 2017-02-10 21:43 UTC (permalink / raw) To: qemu-devel Previous IGD, up through Broadwell, only seem to write GTT values into the first 1MB of space allocated for the BDSM, but clearly the GTT can be multiple MB in size. Our test in vfio_igd_quirk_data_write() correctly filters out indexes beyond 1MB, but given the 1MB mask we're using, we re-apply writes only to the first 1MB of the guest allocated BDSM. We can't assume either the host or guest BDSM is naturally aligned, so we can't simply apply a different mask. Instead, save the host BDSM and do the arithmetic to subtract the host value to get the BDSM offset and add it to the guest allocated BDSM. Reported-by: Alexander Indenbaum <alexander.indenbaum@gmail.com> Tested-by: Alexander Indenbaum <alexander.indenbaum@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> --- hw/vfio/pci-quirks.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index 6c771f778bd0..ec0feca376f6 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -1041,6 +1041,7 @@ static int igd_gen(VFIOPCIDevice *vdev) typedef struct VFIOIGDQuirk { struct VFIOPCIDevice *vdev; uint32_t index; + uint32_t bdsm; } VFIOIGDQuirk; #define IGD_GMCH 0x50 /* Graphics Control Register */ @@ -1304,7 +1305,7 @@ static void vfio_igd_quirk_data_write(void *opaque, hwaddr addr, "BIOS reserved stolen memory. Unsupported BIOS?"); } - val = base | (data & ((1 << 20) - 1)); + val = data - igd->bdsm + base; } else { val = 0; /* upper 32bits of pte, we only enable below 4G PTEs */ } @@ -1503,6 +1504,8 @@ static void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr) igd = quirk->data = g_malloc0(sizeof(*igd)); igd->vdev = vdev; igd->index = ~0; + igd->bdsm = vfio_pci_read_config(&vdev->pdev, IGD_BDSM, 4); + igd->bdsm &= ~((1 << 20) - 1); /* 1MB aligned */ memory_region_init_io(&quirk->mem[0], OBJECT(vdev), &vfio_igd_index_quirk, igd, "vfio-igd-index-quirk", 4); ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PULL 2/3] hw/vfio/pci-quirks: Set category of the "vfio-pci-igd-lpc-bridge" device 2017-02-10 21:42 [Qemu-devel] [PULL 0/3] VFIO updates 2017-02-10 Alex Williamson 2017-02-10 21:43 ` [Qemu-devel] [PULL 1/3] vfio-pci: Fix GTT wrap-around for Skylake+ IGD Alex Williamson @ 2017-02-10 21:43 ` Alex Williamson 2017-02-10 21:43 ` [Qemu-devel] [PULL 3/3] hw/vfio: Add CONFIG switches for calxeda-xgmac and amd-xgbe Alex Williamson 2017-02-13 10:15 ` [Qemu-devel] [PULL 0/3] VFIO updates 2017-02-10 Peter Maydell 3 siblings, 0 replies; 5+ messages in thread From: Alex Williamson @ 2017-02-10 21:43 UTC (permalink / raw) To: qemu-devel From: Thomas Huth <thuth@redhat.com> The device has "bridge" in its name, so it should obviously be in the category DEVICE_CATEGORY_BRIDGE. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> --- hw/vfio/pci-quirks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index ec0feca376f6..e9b493b939db 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -1186,6 +1186,7 @@ static void vfio_pci_igd_lpc_bridge_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->desc = "VFIO dummy ISA/LPC bridge for IGD assignment"; dc->hotpluggable = false; k->realize = vfio_pci_igd_lpc_bridge_realize; ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PULL 3/3] hw/vfio: Add CONFIG switches for calxeda-xgmac and amd-xgbe 2017-02-10 21:42 [Qemu-devel] [PULL 0/3] VFIO updates 2017-02-10 Alex Williamson 2017-02-10 21:43 ` [Qemu-devel] [PULL 1/3] vfio-pci: Fix GTT wrap-around for Skylake+ IGD Alex Williamson 2017-02-10 21:43 ` [Qemu-devel] [PULL 2/3] hw/vfio/pci-quirks: Set category of the "vfio-pci-igd-lpc-bridge" device Alex Williamson @ 2017-02-10 21:43 ` Alex Williamson 2017-02-13 10:15 ` [Qemu-devel] [PULL 0/3] VFIO updates 2017-02-10 Peter Maydell 3 siblings, 0 replies; 5+ messages in thread From: Alex Williamson @ 2017-02-10 21:43 UTC (permalink / raw) To: qemu-devel From: Thomas Huth <thuth@redhat.com> Both devices seem to be specific to the ARM platform. It's confusing for the users if they show up on other target architectures, too (e.g. when the user runs QEMU with "-device ?" to get a list of supported devices). Thus let's introduce proper configuration switches so that the devices are only compiled and included when they are really required. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> --- default-configs/arm-softmmu.mak | 2 ++ hw/vfio/Makefile.objs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak index 824fa71ba957..fdf40893aace 100644 --- a/default-configs/arm-softmmu.mak +++ b/default-configs/arm-softmmu.mak @@ -95,6 +95,8 @@ CONFIG_VERSATILE_PCI=y CONFIG_VERSATILE_I2C=y CONFIG_PCI_GENERIC=y +CONFIG_VFIO_XGMAC=y +CONFIG_VFIO_AMD_XGBE=y CONFIG_SDHCI=y CONFIG_INTEGRATOR_DEBUG=y diff --git a/hw/vfio/Makefile.objs b/hw/vfio/Makefile.objs index c25e32b02999..05e7fbb93fd4 100644 --- a/hw/vfio/Makefile.objs +++ b/hw/vfio/Makefile.objs @@ -2,7 +2,7 @@ ifeq ($(CONFIG_LINUX), y) obj-$(CONFIG_SOFTMMU) += common.o obj-$(CONFIG_PCI) += pci.o pci-quirks.o obj-$(CONFIG_SOFTMMU) += platform.o -obj-$(CONFIG_SOFTMMU) += calxeda-xgmac.o -obj-$(CONFIG_SOFTMMU) += amd-xgbe.o +obj-$(CONFIG_VFIO_XGMAC) += calxeda-xgmac.o +obj-$(CONFIG_VFIO_AMD_XGBE) += amd-xgbe.o obj-$(CONFIG_SOFTMMU) += spapr.o endif ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] VFIO updates 2017-02-10 2017-02-10 21:42 [Qemu-devel] [PULL 0/3] VFIO updates 2017-02-10 Alex Williamson ` (2 preceding siblings ...) 2017-02-10 21:43 ` [Qemu-devel] [PULL 3/3] hw/vfio: Add CONFIG switches for calxeda-xgmac and amd-xgbe Alex Williamson @ 2017-02-13 10:15 ` Peter Maydell 3 siblings, 0 replies; 5+ messages in thread From: Peter Maydell @ 2017-02-13 10:15 UTC (permalink / raw) To: Alex Williamson; +Cc: QEMU Developers On 10 February 2017 at 21:42, Alex Williamson <alex.williamson@redhat.com> wrote: > The following changes since commit 98b2faeaee96ab084d0b1669918688d8895c155f: > > Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into > staging (2017-02-10 18:07:02 +0000) > > are available in the git repository at: > > > git://github.com/awilliam/qemu-vfio.git tags/vfio-updates-20170210.0 > > for you to fetch changes up to e197de50c6cfad69d2c26c22693b57678ae99d14: > > hw/vfio: Add CONFIG switches for calxeda-xgmac and amd-xgbe (2017-02-10 > 13:12:03 -0700) > > ---------------------------------------------------------------- > VFIO updates 2017-02-10 > > - Fix GTT wrap-around for Skylake IGD assignment (Alex Williamson) > - Tag vfio-pci-igd-lpc-bridge as bridge device category (Thomas Huth) > - Don't build calxeda-xgmac or amd-xgbe except on ARM (Thomas Huth) > > ---------------------------------------------------------------- > Alex Williamson (1): > vfio-pci: Fix GTT wrap-around for Skylake+ IGD > > Thomas Huth (2): > hw/vfio/pci-quirks: Set category of the "vfio-pci-igd-lpc-bridge" device > hw/vfio: Add CONFIG switches for calxeda-xgmac and amd-xgbe Applied, thanks. -- PMM ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-02-13 10:16 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-02-10 21:42 [Qemu-devel] [PULL 0/3] VFIO updates 2017-02-10 Alex Williamson 2017-02-10 21:43 ` [Qemu-devel] [PULL 1/3] vfio-pci: Fix GTT wrap-around for Skylake+ IGD Alex Williamson 2017-02-10 21:43 ` [Qemu-devel] [PULL 2/3] hw/vfio/pci-quirks: Set category of the "vfio-pci-igd-lpc-bridge" device Alex Williamson 2017-02-10 21:43 ` [Qemu-devel] [PULL 3/3] hw/vfio: Add CONFIG switches for calxeda-xgmac and amd-xgbe Alex Williamson 2017-02-13 10:15 ` [Qemu-devel] [PULL 0/3] VFIO updates 2017-02-10 Peter Maydell
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).