]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/arm64/include/asm/virt.h
Merge branch 'nvme-4.10-fixes' of git://git.infradead.org/nvme into for-linus
[karo-tx-linux.git] / arch / arm64 / include / asm / virt.h
index 1788545f25bcca63fe4e177c0bfc0fe3411a27d8..439f6b5d31f67576e57e67cdf1e8284bf57c08a7 100644 (file)
@@ -45,6 +45,9 @@
 #ifndef __ASSEMBLY__
 
 #include <asm/ptrace.h>
+#include <asm/sections.h>
+#include <asm/sysreg.h>
+#include <asm/cpufeature.h>
 
 /*
  * __boot_cpu_mode records what mode CPUs were booted in.
@@ -75,10 +78,15 @@ static inline bool is_hyp_mode_mismatched(void)
 
 static inline bool is_kernel_in_hyp_mode(void)
 {
-       u64 el;
+       return read_sysreg(CurrentEL) == CurrentEL_EL2;
+}
+
+static inline bool has_vhe(void)
+{
+       if (cpus_have_const_cap(ARM64_HAS_VIRT_HOST_EXTN))
+               return true;
 
-       asm("mrs %0, CurrentEL" : "=r" (el));
-       return el == CurrentEL_EL2;
+       return false;
 }
 
 #ifdef CONFIG_ARM64_VHE
@@ -87,14 +95,6 @@ extern void verify_cpu_run_el(void);
 static inline void verify_cpu_run_el(void) {}
 #endif
 
-/* The section containing the hypervisor idmap text */
-extern char __hyp_idmap_text_start[];
-extern char __hyp_idmap_text_end[];
-
-/* The section containing the hypervisor text */
-extern char __hyp_text_start[];
-extern char __hyp_text_end[];
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* ! __ASM__VIRT_H */