Blob Blame History Raw
commit 2b70aa524d7d12a8662cf9fcf9d6ca6d0264b5a6
Author: Eduardo Habkost <ehabkost@redhat.com>
Date:   Thu Jun 27 15:57:43 2013 +0200

    target-i386: Set level=4 on Conroe/Penryn/Nehalem
    
    RH-Author: Eduardo Habkost <ehabkost@redhat.com>
    Message-id: <1372348663-1706-4-git-send-email-ehabkost@redhat.com>
    Patchwork-id: 52253
    O-Subject: [PATCH v2 3/3] target-i386: Set level=4 on Conroe/Penryn/Nehalem
    Bugzilla: 861210
    RH-Acked-by: Bandan Das <bsd@redhat.com>
    RH-Acked-by: Markus Armbruster <armbru@redhat.com>
    RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
    
    Bugzilla: 861210
    (cherry picked from commit 6b11322e0f724eb0649fdc324a44288b783023ad)
    
    The CPUID level value on Conroe, Penryn, and Nehalem are too low. This
    causes at least one known problem: the -smp "threads" option doesn't
    work as expect if level is < 4, because thread count information is
    provided to the guest on CPUID[EAX=4,ECX=2].EAX
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    ---
     include/hw/i386/pc.h | 12 ++++++++++++
     target-i386/cpu.c    |  6 +++---
     2 files changed, 15 insertions(+), 3 deletions(-)
    
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 4d6c9bf..6692728 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -192,13 +192,25 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
             .property = "model",\
             .value    = stringify(2),\
         },{\
+            .driver   = "Conroe-" TYPE_X86_CPU,\
+            .property = "level",\
+            .value    = stringify(2),\
+        },{\
             .driver   = "Penryn-" TYPE_X86_CPU,\
             .property = "model",\
             .value    = stringify(2),\
         },{\
+            .driver   = "Penryn-" TYPE_X86_CPU,\
+            .property = "level",\
+            .value    = stringify(2),\
+        },{\
             .driver   = "Nehalem-" TYPE_X86_CPU,\
             .property = "model",\
             .value    = stringify(2),\
+        },{\
+            .driver   = "Nehalem-" TYPE_X86_CPU,\
+            .property = "level",\
+            .value    = stringify(2),\
         }
 
 #define PC_COMPAT_1_4 \
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 012819a..4b2da0d 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -669,7 +669,7 @@ static x86_def_t builtin_x86_defs[] = {
     },
     {
         .name = "Conroe",
-        .level = 2,
+        .level = 4,
         .vendor = CPUID_VENDOR_INTEL,
         .family = 6,
         .model = 15,
@@ -691,7 +691,7 @@ static x86_def_t builtin_x86_defs[] = {
     },
     {
         .name = "Penryn",
-        .level = 2,
+        .level = 4,
         .vendor = CPUID_VENDOR_INTEL,
         .family = 6,
         .model = 23,
@@ -714,7 +714,7 @@ static x86_def_t builtin_x86_defs[] = {
     },
     {
         .name = "Nehalem",
-        .level = 2,
+        .level = 4,
         .vendor = CPUID_VENDOR_INTEL,
         .family = 6,
         .model = 26,