Hello Yuan

On 9/22/26 07:36, Yuan Wang wrote:
Meteor Lake and Arrow Lake GOP can read BAR0 MMIO offset 0x138914 to
detect whether direct framebuffer access via DSM is available.

In a VFIO passthrough VM, the guest cannot access the host DSM memory
region via such a pointer. If the guest GOP enables that path, it may
hand off a DSM-based framebuffer address that the guest cannot actually
use.

Intercept reads from the detection register and return 0 so the guest
does not enable the DSM-based path and instead keeps using the standard
BAR-based framebuffer address.

Suggested-by: Tomita Moeko <[email protected]>
Reviewed-by: Tomita Moeko <[email protected]>
Reviewed-by: Bosheng Xue <[email protected]>
Reviewed-by: Junjie Cao <[email protected]>
Reviewed-by: Cédric Le Goater <[email protected]>
Signed-off-by: Yuan Wang <[email protected]>
---
Changes:
v4:
- Address review comments from Tomita Moeko (update macro/variable
   names and comments).
- Pick up Reviewed-by tags from Tomita Moeko and Cédric Le Goater.

v3:
- Emulated register 0x138914 to return 0x0, which signals the guest
   GOP driver to fall back to BAR-based mapping since DSM is
   unavailable in the VM.

v2:
- Resending because the v1 patch was sent with an incorrect future
   system timestamp due to an unsynchronized local clock. No code
   changes.

Notes:
MTL/ARL device IDs remain in igd_gen().
This is required because vfio_probe_igd_bar0_quirk() checks the
generation before installing BAR0 quirks, and the 0x138914 quirk
is added afterward.
Meanwhile, we also plan to remove the bdsm-size check in the OVMF
offline patches.
---
  hw/vfio/igd.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
  1 file changed, 46 insertions(+), 3 deletions(-)


This change does not apply cleanly on :

    https://github.com/legoater/qemu vfio-next

because of :

  
https://lore.kernel.org/qemu-devel/[email protected]/

Could you please resend on top ?

Thanks,

C.


Reply via email to