Message ID | 20190813011252.4121-2-sean.j.christopherson@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | x86/sgx: Remove EADD worker and page copy | expand |
On Mon, Aug 12, 2019 at 06:12:45PM -0700, Sean Christopherson wrote: > Align the enclave's binary blob to 4096 bytes so that a pointer to the > blob satisfies hardware's requirements that the source data for EADD be > page aligned. An upcoming kernel change will extend the alignment > requirement to userspace so that the kernel can avoid copying the source > into an internal buffer, i.e. pass the userspace pointer directly to > EADD. > > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Requirement is too way strong vocabulary here. Whether it should be required or there should fast and slow paths is debatable. /Jarkko
On 2019-08-16 06:55, Jarkko Sakkinen wrote: > Requirement is too way strong vocabulary here. Whether it should be required > or there should fast and slow paths is debatable. After userspace has gone through all the trouble to map an enclave using the new API, aligning the input to this ioctl seems like a minor inconvenience. -- Jethro Beekman | Fortanix
On Fri, Aug 16, 2019 at 03:36:11PM +0000, Jethro Beekman wrote: > On 2019-08-16 06:55, Jarkko Sakkinen wrote: > > Requirement is too way strong vocabulary here. Whether it should be required > > or there should fast and slow paths is debatable. > > After userspace has gone through all the trouble to map an enclave using the > new API, aligning the input to this ioctl seems like a minor inconvenience. You might in some cases mmap() less than the ELRANGE for legit reasons. It is not really a question of convenience but rather just taking advantage of robustness brought by the loose binding to the VMA. /Jarkko
diff --git a/tools/testing/selftests/x86/sgx/encl_piggy.S b/tools/testing/selftests/x86/sgx/encl_piggy.S index 542001658afb..a7f6447abbba 100644 --- a/tools/testing/selftests/x86/sgx/encl_piggy.S +++ b/tools/testing/selftests/x86/sgx/encl_piggy.S @@ -4,6 +4,7 @@ */ .section ".rodata", "a" + .balign 4096 encl_bin: .globl encl_bin
Align the enclave's binary blob to 4096 bytes so that a pointer to the blob satisfies hardware's requirements that the source data for EADD be page aligned. An upcoming kernel change will extend the alignment requirement to userspace so that the kernel can avoid copying the source into an internal buffer, i.e. pass the userspace pointer directly to EADD. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> --- tools/testing/selftests/x86/sgx/encl_piggy.S | 1 + 1 file changed, 1 insertion(+)