Re: [PATCH V7 05/18] x86/pks: Add PKS setup code

2021-11-26 Thread Thomas Gleixner
On Thu, Nov 25 2021 at 16:15, Thomas Gleixner wrote: > On Tue, Aug 03 2021 at 21:32, ira weiny wrote: > Aside of that, the function which set's up the init value is really > bogus. As you explained in the cover letter a kernel user has to: > >1) Claim an index in the enum >2) Add a default

Re: [PATCH V7 05/18] x86/pks: Add PKS setup code

2021-11-26 Thread Thomas Gleixner
On Fri, Nov 26 2021 at 11:11, taoyi ty wrote: > On 11/25/21 11:15 PM, Thomas Gleixner wrote: >>> +void setup_pks(void) >>> +{ >>> + if (!cpu_feature_enabled(X86_FEATURE_PKS)) >>> + return; >>> + >>> + write_pkrs(pkrs_init_value); >> >> Is the init value set up _before_ this function

Re: [PATCH V7 05/18] x86/pks: Add PKS setup code

2021-11-25 Thread taoyi.ty
On 11/25/21 11:15 PM, Thomas Gleixner wrote: On Tue, Aug 03 2021 at 21:32, ira weiny wrote: +#ifdef CONFIG_ARCH_ENABLE_SUPERVISOR_PKEYS + +void setup_pks(void); pks_setup() +#ifdef CONFIG_ARCH_ENABLE_SUPERVISOR_PKEYS + +static DEFINE_PER_CPU(u32, pkrs_cache); +u32 __read_mostly

Re: [PATCH V7 05/18] x86/pks: Add PKS setup code

2021-11-25 Thread Thomas Gleixner
On Tue, Aug 03 2021 at 21:32, ira weiny wrote: > +#ifdef CONFIG_ARCH_ENABLE_SUPERVISOR_PKEYS > + > +void setup_pks(void); pks_setup() > +#ifdef CONFIG_ARCH_ENABLE_SUPERVISOR_PKEYS > + > +static DEFINE_PER_CPU(u32, pkrs_cache); > +u32 __read_mostly pkrs_init_value; > + > +/* > + * write_pkrs()