thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

ddf19c
From 7b71a7011437ebfa3bc7df9297e892b82293ec98 Mon Sep 17 00:00:00 2001
ddf19c
From: Paolo Bonzini <pbonzini@redhat.com>
ddf19c
Date: Mon, 17 Feb 2020 16:23:16 +0000
ddf19c
Subject: [PATCH 6/9] target/i386: enable monitor and ucode revision with -cpu
ddf19c
 max
ddf19c
MIME-Version: 1.0
ddf19c
Content-Type: text/plain; charset=UTF-8
ddf19c
Content-Transfer-Encoding: 8bit
ddf19c
ddf19c
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
ddf19c
Message-id: <20200217162316.2464-7-pbonzini@redhat.com>
ddf19c
Patchwork-id: 93910
ddf19c
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH 6/6] target/i386: enable monitor and ucode revision with -cpu max
ddf19c
Bugzilla: 1791648
ddf19c
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
ddf19c
RH-Acked-by: Maxim Levitsky <mlevitsk@redhat.com>
ddf19c
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
ddf19c
These two features were incorrectly tied to host_cpuid_required rather than
ddf19c
cpu->max_features.  As a result, -cpu max was not enabling either MONITOR
ddf19c
features or ucode revision.
ddf19c
ddf19c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ddf19c
(cherry picked from commit be02cda3afde60d219786e23c3f8edb53aec8e17)
ddf19c
ddf19c
[RHEL7: context, upstream uses g_autofree]
ddf19c
ddf19c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ddf19c
---
ddf19c
 target/i386/cpu.c | 2 ++
ddf19c
 1 file changed, 2 insertions(+)
ddf19c
ddf19c
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
ddf19c
index 5ac843d..1685a8c 100644
ddf19c
--- a/target/i386/cpu.c
ddf19c
+++ b/target/i386/cpu.c
ddf19c
@@ -6317,7 +6317,9 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
ddf19c
             g_free(name);
ddf19c
             goto out;
ddf19c
         }
ddf19c
+    }
ddf19c
 
ddf19c
+    if (cpu->max_features && accel_uses_host_cpuid()) {
ddf19c
         if (enable_cpu_pm) {
ddf19c
             host_cpuid(5, 0, &cpu->mwait.eax, &cpu->mwait.ebx,
ddf19c
                        &cpu->mwait.ecx, &cpu->mwait.edx);
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c