Blame SOURCES/kvm-target-i386-enable-monitor-and-ucode-revision-with-c.patch

4636b8
From 6bd31dbbc477571124ea1ce9e64217c898f05f22 Mon Sep 17 00:00:00 2001
4636b8
From: Paolo Bonzini <pbonzini@redhat.com>
4636b8
Date: Mon, 17 Feb 2020 16:23:23 -0500
4636b8
Subject: [PATCH 08/12] target/i386: enable monitor and ucode revision with
4636b8
 -cpu max
4636b8
MIME-Version: 1.0
4636b8
Content-Type: text/plain; charset=UTF-8
4636b8
Content-Transfer-Encoding: 8bit
4636b8
4636b8
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
4636b8
Message-id: <20200217162323.2572-7-pbonzini@redhat.com>
4636b8
Patchwork-id: 93905
4636b8
O-Subject: [RHEL7.9 qemu-kvm-rhev PATCH 6/6] target/i386: enable monitor and ucode revision with -cpu max
4636b8
Bugzilla: 1791653
4636b8
RH-Acked-by: Maxim Levitsky <mlevitsk@redhat.com>
4636b8
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
4636b8
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
4636b8
4636b8
These two features were incorrectly tied to host_cpuid_required rather than
4636b8
cpu->max_features.  As a result, -cpu max was not enabling either MONITOR
4636b8
features or ucode revision.
4636b8
4636b8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4636b8
(cherry picked from commit be02cda3afde60d219786e23c3f8edb53aec8e17)
4636b8
4636b8
[RHEL7: only affects microcode revision; plus, upstream uses g_autofree]
4636b8
4636b8
Signed-off-by: Jon Maloy <jmaloy.redhat.com>
4636b8
---
4636b8
 target/i386/cpu.c | 2 ++
4636b8
 1 file changed, 2 insertions(+)
4636b8
4636b8
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
4636b8
index 3579bd53c5..88af0f4348 100644
4636b8
--- a/target/i386/cpu.c
4636b8
+++ b/target/i386/cpu.c
4636b8
@@ -4943,7 +4943,9 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
4636b8
             g_free(name);
4636b8
             goto out;
4636b8
         }
4636b8
+    }
4636b8
 
4636b8
+    if (cpu->max_features && accel_uses_host_cpuid()) {
4636b8
         if (kvm_enabled() && cpu->ucode_rev == 0) {
4636b8
             cpu->ucode_rev = kvm_arch_get_supported_msr_feature(kvm_state,
4636b8
                                                                 MSR_IA32_UCODE_REV);
4636b8
-- 
4636b8
2.18.2
4636b8