All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] x86/sgx: Limit EPC overcommit
@ 2022-01-07 18:16 Kristen Carlson Accardi
  2022-01-07 18:16 ` [PATCH v2 1/2] x86/sgx: Add accounting for tracking overcommit Kristen Carlson Accardi
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Kristen Carlson Accardi @ 2022-01-07 18:16 UTC (permalink / raw)
  To: linux-sgx; +Cc: linux-kernel, Kristen Carlson Accardi

SGX currently allows EPC pages to be overcommitted. If the system is
out of enclave memory, EPC pages are swapped to normal RAM via
a per enclave shared memory area. This shared memory is not charged
to the enclave or the task mapping it, making it hard to account
for using normal methods. Since SGX will allow EPC pages to be
overcommitted without limits, enclaves can consume system memory
for these backing pages without limits.

In order to prevent this, set a cap on the amount of overcommit SGX
allows.  Whenever a backing page is requested by an enclave, track
the total amount of shared memory pages used across all enclaves and
return an error if the overcommit limit has been reached. This will
restrict the total amount of backing pages that all enclaves can
consume to a maximum amount, and prevent enclaves from consuming
all the system RAM for backing pages.

The overcommit percentage has a value of 150, which limits shared
memory page consumption to 1.5x the number of EPC pages in the system.

Changes from v1
----------------
* removed module parameter and disable boolean
* increased over commit percentage to 150% from 100%

Kristen Carlson Accardi (2):
  x86/sgx: Add accounting for tracking overcommit
  x86/sgx: account backing pages

 arch/x86/kernel/cpu/sgx/encl.c | 76 ++++++++++++++++++++++++++++++++--
 arch/x86/kernel/cpu/sgx/encl.h |  6 ++-
 arch/x86/kernel/cpu/sgx/main.c | 52 +++++++++++++++++++++--
 arch/x86/kernel/cpu/sgx/sgx.h  |  2 +
 4 files changed, 128 insertions(+), 8 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2022-01-15 19:02 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 18:16 [PATCH v2 0/2] x86/sgx: Limit EPC overcommit Kristen Carlson Accardi
2022-01-07 18:16 ` [PATCH v2 1/2] x86/sgx: Add accounting for tracking overcommit Kristen Carlson Accardi
2022-01-07 18:46   ` Dave Hansen
2022-01-07 19:16     ` Kristen Carlson Accardi
2022-01-11 14:20       ` Haitao Huang
2022-01-11 15:43         ` Dave Hansen
2022-01-11 16:33           ` Haitao Huang
2022-01-11 17:39             ` Dave Hansen
2022-01-14 17:45               ` Kristen Carlson Accardi
2022-01-08 15:59   ` Jarkko Sakkinen
2022-01-14 17:47     ` Kristen Carlson Accardi
2022-01-07 18:16 ` [PATCH v2 2/2] x86/sgx: account backing pages Kristen Carlson Accardi
2022-01-08 16:05   ` Jarkko Sakkinen
2022-01-14 17:51     ` Kristen Carlson Accardi
2022-01-14 17:55       ` Dave Hansen
2022-01-14 23:57         ` Jarkko Sakkinen
2022-01-15  0:16           ` Dave Hansen
2022-01-15  0:56             ` Jarkko Sakkinen
2022-01-14 23:52       ` Jarkko Sakkinen
2022-01-14 23:55         ` Dave Hansen
2022-01-15  0:58           ` Jarkko Sakkinen
2022-01-15 18:57 ` [PATCH v2 0/2] x86/sgx: Limit EPC overcommit Jarkko Sakkinen
2022-01-15 19:02   ` Jarkko Sakkinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.