diff mbox series

[RFC,39/42] KVM: VMX: add config KVM_INTEL_EXPORTED_EPT

Message ID 20231202093535.15874-1-yan.y.zhao@intel.com (mailing list archive)
State New, archived
Headers show
Series Sharing KVM TDP to IOMMU | expand

Commit Message

Yan Zhao Dec. 2, 2023, 9:35 a.m. UTC
Add config KVM_INTEL_EXPORTED_EPT to let kvm_intel.ko support exporting EPT
to KVM external components (e.g. Intel VT-d).

This config will turn on HAVE_KVM_EXPORTED_TDP and
HAVE_KVM_MMU_PRESENT_HIGH automatically.

HAVE_KVM_MMU_PRESENT_HIGH will make bit 11 reserved as 0.

Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
---
 arch/x86/kvm/Kconfig | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index 950c12868d304..7126344077ab5 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -99,6 +99,19 @@  config X86_SGX_KVM
 
 	  If unsure, say N.
 
+config KVM_INTEL_EXPORTED_EPT
+	bool "export EPT to be used by other modules (e.g. iommufd)"
+	depends on KVM_INTEL
+	select HAVE_KVM_EXPORTED_TDP
+	select HAVE_KVM_MMU_PRESENT_HIGH if X86_64
+	help
+	  Intel EPT is architecturally guaranteed of compatible to stage 2
+	  page tables in Intel IOMMU.
+
+	  Enable this feature to allow Intel EPT to be exported and used
+	  directly as stage 2 page tables in Intel IOMMU.
+
+
 config KVM_AMD
 	tristate "KVM for AMD processors support"
 	depends on KVM && (CPU_SUP_AMD || CPU_SUP_HYGON)