Re: [PATCH v33 03/21] x86/mm: x86/sgx: Signal SIGSEGV with PF_SGX

2020-06-26 Thread Jarkko Sakkinen
On Thu, Jun 25, 2020 at 11:11:03PM +0200, Borislav Petkov wrote: > On Thu, Jun 25, 2020 at 11:52:11PM +0300, Jarkko Sakkinen wrote: > > I ended up with: > > > > * bit 5 == 1: protection keys block access > > * bit 6 == 1: inside SGX

Re: [PATCH v33 03/21] x86/mm: x86/sgx: Signal SIGSEGV with PF_SGX

2020-06-25 Thread Borislav Petkov
On Thu, Jun 25, 2020 at 11:52:11PM +0300, Jarkko Sakkinen wrote: > I ended up with: > > * bit 5 == 1: protection keys block access > * bit 6 == 1: inside SGX enclave You mean bit 15. -- Regards/Gruss, Boris. https://people.kernel.org/tg

Re: [PATCH v33 03/21] x86/mm: x86/sgx: Signal SIGSEGV with PF_SGX

2020-06-25 Thread Jarkko Sakkinen
On Thu, Jun 25, 2020 at 10:59:31AM +0200, Borislav Petkov wrote: > On Thu, Jun 18, 2020 at 01:08:25AM +0300, Jarkko Sakkinen wrote: > > From: Sean Christopherson > > > > Include SGX bit to the PF error codes and throw SIGSEGV with PF_SGX when > > a #PF with SGX set happens. > > > > CPU throws a

Re: [PATCH v33 03/21] x86/mm: x86/sgx: Signal SIGSEGV with PF_SGX

2020-06-25 Thread Borislav Petkov
On Thu, Jun 25, 2020 at 08:34:31AM -0700, Sean Christopherson wrote: > However, building and running enclaves is complex, and the vast majority of > SGX enabled applications are expected to leverage a library of one kind or > another to hand the bulk of the gory details. I gotta say this rings a b

Re: [PATCH v33 03/21] x86/mm: x86/sgx: Signal SIGSEGV with PF_SGX

2020-06-25 Thread Sean Christopherson
On Thu, Jun 25, 2020 at 10:59:31AM +0200, Borislav Petkov wrote: > On Thu, Jun 18, 2020 at 01:08:25AM +0300, Jarkko Sakkinen wrote: > > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c > > index 66be9bd60307..25d48aae36c1 100644 > > --- a/arch/x86/mm/fault.c > > +++ b/arch/x86/mm/fault.c > >

Re: [PATCH v33 03/21] x86/mm: x86/sgx: Signal SIGSEGV with PF_SGX

2020-06-25 Thread Borislav Petkov
On Thu, Jun 18, 2020 at 01:08:25AM +0300, Jarkko Sakkinen wrote: > From: Sean Christopherson > > Include SGX bit to the PF error codes and throw SIGSEGV with PF_SGX when > a #PF with SGX set happens. > > CPU throws a #PF with the SGX bit in the event of Enclave Page Cache Map