[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <op.2b1f8j1bwjvjmi@hhuan26-mobl.amr.corp.intel.com>
Date: Fri, 29 Sep 2023 10:06:09 -0500
From: "Haitao Huang" <haitao.huang@...ux.intel.com>
To: "mingo@...hat.com" <mingo@...hat.com>,
"linux-sgx@...r.kernel.org" <linux-sgx@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"cgroups@...r.kernel.org" <cgroups@...r.kernel.org>,
"hpa@...or.com" <hpa@...or.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"jarkko@...nel.org" <jarkko@...nel.org>,
"bp@...en8.de" <bp@...en8.de>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"tj@...nel.org" <tj@...nel.org>,
"Mehta, Sohil" <sohil.mehta@...el.com>,
"Huang, Kai" <kai.huang@...el.com>
Cc: "kristen@...ux.intel.com" <kristen@...ux.intel.com>,
"anakrish@...rosoft.com" <anakrish@...rosoft.com>,
"Li, Zhiquan1" <zhiquan1.li@...el.com>,
"Christopherson,, Sean" <seanjc@...gle.com>,
"mikko.ylinen@...ux.intel.com" <mikko.ylinen@...ux.intel.com>,
"yangjie@...rosoft.com" <yangjie@...rosoft.com>,
"Zhang, Bo" <zhanb@...rosoft.com>
Subject: Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating
new VA pages
On Wed, 27 Sep 2023 16:21:19 -0500, Huang, Kai <kai.huang@...el.com> wrote:
> On Wed, 2023-09-27 at 10:35 -0500, Haitao Huang wrote:
>> > > +
>> > > + /* Possible owner types */
>> > > + union {
>> > > + struct sgx_encl_page *encl_page;
>> > > + struct sgx_encl *encl;
>> > > + };
>> >
>> > Sadly for virtual EPC page the owner is set to the 'sgx_vepc'
>> instance it
>> > belongs to.
>> >
>> > Given how sgx_{alloc|free}_epc_page() arbitrarily uses encl_page,>
>> perhaps we
>> > should do below?
>> >
>> > union {
>> > struct sgx_encl_page *encl_page;
>> > struct sgx_encl *encl;
>> > struct sgx_vepc *vepc;
>> > void *owner;
>> > };
>> >
>> > And in sgx_{alloc|free}_epc_page() we can use 'owner' instead.
>> >
>>
>> As I mentioned in cover letter and change log in 11/18, this series does
>> not track virtual EPC.
>
> It's not about how does the cover letter says. We cannot ignore the
> fact that
> currently virtual EPC uses owner too.
>
> But given the virtual EPC code currently doesn't use the owner, I can
> live with
> not having the 'vepc' member in the union now.
Ah, I forgot even though we don't use the owner field assigned by vepc, it
is still passed into sgx_alloc/free_epc_page().
Will add back "void* owner" and use it for assignment inside
sgx_alloc/free_epc_page().
Thanks
Haitao
Powered by blists - more mailing lists