NE_SET_USER_MEMORY_REGION(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NE_SET_USER_MEMORY_REGION(9) πŸ’–

okay so bestie, welcome to the NE_SET_USER_MEMORY_REGION(9) page from the Kernel API Manual πŸ’… this is the enclave memory-region lore and it is lowkey important ✨


🌸 NAME 🌸

NE_SET_USER_MEMORY_REGION β€” the command is used to set a memory region for an enclave, given the allocated memory from the userspace. Enclave memory needs to be from the same NUMA node as the enclave CPUs. The user memory region is an input parameter. It includes info provided by the caller β€” flags, memory size and userspace address. The ioctl can be invoked on the enclave fd, before an enclave is started. no cap 🫢


✨ SYNOPSIS ✨

NE_SET_USER_MEMORY_REGION

πŸ¦‹ CONTEXT πŸ¦‹

Process context. that's it, that's the vibe πŸ’…


πŸ”₯ RETURN πŸ”₯

  • 0 β€” Logic successfully completed. slay ✨
  • -1 β€” There was a failure in the ioctl logic. On failure, errno is set to: 😭
    • EFAULT β€” copy_from_user failure.
    • EINVAL β€” Invalid physical memory region(s) e.g. unaligned address.
    • EIO β€” Current task mm is not the same as the one that created the enclave.
    • ENOMEM β€” Memory allocation failure for internal bookkeeping variables.
    • NE_ERR_NOT_IN_INIT_STATE β€” The enclave is not in init state (init = before being started).
    • NE_ERR_INVALID_MEM_REGION_SIZE β€” The memory size of the region is not multiple of 2 MiB.
    • NE_ERR_INVALID_MEM_REGION_ADDR β€” Invalid user space address given.
    • NE_ERR_UNALIGNED_MEM_REGION_ADDR β€” Unaligned user space address given.
    • NE_ERR_MEM_REGION_ALREADY_USED β€” The memory region is already used.
    • NE_ERR_MEM_NOT_HUGE_PAGE β€” The memory region is not backed by huge pages.
    • NE_ERR_MEM_DIFFERENT_NUMA_NODE β€” The memory region is not from the same NUMA node as the CPUs.
    • NE_ERR_MEM_MAX_REGIONS β€” The number of memory regions set for the enclave reached maximum.
    • NE_ERR_INVALID_PAGE_SIZE β€” The memory region is not backed by pages multiple of 2 MiB.
    • NE_ERR_INVALID_FLAG_VALUE β€” The value of the provided flag is invalid.
    • Error codes from get_user_pages.
    • Error codes from the NE PCI device request.

🌈 SEE ALSO 🌈


and that's the page, bestie 🫢 source/version: ./include/uapi/linux, date: October 2026, page: NE_SET_USER_MEMORY_REGION(9) β€” periodt πŸ’–

πŸ“¦ where this page comes from