From cff1032555afc9853a490714d7cfa22fdb4c499d Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 8 Apr 2021 15:10:32 +0200 Subject: Added UMIP --- kernel/drivers/cpu.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'kernel/drivers') diff --git a/kernel/drivers/cpu.c b/kernel/drivers/cpu.c index f751d33..5d53bef 100644 --- a/kernel/drivers/cpu.c +++ b/kernel/drivers/cpu.c @@ -168,6 +168,13 @@ CLEAR void cpu_enable_features(void) } else { print("No SMAP support :(\n"); } + + // Enable UMIP // TODO: QEMU support?! + if (cpu_extended_features.ecx & CPUID_EXT_FEAT_ECX_UMIP) { + cr4_set(cr4_get() | 0x800); + } else { + print("No UMIP support :(\n"); + } } void clac(void) -- cgit v1.2.3