Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1386701 > unrolled thread

[PATCH 6/6] intel_sgx: TODO file for the staging area

Started byJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
First post2016-04-25 19:40 +0200
Last post2016-04-27 09:10 +0200
Articles 7 — 5 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 6/6] intel_sgx: TODO file for the staging area Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-04-25 19:40 +0200
    Re: [PATCH 6/6] intel_sgx: TODO file for the staging area Greg KH <gregkh@linuxfoundation.org> - 2016-04-25 20:00 +0200
      Re: [PATCH 6/6] intel_sgx: TODO file for the staging area Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-04-25 21:00 +0200
    Re: [PATCH 6/6] intel_sgx: TODO file for the staging area One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-04-25 21:10 +0200
    Re: [PATCH 6/6] intel_sgx: TODO file for the staging area Andi Kleen <andi@firstfloor.org> - 2016-04-25 22:10 +0200
      Re: [PATCH 6/6] intel_sgx: TODO file for the staging area Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-04-26 13:30 +0200
        Re: [PATCH 6/6] intel_sgx: TODO file for the staging area Jethro Beekman <kernel@jbeekman.nl> - 2016-04-27 09:10 +0200

#1386701 — [PATCH 6/6] intel_sgx: TODO file for the staging area

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2016-04-25 19:40 +0200
Subject[PATCH 6/6] intel_sgx: TODO file for the staging area
Message-ID<rrSEj-1jR-43@gated-at.bofh.it>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/staging/intel_sgx/TODO | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 drivers/staging/intel_sgx/TODO

diff --git a/drivers/staging/intel_sgx/TODO b/drivers/staging/intel_sgx/TODO
new file mode 100644
index 0000000..05f68c2
--- /dev/null
+++ b/drivers/staging/intel_sgx/TODO
@@ -0,0 +1,25 @@
+Documentation
+=============
+
+* Improve Documents/x86/intel-sgx.txt based on the feedback and
+  questions that pop up.
+
+Internals
+=========
+
+* Move structures needed by the allocator to arch/x86/include/asm/sgx.h
+* Move EPC page allocation and eviction code to arch/x86/mm as they
+  will shared with virtualization code.
+* Move enclave management functions to arch/x86/mm as they will be
+  shared with virtualization code.
+* Use reserve_memtype() in order to add EPC to the PAT memtype list
+  with WB caching.
+* Implement proper recovery code for the pager for cases when
+  ETRACK/EBLOCK/EWB fails instead of BUG_ON(). Probably the sanest
+  way to recover is to clear TCS PTEs, kick threads out of enclave
+  and remove EPC pages.
+* Implement ACPI hot-lug for SGX.
+
+===
+
+* Move isgx_user.h to arch/x86/include/uapi/asm/sgx.h
-- 
2.7.4

[toc] | [next] | [standalone]


#1386723

FromGreg KH <gregkh@linuxfoundation.org>
Date2016-04-25 20:00 +0200
Message-ID<rrSXF-1rj-45@gated-at.bofh.it>
In reply to#1386701
On Mon, Apr 25, 2016 at 08:34:13PM +0300, Jarkko Sakkinen wrote:
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> ---
>  drivers/staging/intel_sgx/TODO | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>  create mode 100644 drivers/staging/intel_sgx/TODO
> 
> diff --git a/drivers/staging/intel_sgx/TODO b/drivers/staging/intel_sgx/TODO
> new file mode 100644
> index 0000000..05f68c2
> --- /dev/null
> +++ b/drivers/staging/intel_sgx/TODO
> @@ -0,0 +1,25 @@
> +Documentation
> +=============
> +
> +* Improve Documents/x86/intel-sgx.txt based on the feedback and
> +  questions that pop up.
> +
> +Internals
> +=========
> +
> +* Move structures needed by the allocator to arch/x86/include/asm/sgx.h
> +* Move EPC page allocation and eviction code to arch/x86/mm as they
> +  will shared with virtualization code.
> +* Move enclave management functions to arch/x86/mm as they will be
> +  shared with virtualization code.
> +* Use reserve_memtype() in order to add EPC to the PAT memtype list
> +  with WB caching.
> +* Implement proper recovery code for the pager for cases when
> +  ETRACK/EBLOCK/EWB fails instead of BUG_ON(). Probably the sanest
> +  way to recover is to clear TCS PTEs, kick threads out of enclave
> +  and remove EPC pages.
> +* Implement ACPI hot-lug for SGX.

What is keeping you from doing all of this work this week, making this
todo list empty?

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1386749

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2016-04-25 21:00 +0200
Message-ID<rrTTH-2ag-7@gated-at.bofh.it>
In reply to#1386723
On Mon, Apr 25, 2016 at 10:54:26AM -0700, Greg KH wrote:
> On Mon, Apr 25, 2016 at 08:34:13PM +0300, Jarkko Sakkinen wrote:
> > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > ---
> >  drivers/staging/intel_sgx/TODO | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >  create mode 100644 drivers/staging/intel_sgx/TODO
> > 
> > diff --git a/drivers/staging/intel_sgx/TODO b/drivers/staging/intel_sgx/TODO
> > new file mode 100644
> > index 0000000..05f68c2
> > --- /dev/null
> > +++ b/drivers/staging/intel_sgx/TODO
> > @@ -0,0 +1,25 @@
> > +Documentation
> > +=============
> > +
> > +* Improve Documents/x86/intel-sgx.txt based on the feedback and
> > +  questions that pop up.
> > +
> > +Internals
> > +=========
> > +
> > +* Move structures needed by the allocator to arch/x86/include/asm/sgx.h
> > +* Move EPC page allocation and eviction code to arch/x86/mm as they
> > +  will shared with virtualization code.
> > +* Move enclave management functions to arch/x86/mm as they will be
> > +  shared with virtualization code.
> > +* Use reserve_memtype() in order to add EPC to the PAT memtype list
> > +  with WB caching.
> > +* Implement proper recovery code for the pager for cases when
> > +  ETRACK/EBLOCK/EWB fails instead of BUG_ON(). Probably the sanest
> > +  way to recover is to clear TCS PTEs, kick threads out of enclave
> > +  and remove EPC pages.
> > +* Implement ACPI hot-lug for SGX.
> 
> What is keeping you from doing all of this work this week, making this
> todo list empty?

I could. I took the internal driver code and just enumerated the tasks
that I saw that need to be done before it's ready from my point of view.
I just wanted intial feedback before starting to work through these so
that I know my aim is right.

> thanks,
> 
> greg k-h

/Jarkko

[toc] | [prev] | [next] | [standalone]


#1386756

FromOne Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Date2016-04-25 21:10 +0200
Message-ID<rrU3n-2yD-9@gated-at.bofh.it>
In reply to#1386701
> +* Implement ACPI hot-lug for SGX.

hot-plug

Also with an upstream hat on I would add being able to check the keys on
the enclave against a kernel keychain because not everyone will want to
solely trust whatever keys the hardware thinks it wants to trust.

Alan

[toc] | [prev] | [next] | [standalone]


#1386809

FromAndi Kleen <andi@firstfloor.org>
Date2016-04-25 22:10 +0200
Message-ID<rrUZs-3iQ-15@gated-at.bofh.it>
In reply to#1386701
Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> writes:


> diff --git a/drivers/staging/intel_sgx/TODO b/drivers/staging/intel_sgx/TODO
> new file mode 100644
> index 0000000..05f68c2
> --- /dev/null
> +++ b/drivers/staging/intel_sgx/TODO
> @@ -0,0 +1,25 @@
> +Documentation
> +=============
> +
> +* Improve Documents/x86/intel-sgx.txt based on the feedback and
> +  questions that pop up.
> +
> +Internals
> +=========
> +
> +* Move structures needed by the allocator to arch/x86/include/asm/sgx.h
> +* Move EPC page allocation and eviction code to arch/x86/mm as they
> +  will shared with virtualization code.
> +* Move enclave management functions to arch/x86/mm as they will be
> +  shared with virtualization code.
> +* Use reserve_memtype() in order to add EPC to the PAT memtype list
> +  with WB caching.
> +* Implement proper recovery code for the pager for cases when
> +  ETRACK/EBLOCK/EWB fails instead of BUG_ON(). Probably the sanest
> +  way to recover is to clear TCS PTEs, kick threads out of enclave
> +  and remove EPC pages.
> +* Implement ACPI hot-lug for SGX.

- Write proper patch descriptions.

Especially how the "new VM" in 3/6 works needs a lot more explanation ...

- Add some test code

-Andi

[toc] | [prev] | [next] | [standalone]


#1387384

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2016-04-26 13:30 +0200
Message-ID<rs9lM-6K3-3@gated-at.bofh.it>
In reply to#1386809
On Mon, Apr 25, 2016 at 01:01:24PM -0700, Andi Kleen wrote:
> Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> writes:
> 
> 
> > diff --git a/drivers/staging/intel_sgx/TODO b/drivers/staging/intel_sgx/TODO
> > new file mode 100644
> > index 0000000..05f68c2
> > --- /dev/null
> > +++ b/drivers/staging/intel_sgx/TODO
> > @@ -0,0 +1,25 @@
> > +Documentation
> > +=============
> > +
> > +* Improve Documents/x86/intel-sgx.txt based on the feedback and
> > +  questions that pop up.
> > +
> > +Internals
> > +=========
> > +
> > +* Move structures needed by the allocator to arch/x86/include/asm/sgx.h
> > +* Move EPC page allocation and eviction code to arch/x86/mm as they
> > +  will shared with virtualization code.
> > +* Move enclave management functions to arch/x86/mm as they will be
> > +  shared with virtualization code.
> > +* Use reserve_memtype() in order to add EPC to the PAT memtype list
> > +  with WB caching.
> > +* Implement proper recovery code for the pager for cases when
> > +  ETRACK/EBLOCK/EWB fails instead of BUG_ON(). Probably the sanest
> > +  way to recover is to clear TCS PTEs, kick threads out of enclave
> > +  and remove EPC pages.
> > +* Implement ACPI hot-lug for SGX.
> 
> - Write proper patch descriptions.
> 
> Especially how the "new VM" in 3/6 works needs a lot more explanation ...

Agreed. I have now idea how to improve this given the feedback so far
from you Andy and Greg. Thanks. It was hard to figure out the areas,
which require more explanation before putting something out first.

> - Add some test code

Skylake, the only microarchitecture available at the moment supporting
SGX, does not support IA32_SGXLEPUBKEYHASH* MSRs documented in Volume 3C
of the Intel x86 SDM.

There will be an Open Source SDK available in the near future. It comes
with Launch Enclave [1] that generates automatically EINITTOKENs for
debug enclaves. At the moment there is no process for signing producton
enclaves with the Intel root of trust for Linux (there is a process for
Windows).

In order to write test code I would need to use the SDK at minimum to
generate EINITTOKEN for the test enclave.

[1] The source code is available but with Skylake you cannot sign your
own Launch Enclave binary, which is of course possible in future when
the MSRs become available for having you own root of trust.

> -Andi

/Jarkko

[toc] | [prev] | [next] | [standalone]


#1388711

FromJethro Beekman <kernel@jbeekman.nl>
Date2016-04-27 09:10 +0200
Message-ID<rsrLI-5uN-19@gated-at.bofh.it>
In reply to#1387384
On 26-04-16 04:23, Jarkko Sakkinen wrote:
> In order to write test code I would need to use the SDK at minimum to
> generate EINITTOKEN for the test enclave.

You could do this right now with the Rust tools for SGX [1]

[1] https://github.com/jethrogb/sgx-utils/

> /Jarkko

Jethro

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web