Re: [PATCH v3 07/25] x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

2021-04-02 Thread Borislav Petkov
On Fri, Apr 02, 2021 at 07:30:23PM +, Sean Christopherson wrote: > Heh, that's what I had originally and used for literally years. IIRC, I > suggested the "!! & !!" abomination after internal review complained about the > oddness of the above. Whut? > FWIW, I think the above is far less

Re: [PATCH v3 07/25] x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

2021-04-02 Thread Sean Christopherson
On Fri, Apr 02, 2021, Borislav Petkov wrote: > On Fri, Apr 02, 2021 at 03:42:51PM +, Sean Christopherson wrote: > > Nope! That's wrong, as sgx_epc_init() will not be called if sgx_drv_init() > > succeeds. And writing it as "if (sgx_drv_init() || sgx_vepc_init())" is > > also > > wrong since

Re: [PATCH v3 07/25] x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

2021-04-02 Thread Borislav Petkov
On Fri, Apr 02, 2021 at 03:42:51PM +, Sean Christopherson wrote: > Nope! That's wrong, as sgx_epc_init() will not be called if sgx_drv_init() > succeeds. And writing it as "if (sgx_drv_init() || sgx_vepc_init())" is also > wrong since that would kill SGX when one of the drivers is alive and

Re: [PATCH v3 07/25] x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

2021-04-02 Thread Kai Huang
On Fri, 2 Apr 2021 15:42:51 + Sean Christopherson wrote: > On Fri, Apr 02, 2021, Borislav Petkov wrote: > > On Fri, Mar 19, 2021 at 08:23:02PM +1300, Kai Huang wrote: > > > Modify sgx_init() to always try to initialize the virtual EPC driver, > > > even if the SGX driver is disabled. The SGX

Re: [PATCH v3 07/25] x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

2021-04-02 Thread Sean Christopherson
On Fri, Apr 02, 2021, Borislav Petkov wrote: > On Fri, Mar 19, 2021 at 08:23:02PM +1300, Kai Huang wrote: > > Modify sgx_init() to always try to initialize the virtual EPC driver, > > even if the SGX driver is disabled. The SGX driver might be disabled > > if SGX Launch Control is in locked mode,

Re: [PATCH v3 07/25] x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

2021-04-02 Thread Kai Huang
On Fri, 2 Apr 2021 13:22:35 +0200 Borislav Petkov wrote: > On Sat, Apr 03, 2021 at 12:08:10AM +1300, Kai Huang wrote: > > Do you want me to send updated patch? > > No need. If I do, I'll ask kindly, otherwise you don't have to do > anything. > I see. Thanks.

Re: [PATCH v3 07/25] x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

2021-04-02 Thread Borislav Petkov
On Sat, Apr 03, 2021 at 12:08:10AM +1300, Kai Huang wrote: > Do you want me to send updated patch? No need. If I do, I'll ask kindly, otherwise you don't have to do anything. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette

Re: [PATCH v3 07/25] x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

2021-04-02 Thread Kai Huang
On Fri, 2 Apr 2021 11:48:16 +0200 Borislav Petkov wrote: > On Fri, Mar 19, 2021 at 08:23:02PM +1300, Kai Huang wrote: > > Modify sgx_init() to always try to initialize the virtual EPC driver, > > even if the SGX driver is disabled. The SGX driver might be disabled > > if SGX Launch Control is in

Re: [PATCH v3 07/25] x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

2021-04-02 Thread Borislav Petkov
On Fri, Mar 19, 2021 at 08:23:02PM +1300, Kai Huang wrote: > Modify sgx_init() to always try to initialize the virtual EPC driver, > even if the SGX driver is disabled. The SGX driver might be disabled > if SGX Launch Control is in locked mode, or not supported in the > hardware at all. This

[PATCH v3 07/25] x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

2021-03-19 Thread Kai Huang
Modify sgx_init() to always try to initialize the virtual EPC driver, even if the SGX driver is disabled. The SGX driver might be disabled if SGX Launch Control is in locked mode, or not supported in the hardware at all. This allows (non-Linux) guests that support non-LC configurations to use