yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-i386-Allow-TOPOEXT-to-be-enabled-on-older-kernels.patch

ae23c9
From 0a6e593487844fd00920c0caab64aa98eac368a1 Mon Sep 17 00:00:00 2001
ae23c9
From: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Date: Thu, 26 Jul 2018 17:19:04 +0100
ae23c9
Subject: [PATCH 14/14] i386: Allow TOPOEXT to be enabled on older kernels
ae23c9
ae23c9
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Message-id: <20180726171904.27418-12-ehabkost@redhat.com>
ae23c9
Patchwork-id: 81534
ae23c9
O-Subject: [qemu-kvm RHEL8/virt212 PATCH v2 11/11] i386: Allow TOPOEXT to be enabled on older kernels
ae23c9
Bugzilla: 1597739
ae23c9
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
ae23c9
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
ae23c9
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
ae23c9
ae23c9
From: Babu Moger <babu.moger@amd.com>
ae23c9
ae23c9
Enabling TOPOEXT feature might cause compatibility issues if
ae23c9
older kernels does not set this feature. Lets set this feature
ae23c9
unconditionally.
ae23c9
ae23c9
Signed-off-by: Babu Moger <babu.moger@amd.com>
ae23c9
Message-Id: <1528939107-17193-2-git-send-email-babu.moger@amd.com>
ae23c9
[ehabkost: rewrite comment and commit message]
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
(cherry picked from commit f98bbd8304112187cafc3e636c31b2a3865d2717)
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 target/i386/kvm.c | 7 +++++++
ae23c9
 1 file changed, 7 insertions(+)
ae23c9
ae23c9
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
ae23c9
index 6e66f9c..bb5e485 100644
ae23c9
--- a/target/i386/kvm.c
ae23c9
+++ b/target/i386/kvm.c
ae23c9
@@ -371,6 +371,13 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
ae23c9
         if (host_tsx_blacklisted()) {
ae23c9
             ret &= ~(CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_HLE);
ae23c9
         }
ae23c9
+    } else if (function == 0x80000001 && reg == R_ECX) {
ae23c9
+        /*
ae23c9
+         * It's safe to enable TOPOEXT even if it's not returned by
ae23c9
+         * GET_SUPPORTED_CPUID.  Unconditionally enabling TOPOEXT here allows
ae23c9
+         * us to keep CPU models including TOPOEXT runnable on older kernels.
ae23c9
+         */
ae23c9
+        ret |= CPUID_EXT3_TOPOEXT;
ae23c9
     } else if (function == 0x80000001 && reg == R_EDX) {
ae23c9
         /* On Intel, kvm returns cpuid according to the Intel spec,
ae23c9
          * so add missing bits according to the AMD spec:
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9