Skip to contentSkip to conversation

drm/amdgpu: add determine passthrough under arm64

PATCH In review Victor Zhao 2 participants 2 messages Jan 24, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: add determine passthrough under arm64

add determine for passthrough mode under arm64 by reading CurrentEL register

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +2 -0
index c5edd84c1c12..40803aab136f 100644
@@ -296,6 +296,8 @@ static inline bool is_virtual_machine(void)
 {
 #ifdef CONFIG_X86
 	return boot_cpu_has(X86_FEATURE_HYPERVISOR);
+#elif CONFIG_ARM64
+	return !is_kernel_in_hyp_mode();
 #else
 	return false;
 #endif
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 25 lines · Victor Zhao

add determine for passthrough mode under arm64 by reading CurrentEL register

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +2 -1
index c5edd84c1c12..40803aab136f 100644
@@ -296,6 +296,8 @@ static inline bool is_virtual_machine(void)
 {
 #ifdef CONFIG_X86
        return boot_cpu_has(X86_FEATURE_HYPERVISOR);
+#elif CONFIG_ARM64
+       return !is_kernel_in_hyp_mode();
 #else
        return false;
 #endif
--

2.25.1