Fix MSR_IA32_PLATFORM_ID access for TDX guests
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 13 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | KVM: TDX: Allow TDs to read MSR_IA32_PLATFORM_IDarch/ | +1 | 8 replies | |
| 2/2 | x86/cpu: Skip reading MSR_IA32_PLATFORM_ID in virtualized environmentarch/ arch/ arch/ | +10 | 5 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Xiaoyao Li |
|---|---|
| 1/2 | R-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] Fix MSR_IA32_PLATFORM_ID access for TDX guests
Since commit d8630b67ca1e ("x86/cpu: Add platform ID to CPU info structure"), the Linux kernel reads MSR_IA32_PLATFORM_ID during CPU init. This causes unchecked MSR access errors when running as a TDX guest, because KVM doesn't include MSR_IA32_PLATFORM_ID in tdx_has_emulated_msr().
On KVM side, this patch set adds MSR_IA32_PLATFORM_ID to tdx_has_emulated_msr() so that KVM returns 0 for TDs reading this MSR, consistent with how KVM already handles it for normal VMs.
Optionally, in order to provide back-compatibility for newer Linux guests running on older KVM hosts without the fix, the second patch skips the MSR_IA32_PLATFORM_ID read entirely when Linux is running in a virtualized environment. This could be dropped if we think the fix on KVM side is sufficient.
Binbin Wu (2):
KVM: TDX: Allow TDs to read MSR_IA32_PLATFORM_ID
x86/cpu: Skip reading MSR_IA32_PLATFORM_ID in virtualized environment
arch/x86/kernel/cpu/microcode/core.c | 2 +- arch/x86/kernel/cpu/microcode/intel.c | 4 ++++ arch/x86/kernel/cpu/microcode/internal.h | 5 +++++ arch/x86/kvm/vmx/tdx.c | 1 + 4 files changed, 11 insertions(+), 1 deletion(-)
base-commit: 39704f00f747aba3144289870b5fd8ac230a9aaf
Signature · 1 line
2.46.0