File target-i386-enable-monitor-and-ucode-rev.patch of Package qemu.30221

From: Paolo Bonzini <pbonzini@redhat.com>
Date: Tue, 11 Feb 2020 18:47:48 +0100
Subject: target/i386: enable monitor and ucode revision with -cpu max

Git-commit: be02cda3afde60d219786e23c3f8edb53aec8e17
References: jsc#SLE-17785

These two features were incorrectly tied to host_cpuid_required rather than
cpu->max_features.  As a result, -cpu max was not enabling either MONITOR
features or ucode revision.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
 target/i386/cpu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 17cc1e9a71f5bedc8917071be12b..53b72368d7de0ec2d5112ee4bd7f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6424,7 +6424,9 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
             g_free(name);
             goto out;
         }
+    }
 
+    if (cpu->max_features && accel_uses_host_cpuid()) {
         if (enable_cpu_pm) {
             host_cpuid(5, 0, &cpu->mwait.eax, &cpu->mwait.ebx,
                        &cpu->mwait.ecx, &cpu->mwait.edx);
openSUSE Build Service is sponsored by