lkml.org 
[lkml]   [2017]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 06/11] intel_sgx: driver for Intel Software Guard Extensions
On Tue, Nov 14, 2017 at 10:41:50AM +1100, James Morris wrote:
> On Mon, 13 Nov 2017, Jarkko Sakkinen wrote:
>
> > +
> > + secs_epc = sgx_alloc_page(0);
>
> Use SGX_ALLOC_ATOMIC instead of 0 ?

It is used in the #PF handler where it is not safe to swap pages in the
call context. I.e. you cannot lock mmap_sem without potentially causing
a deadlock.

> > + if (IS_ERR(secs_epc)) {
> > + ret = PTR_ERR(secs_epc);
> > + goto out;
> > + }
>
> > +out:
> > + if (encl)
> > + kref_put(&encl->refcount, sgx_encl_release);
> > + return ret;
> > +}
>
> Don't you need an sgx_free_page() somewhere here?

It will get freed by sgx_encl_release().

> --
> James Morris
> <james.l.morris@oracle.com>

/Jarkko

\
 
 \ /
  Last update: 2017-11-14 21:13    [W:0.081 / U:3.436 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site