[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 8/8] vfio/igd: add x-igd-gms option back to set DSM region si
From: |
Corvin Köhne |
Subject: |
Re: [PATCH 8/8] vfio/igd: add x-igd-gms option back to set DSM region size for guest |
Date: |
Mon, 2 Dec 2024 09:48:51 +0000 |
On Mon, 2024-12-02 at 00:09 +0800, Tomita Moeko wrote:
> CAUTION: External Email!!
> DSM region is likely to store framebuffer in Windows, a small DSM
> region may cause display issues (e.g. half of the screen is black).
> By default, QEMU uses host's original value, which is determined by
> DVMT Pre-Allocated option in Intel FSP of host bios. Some vendors
> do not expose this config item to users. In such cases, x-igd-gms
> option can be used to manually set the data stolen memory size for
> guest.
>
> When DVMT Pre-Allocated option is available in host BIOS, user should
> set DSM region size there instead of using x-igd-gms option.
>
> Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
> ---
> hw/vfio/igd.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c
> index 3fd822241d..614223123b 100644
> --- a/hw/vfio/igd.c
> +++ b/hw/vfio/igd.c
> @@ -712,6 +712,23 @@ void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int
> nr)
>
> QLIST_INSERT_HEAD(&vdev->bars[nr].quirks, quirk, next);
>
> + /*
> + * Allow user to override dsm size using x-igd-gms option, in multiples
> of
> + * 32MiB. This option should only be used when the desired size cannot be
> + * set from DVMT Pre-Allocated option in host BIOS.
> + */
> + if (vdev->igd_gms) {
> + if (gen < 8 && vdev->igd_gms <= 0x10) {
> + gmch &= ~(IGD_GMCH_GEN6_GMS_MASK << IGD_GMCH_GEN6_GMS_SHIFT);
> + gmch |= vdev->igd_gms << IGD_GMCH_GEN6_GMS_SHIFT;
> + } else if (vdev->igd_gms <= 0x40) {
> + gmch &= ~(IGD_GMCH_GEN8_GMS_MASK << IGD_GMCH_GEN8_GMS_SHIFT);
> + gmch |= vdev->igd_gms << IGD_GMCH_GEN8_GMS_SHIFT;
> + } else {
> + error_report("Unsupported IGD GMS value 0x%x", vdev->igd_gms);
> + }
> + }
> +
> ggms_size = igd_gtt_memory_size(gen, gmch);
> gms_size = igd_stolen_memory_size(gen, gmch);
>
As mentioned in my commit removing the x-igd-gms option, I've seen issues on
Windows guest when
setting a wrong gms value. I can try to recheck this.
--
Kind regards,
Corvin
disable-disclaimer-BADE
signature.asc
Description: This is a digitally signed message part
- [PATCH 0/8] vfio/igd: Enable legacy mode on more devices, Tomita Moeko, 2024/12/01
- [PATCH 7/8] vfio/igd: emulate BDSM in mmio bar0 for gen 6-10 devices, Tomita Moeko, 2024/12/01
- [PATCH 8/8] vfio/igd: add x-igd-gms option back to set DSM region size for guest, Tomita Moeko, 2024/12/01
- Re: [PATCH 8/8] vfio/igd: add x-igd-gms option back to set DSM region size for guest,
Corvin Köhne <=
- [PATCH 6/8] vfio/igd: emulate GGC register in mmio bar0, Tomita Moeko, 2024/12/01
- [PATCH 3/8] vfio/igd: remove unsupported device ids, Tomita Moeko, 2024/12/01
- [PATCH 4/8] vfio/igd: align generation with i915 kernel driver, Tomita Moeko, 2024/12/01