Enable UMIP feature if present. miod originally pointed this out to me.
authormlarkin <mlarkin@openbsd.org>
Tue, 28 Jun 2016 05:37:50 +0000 (05:37 +0000)
committermlarkin <mlarkin@openbsd.org>
Tue, 28 Jun 2016 05:37:50 +0000 (05:37 +0000)
ok deraadt@

sys/arch/amd64/amd64/cpu.c
sys/arch/i386/i386/cpu.c

index 92a548d..c1dedf9 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cpu.c,v 1.100 2016/06/08 01:00:18 tedu Exp $  */
+/*     $OpenBSD: cpu.c,v 1.101 2016/06/28 05:37:50 mlarkin Exp $       */
 /* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
 
 /*-
@@ -500,6 +500,8 @@ cpu_init(struct cpu_info *ci)
                cr4 |= CR4_SMAP;
        if (ci->ci_feature_sefflags_ebx & SEFF0EBX_FSGSBASE)
                cr4 |= CR4_FSGSBASE;
+       if (ci->ci_feature_sefflags_ecx & SEFF0ECX_UMIP)
+               cr4 |= CR4_UMIP;
 #endif
        if (cpu_ecxfeature & CPUIDECX_XSAVE)
                cr4 |= CR4_OSXSAVE;
index 1e9147c..acc1f6a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cpu.c,v 1.77 2016/05/18 03:45:11 mlarkin Exp $        */
+/*     $OpenBSD: cpu.c,v 1.78 2016/06/28 05:37:50 mlarkin Exp $        */
 /* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */
 
 /*-
@@ -379,6 +379,8 @@ cpu_init(struct cpu_info *ci)
 #ifndef SMALL_KERNEL
        if (ci->ci_feature_sefflags_ebx & SEFF0EBX_SMAP)
                cr4 |= CR4_SMAP;
+       if (ci->ci_feature_sefflags_ecx & SEFF0ECX_UMIP)
+               cr4 |= CR4_UMIP;
 #endif
 
        /*