218e99
commit 2b70aa524d7d12a8662cf9fcf9d6ca6d0264b5a6
218e99
Author: Eduardo Habkost <ehabkost@redhat.com>
218e99
Date:   Thu Jun 27 15:57:43 2013 +0200
218e99
218e99
    target-i386: Set level=4 on Conroe/Penryn/Nehalem
218e99
    
218e99
    RH-Author: Eduardo Habkost <ehabkost@redhat.com>
218e99
    Message-id: <1372348663-1706-4-git-send-email-ehabkost@redhat.com>
218e99
    Patchwork-id: 52253
218e99
    O-Subject: [PATCH v2 3/3] target-i386: Set level=4 on Conroe/Penryn/Nehalem
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 6b11322e0f724eb0649fdc324a44288b783023ad)
218e99
    
218e99
    The CPUID level value on Conroe, Penryn, and Nehalem are too low. This
218e99
    causes at least one known problem: the -smp "threads" option doesn't
218e99
    work as expect if level is < 4, because thread count information is
218e99
    provided to the guest on CPUID[EAX=4,ECX=2].EAX
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
     include/hw/i386/pc.h | 12 ++++++++++++
218e99
     target-i386/cpu.c    |  6 +++---
218e99
     2 files changed, 15 insertions(+), 3 deletions(-)
218e99
    
218e99
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
218e99
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
218e99
index 4d6c9bf..6692728 100644
218e99
--- a/include/hw/i386/pc.h
218e99
+++ b/include/hw/i386/pc.h
218e99
@@ -192,13 +192,25 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
218e99
             .property = "model",\
218e99
             .value    = stringify(2),\
218e99
         },{\
218e99
+            .driver   = "Conroe-" TYPE_X86_CPU,\
218e99
+            .property = "level",\
218e99
+            .value    = stringify(2),\
218e99
+        },{\
218e99
             .driver   = "Penryn-" TYPE_X86_CPU,\
218e99
             .property = "model",\
218e99
             .value    = stringify(2),\
218e99
         },{\
218e99
+            .driver   = "Penryn-" TYPE_X86_CPU,\
218e99
+            .property = "level",\
218e99
+            .value    = stringify(2),\
218e99
+        },{\
218e99
             .driver   = "Nehalem-" TYPE_X86_CPU,\
218e99
             .property = "model",\
218e99
             .value    = stringify(2),\
218e99
+        },{\
218e99
+            .driver   = "Nehalem-" TYPE_X86_CPU,\
218e99
+            .property = "level",\
218e99
+            .value    = stringify(2),\
218e99
         }
218e99
 
218e99
 #define PC_COMPAT_1_4 \
218e99
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
218e99
index 012819a..4b2da0d 100644
218e99
--- a/target-i386/cpu.c
218e99
+++ b/target-i386/cpu.c
218e99
@@ -669,7 +669,7 @@ static x86_def_t builtin_x86_defs[] = {
218e99
     },
218e99
     {
218e99
         .name = "Conroe",
218e99
-        .level = 2,
218e99
+        .level = 4,
218e99
         .vendor = CPUID_VENDOR_INTEL,
218e99
         .family = 6,
218e99
         .model = 15,
218e99
@@ -691,7 +691,7 @@ static x86_def_t builtin_x86_defs[] = {
218e99
     },
218e99
     {
218e99
         .name = "Penryn",
218e99
-        .level = 2,
218e99
+        .level = 4,
218e99
         .vendor = CPUID_VENDOR_INTEL,
218e99
         .family = 6,
218e99
         .model = 23,
218e99
@@ -714,7 +714,7 @@ static x86_def_t builtin_x86_defs[] = {
218e99
     },
218e99
     {
218e99
         .name = "Nehalem",
218e99
-        .level = 2,
218e99
+        .level = 4,
218e99
         .vendor = CPUID_VENDOR_INTEL,
218e99
         .family = 6,
218e99
         .model = 26,