All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes
@ 2013-05-27 20:23 Eduardo Habkost
  2013-05-27 20:23 ` [Qemu-devel] [PATCH qom-cpu 1/3] pc: create pc-*-1.6 machine-types Eduardo Habkost
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Eduardo Habkost @ 2013-05-27 20:23 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber; +Cc: Igor Mammedov, Gleb Natapov

This series changes the CPUID family and level fields of the Conroe, Penryn, and
Nehalem CPU models.

Testing: those model/level values have been in use on Red Hat
Enterprise Linux since version 6.0 (released in 2010). The fix wasn't
submitted to QEMU earlier because we didn't have a good mechanism and
clear procedure to update CPUID values of existing CPU models in QEMU.

Eduardo Habkost (3):
  pc: create pc-*-1.6 machine-types
  target-i386: update model values on Conroe/Penryn/Nehalem CPU models
  target-i386: set level=4 on Conroe/Penryn/Nehalem

 hw/i386/pc_piix.c    | 18 ++++++++++++++++--
 hw/i386/pc_q35.c     | 16 +++++++++++++++-
 include/hw/i386/pc.h | 28 ++++++++++++++++++++++++++++
 target-i386/cpu.c    | 12 ++++++------
 4 files changed, 65 insertions(+), 9 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH qom-cpu 1/3] pc: create pc-*-1.6 machine-types
  2013-05-27 20:23 [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes Eduardo Habkost
@ 2013-05-27 20:23 ` Eduardo Habkost
  2013-05-27 20:23 ` [Qemu-devel] [PATCH qom-cpu 2/3] target-i386: update model values on Conroe/Penryn/Nehalem CPU models Eduardo Habkost
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Eduardo Habkost @ 2013-05-27 20:23 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber; +Cc: Igor Mammedov, Gleb Natapov

Some CPU model fixes are going to be included and they will require
compatibility properties in the pc-*-1.5 machine-types.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 14 ++++++++++++--
 hw/i386/pc_q35.c  | 12 +++++++++++-
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 43ab480..c4e0391 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -328,8 +328,8 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
 }
 #endif
 
-static QEMUMachine pc_i440fx_machine_v1_5 = {
-    .name = "pc-i440fx-1.5",
+static QEMUMachine pc_i440fx_machine_v1_6 = {
+    .name = "pc-i440fx-1.6",
     .alias = "pc",
     .desc = "Standard PC (i440FX + PIIX, 1996)",
     .init = pc_init_pci,
@@ -339,6 +339,15 @@ static QEMUMachine pc_i440fx_machine_v1_5 = {
     DEFAULT_MACHINE_OPTIONS,
 };
 
+static QEMUMachine pc_i440fx_machine_v1_5 = {
+    .name = "pc-i440fx-1.5",
+    .desc = "Standard PC (i440FX + PIIX, 1996)",
+    .init = pc_init_pci,
+    .hot_add_cpu = pc_hot_add_cpu,
+    .max_cpus = 255,
+    DEFAULT_MACHINE_OPTIONS,
+};
+
 static QEMUMachine pc_i440fx_machine_v1_4 = {
     .name = "pc-i440fx-1.4",
     .desc = "Standard PC (i440FX + PIIX, 1996)",
@@ -731,6 +740,7 @@ static QEMUMachine xenfv_machine = {
 
 static void pc_machine_init(void)
 {
+    qemu_register_machine(&pc_i440fx_machine_v1_6);
     qemu_register_machine(&pc_i440fx_machine_v1_5);
     qemu_register_machine(&pc_i440fx_machine_v1_4);
     qemu_register_machine(&pc_machine_v1_3);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 7888dfe..db5c46e 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -215,9 +215,18 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
     pc_q35_init(args);
 }
 
+static QEMUMachine pc_q35_machine_v1_6 = {
+    .name = "pc-q35-1.6",
+    .alias = "q35",
+    .desc = "Standard PC (Q35 + ICH9, 2009)",
+    .init = pc_q35_init,
+    .hot_add_cpu = pc_hot_add_cpu,
+    .max_cpus = 255,
+    DEFAULT_MACHINE_OPTIONS,
+};
+
 static QEMUMachine pc_q35_machine_v1_5 = {
     .name = "pc-q35-1.5",
-    .alias = "q35",
     .desc = "Standard PC (Q35 + ICH9, 2009)",
     .init = pc_q35_init,
     .hot_add_cpu = pc_hot_add_cpu,
@@ -239,6 +248,7 @@ static QEMUMachine pc_q35_machine_v1_4 = {
 
 static void pc_q35_machine_init(void)
 {
+    qemu_register_machine(&pc_q35_machine_v1_6);
     qemu_register_machine(&pc_q35_machine_v1_5);
     qemu_register_machine(&pc_q35_machine_v1_4);
 }
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH qom-cpu 2/3] target-i386: update model values on Conroe/Penryn/Nehalem CPU models
  2013-05-27 20:23 [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes Eduardo Habkost
  2013-05-27 20:23 ` [Qemu-devel] [PATCH qom-cpu 1/3] pc: create pc-*-1.6 machine-types Eduardo Habkost
@ 2013-05-27 20:23 ` Eduardo Habkost
  2013-05-27 20:23 ` [Qemu-devel] [PATCH qom-cpu 3/3] target-i386: set level=4 on Conroe/Penryn/Nehalem Eduardo Habkost
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Eduardo Habkost @ 2013-05-27 20:23 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber; +Cc: Igor Mammedov, Gleb Natapov

The CPUID model values on Conroe, Penryn, and Nehalem are too
conservative and don't reflect the values found on real Conroe, Penryn,
and Nehalem CPUs.

This causes at least one known problems: Windows XP disables sysenter
when (family == 6 && model <= 2), but Skype tries to use the sysenter
instruction anyway because it is reported as available on CPUID, making
it crash.

This patch sets appropriate model values that correspond to real Conroe,
Penryn, and Nehalem CPUs.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Testing: those family/model values have been in use on Red Hat
Enterprise Linux since version 6.0 (released in 2010). The fix wasn't
submitted to QEMU earlier because we didn't have a good mechanism and
clear procedure to update CPUID values of existing CPU models in QEMU.
---
 hw/i386/pc_piix.c    |  4 ++++
 hw/i386/pc_q35.c     |  4 ++++
 include/hw/i386/pc.h | 16 ++++++++++++++++
 target-i386/cpu.c    |  6 +++---
 4 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index c4e0391..b3c835e 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -345,6 +345,10 @@ static QEMUMachine pc_i440fx_machine_v1_5 = {
     .init = pc_init_pci,
     .hot_add_cpu = pc_hot_add_cpu,
     .max_cpus = 255,
+    .compat_props = (GlobalProperty[]) {
+        PC_COMPAT_1_5,
+        { /* end of list */ }
+    },
     DEFAULT_MACHINE_OPTIONS,
 };
 
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index db5c46e..bb0ce6a 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -231,6 +231,10 @@ static QEMUMachine pc_q35_machine_v1_5 = {
     .init = pc_q35_init,
     .hot_add_cpu = pc_hot_add_cpu,
     .max_cpus = 255,
+    .compat_props = (GlobalProperty[]) {
+        PC_COMPAT_1_5,
+        { /* end of list */ }
+    },
     DEFAULT_MACHINE_OPTIONS,
 };
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 663426c..8883b37 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -182,7 +182,23 @@ int pvpanic_init(ISABus *bus);
 
 int e820_add_entry(uint64_t, uint64_t, uint32_t);
 
+#define PC_COMPAT_1_5 \
+        {\
+            .driver   = "Conroe-" TYPE_X86_CPU,\
+            .property = "model",\
+            .value    = stringify(2),\
+        },{\
+            .driver   = "Penryn-" TYPE_X86_CPU,\
+            .property = "model",\
+            .value    = stringify(2),\
+        },{\
+            .driver   = "Nehalem-" TYPE_X86_CPU,\
+            .property = "model",\
+            .value    = stringify(2),\
+        }
+
 #define PC_COMPAT_1_4 \
+        PC_COMPAT_1_5, \
         {\
             .driver   = "scsi-hd",\
             .property = "discard_granularity",\
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 1a501d9..6b48562 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -672,7 +672,7 @@ static x86_def_t builtin_x86_defs[] = {
         .level = 2,
         .vendor = CPUID_VENDOR_INTEL,
         .family = 6,
-        .model = 2,
+        .model = 15,
         .stepping = 3,
         .features[FEAT_1_EDX] =
             CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
@@ -694,7 +694,7 @@ static x86_def_t builtin_x86_defs[] = {
         .level = 2,
         .vendor = CPUID_VENDOR_INTEL,
         .family = 6,
-        .model = 2,
+        .model = 23,
         .stepping = 3,
         .features[FEAT_1_EDX] =
             CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
@@ -717,7 +717,7 @@ static x86_def_t builtin_x86_defs[] = {
         .level = 2,
         .vendor = CPUID_VENDOR_INTEL,
         .family = 6,
-        .model = 2,
+        .model = 26,
         .stepping = 3,
         .features[FEAT_1_EDX] =
             CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH qom-cpu 3/3] target-i386: set level=4 on Conroe/Penryn/Nehalem
  2013-05-27 20:23 [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes Eduardo Habkost
  2013-05-27 20:23 ` [Qemu-devel] [PATCH qom-cpu 1/3] pc: create pc-*-1.6 machine-types Eduardo Habkost
  2013-05-27 20:23 ` [Qemu-devel] [PATCH qom-cpu 2/3] target-i386: update model values on Conroe/Penryn/Nehalem CPU models Eduardo Habkost
@ 2013-05-27 20:23 ` Eduardo Habkost
  2013-05-27 20:30 ` [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes Andreas Färber
  2013-05-28  9:31 ` Igor Mammedov
  4 siblings, 0 replies; 7+ messages in thread
From: Eduardo Habkost @ 2013-05-27 20:23 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber; +Cc: Igor Mammedov, Gleb Natapov

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>
---
Testing: those level values have been in use on Red Hat Enterprise Linux
since version 6.0 (released in 2010). The fix wasn't submitted to QEMU
earlier because we didn't have a good mechanism and clear procedure to
update CPUID values of existing CPU models in QEMU.
---
 include/hw/i386/pc.h | 12 ++++++++++++
 target-i386/cpu.c    |  6 +++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 8883b37..4351f39 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -188,13 +188,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 6b48562..762baad 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,
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes
  2013-05-27 20:23 [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes Eduardo Habkost
                   ` (2 preceding siblings ...)
  2013-05-27 20:23 ` [Qemu-devel] [PATCH qom-cpu 3/3] target-i386: set level=4 on Conroe/Penryn/Nehalem Eduardo Habkost
@ 2013-05-27 20:30 ` Andreas Färber
  2013-05-28  9:31 ` Igor Mammedov
  4 siblings, 0 replies; 7+ messages in thread
From: Andreas Färber @ 2013-05-27 20:30 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: Igor Mammedov, qemu-devel, Gleb Natapov

Am 27.05.2013 22:23, schrieb Eduardo Habkost:
> This series changes the CPUID family and level fields of the Conroe, Penryn, and
> Nehalem CPU models.
> 
> Testing: those model/level values have been in use on Red Hat
> Enterprise Linux since version 6.0 (released in 2010). The fix wasn't
> submitted to QEMU earlier because we didn't have a good mechanism and
> clear procedure to update CPUID values of existing CPU models in QEMU.
> 
> Eduardo Habkost (3):
>   pc: create pc-*-1.6 machine-types
>   target-i386: update model values on Conroe/Penryn/Nehalem CPU models
>   target-i386: set level=4 on Conroe/Penryn/Nehalem

Series looks good. Since we're not under time pressure yet will give
others some more time for review.

Andreas

> 
>  hw/i386/pc_piix.c    | 18 ++++++++++++++++--
>  hw/i386/pc_q35.c     | 16 +++++++++++++++-
>  include/hw/i386/pc.h | 28 ++++++++++++++++++++++++++++
>  target-i386/cpu.c    | 12 ++++++------
>  4 files changed, 65 insertions(+), 9 deletions(-)
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes
  2013-05-27 20:23 [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes Eduardo Habkost
                   ` (3 preceding siblings ...)
  2013-05-27 20:30 ` [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes Andreas Färber
@ 2013-05-28  9:31 ` Igor Mammedov
  2013-05-30 16:17   ` Andreas Färber
  4 siblings, 1 reply; 7+ messages in thread
From: Igor Mammedov @ 2013-05-28  9:31 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: qemu-devel, Gleb Natapov, Andreas Färber

On Mon, 27 May 2013 17:23:52 -0300
Eduardo Habkost <ehabkost@redhat.com> wrote:

> This series changes the CPUID family and level fields of the Conroe, Penryn, and
> Nehalem CPU models.
> 
> Testing: those model/level values have been in use on Red Hat
> Enterprise Linux since version 6.0 (released in 2010). The fix wasn't
> submitted to QEMU earlier because we didn't have a good mechanism and
> clear procedure to update CPUID values of existing CPU models in QEMU.
> 
> Eduardo Habkost (3):
>   pc: create pc-*-1.6 machine-types
>   target-i386: update model values on Conroe/Penryn/Nehalem CPU models
>   target-i386: set level=4 on Conroe/Penryn/Nehalem
> 
>  hw/i386/pc_piix.c    | 18 ++++++++++++++++--
>  hw/i386/pc_q35.c     | 16 +++++++++++++++-
>  include/hw/i386/pc.h | 28 ++++++++++++++++++++++++++++
>  target-i386/cpu.c    | 12 ++++++------
>  4 files changed, 65 insertions(+), 9 deletions(-)
> 

Reviewed-By: Igor Mammedov <imammedo@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes
  2013-05-28  9:31 ` Igor Mammedov
@ 2013-05-30 16:17   ` Andreas Färber
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Färber @ 2013-05-30 16:17 UTC (permalink / raw)
  To: Igor Mammedov, Eduardo Habkost
  Cc: qemu-devel, Gleb Natapov, Michael S. Tsirkin

Am 28.05.2013 11:31, schrieb Igor Mammedov:
> On Mon, 27 May 2013 17:23:52 -0300
> Eduardo Habkost <ehabkost@redhat.com> wrote:
> 
>> This series changes the CPUID family and level fields of the Conroe, Penryn, and
>> Nehalem CPU models.
>>
>> Testing: those model/level values have been in use on Red Hat
>> Enterprise Linux since version 6.0 (released in 2010). The fix wasn't
>> submitted to QEMU earlier because we didn't have a good mechanism and
>> clear procedure to update CPUID values of existing CPU models in QEMU.
>>
>> Eduardo Habkost (3):
>>   pc: create pc-*-1.6 machine-types
>>   target-i386: update model values on Conroe/Penryn/Nehalem CPU models
>>   target-i386: set level=4 on Conroe/Penryn/Nehalem
>>
>>  hw/i386/pc_piix.c    | 18 ++++++++++++++++--
>>  hw/i386/pc_q35.c     | 16 +++++++++++++++-
>>  include/hw/i386/pc.h | 28 ++++++++++++++++++++++++++++
>>  target-i386/cpu.c    | 12 ++++++------
>>  4 files changed, 65 insertions(+), 9 deletions(-)
>>
> 
> Reviewed-By: Igor Mammedov <imammedo@redhat.com>

Thanks, applied to qom-cpu:
https://github.com/afaerber/qemu-cpu/commits/qom-cpu

mst also has a patch adding a 1.6 i440fx machine, so this may need merging.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-05-30 16:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-27 20:23 [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes Eduardo Habkost
2013-05-27 20:23 ` [Qemu-devel] [PATCH qom-cpu 1/3] pc: create pc-*-1.6 machine-types Eduardo Habkost
2013-05-27 20:23 ` [Qemu-devel] [PATCH qom-cpu 2/3] target-i386: update model values on Conroe/Penryn/Nehalem CPU models Eduardo Habkost
2013-05-27 20:23 ` [Qemu-devel] [PATCH qom-cpu 3/3] target-i386: set level=4 on Conroe/Penryn/Nehalem Eduardo Habkost
2013-05-27 20:30 ` [Qemu-devel] [PATCH qom-cpu 0/3] Conroe/Penryn/Nehalem CPUID family/level fixes Andreas Färber
2013-05-28  9:31 ` Igor Mammedov
2013-05-30 16:17   ` Andreas Färber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.