[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 8/9] target/i386: check for availability of MSR_IA32_UCODE_REV as
From: |
Paolo Bonzini |
Subject: |
[PULL 8/9] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR |
Date: |
Wed, 12 Feb 2020 17:41:28 +0100 |
Even though MSR_IA32_UCODE_REV has been available long before Linux 5.6,
which added it to the emulated MSR list, a bug caused the microcode
version to revert to 0x100000000 on INIT. As a result, processors other
than the bootstrap processor would not see the host microcode revision;
some Windows version complain loudly about this and crash with a
fairly explicit MICROCODE REVISION MISMATCH error.
[If running 5.6 prereleases, the kernel fix "KVM: x86: do not reset
microcode version on INIT or RESET" should also be applied.]
Reported-by: Alex Williamson <address@hidden>
Message-id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/i386/kvm.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 6ef291d580..69eb43d796 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -105,6 +105,7 @@ static bool has_msr_smi_count;
static bool has_msr_arch_capabs;
static bool has_msr_core_capabs;
static bool has_msr_vmx_vmfunc;
+static bool has_msr_ucode_rev;
static uint32_t has_architectural_pmu_version;
static uint32_t num_architectural_pmu_gp_counters;
@@ -2056,6 +2057,9 @@ static int kvm_get_supported_msrs(KVMState *s)
case MSR_IA32_VMX_VMFUNC:
has_msr_vmx_vmfunc = true;
break;
+ case MSR_IA32_UCODE_REV:
+ has_msr_ucode_rev = true;
+ break;
}
}
}
@@ -2696,8 +2700,7 @@ 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)) {
+ if (has_msr_ucode_rev) {
kvm_msr_entry_add(cpu, MSR_IA32_UCODE_REV, cpu->ucode_rev);
}
--
2.21.0
- [PULL 0/9] Mini misc patches queue for 2020-02-12, Paolo Bonzini, 2020/02/12
- [PULL 1/9] vl: Don't mismatch g_strsplit()/g_free(), Paolo Bonzini, 2020/02/12
- [PULL 2/9] seqlock: fix seqlock_write_unlock_impl function, Paolo Bonzini, 2020/02/12
- [PULL 3/9] Remove support for CLOCK_MONOTONIC not being defined, Paolo Bonzini, 2020/02/12
- [PULL 4/9] minikconf: accept alnum identifiers, Paolo Bonzini, 2020/02/12
- [PULL 5/9] exec: do not define use_icount for user-mode emulation, Paolo Bonzini, 2020/02/12
- [PULL 6/9] build: move TARGET_GPROF to config-host.mak, Paolo Bonzini, 2020/02/12
- [PULL 7/9] target/i386: fix TCG UCODE_REV access, Paolo Bonzini, 2020/02/12
- [PULL 8/9] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR,
Paolo Bonzini <=
- [PULL 9/9] target/i386: enable monitor and ucode revision with -cpu max, Paolo Bonzini, 2020/02/12
- Re: [PULL 0/9] Mini misc patches queue for 2020-02-12, Peter Maydell, 2020/02/13