[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e6e6eec-f2a3-9b18-eed8-e0ba965774b0@intel.com>
Date: Mon, 17 Dec 2018 11:40:18 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Cc: Sean Christopherson <sean.j.christopherson@...el.com>,
x86@...nel.org, platform-driver-x86@...r.kernel.org,
linux-sgx@...r.kernel.org, nhorman@...hat.com,
npmccallum@...hat.com, serge.ayoun@...el.com,
shay.katz-zamir@...el.com, haitao.huang@...ux.intel.com,
andriy.shevchenko@...ux.intel.com, tglx@...utronix.de,
kai.svahn@...el.com, mark.shanahan@...el.com, luto@...capital.net,
Suresh Siddha <suresh.b.siddha@...el.com>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Darren Hart <dvhart@...radead.org>,
Andy Shevchenko <andy@...radead.org>,
"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v17 18/23] platform/x86: Intel SGX driver
On 12/17/18 11:37 AM, Jarkko Sakkinen wrote:
>> Suggestion:
>>
>> It looks like you only expect one VMA per enclave. Things go bonkers if
>> this is not true. So, instead of storing encl->mm, don't. You can get
>> the mm from vma->vm_mm and you could just store encl->vma instead.
> The code actually supports having multiple VMAs per enclave.
That seems at least somewhat at odds with this comment:
> static void sgx_vma_open(struct vm_area_struct *vma)
> {
> struct sgx_encl *encl = vma->vm_private_data;
>
> if (!encl)
> return;
>
> /* kref cannot underflow because ECREATE ioctl checks that there is only
> * one single VMA for the enclave before proceeding.
> */
> kref_get(&encl->refcount);
> }
Powered by blists - more mailing lists