[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f2236b51-400a-b300-e818-297e45cc7b49@intel.com>
Date: Thu, 22 Sep 2022 14:39:53 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Kristen Carlson Accardi <kristen@...ux.intel.com>,
linux-kernel@...r.kernel.org, linux-sgx@...r.kernel.org,
cgroups@...r.kernel.org, Jarkko Sakkinen <jarkko@...nel.org>,
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>
Cc: Sean Christopherson <seanjc@...gle.com>
Subject: Re: [RFC PATCH 03/20] x86/sgx: Track owning enclave in VA EPC pages
On 9/22/22 13:04, Kristen Carlson Accardi wrote:
>> BTW, is there a flag or any other way to tell to what kind of object
>> ->owner points?
> The owner will only be an sgx_encl type if it is a va page, so to tell
> what kind of object owner is, you look at the epc page flags - like
> this:
> if (epc_page->flags & SGX_EPC_PAGE_ENCLAVE)
> encl = ((struct sgx_encl_page *)epc_page->owner)->encl;
> else if (epc_page->flags & SGX_EPC_PAGE_VERSION_ARRAY)
> encl = epc_page->owner;
> ...
I don't know how much refactoring it would take, but it would be nice if
that was a bit more obvious. Basically, can we get the code that checks
for or sets SGX_EPC_PAGE_VERSION_ARRAY close to the code that assigns or
reads ->owner?
Powered by blists - more mailing lists