Skip to content

RFC x86, kvm: Unify CPUID computation and fix MSR accessing

Borislav Petkov kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86/cpu: Unify CPU family, model, stepping calculationarch/x86/include/asm/cpu.h arch/x86/include/asm/microcode.h arch/x86/kernel/cpu/common.c +4 more+54 -506 replies
2/3kvm: Add accessors for guest CPU's family, model, steppingarch/x86/kvm/cpuid.h+34 -01 reply
3/3x86/cpu/amd, kvm: Satisfy guest kernel reads of IC_CFG MSRarch/x86/include/asm/msr-index.h arch/x86/kernel/cpu/amd.c arch/x86/kvm/svm.c+20 -21 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchPaolo Bonzini
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/3] x86, kvm: Unify CPUID computation and fix MSR accessing

From: Borislav Petkov <[email protected]>

Hi all,

so this is something which should help fixing the MSR access to IC_CFG on AMD.

The usefulness should come, however, from the unification and the additional family, model, stepping helpers in kvm in case one wants to know those of the guest CPU. Who knows, might be much more useful in the future.

Quick testing shows it works, I'll hammer on it more after rc1 is out.

Thanks.

Borislav Petkov (3):
x86/cpu: Unify CPU family, model, stepping calculation
kvm: Add accessors for guest CPU's family, model, stepping x86/cpu/amd, kvm: Satisfy guest kernel reads of IC_CFG MSR

 arch/x86/include/asm/cpu.h            |  3 +++
 arch/x86/include/asm/microcode.h      | 31 +++----------------------------
 arch/x86/include/asm/msr-index.h      |  1 +
 arch/x86/kernel/cpu/amd.c             |  4 ++--
 arch/x86/kernel/cpu/common.c          | 11 +++--------
 arch/x86/kernel/cpu/microcode/core.c  |  6 +++---
 arch/x86/kernel/cpu/microcode/intel.c | 16 ++++++----------
 arch/x86/kvm/cpuid.h                  | 34 ++++++++++++++++++++++++++++++++++
 arch/x86/kvm/svm.c                    | 17 +++++++++++++++++
 arch/x86/lib/Makefile                 |  2 +-
 arch/x86/lib/cpu.c                    | 35 +++++++++++++++++++++++++++++++++++
 11 files changed, 108 insertions(+), 52 deletions(-)
 create mode 100644 arch/x86/lib/cpu.c
Signature · 1 line
2.3.5