[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 03/10] vfio/igd: fix GTT stolen memory size calculation fo
From: |
Alex Williamson |
Subject: |
Re: [PATCH v3 03/10] vfio/igd: fix GTT stolen memory size calculation for gen 8+ |
Date: |
Thu, 5 Dec 2024 10:19:02 -0700 |
On Thu, 5 Dec 2024 18:55:28 +0800
Tomita Moeko <tomitamoeko@gmail.com> wrote:
> On gen 8 and later devices, the GTT stolen memory size when GGMS equals
> 0 is 0 (no preallocated memory) rather than 1MB [1].
>
> [1] 3.1.13, 5th Generation Intel Core Processor Family Datasheet Vol. 2
> https://www.intel.com/content/www/us/en/content-details/330835
>
> Reported-By: Alex Williamson <alex.williamson@redhat.com>
> Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
> ---
> hw/vfio/igd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
This should come before the preceding patch in the series so that we're
not making a fix dependent on other code churn. This makes it easier
to backport to stable branches. Also we should include the tag:
Fixes: c4c45e943e51 ("vfio/pci: Intel graphics legacy mode assignment")
Otherwise the series looks good now. Thanks,
Alex
> diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c
> index 18d179bc83..09bd4e5383 100644
> --- a/hw/vfio/igd.c
> +++ b/hw/vfio/igd.c
> @@ -259,7 +259,7 @@ static int vfio_igd_gtt_max(VFIOPCIDevice *vdev)
>
> gmch = vfio_pci_read_config(&vdev->pdev, IGD_GMCH, sizeof(gmch));
> ggms = (gmch >> (gen < 8 ? 8 : 6)) & 0x3;
> - if (gen >= 8) {
> + if (gen >= 8 && ggms != 0) {
> ggms = 1 << ggms;
> }
>
> @@ -669,7 +669,7 @@ void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int
> nr)
>
> /* Determine the size of stolen memory needed for GTT */
> ggms_mb = (gmch >> (gen < 8 ? 8 : 6)) & 0x3;
> - if (gen >= 8) {
> + if (gen >= 8 && ggms_mb != 0) {
> ggms_mb = 1 << ggms_mb;
> }
>
- [PATCH v3 00/10] vfio/igd: Enable legacy mode on more devices, Tomita Moeko, 2024/12/05
- [PATCH v3 01/10] vfio/igd: remove unsupported device ids, Tomita Moeko, 2024/12/05
- [PATCH v3 02/10] vfio/igd: align generation with i915 kernel driver, Tomita Moeko, 2024/12/05
- [PATCH v3 03/10] vfio/igd: fix GTT stolen memory size calculation for gen 8+, Tomita Moeko, 2024/12/05
- Re: [PATCH v3 03/10] vfio/igd: fix GTT stolen memory size calculation for gen 8+,
Alex Williamson <=
- [PATCH v3 04/10] vfio/igd: canonicalize memory size calculations, Tomita Moeko, 2024/12/05
- [PATCH v3 05/10] vfio/igd: add Gemini Lake and Comet Lake device ids, Tomita Moeko, 2024/12/05
- [PATCH v3 06/10] vfio/igd: add Alder/Raptor/Rocket/Ice/Jasper Lake device ids, Tomita Moeko, 2024/12/05
- [PATCH v3 07/10] vfio/igd: add macro for declaring mirrored registers, Tomita Moeko, 2024/12/05
- [PATCH v3 08/10] vfio/igd: emulate GGC register in mmio bar0, Tomita Moeko, 2024/12/05
- [PATCH v3 09/10] vfio/igd: emulate BDSM in mmio bar0 for gen 6-10 devices, Tomita Moeko, 2024/12/05
- [PATCH v3 10/10] vfio/igd: add x-igd-gms option back to set DSM region size for guest, Tomita Moeko, 2024/12/05