Re: [PATCH v15 05/23] x86/cpu/intel: Detect SGX support and update caps appropriately

2018-11-05 Thread Andy Shevchenko
On Mon, Nov 05, 2018 at 04:09:33PM +0200, Jarkko Sakkinen wrote: > On Sat, Nov 03, 2018 at 03:05:39PM +0200, Andy Shevchenko wrote: > Agree. Would this be a more clean flow in the attached patch? LGTM. > From 3b863a7db00cefffc15df918a5132c35ea313c27 Mon Sep 17 00:00:00 2001 > From: Jarkko Sakkin

Re: [PATCH v15 05/23] x86/cpu/intel: Detect SGX support and update caps appropriately

2018-11-05 Thread Jarkko Sakkinen
On Mon, Nov 05, 2018 at 04:09:33PM +0200, Jarkko Sakkinen wrote: > On Sat, Nov 03, 2018 at 03:05:39PM +0200, Andy Shevchenko wrote: > > > +static void detect_sgx(struct cpuinfo_x86 *c) > > > +{ > > > + bool unsupported = false; > > > + unsigned long long fc; > > > + > > > + rdmsrl

Re: [PATCH v15 05/23] x86/cpu/intel: Detect SGX support and update caps appropriately

2018-11-05 Thread Jarkko Sakkinen
On Sat, Nov 03, 2018 at 03:05:39PM +0200, Andy Shevchenko wrote: > > +static void detect_sgx(struct cpuinfo_x86 *c) > > +{ > > + bool unsupported = false; > > + unsigned long long fc; > > + > > + rdmsrl(MSR_IA32_FEATURE_CONTROL, fc); > > + if (!(fc & FEATURE_CONTROL_LOCKED))

Re: [PATCH v15 05/23] x86/cpu/intel: Detect SGX support and update caps appropriately

2018-11-03 Thread Andy Shevchenko
On Sat, Nov 3, 2018 at 1:16 AM Jarkko Sakkinen wrote: > > From: Sean Christopherson > > Similar to other large Intel features such as VMX and TXT, SGX must be > explicitly enabled in IA32_FEATURE_CONTROL MSR to be truly usable. > Clear all SGX related capabilities if SGX is not fully enabled in >

[PATCH v15 05/23] x86/cpu/intel: Detect SGX support and update caps appropriately

2018-11-02 Thread Jarkko Sakkinen
From: Sean Christopherson Similar to other large Intel features such as VMX and TXT, SGX must be explicitly enabled in IA32_FEATURE_CONTROL MSR to be truly usable. Clear all SGX related capabilities if SGX is not fully enabled in IA32_FEATURE_CONTROL or if the SGX1 instruction set isn't supported