diff options
| author | Corvin Köhne <corvin.koehne@gmail.com> | 2024-08-28 15:43:25 +0200 |
|---|---|---|
| committer | Cédric Le Goater <clg@redhat.com> | 2024-09-17 10:37:55 +0200 |
| commit | 11b5ce95beecfd51d1b17858d23fe9cbb0b5783f (patch) | |
| tree | a7be64c87337857854662332f97650f18baae4fe /hw/vfio/pci-quirks.c | |
| parent | 7bafcd17672934284d59b82a2e2a876566c3f6f9 (diff) | |
| download | focaccia-qemu-11b5ce95beecfd51d1b17858d23fe9cbb0b5783f.tar.gz focaccia-qemu-11b5ce95beecfd51d1b17858d23fe9cbb0b5783f.zip | |
vfio/igd: add new bar0 quirk to emulate BDSM mirror
The BDSM register is mirrored into MMIO space at least for gen 11 and later devices. Unfortunately, the Windows driver reads the register value from MMIO space instead of PCI config space for those devices [1]. Therefore, we either have to keep a 1:1 mapping for the host and guest address or we have to emulate the MMIO register too. Using the igd in legacy mode is already hard due to it's many constraints. Keeping a 1:1 mapping may not work in all cases and makes it even harder to use. An MMIO emulation has to trap the whole MMIO page. This makes accesses to this page slower compared to using second level address translation. Nevertheless, it doesn't have any constraints and I haven't noticed any performance degradation yet making it a better solution. [1] https://github.com/projectacrn/acrn-hypervisor/blob/5c351bee0f6ae46250eefc07f44b4a31e770f3cf/devicemodel/hw/pci/passthrough.c#L650-L653 Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com> Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw/vfio/pci-quirks.c')
| -rw-r--r-- | hw/vfio/pci-quirks.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index 39dae72497..d37f722cce 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -1259,6 +1259,7 @@ void vfio_bar_quirk_setup(VFIOPCIDevice *vdev, int nr) vfio_probe_nvidia_bar0_quirk(vdev, nr); vfio_probe_rtl8168_bar2_quirk(vdev, nr); #ifdef CONFIG_VFIO_IGD + vfio_probe_igd_bar0_quirk(vdev, nr); vfio_probe_igd_bar4_quirk(vdev, nr); #endif } |