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

From: Yan Zhao
Date: Sat Dec 02 2023 - 05:04:37 EST


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@xxxxxxxxx>
---
arch/x86/kvm/Kconfig | 13 +++++++++++++
1 file changed, 13 insertions(+)

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)
--
2.17.1