Skip to content

Commit 26eab9a

Browse files
Binbin Wubonzini
authored andcommitted
KVM: TDX: Enable guest access to MTRR MSRs
Allow TDX guests to access MTRR MSRs as what KVM does for normal VMs, i.e., KVM emulates accesses to MTRR MSRs, but doesn't virtualize guest MTRR memory types. TDX module exposes MTRR feature to TDX guests unconditionally. KVM needs to support MTRR MSRs accesses for TDX guests to match the architectural behavior. Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com> Message-ID: <20250227012021.1778144-19-binbin.wu@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 0b75889 commit 26eab9a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kvm/vmx/tdx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,6 +2075,9 @@ bool tdx_has_emulated_msr(u32 index)
20752075
case MSR_IA32_ARCH_CAPABILITIES:
20762076
case MSR_IA32_POWER_CTL:
20772077
case MSR_IA32_CR_PAT:
2078+
case MSR_MTRRcap:
2079+
case MTRRphysBase_MSR(0) ... MSR_MTRRfix4K_F8000:
2080+
case MSR_MTRRdefType:
20782081
case MSR_IA32_TSC_DEADLINE:
20792082
case MSR_IA32_MISC_ENABLE:
20802083
case MSR_PLATFORM_INFO:

0 commit comments

Comments
 (0)