public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix MSR_IA32_PLATFORM_ID access for TDX guests
@ 2026-04-28  2:47 Binbin Wu
  2026-04-28  2:47 ` [PATCH 1/2] KVM: TDX: Allow TDs to read MSR_IA32_PLATFORM_ID Binbin Wu
  2026-04-28  2:47 ` [PATCH 2/2] x86/cpu: Skip reading MSR_IA32_PLATFORM_ID in virtualized environment Binbin Wu
  0 siblings, 2 replies; 14+ messages in thread
From: Binbin Wu @ 2026-04-28  2:47 UTC (permalink / raw)
  To: kvm, linux-kernel, x86
  Cc: pbonzini, seanjc, dave.hansen, kas, rick.p.edgecombe,
	vishal.l.verma, xiaoyao.li, chao.gao, binbin.wu

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
-- 
2.46.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-04-28 19:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28  2:47 [PATCH 0/2] Fix MSR_IA32_PLATFORM_ID access for TDX guests Binbin Wu
2026-04-28  2:47 ` [PATCH 1/2] KVM: TDX: Allow TDs to read MSR_IA32_PLATFORM_ID Binbin Wu
2026-04-28  5:31   ` Xiaoyao Li
2026-04-28 11:44   ` Chao Gao
2026-04-28 16:30     ` Sean Christopherson
2026-04-28 18:31       ` Edgecombe, Rick P
2026-04-28 18:44         ` Sean Christopherson
2026-04-28 19:28           ` Edgecombe, Rick P
2026-04-28 18:49   ` Dave Hansen
2026-04-28  2:47 ` [PATCH 2/2] x86/cpu: Skip reading MSR_IA32_PLATFORM_ID in virtualized environment Binbin Wu
2026-04-28  6:01   ` Xiaoyao Li
2026-04-28  9:57     ` Binbin Wu
2026-04-28 18:54     ` Edgecombe, Rick P
2026-04-28 19:13       ` Dave Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox