[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNH0FbTeHthv8xud@zn.tnic>
Date: Tue, 22 Jun 2021 16:30:45 +0200
From: Borislav Petkov <bp@...e.de>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Fenghua Yu <fenghua.yu@...el.com>,
Tony Luck <tony.luck@...el.com>,
Yu-cheng Yu <yu-cheng.yu@...el.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Kan Liang <kan.liang@...ux.intel.com>
Subject: Re: [patch V3 43/66] x86/pkru: Provide pkru_write_default()
On Fri, Jun 18, 2021 at 04:19:06PM +0200, Thomas Gleixner wrote:
> Provide a simple and trivial helper which just writes the PKRU default
> value without trying to fiddle with the tasks xsave buffer.
task's
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
> arch/x86/include/asm/pkru.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> --- a/arch/x86/include/asm/pkru.h
> +++ b/arch/x86/include/asm/pkru.h
> @@ -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
Reviewed-by: Borislav Petkov <bp@...e.de>
--
Regards/Gruss,
Boris.
SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg
Powered by blists - more mailing lists