File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 62
62
63
63
#define CHOOSE_VHE_SYM (sym ) sym
64
64
#define CHOOSE_NVHE_SYM (sym ) kvm_nvhe_sym(sym)
65
- #define CHOOSE_HYP_SYM (sym ) (has_vhe() ? CHOOSE_VHE_SYM(sym) \
65
+
66
+ #ifndef __KVM_NVHE_HYPERVISOR__
67
+ /*
68
+ * BIG FAT WARNINGS:
69
+ *
70
+ * - Don't be tempted to change the following is_kernel_in_hyp_mode()
71
+ * to has_vhe(). has_vhe() is implemented as a *final* capability,
72
+ * while this is used early at boot time, when the capabilities are
73
+ * not final yet....
74
+ *
75
+ * - Don't let the nVHE hypervisor have access to this, as it will
76
+ * pick the *wrong* symbol (yes, it runs at EL2...).
77
+ */
78
+ #define CHOOSE_HYP_SYM (sym ) (is_kernel_in_hyp_mode() ? CHOOSE_VHE_SYM(sym) \
66
79
: CHOOSE_NVHE_SYM(sym))
80
+ #else
81
+ /* The nVHE hypervisor shouldn't even try to access anything */
82
+ extern void * __nvhe_undefined_symbol ;
83
+ #define CHOOSE_HYP_SYM (sym ) __nvhe_undefined_symbol
84
+ #endif
67
85
68
86
/* Translate a kernel address @ptr into its equivalent linear mapping */
69
87
#define kvm_ksym_ref (ptr ) \
You can’t perform that action at this time.
0 commit comments