Skip to content

RFC MAP_POPULATE for device memory

Jarkko Sakkinen linux-fsdevel linux-mm linux-sgx lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 RFC Latest3 patches 1 replyIn review
  2. v2 RFC3 patches 1 replySuperseded
  3. v1 RFC3 patches 19 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm: Add f_op->populate() for populating memory outside of core mminclude/linux/fs.h mm/gup.c+9 -30 replies
2/3x86/sgx: Export sgx_encl_page_alloc()arch/x86/kernel/cpu/sgx/encl.c arch/x86/kernel/cpu/sgx/encl.h arch/x86/kernel/cpu/sgx/ioctl.c+41 -380 replies
3/3x86/sgx: Implement EAUG population with MAP_POPULATEarch/x86/kernel/cpu/sgx/driver.c+128 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH RFC v3 0/3] MAP_POPULATE for device memory

SGX is weird. SGX memory is managed outside the core mm. It doesn't have a 'struct page' and get_user_pages() doesn't work on it. Its VMAs are marked with VM_IO. So, none of the existing methods for avoiding page faults work on SGX memory.

This patch set essentially helps extend existing "normal RAM" kernel ABIs to work for avoiding faults for SGX too. SGX users want to enjoy all of the benefits of a delayed allocation policy (better resource use, overcommit, NUMA affinity) but without the cost of millions of faults.

Jarkko Sakkinen (3):
mm: Add f_op->populate() for populating memory outside of core mm x86/sgx: Export sgx_encl_page_alloc()
x86/sgx: Implement EAUG population with MAP_POPULATE

 arch/x86/kernel/cpu/sgx/driver.c | 128 +++++++++++++++++++++++++++++++
 arch/x86/kernel/cpu/sgx/encl.c   |  38 +++++++++
 arch/x86/kernel/cpu/sgx/encl.h   |   3 +
 arch/x86/kernel/cpu/sgx/ioctl.c  |  38 ---------
 include/linux/fs.h               |   1 +
 mm/gup.c                         |  11 ++-
 6 files changed, 178 insertions(+), 41 deletions(-)
Signature · 1 line
2.35.1