+12
−1
+15
−0
Loading
TDX uses two EPT pointers, one for the private half of the GPA space and one for the shared half. The private half uses the normal EPT_POINTER vmcs field, which is managed in a special way by the TDX module. For TDX, KVM is not allowed to operate on it directly. The shared half uses a new SHARED_EPT_POINTER field and will be managed by the conventional MMU management operations that operate directly on the EPT root. This means for TDX the .load_mmu_pgd() operation will need to know to use the SHARED_EPT_POINTER field instead of the normal one. Add a new wrapper in x86 ops for load_mmu_pgd() that either directs the write to the existing vmx implementation or a TDX one. tdx_load_mmu_pgd() is so much simpler than vmx_load_mmu_pgd() since for the TDX mode of operation, EPT will always be used and KVM does not need to be involved in virtualization of CR3 behavior. So tdx_load_mmu_pgd() can simply write to SHARED_EPT_POINTER. Signed-off-by:Sean Christopherson <sean.j.christopherson@intel.com> Co-developed-by:
Isaku Yamahata <isaku.yamahata@intel.com> Signed-off-by:
Isaku Yamahata <isaku.yamahata@intel.com> Co-developed-by:
Rick Edgecombe <rick.p.edgecombe@intel.com> Signed-off-by:
Rick Edgecombe <rick.p.edgecombe@intel.com> Co-developed-by:
Yan Zhao <yan.y.zhao@intel.com> Signed-off-by:
Yan Zhao <yan.y.zhao@intel.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20241112073601.22084-1-yan.y.zhao@intel.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>