linux-sgx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v5 0/5] x86: Add vDSO exception fixup for SGX
@ 2018-12-14 21:57 Sean Christopherson
  2018-12-14 21:57 ` [RFC PATCH v5 1/5] x86/vdso: Add support for exception fixup in vDSO functions Sean Christopherson
                   ` (6 more replies)
  0 siblings, 7 replies; 64+ messages in thread
From: Sean Christopherson @ 2018-12-14 21:57 UTC (permalink / raw)
  To: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	x86, Dave Hansen, Peter Zijlstra, Jarkko Sakkinen
  Cc: H. Peter Anvin, linux-kernel, linux-sgx, Andy Lutomirski,
	Josh Triplett, Haitao Huang, Jethro Beekman, Dr . Greg Wettstein

__vdso_sgx_enter_enclave() gets another rewrite, this time to strip
it down to the bare minimum and explicitly break compliance with the
x86-64 ABI.  Feedback from v4 revealed that __vdso_sgx_enter_enclave()
would need to save (a lot) more than just the non-volatile GPRs to be
compliant with the x86-64 ABI, at which point breaking from the ABI
completely became much more palatable.

The non-standard ABI also solves the question of "which GPRs should be
marshalled to/from the enclave" by getting out of the way entirely and
letting userspace have free reign (except for RSP, which has a big ol'
DO NOT TOUCH sign on it).

[1] https://lkml.kernel.org/r/cda13cff-1a56-a40f-7d69-f0f1ab752f8e@fortanix.com


v1: https://lkml.kernel.org/r/20181205232012.28920-1-sean.j.christopherson@intel.com
v2: https://lkml.kernel.org/r/20181206221922.31012-1-sean.j.christopherson@intel.com
v3: https://lkml.kernel.org/r/20181210232141.5425-1-sean.j.christopherson@intel.com
v4: https://lkml.kernel.org/r/20181213213135.12913-1-sean.j.christopherson@intel.com
v5:
  - Strip down  __vdso_sgx_enter_enclave() so it only touches RSP and
    GPRs that are already collateral damage of ENCLU[EENTER/ERESUME].
  - Add a 16-byte reserved field to 'struct sgx_enclave_exception' so
    the struct can grow in a backwards compatible fashion.
  - Add a blurb at the end of the changelog for patch 1/5 explaining
    why the vDSO fixup macros look different than the equivalent kernel
    macros.

Sean Christopherson (5):
  x86/vdso: Add support for exception fixup in vDSO functions
  x86/fault: Add helper function to sanitize error code
  x86/fault: Attempt to fixup unhandled #PF on ENCLU before signaling
  x86/traps: Attempt to fixup exceptions in vDSO before signaling
  x86/vdso: Add __vdso_sgx_enter_enclave() to wrap SGX enclave
    transitions

 arch/x86/entry/vdso/Makefile             |  6 +-
 arch/x86/entry/vdso/extable.c            | 37 +++++++++
 arch/x86/entry/vdso/extable.h            | 29 +++++++
 arch/x86/entry/vdso/vdso-layout.lds.S    |  9 ++-
 arch/x86/entry/vdso/vdso.lds.S           |  1 +
 arch/x86/entry/vdso/vdso2c.h             | 58 ++++++++++++--
 arch/x86/entry/vdso/vsgx_enter_enclave.S | 97 ++++++++++++++++++++++++
 arch/x86/include/asm/vdso.h              |  5 ++
 arch/x86/include/uapi/asm/sgx.h          | 18 +++++
 arch/x86/kernel/traps.c                  | 14 ++++
 arch/x86/mm/fault.c                      | 33 +++++---
 11 files changed, 284 insertions(+), 23 deletions(-)
 create mode 100644 arch/x86/entry/vdso/extable.c
 create mode 100644 arch/x86/entry/vdso/extable.h
 create mode 100644 arch/x86/entry/vdso/vsgx_enter_enclave.S

-- 
2.19.2


^ permalink raw reply	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2019-01-18 14:37 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-14 21:57 [RFC PATCH v5 0/5] x86: Add vDSO exception fixup for SGX Sean Christopherson
2018-12-14 21:57 ` [RFC PATCH v5 1/5] x86/vdso: Add support for exception fixup in vDSO functions Sean Christopherson
2018-12-14 21:57 ` [RFC PATCH v5 2/5] x86/fault: Add helper function to sanitize error code Sean Christopherson
2018-12-14 21:57 ` [RFC PATCH v5 3/5] x86/fault: Attempt to fixup unhandled #PF on ENCLU before signaling Sean Christopherson
2018-12-14 21:57 ` [RFC PATCH v5 4/5] x86/traps: Attempt to fixup exceptions in vDSO " Sean Christopherson
2018-12-14 21:57 ` [RFC PATCH v5 5/5] x86/vdso: Add __vdso_sgx_enter_enclave() to wrap SGX enclave transitions Sean Christopherson
2018-12-19  9:21   ` Jarkko Sakkinen
2018-12-18  4:18 ` [RFC PATCH v5 0/5] x86: Add vDSO exception fixup for SGX Jarkko Sakkinen
2018-12-18 15:08   ` Sean Christopherson
2018-12-19  4:43     ` Jarkko Sakkinen
2018-12-19  5:03       ` Jarkko Sakkinen
2018-12-19  7:58 ` x86/sgx: uapi change proposal Jarkko Sakkinen
2018-12-19  8:41   ` Jethro Beekman
2018-12-19  9:11     ` Jarkko Sakkinen
2018-12-19  9:36       ` Jethro Beekman
2018-12-19 10:43         ` Jarkko Sakkinen
2018-12-19 14:45         ` Sean Christopherson
2018-12-20  2:58           ` Andy Lutomirski
2018-12-20 10:32             ` Jarkko Sakkinen
2018-12-20 13:12               ` Jarkko Sakkinen
2018-12-20 13:19                 ` Jarkko Sakkinen
2018-12-22  8:16               ` Jarkko Sakkinen
     [not found]                 ` <20181222082502.GA13275@linux.intel.com>
2018-12-23 12:52                   ` Jarkko Sakkinen
2018-12-23 20:42                     ` Andy Lutomirski
2018-12-24 11:52                       ` Jarkko Sakkinen
2019-01-02 20:47                   ` Sean Christopherson
2019-01-03 15:02                     ` Jarkko Sakkinen
     [not found]                       ` <20190103162634.GA8610@linux.intel.com>
2019-01-09 14:45                         ` Jarkko Sakkinen
2018-12-21 16:28             ` Sean Christopherson
2018-12-21 17:12               ` Andy Lutomirski
2018-12-21 18:24                 ` Sean Christopherson
2018-12-21 23:41                   ` Jarkko Sakkinen
2018-12-23 20:41                   ` Andy Lutomirski
2018-12-24 12:01                     ` Jarkko Sakkinen
2018-12-21 23:37                 ` Jarkko Sakkinen
2018-12-22  6:32                 ` Jarkko Sakkinen
2019-01-08 19:27               ` Huang, Kai
2019-01-08 22:09                 ` Sean Christopherson
2019-01-08 22:54                   ` Andy Lutomirski
2019-01-09 16:31                     ` Sean Christopherson
2019-01-10 21:34                       ` Andy Lutomirski
2019-01-10 22:22                         ` Huang, Kai
2019-01-10 23:54                         ` Sean Christopherson
2019-01-11  0:30                           ` Andy Lutomirski
2019-01-11  1:32                             ` Sean Christopherson
2019-01-11 12:58                       ` Jarkko Sakkinen
2019-01-11 13:00                         ` Jarkko Sakkinen
2019-01-11 23:19                         ` Sean Christopherson
2019-01-18 14:37                           ` Jarkko Sakkinen
2019-01-10 17:45                     ` Jarkko Sakkinen
2019-01-10 21:36                       ` Andy Lutomirski
2019-01-11 16:07                         ` Jarkko Sakkinen
2019-01-09  5:24                   ` Huang, Kai
2019-01-09 17:16                     ` Sean Christopherson
2019-01-10  0:21                       ` Huang, Kai
2019-01-10  0:40                         ` Sean Christopherson
2019-01-10 17:43                 ` Jarkko Sakkinen
2018-12-20 10:30           ` Jarkko Sakkinen
2018-12-19 14:43     ` Dr. Greg
2018-12-20 10:34       ` Jarkko Sakkinen
2018-12-20 22:06         ` Dr. Greg
2018-12-21 13:48           ` Jarkko Sakkinen
2018-12-20 12:08     ` Arnd Bergmann
2018-12-20 12:49       ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).