Re: [PATCH v6 07/11] intel_sgx: ptrace() support

2017-11-26 Thread Jarkko Sakkinen
On Sat, Nov 25, 2017 at 09:29:24PM +0200, Jarkko Sakkinen wrote: > + offset = addr & PAGE_MASK; Should be addr & ~PAGE_MASK. Had fixup for this but it ended up not be squashed to the series :-( /Jarkko

Re: [PATCH v6 07/11] intel_sgx: ptrace() support

2017-11-26 Thread Jarkko Sakkinen
On Sun, Nov 26, 2017 at 07:50:05AM -0800, Joe Perches wrote: > On Sun, 2017-11-26 at 17:44 +0200, Jarkko Sakkinen wrote: > > On Sat, Nov 25, 2017 at 09:29:24PM +0200, Jarkko Sakkinen wrote: > > > + ptr = sgx_get_page(page->epc_page); > > > + ret = __edbgrd((unsigned long)ptr + offset, data); >

Re: [PATCH v6 07/11] intel_sgx: ptrace() support

2017-11-26 Thread Joe Perches
On Sun, 2017-11-26 at 17:44 +0200, Jarkko Sakkinen wrote: > On Sat, Nov 25, 2017 at 09:29:24PM +0200, Jarkko Sakkinen wrote: > > + ptr = sgx_get_page(page->epc_page); > > + ret = __edbgrd((unsigned long)ptr + offset, data); ^^ > > + sgx_put_page(ptr); > > + if (ret) { >

Re: [PATCH v6 07/11] intel_sgx: ptrace() support

2017-11-26 Thread Jarkko Sakkinen
On Sat, Nov 25, 2017 at 09:29:24PM +0200, Jarkko Sakkinen wrote: > + ptr = sgx_get_page(page->epc_page); > + ret = __edbgrd((unsigned long)ptr + offset, data); > + sgx_put_page(ptr); > + if (ret) { > + sgx_dbg(encl, "EDBGRD returned %d\n", ret);

[PATCH v6 07/11] intel_sgx: ptrace() support

2017-11-25 Thread Jarkko Sakkinen
Implemented VMA callbacks in order to ptrace() debug enclaves. With debug enclaves data can be read and write the memory word at a time by using ENCLS(EDBGRD) and ENCLS(EDBGWR) leaf instructions. Signed-off-by: Jarkko Sakkinen --- drivers/platform/x86/intel_sgx/sgx_vma.c | 119 ++