Skip to content

Commit

Permalink
target-i386: Set level=4 on Conroe/Penryn/Nehalem
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
  • Loading branch information
ehabkost authored and afaerber committed Jun 10, 2013
1 parent ffce9eb commit 6b11322
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions include/hw/i386/pc.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,26 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
.driver = "Conroe-" TYPE_X86_CPU,\
.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 \
Expand Down
6 changes: 3 additions & 3 deletions target-i386/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 6b11322

Please sign in to comment.