diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-01-20 19:21:44 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-01-24 20:59:10 +0100 |
commit | 32c87d70ff55b96741f08c35108935cac6f40fe4 (patch) | |
tree | 23e07fd65a61841cb7b7d75b3d74dbf05939a7bd /target/i386/cpu.c | |
parent | 4e45aff398cd1542c2a384a2a3b8600f23337d86 (diff) | |
download | qemu-32c87d70ff55b96741f08c35108935cac6f40fe4.zip |
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 <pbonzini@redhat.com>
Message-Id: <1579544504-3616-4-git-send-email-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/cpu.c')
-rw-r--r-- | target/i386/cpu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 790254ead6..ffe5de0f82 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6416,6 +6416,10 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) &cpu->mwait.ecx, &cpu->mwait.edx); env->features[FEAT_1_ECX] |= CPUID_EXT_MONITOR; } + if (kvm_enabled() && cpu->ucode_rev == 0) { + cpu->ucode_rev = kvm_arch_get_supported_msr_feature(kvm_state, + MSR_IA32_UCODE_REV); + } } if (cpu->ucode_rev == 0) { |