linux-sgx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: sean.j.christopherson@intel.com
Cc: luto@kernel.org, linux-sgx@vger.kernel.org,
	serge.ayoun@intel.com, shay.katz-zamir@intel.com
Subject: Re: sgx_encl_may_map()
Date: Fri, 23 Aug 2019 19:27:35 +0300	[thread overview]
Message-ID: <20190823162705.xhpk4nhx7rzzq636@linux.intel.com> (raw)
In-Reply-To: <20190823160404.oszonu4srjx276a3@linux.intel.com>

On Fri, Aug 23, 2019 at 07:04:04PM +0300, Jarkko Sakkinen wrote:
> On Fri, Aug 23, 2019 at 06:02:48PM +0300, Jarkko Sakkinen wrote:
> > 3. Why don't just store SECINFO flags on EADD? Doing
> >    calc_vma_prot_bits() on fly is not expensive. Now
> >    data in SECINFO flags is scattered to two different
> >    fields (desc and vm_max_prot_bits). I'd just have a field
> >    called secinfo_flags.
> 
> Makes sense to have that field as a cache so that we don't have to do
> recalc per page in the sgx_encl_may_map() and thus makes sense to keep
> TCS tagging in desc.

(1) and (2) I will remark in v22 patch review. It is better to do that
way.

I squashed my remaining fixes that I just posted to the patch set.

The final change log for v22 is:

* Alignment checks have been removed from mmap() because it does not define the
  ELRANGE. VMAs only act as windows to the enclave. The semantics compare
  somewhat how mmap() works with regular files.
* We now require user space addresses given to SGX_IOC_ENCLAVE_ADD_PAGE to be
  page aligned so that we can pass the page directly to EADD and do not have
  to do an extra copy. This was made effectively possible by removing the
  worker thread for adding pages.
* The selftest build files have been refined throughout of various glitches
  and work properly in a cross compilation environment such as BuildRoot.
  In addition, libcalls fail the build with an assertion in the linker
  script, if they end up to the enclave binary.
* CONFIG_INTEL_SGX_DRIVER has been removed because you cannot use SGX core
  for anything without having the driver. This could change when KVM support
  is added.
* We require zero permissions in SECINFO for TCS pages because the CPU
  overwrites SECINFO flags with zero permissions and measures the page
  only after that. Allowing to pass TCS with non-zero permissions would
  cause mismatching measurement between the one provided in SIGSTRUCT and
  the one computed by the CPU.

As I noted I can ATM run only selftest as the stress test that I'm using
is not yet working with the latets API changes.

Can you give it a shot?

/Jarkko

  reply	other threads:[~2019-08-23 16:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 15:02 sgx_encl_may_map() Jarkko Sakkinen
2019-08-23 16:04 ` sgx_encl_may_map() Jarkko Sakkinen
2019-08-23 16:27   ` Jarkko Sakkinen [this message]
2019-08-23 20:37 ` sgx_encl_may_map() Sean Christopherson
2019-08-26  2:56   ` sgx_encl_may_map() Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190823162705.xhpk4nhx7rzzq636@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=linux-sgx@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=sean.j.christopherson@intel.com \
    --cc=serge.ayoun@intel.com \
    --cc=shay.katz-zamir@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).