All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: add determine passthrough under arm64
@ 2022-01-24  6:45 Victor Zhao
  2022-01-24 16:53 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Victor Zhao @ 2022-01-24  6:45 UTC (permalink / raw)
  To: amd-gfx; +Cc: emily.deng, Victor Zhao

add determine for passthrough mode under arm64 by reading
CurrentEL register

Signed-off-by: Victor Zhao <Victor.Zhao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
index c5edd84c1c12..40803aab136f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
@@ -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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-24 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-24  6:45 [PATCH] drm/amdgpu: add determine passthrough under arm64 Victor Zhao
2022-01-24 16:53 ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.