[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dd7c1402-eeb9-cea5-25c6-ab19e8031991@intel.com>
Date: Sun, 7 Nov 2021 11:58:21 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Jarkko Sakkinen <jarkko@...nel.org>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
Jethro Beekman <jethro@...tanix.com>,
Sean Christopherson <seanjc@...gle.com>,
reinette.chatre@...el.com, tony.luck@...el.com,
nathaniel@...fian.com, stable@...r.kernel.org,
Borislav Petkov <bp@...e.de>, linux-sgx@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/sgx: Free backing memory after faulting the enclave
page
On 11/7/21 11:45 AM, Jarkko Sakkinen wrote:
> On Sun, Nov 07, 2021 at 11:06:01AM -0800, Dave Hansen wrote:
>> That's true, the page cache should all be torn down along with the
>> fput(). *But*, it would be a very nice property if the backing storage
>> was empty by this point. It essentially ensures that no enclave-runtime
>> cases missed truncating the backing storage away.
>
> What if an enclave is released a point when all of its pages
> are swapped out? Or even simpler case would an enclave that is
> larger than all of EPC.
In this loop:
void sgx_encl_release(struct kref *ref)
{
...
xa_for_each(&encl->page_array, index, entry) {
if (entry->epc_page == NULL)
// truncate backing storage
> What can be made sure is that for all pages, which are in EPC,
> the backing page is truncated.
Right, and that should be utterly trivial to do.
Powered by blists - more mailing lists