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

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