summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Zhao <Victor.Zhao@amd.com>2022-01-24 12:13:58 +0800
committerAlex Deucher <alexander.deucher@amd.com>2022-01-27 15:47:34 -0500
commit039cacd2393971fe11f855118eea6c83c8f506fa (patch)
tree075c9a74d55381c76802175a7af5aefadcbb4b14
parent3b36f50d3a69ed720e4c464bc9c5fa2c3fadc750 (diff)
downloadlwn-039cacd2393971fe11f855118eea6c83c8f506fa.tar.gz
lwn-039cacd2393971fe11f855118eea6c83c8f506fa.zip
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>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
index c5edd84c1c12..645093610aa0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
@@ -294,8 +294,10 @@ struct amdgpu_video_codec_info;
static inline bool is_virtual_machine(void)
{
-#ifdef CONFIG_X86
+#if defined(CONFIG_X86)
return boot_cpu_has(X86_FEATURE_HYPERVISOR);
+#elif defined(CONFIG_ARM64)
+ return !is_kernel_in_hyp_mode();
#else
return false;
#endif