From 32c87d70ff55b96741f08c35108935cac6f40fe4 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 20 Jan 2020 19:21:44 +0100 Subject: target/i386: kvm: initialize microcode revision from KVM KVM can return the host microcode revision as a feature MSR. Use it as the default value for -cpu host. Signed-off-by: Paolo Bonzini Message-Id: <1579544504-3616-4-git-send-email-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/kvm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'target/i386/kvm.c') diff --git a/target/i386/kvm.c b/target/i386/kvm.c index f6dd6b790e..1b67090c5c 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -2696,6 +2696,11 @@ static void kvm_init_msrs(X86CPU *cpu) env->features[FEAT_CORE_CAPABILITY]); } + if (kvm_arch_get_supported_msr_feature(kvm_state, + MSR_IA32_UCODE_REV)) { + kvm_msr_entry_add(cpu, MSR_IA32_UCODE_REV, cpu->ucode_rev); + } + /* * Older kernels do not include VMX MSRs in KVM_GET_MSR_INDEX_LIST, but * all kernels with MSR features should have them. -- cgit v1.2.3