[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fcdf25d46785c195d73815d52b9829efaa376bfc.camel@intel.com>
Date: Mon, 2 Oct 2023 11:05:16 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "tj@...nel.org" <tj@...nel.org>,
"linux-sgx@...r.kernel.org" <linux-sgx@...r.kernel.org>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"x86@...nel.org" <x86@...nel.org>,
"cgroups@...r.kernel.org" <cgroups@...r.kernel.org>,
"hpa@...or.com" <hpa@...or.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"bp@...en8.de" <bp@...en8.de>,
"haitao.huang@...ux.intel.com" <haitao.huang@...ux.intel.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"jarkko@...nel.org" <jarkko@...nel.org>,
"Mehta, Sohil" <sohil.mehta@...el.com>
CC: "kristen@...ux.intel.com" <kristen@...ux.intel.com>,
"Zhang, Bo" <zhanb@...rosoft.com>,
"Li, Zhiquan1" <zhiquan1.li@...el.com>,
"Christopherson,, Sean" <seanjc@...gle.com>,
"mikko.ylinen@...ux.intel.com" <mikko.ylinen@...ux.intel.com>,
"anakrish@...rosoft.com" <anakrish@...rosoft.com>,
"yangjie@...rosoft.com" <yangjie@...rosoft.com>
Subject: Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating
new VA pages
On Fri, 2023-09-29 at 10:06 -0500, Haitao Huang wrote:
> 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().
>
>
And also sgx_setup_epc_section().
Powered by blists - more mailing lists