Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/amdgpu: Only reserve vram for firmware with vega9 MS_HYPERV host.

driver loading failed on VEGA10 SRIOV VF with linux host due to a wide
range of stolen reserved vram.
Since VEGA10 SRIOV VF need to reserve vram for firmware with windows
Hyper_V host specifically, check hypervisor type to only reserve
memory for it, and the range of the reserved vram can be limited
to between 5M-7M area.

Fixes: faad5ccac1eaae ("drm/amdgpu: Add stolen reserved memory for MI25 SRIOV.")
Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Yongqiang Sun and committed by
Alex Deucher
49aa98ca 3cd3e731

+5 -4
+5 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
··· 25 25 */ 26 26 27 27 #include <linux/io-64-nonatomic-lo-hi.h> 28 + #include <asm/hypervisor.h> 28 29 29 30 #include "amdgpu.h" 30 31 #include "amdgpu_gmc.h" ··· 648 647 case CHIP_VEGA10: 649 648 adev->mman.keep_stolen_vga_memory = true; 650 649 /* 651 - * VEGA10 SRIOV VF needs some firmware reserved area. 650 + * VEGA10 SRIOV VF with MS_HYPERV host needs some firmware reserved area. 652 651 */ 653 - if (amdgpu_sriov_vf(adev)) { 654 - adev->mman.stolen_reserved_offset = 0x100000; 655 - adev->mman.stolen_reserved_size = 0x600000; 652 + if (amdgpu_sriov_vf(adev) && hypervisor_is_type(X86_HYPER_MS_HYPERV)) { 653 + adev->mman.stolen_reserved_offset = 0x500000; 654 + adev->mman.stolen_reserved_size = 0x200000; 656 655 } 657 656 break; 658 657 case CHIP_RAVEN: