linux/Documentation/x86
Paolo Bonzini ae095b16fc x86/sgx/virt: implement SGX_IOC_VEPC_REMOVE ioctl
For bare-metal SGX on real hardware, the hardware provides guarantees
SGX state at reboot.  For instance, all pages start out uninitialized.
The vepc driver provides a similar guarantee today for freshly-opened
vepc instances, but guests such as Windows expect all pages to be in
uninitialized state on startup, including after every guest reboot.

Some userspace implementations of virtual SGX would rather avoid having
to close and reopen the /dev/sgx_vepc file descriptor and re-mmap the
virtual EPC.  For example, they could sandbox themselves after the guest
starts and forbid further calls to open(), in order to mitigate exploits
from untrusted guests.

Therefore, add a ioctl that does this with EREMOVE.  Userspace can
invoke the ioctl to bring its vEPC pages back to uninitialized state.
There is a possibility that some pages fail to be removed if they are
SECS pages, and the child and SECS pages could be in separate vEPC
regions.  Therefore, the ioctl returns the number of EREMOVE failures,
telling userspace to try the ioctl again after it's done with all
vEPC regions.  A more verbose description of the correct usage and
the possible error conditions is documented in sgx.rst.

Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lkml.kernel.org/r/20211021201155.1523989-3-pbonzini@redhat.com
2021-10-22 08:32:12 -07:00
..
i386
x86_64 Another collection of documentation patches, mostly fixes but also includes 2021-09-08 16:28:14 -07:00
amd-memory-encryption.rst x86/msr: Rename MSR_K8_SYSCFG to MSR_AMD64_SYSCFG 2021-05-10 07:51:38 +02:00
boot.rst docs: x86: avoid using ReST :doc:foo markup 2021-06-17 13:24:39 -06:00
booting-dt.rst
buslock.rst Documentation/x86: Add ratelimit in buslock.rst 2021-05-18 16:39:31 +02:00
cpuinfo.rst
earlyprintk.rst
elf_auxvec.rst x86/elf: Support a new ELF aux vector AT_MINSIGSTKSZ 2021-05-19 12:18:45 +02:00
entry_64.rst
exception-tables.rst
features.rst docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
index.rst Fixes and improvements for FPU handling on x86: 2021-07-07 11:12:01 -07:00
intel-iommu.rst
intel_txt.rst
kernel-stacks.rst
mds.rst
microcode.rst
mtrr.rst docs: x86: avoid using ReST :doc:foo markup 2021-06-17 13:24:39 -06:00
orc-unwinder.rst
pat.rst
pti.rst
resctrl.rst Documentation/x86: Rename resctrl_ui.rst and add two errata to the file 2020-10-27 16:47:00 +01:00
sgx.rst x86/sgx/virt: implement SGX_IOC_VEPC_REMOVE ioctl 2021-10-22 08:32:12 -07:00
sva.rst
tlb.rst
topology.rst x86/CPU/AMD: Save AMD NodeId as cpu_die_id 2020-11-19 11:43:13 +01:00
tsx_async_abort.rst
usb-legacy-support.rst
zero-page.rst