From: Victor Zhao <Victor.Zhao@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: emily.deng@amd.com, Victor Zhao <Victor.Zhao@amd.com>
Subject: [PATCH] drm/amdgpu: add determine passthrough under arm64
Date: Mon, 24 Jan 2022 14:45:25 +0800 [thread overview]
Message-ID: <20220124064525.1357499-1-Victor.Zhao@amd.com> (raw)
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
next reply other threads:[~2022-01-24 6:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 6:45 Victor Zhao [this message]
2022-01-24 16:53 ` [PATCH] drm/amdgpu: add determine passthrough under arm64 Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220124064525.1357499-1-Victor.Zhao@amd.com \
--to=victor.zhao@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=emily.deng@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.