[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 8/9] vfio/igd: emulate BDSM in mmio bar0 for gen 6-10 devi
From: |
Corvin Köhne |
Subject: |
Re: [PATCH v2 8/9] vfio/igd: emulate BDSM in mmio bar0 for gen 6-10 devices |
Date: |
Tue, 3 Dec 2024 16:24:46 +0000 |
On Tue, 2024-12-03 at 21:35 +0800, Tomita Moeko wrote:
> CAUTION: External Email!!
> A recent commit in i915 driver [1] claims the BDSM register at 0x1080c0
> of mmio bar0 has been there since gen 6. Mirror this register to the 32
> bit BDSM register at 0x5c in pci config space for gen6-10 devices.
>
> [1]
> https://nospamproxywebp.beckhoff.com/enQsig/link?id=BAgAAACDiMFDAVNh97kAAACXccDLV2jHgpqoPX7MzgRYJ_QvhHcIgEu_cy5EZCuBkJVjGfUQRHJIyDHnpjPw2eMGixZwJxpCSnGEWYbfEqWqFznDz1dMDFEfcjfnUY47OWkKRXq2MCufjXyHUAP2VyS_NKnpJ0Va7uajM38HaSV4dvGWO_CRkUuqInMmibaFge3X_Sk0bzFI_MfYGVBN1TvIzITrYCLcmKwyp9-oS61DI7iv29IZB9I0WJURq0t1Nk0h-22zlXjxrQ2
>
>
> Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
> ---
> hw/vfio/igd.c | 26 ++++++++++++++++++--------
> 1 file changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c
> index bc18fc8cc0..e464cd6949 100644
> --- a/hw/vfio/igd.c
> +++ b/hw/vfio/igd.c
> @@ -484,7 +484,8 @@ static const MemoryRegionOps vfio_igd_quirk_mirror_##name
> = { \
> };
>
> VFIO_IGD_QUIRK_MIRROR_REG(IGD_GMCH, ggc)
> -VFIO_IGD_QUIRK_MIRROR_REG(IGD_BDSM_GEN11, bdsm)
> +VFIO_IGD_QUIRK_MIRROR_REG(IGD_BDSM, bdsm)
> +VFIO_IGD_QUIRK_MIRROR_REG(IGD_BDSM_GEN11, bdsm64)
>
> #define IGD_GGC_MMIO_OFFSET 0x108040
> #define IGD_BDSM_MMIO_OFFSET 0x1080C0
> @@ -511,7 +512,7 @@ void vfio_probe_igd_bar0_quirk(VFIOPCIDevice *vdev, int
> nr)
> * into MMIO space and read from MMIO space by the Windows driver.
> */
> gen = igd_gen(vdev);
> - if (gen < 11) {
> + if (gen < 6) {
> return;
> }
>
> @@ -525,12 +526,21 @@ void vfio_probe_igd_bar0_quirk(VFIOPCIDevice *vdev, int
> nr)
> IGD_GGC_MMIO_OFFSET, &quirk->mem[0],
> 1);
>
> - memory_region_init_io(&quirk->mem[1], OBJECT(vdev),
> - &vfio_igd_quirk_mirror_bdsm, vdev,
> - "vfio-igd-bdsm-quirk", 8);
> - memory_region_add_subregion_overlap(vdev->bars[0].region.mem,
> - IGD_BDSM_MMIO_OFFSET, &quirk->mem[1],
> - 1);
> + if (gen < 11) {
> + memory_region_init_io(&quirk->mem[1], OBJECT(vdev),
> + &vfio_igd_quirk_mirror_bdsm, vdev,
> + "vfio-igd-bdsm-quirk", 4);
> + memory_region_add_subregion_overlap(vdev->bars[0].region.mem,
> + IGD_BDSM_MMIO_OFFSET,
> + &quirk->mem[1], 1);
> + } else {
> + memory_region_init_io(&quirk->mem[1], OBJECT(vdev),
> + &vfio_igd_quirk_mirror_bdsm64, vdev,
> + "vfio-igd-bdsm-quirk", 8);
> + memory_region_add_subregion_overlap(vdev->bars[0].region.mem,
> + IGD_BDSM_MMIO_OFFSET,
> + &quirk->mem[1], 1);
> + }
>
> QLIST_INSERT_HEAD(&vdev->bars[nr].quirks, quirk, next);
> }
Reviewed-by: Corvin Köhne <c.koehne@beckhoff.com>
signature.asc
Description: This is a digitally signed message part
- Re: [PATCH v2 5/9] vfio/igd: add Alder/Raptor/Rocket/Ice/Jasper Lake device ids, (continued)
- [PATCH v2 6/9] vfio/igd: add macro for declaring mirrored registers, Tomita Moeko, 2024/12/03
- [PATCH v2 7/9] vfio/igd: emulate GGC register in mmio bar0, Tomita Moeko, 2024/12/03
- [PATCH v2 9/9] vfio/igd: add x-igd-gms option back to set DSM region size for guest, Tomita Moeko, 2024/12/03
- [PATCH v2 8/9] vfio/igd: emulate BDSM in mmio bar0 for gen 6-10 devices, Tomita Moeko, 2024/12/03
- Re: [PATCH v2 8/9] vfio/igd: emulate BDSM in mmio bar0 for gen 6-10 devices,
Corvin Köhne <=
- Re: [PATCH v2 0/9] vfio/igd: Enable legacy mode on more devices, Alex Williamson, 2024/12/03