mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
vfio/igd: fix GTT stolen memory size calculation for gen 8+
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
Fixes: c4c45e943e
("vfio/pci: Intel graphics legacy mode assignment")
Reported-By: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Link: https://lore.kernel.org/r/20241206122749.9893-2-tomitamoeko@gmail.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
a7f77545d4
commit
03828b00a2
1 changed files with 2 additions and 2 deletions
|
@ -268,7 +268,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 > 6) {
|
||||
if (gen > 6 && ggms != 0) {
|
||||
ggms = 1 << ggms;
|
||||
}
|
||||
|
||||
|
@ -678,7 +678,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 > 6) {
|
||||
if (gen > 6 && ggms_mb != 0) {
|
||||
ggms_mb = 1 << ggms_mb;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue