qemu-kvm/kvm-target-i386-check-for-availability-of-MSR_IA32_UCODE.patch
Danilo C. L. de Paula 2084aa0246 * Sat Feb 29 2020 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 4.2.0-13.el8
- kvm-target-i386-kvm-initialize-feature-MSRs-very-early.patch [bz#1791648]
- kvm-target-i386-add-a-ucode-rev-property.patch [bz#1791648]
- kvm-target-i386-kvm-initialize-microcode-revision-from-K.patch [bz#1791648]
- kvm-target-i386-fix-TCG-UCODE_REV-access.patch [bz#1791648]
- kvm-target-i386-check-for-availability-of-MSR_IA32_UCODE.patch [bz#1791648]
- kvm-target-i386-enable-monitor-and-ucode-revision-with-c.patch [bz#1791648]
- kvm-qcow2-Fix-qcow2_alloc_cluster_abort-for-external-dat.patch [bz#1703907]
- kvm-mirror-Store-MirrorOp.co-for-debuggability.patch [bz#1794692]
- kvm-mirror-Don-t-let-an-operation-wait-for-itself.patch [bz#1794692]
- Resolves: bz#1703907
  ([upstream]QEMU coredump when converting to qcow2: external data file images on block devices with copy_offloading)
- Resolves: bz#1791648
  ([RFE] Passthrough host CPU microcode version to KVM guest if using CPU passthrough)
- Resolves: bz#1794692
  (Mirror block job stops making progress)
2020-02-29 03:50:42 +00:00

73 lines
2.7 KiB
Diff

From 27d7b085f2f568050d638b694ed2f51495db718c Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Mon, 17 Feb 2020 16:23:15 +0000
Subject: [PATCH 5/9] target/i386: check for availability of MSR_IA32_UCODE_REV
as an emulated MSR
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
Message-id: <20200217162316.2464-6-pbonzini@redhat.com>
Patchwork-id: 93898
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH 5/6] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR
Bugzilla: 1791648
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Maxim Levitsky <mlevitsk@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
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 <alex.williamson@redhat.com>
Message-id: <20200211175516.10716-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 6702514814c7e7b4cbf179624539b5f38c72740b)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
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 6c61aef..99840ca 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);
}
--
1.8.3.1