From: mlarkin Date: Tue, 28 Jun 2016 05:37:50 +0000 (+0000) Subject: Enable UMIP feature if present. miod originally pointed this out to me. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2f4e497e249bea4b96f995b1c0564bb8d367685a;p=openbsd Enable UMIP feature if present. miod originally pointed this out to me. ok deraadt@ --- diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c index 92a548d84dc..c1dedf9115d 100644 --- a/sys/arch/amd64/amd64/cpu.c +++ b/sys/arch/amd64/amd64/cpu.c @@ -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; diff --git a/sys/arch/i386/i386/cpu.c b/sys/arch/i386/i386/cpu.c index 1e9147c3900..acc1f6a73a4 100644 --- a/sys/arch/i386/i386/cpu.c +++ b/sys/arch/i386/i386/cpu.c @@ -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 /*