yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-i386-Disable-TOPOEXT-by-default-on-cpu-host.patch

26ba25
From 42405600b468b79523f7e8171c1aac4a3d012792 Mon Sep 17 00:00:00 2001
26ba25
From: Eduardo Habkost <ehabkost@redhat.com>
26ba25
Date: Tue, 21 Aug 2018 19:15:41 +0100
26ba25
Subject: [PATCH 1/2] i386: Disable TOPOEXT by default on "-cpu host"
26ba25
26ba25
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
26ba25
Message-id: <20180821191541.31916-2-ehabkost@redhat.com>
26ba25
Patchwork-id: 81904
26ba25
O-Subject: [qemu-kvm RHEL8/virt212 PATCH v2 1/1] i386: Disable TOPOEXT by default on "-cpu host"
26ba25
Bugzilla: 1619804
26ba25
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
26ba25
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
26ba25
26ba25
Enabling TOPOEXT is always allowed, but it can't be enabled
26ba25
blindly by "-cpu host" because it may make guests crash if the
26ba25
rest of the cache topology information isn't provided or isn't
26ba25
consistent.
26ba25
26ba25
This addresses the bug reported at:
26ba25
https://bugzilla.redhat.com/show_bug.cgi?id=1613277
26ba25
26ba25
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
26ba25
Message-Id: <20180809221852.15285-1-ehabkost@redhat.com>
26ba25
Tested-by: Richard W.M. Jones <rjones@redhat.com>
26ba25
Reviewed-by: Babu Moger <babu.moger@amd.com>
26ba25
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
26ba25
(cherry picked from commit 7210a02c58572b2686a3a8d610c6628f87864aed)
26ba25
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
---
26ba25
 target/i386/cpu.c | 6 ++++++
26ba25
 1 file changed, 6 insertions(+)
26ba25
26ba25
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
26ba25
index 605d0fa..e16dba7 100644
26ba25
--- a/target/i386/cpu.c
26ba25
+++ b/target/i386/cpu.c
26ba25
@@ -852,6 +852,12 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
26ba25
         },
26ba25
         .cpuid_eax = 0x80000001, .cpuid_reg = R_ECX,
26ba25
         .tcg_features = TCG_EXT3_FEATURES,
26ba25
+        /*
26ba25
+         * TOPOEXT is always allowed but can't be enabled blindly by
26ba25
+         * "-cpu host", as it requires consistent cache topology info
26ba25
+         * to be provided so it doesn't confuse guests.
26ba25
+         */
26ba25
+        .no_autoenable_flags = CPUID_EXT3_TOPOEXT,
26ba25
     },
26ba25
     [FEAT_C000_0001_EDX] = {
26ba25
         .feat_names = {
26ba25
-- 
26ba25
1.8.3.1
26ba25