Re: [PATCH v22 07/24] x86/sgx: Add wrappers for ENCLS leaf functions

2019-10-08 Thread Borislav Petkov
On Tue, Oct 08, 2019 at 06:35:11AM -0700, Sean Christopherson wrote: > Hmm, I get assembler errors using gcc 5.4.0 Crap. 8.3 eats this just fine. And I guess we can accomodate old gccs by having BIT() evaluate the enclosing UL() macro into its __ASSEMBLY__ variant but it ain't worth the trouble.

Re: [PATCH v22 07/24] x86/sgx: Add wrappers for ENCLS leaf functions

2019-10-08 Thread Sean Christopherson
On Tue, Oct 08, 2019 at 09:18:45AM +0200, Borislav Petkov wrote: > On Mon, Oct 07, 2019 at 09:04:05PM -0700, Sean Christopherson wrote: > > > BIT(30) > > > > This is intentionally open coded so that it can be stringified in asm. > > It stringifies just fine with the BIT() macro too: > > # 187 "a

Re: [PATCH v22 07/24] x86/sgx: Add wrappers for ENCLS leaf functions

2019-10-08 Thread Borislav Petkov
On Mon, Oct 07, 2019 at 09:04:05PM -0700, Sean Christopherson wrote: > > BIT(30) > > This is intentionally open coded so that it can be stringified in asm. It stringifies just fine with the BIT() macro too: # 187 "arch/x86/kernel/cpu/sgx/encls.h" 1 1: .byte 0x0f, 0x01, 0xcf; 2: .

Re: [PATCH v22 07/24] x86/sgx: Add wrappers for ENCLS leaf functions

2019-10-07 Thread Sean Christopherson
On Fri, Oct 04, 2019 at 11:45:13AM +0200, Borislav Petkov wrote: > On Tue, Sep 03, 2019 at 05:26:38PM +0300, Jarkko Sakkinen wrote: > > +/** > > + * ENCLS_FAULT_FLAG - flag signifying an ENCLS return code is a trapnr > > + * > > + * ENCLS has its own (positive value) error codes and also generates

Re: [PATCH v22 07/24] x86/sgx: Add wrappers for ENCLS leaf functions

2019-10-04 Thread Jarkko Sakkinen
On Fri, Oct 04, 2019 at 11:45:13AM +0200, Borislav Petkov wrote: > On Tue, Sep 03, 2019 at 05:26:38PM +0300, Jarkko Sakkinen wrote: > > ENCLS is a ring 0 instruction that contains a set of leaf functions for > > managing enclaves [1]. Enclaves SGX hosted measured and signed software > > entities, w

Re: [PATCH v22 07/24] x86/sgx: Add wrappers for ENCLS leaf functions

2019-10-04 Thread Borislav Petkov
On Tue, Sep 03, 2019 at 05:26:38PM +0300, Jarkko Sakkinen wrote: > ENCLS is a ring 0 instruction that contains a set of leaf functions for > managing enclaves [1]. Enclaves SGX hosted measured and signed software > entities, which are protected by asserting the outside memory accesses and > memory

[PATCH v22 07/24] x86/sgx: Add wrappers for ENCLS leaf functions

2019-09-03 Thread Jarkko Sakkinen
ENCLS is a ring 0 instruction that contains a set of leaf functions for managing enclaves [1]. Enclaves SGX hosted measured and signed software entities, which are protected by asserting the outside memory accesses and memory encryption. Add a two-layer macro system along with an encoding scheme t