cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/target-i386-update-model-values-on-conroe-penryn-nehalem-cpu-models.patch

218e99
commit 891c6ba393323686ace2b5ecd9c35bbde6165f2a
218e99
Author: Eduardo Habkost <ehabkost@redhat.com>
218e99
Date:   Thu Jun 27 15:57:42 2013 +0200
218e99
218e99
    target-i386: Update model values on Conroe/Penryn/Nehalem CPU models
218e99
    
218e99
    RH-Author: Eduardo Habkost <ehabkost@redhat.com>
218e99
    Message-id: <1372348663-1706-3-git-send-email-ehabkost@redhat.com>
218e99
    Patchwork-id: 52252
218e99
    O-Subject: [PATCH v2 2/3] target-i386: Update model values on Conroe/Penryn/Nehalem CPU models
218e99
    Bugzilla: 861210
218e99
    RH-Acked-by: Bandan Das <bsd@redhat.com>
218e99
    RH-Acked-by: Markus Armbruster <armbru@redhat.com>
218e99
    RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
218e99
    
218e99
    Bugzilla: 861210
218e99
    (cherry picked from commit ffce9ebbb69363dfe7605585cdad58ea3847edf4)
218e99
    
218e99
    The CPUID model values on Conroe, Penryn, and Nehalem are too
218e99
    conservative and don't reflect the values found on real Conroe, Penryn,
218e99
    and Nehalem CPUs.
218e99
    
218e99
    This causes at least one known problems: Windows XP disables sysenter
218e99
    when (family == 6 && model <= 2), but Skype tries to use the sysenter
218e99
    instruction anyway because it is reported as available on CPUID, making
218e99
    it crash.
218e99
    
218e99
    This patch sets appropriate model values that correspond to real Conroe,
218e99
    Penryn, and Nehalem CPUs.
218e99
    
218e99
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
218e99
    Signed-off-by: Andreas Färber <afaerber@suse.de>
218e99
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
218e99
    ---
218e99
     hw/i386/pc_piix.c    |  4 ++++
218e99
     hw/i386/pc_q35.c     |  4 ++++
218e99
     include/hw/i386/pc.h | 16 ++++++++++++++++
218e99
     target-i386/cpu.c    |  6 +++---
218e99
     4 files changed, 27 insertions(+), 3 deletions(-)
218e99
    
218e99
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
218e99
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
218e99
index d8d74a3..b52034d 100644
218e99
--- a/hw/i386/pc_piix.c
218e99
+++ b/hw/i386/pc_piix.c
218e99
@@ -338,6 +338,10 @@ static QEMUMachine pc_i440fx_machine_v1_5 = {
218e99
     .hot_add_cpu = pc_hot_add_cpu,
218e99
     .max_cpus = 255,
218e99
     .is_default = 1,
218e99
+    .compat_props = (GlobalProperty[]) {
218e99
+        PC_COMPAT_1_5,
218e99
+        { /* end of list */ }
218e99
+    },
218e99
     DEFAULT_MACHINE_OPTIONS,
218e99
 };
218e99
 
218e99
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
218e99
index 9bcad00..0092032 100644
218e99
--- a/hw/i386/pc_q35.c
218e99
+++ b/hw/i386/pc_q35.c
218e99
@@ -224,6 +224,10 @@ static QEMUMachine pc_q35_machine_v1_5 = {
218e99
     .init = pc_q35_init,
218e99
     .hot_add_cpu = pc_hot_add_cpu,
218e99
     .max_cpus = 255,
218e99
+    .compat_props = (GlobalProperty[]) {
218e99
+        PC_COMPAT_1_5,
218e99
+        { /* end of list */ }
218e99
+    },
218e99
     DEFAULT_MACHINE_OPTIONS,
218e99
 };
218e99
 
218e99
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
218e99
index 0242fec..4d6c9bf 100644
218e99
--- a/include/hw/i386/pc.h
218e99
+++ b/include/hw/i386/pc.h
218e99
@@ -186,7 +186,23 @@ int pvpanic_init(ISABus *bus);
218e99
 
218e99
 int e820_add_entry(uint64_t, uint64_t, uint32_t);
218e99
 
218e99
+#define PC_COMPAT_1_5 \
218e99
+        {\
218e99
+            .driver   = "Conroe-" TYPE_X86_CPU,\
218e99
+            .property = "model",\
218e99
+            .value    = stringify(2),\
218e99
+        },{\
218e99
+            .driver   = "Penryn-" TYPE_X86_CPU,\
218e99
+            .property = "model",\
218e99
+            .value    = stringify(2),\
218e99
+        },{\
218e99
+            .driver   = "Nehalem-" TYPE_X86_CPU,\
218e99
+            .property = "model",\
218e99
+            .value    = stringify(2),\
218e99
+        }
218e99
+
218e99
 #define PC_COMPAT_1_4 \
218e99
+        PC_COMPAT_1_5, \
218e99
         {\
218e99
             .driver   = "scsi-hd",\
218e99
             .property = "discard_granularity",\
218e99
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
218e99
index ae8e682..012819a 100644
218e99
--- a/target-i386/cpu.c
218e99
+++ b/target-i386/cpu.c
218e99
@@ -672,7 +672,7 @@ static x86_def_t builtin_x86_defs[] = {
218e99
         .level = 2,
218e99
         .vendor = CPUID_VENDOR_INTEL,
218e99
         .family = 6,
218e99
-        .model = 2,
218e99
+        .model = 15,
218e99
         .stepping = 3,
218e99
         .features[FEAT_1_EDX] =
218e99
             CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
218e99
@@ -694,7 +694,7 @@ static x86_def_t builtin_x86_defs[] = {
218e99
         .level = 2,
218e99
         .vendor = CPUID_VENDOR_INTEL,
218e99
         .family = 6,
218e99
-        .model = 2,
218e99
+        .model = 23,
218e99
         .stepping = 3,
218e99
         .features[FEAT_1_EDX] =
218e99
             CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
218e99
@@ -717,7 +717,7 @@ static x86_def_t builtin_x86_defs[] = {
218e99
         .level = 2,
218e99
         .vendor = CPUID_VENDOR_INTEL,
218e99
         .family = 6,
218e99
-        .model = 2,
218e99
+        .model = 26,
218e99
         .stepping = 3,
218e99
         .features[FEAT_1_EDX] =
218e99
             CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |