summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/amd64/machdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amd64/amd64/machdep.c')
-rw-r--r--sys/arch/amd64/amd64/machdep.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 7720620..6408ad3 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -74,6 +74,12 @@
#define CPU_SMEP 0
#endif
+#if defined(__CPU_UMIP)
+#define CPU_UMIP __CPU_UMIP
+#else
+#define CPU_UMIP 0
+#endif
+
int ibrs_enable(void);
int simd_init(void);
void syscall_isr(void);
@@ -355,6 +361,11 @@ cpu_enable_umip(void)
struct cpu_info *ci = this_cpu();
uint64_t cr4;
+ if (!CPU_UMIP) {
+ pr_trace_bsp("UMIP not configured\n");
+ return;
+ }
+
if (ISSET(ci->feat, CPU_FEAT_UMIP)) {
cr4 = amd64_read_cr4();
cr4 |= CR4_UMIP;