提交 84e4a1b6 编写于 作者: T Thomas Gleixner 提交者: Aichun Shi

x86/cpu: Write the default PKRU value when enabling PKE

mainline inclusion
from mainline-v5.14-rc1
commit fa8c84b7
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I590ZC
CVE: NA

Intel-SIG: commit fa8c84b7 x86/cpu: Write the default PKRU value when enabling PKE.

--------------------------------

In preparation of making the PKRU management more independent from XSTATES,
write the default PKRU value into the hardware right after enabling PKRU in
CR4. This ensures that switch_to() and copy_thread() have the correct
setting for init task and the per CPU idle threads right away.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NBorislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121455.622983906@linutronix.deSigned-off-by: NLin Wang <lin.x.wang@intel.com>
Signed-off-by: NAichun Shi <aichun.shi@intel.com>
上级 4709273a
......@@ -482,6 +482,8 @@ static __always_inline void setup_pku(struct cpuinfo_x86 *c)
}
cr4_set_bits(X86_CR4_PKE);
/* Load the default PKRU value */
pkru_write_default();
}
#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册