Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-10-05 Thread Huang, Kai
On Wed, 2023-10-04 at 23:22 -0500, Haitao Huang wrote: > On Wed, 04 Oct 2023 16:13:41 -0500, Huang, Kai wrote: > > > On Wed, 2023-10-04 at 10:03 -0500, Haitao Huang wrote: > > > On Tue, 03 Oct 2023 15:07:42 -0500, Huang, Kai > > > wrote: > > > > > > > On Tue, 2023-10-03 at 01:45 -0500,

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-10-05 Thread Haitao Huang
On Wed, 04 Oct 2023 16:13:41 -0500, Huang, Kai wrote: On Wed, 2023-10-04 at 10:03 -0500, Haitao Huang wrote: On Tue, 03 Oct 2023 15:07:42 -0500, Huang, Kai wrote: > On Tue, 2023-10-03 at 01:45 -0500, Haitao Huang wrote: > > > > > > Btw, probably a dumb question: > > > > > > Theoretically

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-10-04 Thread Huang, Kai
On Wed, 2023-10-04 at 10:03 -0500, Haitao Huang wrote: > On Tue, 03 Oct 2023 15:07:42 -0500, Huang, Kai wrote: > > > On Tue, 2023-10-03 at 01:45 -0500, Haitao Huang wrote: > > > > > > > > Btw, probably a dumb question: > > > > > > > > Theoretically if you only need to find a victim enclave you

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-10-04 Thread Haitao Huang
On Tue, 03 Oct 2023 15:07:42 -0500, Huang, Kai wrote: On Tue, 2023-10-03 at 01:45 -0500, Haitao Huang wrote: > > Btw, probably a dumb question: > > Theoretically if you only need to find a victim enclave you don't need > to put VA > pages to the unreclaimable list, because those VA pages

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-10-03 Thread Huang, Kai
On Tue, 2023-10-03 at 01:45 -0500, Haitao Huang wrote: > > > > Btw, probably a dumb question: > > > > Theoretically if you only need to find a victim enclave you don't need  > > to put VA > > pages to the unreclaimable list, because those VA pages will be freed  > > anyway > > when enclave is

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-10-03 Thread Haitao Huang
On Wed, 27 Sep 2023 06:35:57 -0500, Huang, Kai wrote: On Fri, 2023-09-22 at 20:06 -0700, Haitao Huang wrote: From: Sean Christopherson In a later patch, when a cgroup has exceeded the max capacity for EPC pages, it may need to identify and OOM kill a less active enclave to make room for

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-10-02 Thread Huang, Kai
On Fri, 2023-09-29 at 10:06 -0500, Haitao Huang wrote: > On Wed, 27 Sep 2023 16:21:19 -0500, Huang, Kai wrote: > > > On Wed, 2023-09-27 at 10:35 -0500, Haitao Huang wrote: > > > > > + > > > > > + /* Possible owner types */ > > > > > + union { > > > > > + struct sgx_encl_page

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-09-29 Thread Haitao Huang
On Wed, 27 Sep 2023 16:21:19 -0500, Huang, Kai 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

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-09-27 Thread Huang, Kai
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 >

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-09-27 Thread Haitao Huang
Hi Kai, On Wed, 27 Sep 2023 06:14:20 -0500, Huang, Kai wrote: On Fri, 2023-09-22 at 20:06 -0700, Haitao Huang wrote: From: Sean Christopherson In a later patch, when a cgroup has exceeded the max capacity for EPC pages, it may need to identify and OOM kill a less active enclave to make

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-09-27 Thread Huang, Kai
On Fri, 2023-09-22 at 20:06 -0700, Haitao Huang wrote: > From: Sean Christopherson > > In a later patch, when a cgroup has exceeded the max capacity for EPC > pages, it may need to identify and OOM kill a less active enclave to > make room for other enclaves within the same group. Such a victim

Re: [PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-09-27 Thread Huang, Kai
On Fri, 2023-09-22 at 20:06 -0700, Haitao Huang wrote: > From: Sean Christopherson > > In a later patch, when a cgroup has exceeded the max capacity for EPC > pages, it may need to identify and OOM kill a less active enclave to > make room for other enclaves within the same group. Such a victim

[PATCH v5 09/18] x86/sgx: Store struct sgx_encl when allocating new VA pages

2023-09-22 Thread Haitao Huang
From: Sean Christopherson In a later patch, when a cgroup has exceeded the max capacity for EPC pages, it may need to identify and OOM kill a less active enclave to make room for other enclaves within the same group. Such a victim enclave would have no active pages other than the unreclaimable