We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7621712 commit 53b6711Copy full SHA for 53b6711
arch/arm64/include/asm/virt.h
@@ -85,10 +85,17 @@ static inline bool is_kernel_in_hyp_mode(void)
85
86
static __always_inline bool has_vhe(void)
87
{
88
- if (cpus_have_final_cap(ARM64_HAS_VIRT_HOST_EXTN))
+ /*
89
+ * The following macros are defined for code specic to VHE/nVHE.
90
+ * If has_vhe() is inlined into those compilation units, it can
91
+ * be determined statically. Otherwise fall back to caps.
92
+ */
93
+ if (__is_defined(__KVM_VHE_HYPERVISOR__))
94
return true;
-
- return false;
95
+ else if (__is_defined(__KVM_NVHE_HYPERVISOR__))
96
+ return false;
97
+ else
98
+ return cpus_have_final_cap(ARM64_HAS_VIRT_HOST_EXTN);
99
}
100
101
#endif /* __ASSEMBLY__ */
0 commit comments