x86/cpuid: KVM: TDX CPUID fixes
Status from this message: The following commit has been merged into the x86/urgent branch of tip:
Get series with b4
b4 am [email protected]Versions newest first
Changes in v2 from the cover letter
- Add CPUID.0x23 to the indexed set. [Rick, Binbin]
- Document that zeroing the index when it's supposed to be ignored is KVM ABI that at least QEMU relies on. [Binbin]
- Zero out all of flags to ensure garbage isn't reported to userspace.
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | x86/cpuid: Mark CPUID function 0x23 as being indexedarch/ | +1 | 1 reply | |
| 2/3 | KVM: TDX: Set SIGNIFCANT_INDEX flag as appropriate when filling CPUID entriesarch/ | +13 | 9 replies | |
| 3/3 | KVM: TDX: Reject KVM_TDX_INIT_VM if indexed CPUID functions don't matcharch/ | +6 | 3 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Rick Edgecombe | Xiaoyao Li | Binbin Wu |
|---|---|---|---|
| Series | T-b R-b | R-b | |
| 1/3 | R-b | ||
| 2/3 | R-b | ||
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v2 0/3] x86/cpuid: KVM: TDX CPUID fixes
Boris or Dave, can you grab patch 1 for 7.4, ideally sooner than later? That would avoid having to carry a stable topic branch for a trivial change.
Annotate CPUID entries that have a significant index when reporting TDX capabilities to userspace, and enforce that userspace honors significant indices to avoid creating a misconfiguring between KVM and the TDX Module, which in the worst case scenario could lead to host state getting clobbered.
Patch 1 is a fix to mark function 0x23 as being indexed. That change is needed to avoid tripping a WARN sanity check that KVM and the TDX Module agree on which functions are indexed.
I'd like to take this through the KVM tree as it seems extremely unlikely the cpuid_function_is_indexed() will conflict or grow other dependencies, i.e. creating a shared topic branch for this seems rather silly. Actually, a better alternative would be to rush patch 1 into 7.4 so that I can use 7.4-rc2 as a base (even rc3 or rc4 would be a-ok). /me adds an intro
Note, SIGNIFCANT_INDEX isn't a typo, KVM's uAPI macro is misspelled...
v2:
- Add CPUID.0x23 to the indexed set. [Rick, Binbin]
- Document that zeroing the index when it's supposed to be ignored is KVM ABI that at least QEMU relies on. [Binbin]
- Zero out all of flags to ensure garbage isn't reported to userspace.
v1: https://lore.kernel.org/all/[email protected]
Changyuan Lyu (1):
KVM: TDX: Set SIGNIFCANT_INDEX flag as appropriate when filling CPUID
entries
Sean Christopherson (2):
x86/cpuid: Mark CPUID function 0x23 as being indexed
KVM: TDX: Reject KVM_TDX_INIT_VM if indexed CPUID functions don't
match
arch/x86/include/asm/cpuid/api.h | 1 + arch/x86/kvm/vmx/tdx.c | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-)
base-commit: 814607cd40df80d5727957adaa857e0feca43497
Signature · 1 line
2.56.0.257.gf7497c7d27-goog