Skip to content

target-i386: kvm: Use env->mcg_cap when setting up MCE

Eduardo Habkost kvm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3target-i386: kvm: Abort if MCE bank count is not supported by hosttarget-i386/kvm.c+6 -33 replies
2/3target-i386: kvm: Use env->mcg_cap when setting up MCEtarget-i386/cpu.h target-i386/kvm.c+6 -70 replies
3/3target-i386: kvm: Print warning when clearing mcg_cap bitstarget-i386/kvm.c+7 -16 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchBorislav Petkov
1/3
2/3
3/3A-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 [PATCH 0/3] target-i386: kvm: Use env->mcg_cap when setting up MCE

Instead of overwriting env->mcg_cap, make kvm_arch_init_vcpu(), use the value already set at the CPU object when initializing MCE.

Except for the new "unsupported MCG_CAPS bits" warning, this patch doesn't change any of the existing QEMU behavior. The previous code set env->mcg_cap to:
(MCE_CAP_DEF & ioctl(KVM_X86_GET_MCE_CAP_SUPPORTED)) | MCE_BANKS_DEF
and the new code still keeps it exactly the same, as env->mcg_cap is already initialized as MCE_CAP_DEF|MCE_BANKS_DEF at mce_init().

This will allow us to change mce_init() in the future, to implement different defaults depending on CPU model, machine-type or command-line parameters.

Eduardo Habkost (3):
target-i386: kvm: Abort if MCE bank count is not supported by host
target-i386: kvm: Use env->mcg_cap when setting up MCE
target-i386: kvm: Print warning when clearing mcg_cap bits

 target-i386/cpu.h |  2 ++
 target-i386/kvm.c | 22 ++++++++++++++--------
 2 files changed, 16 insertions(+), 8 deletions(-)
Signature · 1 line
2.1.0