On Mon, 11 Jan 2021 18:08:10 -0600, Jarkko Sakkinen
wrote:
On Tue, Jan 05, 2021 at 03:57:49PM +0100, Borislav Petkov wrote:
On Wed, Dec 16, 2020 at 03:49:20PM +0200, Jarkko Sakkinen wrote:
> Add synchronize_srcu_expedited() to sgx_encl_release() to catch a
grace
> period initiated by
-by: Jethro Beekman
Tested-by: Haitao Huang
Tested-by: Chunyang Hui
Tested-by: Jordan Hand
Tested-by: Nathaniel McCallum
Tested-by: Seth Moore
Tested-by: Darren Kenny
Reviewed-by: Darren Kenny
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Co-developed-by: Suresh Siddha
When I turn on CONFIG_PROVE_LOCKING, kernel reports following suspicious
RCU usages. Not sure if it is an issue. Just reporting here:
[ +34.337095] =
[ +0.01] WARNING: suspicious RCU usage
[ +0.02] 5.9.0-rc6-lock-sgx39 #1 Not tainted
[ +0.01]
On Sat, 03 Oct 2020 08:32:45 -0500, Jarkko Sakkinen
wrote:
On Sat, Oct 03, 2020 at 12:22:47AM -0500, Haitao Huang wrote:
When I turn on CONFIG_PROVE_LOCKING, kernel reports following
suspicious RCU
usages. Not sure if it is an issue. Just reporting here:
I'm glad to hear that my tip
On Mon, 05 Oct 2020 07:42:21 -0500, Jarkko Sakkinen
wrote:
On Mon, Oct 05, 2020 at 11:42:46AM +0200, Greg KH wrote:
> > You use gpl-only header files in this file, so how in the world can
it
> > be bsd-3 licensed?
> >
> > Please get your legal department to agree with this, after you
On Thu, 17 Sep 2020 11:02:06 -0500, Jarkko Sakkinen
wrote:
On Thu, Sep 17, 2020 at 12:34:18AM -0500, Haitao Huang wrote:
On Tue, 15 Sep 2020 06:05:11 -0500, Jarkko Sakkinen
wrote:
...
> +static int __sgx_encl_add_page(struct sgx_encl *encl,
> + struct sgx_enc
-by: Jethro Beekman
Tested-by: Haitao Huang
Tested-by: Chunyang Hui
Tested-by: Jordan Hand
Tested-by: Nathaniel McCallum
Tested-by: Seth Moore
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Co-developed-by: Suresh Siddha
Signed-off-by: Suresh Siddha
Signed-off
On Fri, 11 Sep 2020 07:40:08 -0500, Jarkko Sakkinen
wrote:
...
+/**
+ * sgx_ioc_enclave_add_pages() - The handler for
%SGX_IOC_ENCLAVE_ADD_PAGES
+ * @encl: an enclave pointer
+ * @arg: a user pointer to a struct sgx_enclave_add_pages instance
+ *
+ * Add one or more pages
s: 1728ab54b4be ("x86/sgx: Add a page reclaimer")
Suggested-by: Sean Christopherson
Suggested-by: Haitao Huang
Signed-off-by: Jarkko Sakkinen
---
v3: Fine-tuned tags, and added missing change log for v2.
v2: Switch to synchronize_srcu_expedited().
arch/x86/kernel/cpu/sgx/encl.c | 6
a legitimate bug and
that the
> synchronization in sgx_encl_release() was indeed necessary.
Good and valid point. The way I see it, the tags should be:
Reported-by: Haitao Huang
Suggested-by: Sean Christopherson
Haitao pointed out the bug but from your analysis I could resolve that
this is the f
On Mon, 16 Nov 2020 12:00:23 -0600, Dr. Greg wrote:
On Thu, Nov 12, 2020 at 02:41:00PM -0800, Andy Lutomirski wrote:
Good morning, I hope the week is starting well for everyone.
On Thu, Nov 12, 2020 at 1:31 PM Dave Hansen
wrote:
>
> On 11/12/20 12:58 PM, Dr. Greg wrote:
> > @@ -270,11
On Fri, 03 Jul 2020 22:31:10 -0500, Jarkko Sakkinen
wrote:
On Wed, Jul 01, 2020 at 08:59:02PM -0700, Sean Christopherson wrote:
On Thu, Jun 18, 2020 at 01:08:33AM +0300, Jarkko Sakkinen wrote:
> +static int sgx_validate_secs(const struct sgx_secs *secs,
> + unsigned
On Wed, 02 Sep 2020 11:10:12 -0500, Sean Christopherson
wrote:
On Tue, Sep 01, 2020 at 10:06:32PM -0500, Haitao Huang wrote:
On Fri, 03 Jul 2020 22:31:10 -0500, Jarkko Sakkinen
wrote:
> On Wed, Jul 01, 2020 at 08:59:02PM -0700, Sean Christopherson wrote:
> > On Thu, Jun 18, 2020
On Wed, 23 Sep 2020 08:50:56 -0500, Jarkko Sakkinen
wrote:
On Tue, Sep 22, 2020 at 09:43:02AM -0700, Sean Christopherson wrote:
On Tue, Sep 22, 2020 at 08:35:15AM +0300, Jarkko Sakkinen wrote:
> On Tue, Sep 22, 2020 at 08:30:06AM +0300, Jarkko Sakkinen wrote:
> > On Mon, Sep 21, 2020 at
On Wed, 06 May 2020 17:14:22 -0500, Sean Christopherson
wrote:
On Wed, May 06, 2020 at 05:42:42PM -0400, Nathaniel McCallum wrote:
Tested on Enarx. This requires a patch[0] for v29 support.
Tested-by: Nathaniel McCallum
However, we did uncover a small usability issue. See below.
[0]:
On Thu, 07 May 2020 11:49:15 -0500, Nathaniel McCallum
wrote:
On Thu, May 7, 2020 at 1:03 AM Haitao Huang
wrote:
On Wed, 06 May 2020 17:14:22 -0500, Sean Christopherson
wrote:
> On Wed, May 06, 2020 at 05:42:42PM -0400, Nathaniel McCallum wrote:
>> Tested on Enarx. This require
On Thu, 07 May 2020 14:34:59 -0500, Sean Christopherson
wrote:
On Thu, May 07, 2020 at 12:49:15PM -0400, Nathaniel McCallum wrote:
On Thu, May 7, 2020 at 1:03 AM Haitao Huang
wrote:
>
> On Wed, 06 May 2020 17:14:22 -0500, Sean Christopherson
> wrote:
>
> > On Wed, May
On Fri, 10 May 2019 14:22:34 -0500, Andy Lutomirski
wrote:
On Fri, May 10, 2019 at 12:04 PM Jethro Beekman
wrote:
On 2019-05-10 11:56, Xing, Cedric wrote:
> Hi Jethro,
>
>> ELF files are explicitly designed such that you can map them (with
mmap)
>> in 4096-byte chunks. However,
On Tue, 14 May 2019 10:17:29 -0500, Andy Lutomirski
wrote:
On Tue, May 14, 2019 at 7:33 AM Haitao Huang
wrote:
On Fri, 10 May 2019 14:22:34 -0500, Andy Lutomirski
wrote:
> On Fri, May 10, 2019 at 12:04 PM Jethro Beekman
> wrote:
>>
>> On 2019-05-10 11:56, Xing, Ced
On Tue, 14 May 2019 15:45:54 -0500, Andy Lutomirski
wrote:
On May 14, 2019, at 8:30 AM, Haitao Huang
wrote:
On Tue, 14 May 2019 10:17:29 -0500, Andy Lutomirski
wrote:
On Tue, May 14, 2019 at 7:33 AM Haitao Huang
wrote:
On Fri, 10 May 2019 14:22:34 -0500, Andy Lutomirski
wrote
On Tue, 14 May 2019 16:58:24 -0500, Xing, Cedric
wrote:
Hi Everyone,
I think we are talking about 2 different kinds of criteria for
determining the sanity of an enclave.
The first kind determines an enclave's sanity by generally accepted good
practices. For example, no executable
On Wed, 15 May 2019 16:38:58 -0500, Sean Christopherson
wrote:
On Wed, May 15, 2019 at 11:27:04AM -0700, Andy Lutomirski wrote:
2) Just like any other DSO, there are potential issues with how
enclaves deal with writable vs executable memory. This takes two
forms. First, a task should
On Mon, 01 Mar 2021 05:43:06 -0600, Kai Huang wrote:
On Mon, 2021-03-01 at 12:32 +0100, Borislav Petkov wrote:
On Tue, Mar 02, 2021 at 12:28:27AM +1300, Kai Huang wrote:
> I think some script can utilize /proc/cpuinfo. For instance, admin
can have
> automation tool/script to deploy enclave
On Sun, 07 Feb 2021 16:14:01 -0600, Jarkko Sakkinen
wrote:
This has been shown in tests:
[ +0.08] WARNING: CPU: 3 PID: 7620 at kernel/rcu/srcutree.c:374
cleanup_srcu_struct+0xed/0x100
This is essentially a use-after free, although SRCU notices it as
an SRCU cleanup in an invalid
On Thu, 14 Sep 2023 05:31:30 -0500, Huang, Kai wrote:
Some non-technical staff:
On Tue, 2023-09-12 at 21:06 -0700, Haitao Huang wrote:
From: Kristen Carlson Accardi
The patch was from Kristen, but ...
Introduce a data structure to wrap the existing reclaimable list and its
spinlock
Hi Jarkko
On Wed, 13 Sep 2023 04:39:06 -0500, Jarkko Sakkinen
wrote:
On Wed Sep 13, 2023 at 7:06 AM EEST, Haitao Huang wrote:
From: Kristen Carlson Accardi
Consumers of the misc cgroup controller might need to perform separate
actions for Cgroups Subsystem State(CSS) events: cgroup
On Wed, 13 Sep 2023 10:34:28 -0500, Jarkko Sakkinen
wrote:
+++ b/arch/x86/kernel/cpu/sgx/encl.h
@@ -39,6 +39,7 @@ enum sgx_encl_flags {
SGX_ENCL_DEBUG = BIT(1),
SGX_ENCL_CREATED= BIT(2),
SGX_ENCL_INITIALIZED= BIT(3),
+ SGX_ENCL_OOM
On Fri, 15 Sep 2023 12:58:11 -0500, Tejun Heo wrote:
On Fri, Sep 15, 2023 at 07:55:45AM -1000, Tejun Heo wrote:
On Tue, Sep 12, 2023 at 09:06:18PM -0700, Haitao Huang wrote:
> @@ -37,6 +37,11 @@ struct misc_res {
>u64 max;
>atomic64_t usage;
>atomic64_t events;
>
On Wed, 13 Sep 2023 10:42:52 -0500, Jarkko Sakkinen
wrote:
On Wed Sep 13, 2023 at 7:06 AM EEST, Haitao Huang wrote:
Add sgx_can_reclaim() wrapper and encapsulate direct references to the
global LRU list in the reclaimer functions so that they can be called
with
an LRU list per EPC cgroup
ore.kernel.org/linux-sgx/20220905020411.17290-1-jar...@kernel.org/
[7]https://lore.kernel.org/linux-sgx/zlcxmvdkhecry...@slm.duckdns.org/
[8]https://lore.kernel.org/linux-sgx/20230721120231.13916-1-haitao.hu...@linux.intel.com/
[9]https://lore.kernel.org/linux-sgx/20230728051024.33063-1-haitao.hu...@linux.intel.com/
callbacks for these
operations, and call the corresponding per-resource-type callback when
appropriate.
This code will be utilized by the SGX driver in a future patch.
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
---
V4:
- Moved this to the front of the series.
- Applies
struct.
Allow SGX EPC memory to be a valid resource type for the misc
controller.
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
---
V4:
- Moved this to the second in the series.
---
include/linux/misc_cgroup.h | 29 +
kernel/cgroup/misc.c
to this structure
to support this OOM killing of enclaves.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Removed unneeded comments for the spinlock and the non-reclaimables.
(Kai, Jarkko)
- Revised the commit to add
not tracked
at this point but they will be tracked after an unreclaimable LRU list
is added to the sgx_epc_lru_lists struct.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- No change, only reordered
eclaimable lists.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Code update needed for patch reordering
- Revised commit message.
---
arch/x86/kernel/cpu/sgx/encl.c | 8 +---
arch/x86/kernel/cpu/s
ghtforward than using an array.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Changes needed for patch reordering
- Revised commit message
V3:
- Removed list wrappers
---
arch/x86/kernel/cpu/sgx/m
Use the lower 3 bits in the flags field of sgx_epc_page struct to
track EPC states in its life cycle and define an enum for possible
states. More state(s) will be added later.
Signed-off-by: Haitao Huang
---
V4:
- No changes other than required for patch reordering.
V3:
- This is new in V3
/drop_epc_pages()" functions for adding/removing
VA and SECS pages to/from this "unreclaimable" list.
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
---
V4:
- Updates for patch reordering.
- Revised commit messages.
- Revised comments for the list.
V3:
- Remo
opherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Tested-by: Mikko Ylinen
Cc: Sean Christopherson
---
V4:
- Fix a white space issue in Kconfig (Randy).
- Update comments for LRU list as it can be owned by a cgroup.
- Fix comments for sgx_reclaim_epc_pages() and use IS_EN
allows the cgroup iteration logic to be wholly encapsulated within the
cgroup code.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- No changes other than reordering the patches
---
arch/x86/kernel/cpu/sgx
. Address this by adding
flags for the owner type.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Updates for patch reordering.
- Rename SGX_EPC_OWNER_ENCL_PAGE to SGX_EPC_OWNER_PAGE. (Jarkko)
- Commit message
those enclave resources, instead, it lets all
reclaiming in progress to finish, and relies (as currently done) on
kref_put on encl->refcount to trigger sgx_encl_release() to do the
final cleanup.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao
, e.g., calling this function with the flag to ignore age
of pages.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Combined the 3 patches that made the individual changes to the
function signature
Add sgx_can_reclaim() wrapper and encapsulate direct references to the
global LRU list in the reclaimer functions so that they can be called with
an LRU list per EPC cgroup.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean
by the cgroup to select the OOM
killed enclave.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Changes needed for patch reordering
- Revised commit messages (Jarkko)
---
arch/x86/kernel/cpu/sgx/encl.c
pty(_page->list).
A later patch will replace the array on stack with a temporary list to
store the candidate pages, so list_empty() should no longer be used for
this purpose.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean Christop
From: Kristen Carlson Accardi
Add initial documentation of how to regulate the distribution of
SGX Enclave Page Cache (EPC) memory via the Miscellaneous cgroup
controller.
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean
-by: Haitao Huang
---
V4:
Note: Need to apply on top of this series previously reviewed:
https://lore.kernel.org/linux-sgx/20220905020411.17290-1-jar...@kernel.org/
---
.../selftests/sgx/run_tests_in_misc_cg.sh | 68 +++
tools/testing/selftests/sgx/setup_epc_cg.sh | 29
On Tue, 10 Oct 2023 19:01:25 -0500, Sean Christopherson
wrote:
On Tue, Oct 10, 2023, Haitao Huang wrote:
On Mon, 09 Oct 2023 21:23:12 -0500, Huang, Kai
wrote:
> On Mon, 2023-10-09 at 20:42 -0500, Haitao Huang wrote:
> > Hi Sean
> >
> > On Mon, 09 Oct 2023
On Tue, 10 Oct 2023 19:31:19 -0500, Huang, Kai wrote:
On Tue, 2023-10-10 at 12:05 -0500, Haitao Huang wrote:
On Mon, 09 Oct 2023 21:12:27 -0500, Huang, Kai
wrote:
>
> > > > >
> > > > Later the hosting process could migrated/reassigned to another
> > cgr
On Mon, 16 Oct 2023 05:57:36 -0500, Huang, Kai wrote:
On Thu, 2023-10-12 at 08:27 -0500, Haitao Huang wrote:
On Tue, 10 Oct 2023 19:51:17 -0500, Huang, Kai
wrote:
[...]
> (btw, even you track VA/SECS pages in unreclaimable list, given they
> both have
> 'enclave' as the owner
Hi Sean
On Mon, 16 Oct 2023 16:32:31 -0500, Sean Christopherson
wrote:
On Mon, Oct 16, 2023, Haitao Huang wrote:
From this perspective, I think the current implementation is
"well-defined":
EPC cgroup limits for VMs are only enforced at VM launch time, not
runtime.
In practic
On Mon, 16 Oct 2023 16:09:52 -0500, Huang, Kai wrote:
[...]
still need to fix the bug mentioned above here.
I really think you should just go this simple way:
When you want to take EPC back from VM, kill the VM.
My only concern is that this is a compromise due to current limitation (no
On Mon, 16 Oct 2023 20:34:57 -0500, Huang, Kai wrote:
On Mon, 2023-10-16 at 19:10 -0500, Haitao Huang wrote:
On Mon, 16 Oct 2023 16:09:52 -0500, Huang, Kai
wrote:
[...]
> still need to fix the bug mentioned above here.
>
> I really think you should just go this simple way:
>
On Mon, 06 Nov 2023 19:16:30 -0600, Haitao Huang
wrote:
On Mon, 06 Nov 2023 16:18:30 -0600, Huang, Kai
wrote:
> > +/**
> > + * sgx_epc_cgroup_try_charge() - hierarchically try to charge a
single
> > EPC page
> > + *
> > + * Returns EPC cgroup or NULL
On Mon, 06 Nov 2023 16:18:30 -0600, Huang, Kai wrote:
> > +/**
> > + * sgx_epc_cgroup_try_charge() - hierarchically try to charge a
single
> > EPC page
> > + *
> > + * Returns EPC cgroup or NULL on success, -errno on failure.
> > + */
> > +struct sgx_epc_cgroup
On Mon, 06 Nov 2023 09:48:36 -0600, Haitao Huang
wrote:
On Sun, 05 Nov 2023 21:26:44 -0600, Jarkko Sakkinen
wrote:
On Mon, 2023-10-30 at 11:20 -0700, Haitao Huang wrote:
SGX Enclave Page Cache (EPC) memory allocations are separate from
normal RAM allocations, and
are managed solely
On Sun, 05 Nov 2023 21:26:44 -0600, Jarkko Sakkinen
wrote:
On Mon, 2023-10-30 at 11:20 -0700, Haitao Huang wrote:
SGX Enclave Page Cache (EPC) memory allocations are separate from
normal RAM allocations, and
are managed solely by the SGX subsystem. The existing cgroup memory
controller
, if the flag is true, switch the
active mem_cgroup to the one returned from sgx_encl_get_mem_cgroup(),
prior to any backing page allocation, in order to ensure that shmem page
allocations are charged to the enclave's cgroup.
Removed current_is_ksgxd() as it is no longer needed.
Signed-off-by: Haitao
There is an issue WRT charging proper mem_cgroups for backing pages once
per-cgroup reclamation is implemented.
Please apply the fix-up patch [1] on top of this patch or the series.
Thanks
Haitao
[1]
https://lore.kernel.org/all/20231106155859.7251-1-haitao.hu...@linux.intel.com/
On Mon, 06 Nov 2023 06:09:45 -0600, Huang, Kai wrote:
On Mon, 2023-10-30 at 11:20 -0700, Haitao Huang wrote:
From: Kristen Carlson Accardi
Implement support for cgroup control of SGX Enclave Page Cache (EPC)
memory using the misc cgroup controller. EPC memory is independent
from normal
, also calling
sgx_epc_cgroup_reclaim_pages().
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
---
V6:
- Drop EPC OOM killer.(Dave, Michal)
- Patch restructuring: this includes
testing, run this in a
separate terminal:
./watch_misc_for_tests.sh current
[1] https://github.com/libcgroup/libcgroup/blob/main/README
Signed-off-by: Haitao Huang
---
V5:
- Added script with automatic results checking, remove the interactive
script.
- The script can run independent from
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V6:
- Drop UNRECLAIMABLE and use only 2 bits for states (Kai)
- Combine the patch for RECLAIM_IN_PROGRESS
- Style fixes (Jarkko and Kai)
---
arch/x86/kernel/cpu/
rward than using an array.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V6:
- Remove extra list_del_init and style fix (Kai)
V4:
- Chan
to be done in LRUs in its children groups.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V6:
- Restructure patches to make it easier
cgroup reclaims pages
from the reclaimable list in this structure when its usage reaches near
its limit.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean
count is lower than a threshold.
Later patches will reorganize the tracking and reclamation code in the
globale reclaimer and implement per-cgroup tracking and reclaiming.
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed
rg/linux-sgx/20230728051024.33063-1-haitao.hu...@linux.intel.com/
[10]https://lore.kernel.org/all/20230923030657.16148-1-haitao.hu...@linux.intel.com/
Haitao Huang (2):
x86/sgx: Introduce EPC page states
selftests/sgx: Add scripts for EPC cgroup testing
Kristen Carlson Accardi (5):
cgro
-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
---
V6:
- Create ops struct for per resource callbacks (Jarkko)
- Drop max_write callback (Dave, Michal)
- Style fixes (Kai)
---
include/linux/misc_cgroup.h | 14 ++
kernel/cgroup/misc.c| 27
. This requires a walk from the current
cgroup up to the root similar to misc_cg_try_charge(). Export
misc_cg_parent() to enable this walk.
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
---
V6:
- Make commit messages more concise and split the original patch
From: Kristen Carlson Accardi
Add SGX EPC memory, MISC_CG_RES_SGX_EPC, to be a valid resource type
for the misc controller.
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
---
V6:
- Split the original patch into this and the preceding one (Kai
Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V5:
- Spelled out SECS, VA (Jarkko)
V4:
- No change, only reordered the patch.
V3:
- Remove usage of list wrapper
---
arch/x86/kernel/cpu/sgx/main.c | 39
-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V6:
- Remove mentioning of VMM specific behavior on handling SIGBUS
- Remove statement of forced reclamation, add statement to specify
ENOMEM returned when no reclamation possible.
- Added statements on the non-preemptive
-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
Reviewed-by: Bagas Sanjaya
---
V4:
- Fix indentation (Randy)
- Change misc.events file to be read-only
- Fix a typo for 'subsystem'
- Add behavior when VMM overcommit EPC with a cgroup (Mikko)
---
Documentation/arch/x86
rson
Signed-off-by: Sean Christopherson
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Tested-by: Mikko Ylinen
Cc: Sean Christopherson
---
V5:
- kernel-doc fixes (Jarkko)
V4:
- Fix a white space issue in Kconfig (Randy).
- Update comments for
isc()
into misc_cgroup.h and make inline to make this function available to
SGX, rename it to misc_cg_parent(), and update kernel/cgroup/misc.c to
use the new name.
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
---
V5:
- Revised commit message (Jarkko)
V4:
- Mo
-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V5:
- Spelled out SECS, VA (Jarkko)
V4:
- No change, only reordered the patch.
V3:
- Remove usage of list wrapper
---
arch/x86/kernel/cpu/sgx/main.c | 39 +-
1 file changed, 20 insertions
to this structure
to support this OOM killing of enclaves.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Removed unneeded comments for the spinlock
ao.hu...@linux.intel.com/
[9]https://lore.kernel.org/linux-sgx/20230728051024.33063-1-haitao.hu...@linux.intel.com/
Haitao Huang (2):
x86/sgx: Introduce EPC page states
selftests/sgx: Add scripts for EPC cgroup testing
Kristen Carlson Accardi (3):
cgroup/misc: Add per resource callbacks for CSS events
.
Signed-off-by: Kristen Carlson Accardi
Signed-off-by: Haitao Huang
---
V5:
- Remove prefixes from the callback names (tj)
- Update commit message (Jarkko)
V4:
- Moved this to the front of the series.
- Applies on cgroup/for-6.6 with the overflow fix for misc.
V3:
- Removed the released() callback
, e.g., calling this function with the flag to ignore age
of pages.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Combined the 3
. Address this by adding
flags for the owner type.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Updates for patch reordering.
- Rename
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V5:
- Revise commit message to make the purpose more clear.
V4:
- Re-organized this patch to include all changes related to
encapsulation of the global LRU
- Moved
/main/README
Signed-off-by: Haitao Huang
---
V5:
- Added script with automatic results checking, remove the interactive
script.
- The script can run independent from the series below.
V4:
Note: Need to apply on top of this series previously reviewed:
https://lore.kernel.org/linux-sgx
allows the cgroup iteration logic to be wholly encapsulated within the
cgroup code.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4
/drop_epc_pages()" functions for adding/removing
VA and SECS pages to/from this "unreclaimable" list.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
C
Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V5:
- Rename SGX_ENCL_OOM to SGX_ENCL_NO_MEMORY
V4:
- Updates for patch reordering and typo fixes.
V3:
- Rebased to use the new VMA_ITERATOR to zap VMAs.
- Fixed the racing cases by b
eloped-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Fixed some typos.
- Revised commit message.
V3:
- Extend the sgx_epc_page_state enum introduced earlier to replace the
flag based approach.
---
arch/x86/kernel/cpu/sgx/main.c | 21 ++---
ar
rward than using an array.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V4:
- Changes needed for patch reordering
- Revised commit m
in an
unreclaimable queue that can be examined by the cgroup to select the OOM
killed enclave.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V5:
- Fixed
eclaimable lists.
Signed-off-by: Sean Christopherson
Co-developed-by: Kristen Carlson Accardi
Signed-off-by: Kristen Carlson Accardi
Co-developed-by: Haitao Huang
Signed-off-by: Haitao Huang
Cc: Sean Christopherson
---
V5:
- style fixes (Jarkko)
V4:
- Code update needed for patch reordering
Use the lower 3 bits in the flags field of sgx_epc_page struct to
track EPC states in its life cycle and define an enum for possible
states. More state(s) will be added later.
Signed-off-by: Haitao Huang
---
V4:
- No changes other than required for patch reordering.
V3:
- This is new in V3
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
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
On Wed, 27 Sep 2023 06:57:18 -0500, Huang, Kai wrote:
On Fri, 2023-09-22 at 20:06 -0700, Haitao Huang wrote:
From: Sean Christopherson
When an OOM event occurs, all pages associated with an enclave will need
to be freed, including pages that are not currently tracked by the
cgroup LRU lists
On Wed, 27 Sep 2023 22:59:12 -0500, Huang, Kai wrote:
On Fri, 2023-09-22 at 20:06 -0700, Haitao Huang wrote:
From: Kristen Carlson Accardi
Add SGX EPC memory, MISC_CG_RES_SGX_EPC, to be a valid resource type
for the misc controller.
Add per resource type private data so that SGX can store
On Wed, 27 Sep 2023 05:28:36 -0500, Huang, Kai wrote:
On Fri, 2023-09-22 at 20:06 -0700, Haitao Huang wrote:
Use the lower 3 bits in the flags field of sgx_epc_page struct to
track EPC states in its life cycle and define an enum for possible
states. More state(s) will be added later
On Thu, 28 Sep 2023 04:28:34 -0500, Huang, Kai wrote:
On Fri, 2023-09-22 at 20:06 -0700, Haitao Huang wrote:
@@ -314,18 +313,22 @@ static void sgx_reclaim_pages(void)
if (kref_get_unless_zero(_page->encl->refcount) != 0) {
sgx_epc_page_set
On Thu, 28 Sep 2023 04:41:33 -0500, Huang, Kai wrote:
--- a/arch/x86/kernel/cpu/sgx/encl.c
+++ b/arch/x86/kernel/cpu/sgx/encl.c
@@ -746,6 +746,7 @@ void sgx_encl_release(struct kref *ref)
xa_destroy(>page_array);
if (!encl->secs_child_cnt && encl->secs.epc_page) {
+
1 - 100 of 348 matches
Mail list logo