mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 00:48:50 +00:00
x86/pkru: Provide pkru_write_default()
Provide a simple and trivial helper which just writes the PKRU default value without trying to fiddle with the task's xsave buffer. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20210623121455.513729794@linutronix.de
This commit is contained in:
parent
739e2eec0f
commit
ff7ebff47c
1 changed files with 8 additions and 0 deletions
|
@ -60,4 +60,12 @@ static inline void write_pkru(u32 pkru)
|
|||
fpregs_unlock();
|
||||
}
|
||||
|
||||
static inline void pkru_write_default(void)
|
||||
{
|
||||
if (!cpu_feature_enabled(X86_FEATURE_OSPKE))
|
||||
return;
|
||||
|
||||
wrpkru(pkru_get_init_value());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue