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

drm/amdgpu: add determine passthrough under arm64

add determine for passthrough mode under arm64 by reading
CurrentEL register

v2: squash in warning fix (Alex)

Signed-off-by: Victor Zhao <Victor.Zhao@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Victor Zhao and committed by
Alex Deucher
039cacd2 3b36f50d

+3 -1
+3 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
··· 294 294 295 295 static inline bool is_virtual_machine(void) 296 296 { 297 - #ifdef CONFIG_X86 297 + #if defined(CONFIG_X86) 298 298 return boot_cpu_has(X86_FEATURE_HYPERVISOR); 299 + #elif defined(CONFIG_ARM64) 300 + return !is_kernel_in_hyp_mode(); 299 301 #else 300 302 return false; 301 303 #endif