x86/sgx: Initialize metadata for Enclave Page Cache (EPC) sections
PATCH v37 8/24 x86/sgx: Initialize metadata for Enclave Page Cache (EPC) sections
From: Sean Christopherson <[email protected]>
Enumerate Enclave Page Cache (EPC) sections via CPUID and add the data structures necessary to track EPC pages so that they can be easily borrowed for different uses.
Embed section index to the first eight bits of the EPC page descriptor. Existing client hardware supports only a single section, while upcoming server hardware will support at most eight sections. Thus, eight bits should be enough for long term needs.
Acked-by Jethro Beekman <[email protected]>
Reviewed-by Darren Kenny <[email protected]>
Signed-off-by Sean Christopherson <[email protected]>
Co-developed-by Serge Ayoun <[email protected]>
Signed-off-by Serge Ayoun <[email protected]>
Co-developed-by Jarkko Sakkinen <[email protected]>
Signed-off-by Jarkko Sakkinen <[email protected]>
--- arch/x86/Kconfig | 17 +++ arch/x86/kernel/cpu/Makefile | 1 + arch/x86/kernel/cpu/sgx/Makefile | 2 + arch/x86/kernel/cpu/sgx/main.c | 216 +++++++++++++++++++++++++++++++ arch/x86/kernel/cpu/sgx/sgx.h | 52 ++++++++ 5 files changed, 288 insertions(+) create mode 100644 arch/x86/kernel/cpu/sgx/Makefile create mode 100644 arch/x86/kernel/cpu/sgx/main.c create mode 100644 arch/x86/kernel/cpu/sgx/sgx.h
arch/x86/Kconfig +17 -0
@@ -1927,6 +1927,23 @@ config X86_INTEL_TSX_MODE_AUTO side channel attacks- equals the tsx=auto command line parameter. endchoice +config INTEL_SGX + bool "Intel SGX" + depends on X86_64 && CPU_SUP_INTEL + depends on CRYPTO=y + depends on CRYPTO_SHA256=y + select SRCU + select MMU_NOTIFIER + help + Intel(R) Software Guard eXtensions (SGX) is a set of CPU instructions + that can be used by applications to set aside private regions of code + and data, referred to as enclaves. An enclave's private memory can + only be accessed by code running within the enclave. Accesses from + outside the enclave, including other enclaves, are disallowed by + hardware. + + If unsure, say N. + config EFI bool "EFI runtime service support" depends on ACPI
arch/x86/kernel/cpu/Makefile +1 -0
@@ -48,6 +48,7 @@ obj-$(CONFIG_X86_MCE) += mce/ obj-$(CONFIG_MTRR) += mtrr/ obj-$(CONFIG_MICROCODE) += microcode/ obj-$(CONFIG_X86_CPU_RESCTRL) += resctrl/ +obj-$(CONFIG_INTEL_SGX) += sgx/ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o
arch/x86/kernel/cpu/sgx/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +obj-y += \ + main.o
arch/x86/kernel/cpu/sgx/main.c new file +216 -0
216 lines not on this page · raw message
arch/x86/kernel/cpu/sgx/sgx.h new file +52 -0
52 lines not on this page · raw message
Signature · 1 line
2.25.1