qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: libvir-list@redhat.com, Jiri Denemark <jdenemar@redhat.com>,
	Gleb Natapov <gleb@redhat.com>
Subject: [Qemu-devel] [QEMU PATCH 3/3] x86: pc: versioned CPU model names & compatibility aliases
Date: Wed, 25 Jul 2012 15:18:43 -0300	[thread overview]
Message-ID: <1343240323-7402-4-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1343240323-7402-1-git-send-email-ehabkost@redhat.com>

This adds version number to CPU model names on the "pc-<version>"
machine-types, so we can create new models with bug fixes while keeping
compatibility when using older machine-types.

When naming the existing models, I used the last QEMU version where the
model was changed (see summary below), but by coincidence every single
one was changed on QEMU-1.1.

- Conroe, Penryn, Nehalem, Opteron_G1, Opteron_G2, Opteron_G3:
  added on 0.13, changed on 1.1
- Westmere, SandyBridge, Opteron_G4: added on 1.1

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/pc_piix.c                       |   56 ++++++++++++++++++++++++++++++++++++
 sysconfigs/target/cpus-x86_64.conf |   18 ++++++------
 2 files changed, 65 insertions(+), 9 deletions(-)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 0c0096f..ef3840f 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -349,6 +349,18 @@ static void pc_xen_hvm_init(ram_addr_t ram_size,
 }
 #endif
 
+/* CPU aliases for pre-1.2 CPU models */
+#define V1_1_CPU_ALIASES  \
+    { "Conroe",      "Conroe-1.1" }, \
+    { "Penryn",      "Penryn-1.1" }, \
+    { "Nehalem",     "Nehalem-1.1" }, \
+    { "Westmere",    "Westmere-1.1" }, \
+    { "SandyBridge", "SandyBridge-1.1" }, \
+    { "Opteron_G1",  "Opteron_G1-1.1" }, \
+    { "Opteron_G2",  "Opteron_G2-1.1" }, \
+    { "Opteron_G3",  "Opteron_G3-1.1" }, \
+    { "Opteron_G4",  "Opteron_G4-1.1" },
+
 static QEMUMachine pc_machine_v1_2 = {
     .name = "pc-1.2",
     .alias = "pc",
@@ -356,6 +368,10 @@ static QEMUMachine pc_machine_v1_2 = {
     .init = pc_init_pci,
     .max_cpus = 255,
     .is_default = 1,
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 
 #define PC_COMPAT_1_1 \
@@ -386,6 +402,10 @@ static QEMUMachine pc_machine_v1_1 = {
         PC_COMPAT_1_1,
         { /* end of list */ }
     },
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 
 #define PC_COMPAT_1_0 \
@@ -422,6 +442,10 @@ static QEMUMachine pc_machine_v1_0 = {
         { /* end of list */ }
     },
     .hw_version = "1.0",
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 
 #define PC_COMPAT_0_15 \
@@ -437,6 +461,10 @@ static QEMUMachine pc_machine_v0_15 = {
         { /* end of list */ }
     },
     .hw_version = "0.15",
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 
 #define PC_COMPAT_0_14 \
@@ -478,6 +506,10 @@ static QEMUMachine pc_machine_v0_14 = {
         { /* end of list */ }
     },
     .hw_version = "0.14",
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 
 #define PC_COMPAT_0_13 \
@@ -515,6 +547,10 @@ static QEMUMachine pc_machine_v0_13 = {
         { /* end of list */ }
     },
     .hw_version = "0.13",
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 
 #define PC_COMPAT_0_12 \
@@ -548,6 +584,10 @@ static QEMUMachine pc_machine_v0_12 = {
         { /* end of list */ }
     },
     .hw_version = "0.12",
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 
 #define PC_COMPAT_0_11 \
@@ -581,6 +621,10 @@ static QEMUMachine pc_machine_v0_11 = {
         { /* end of list */ }
     },
     .hw_version = "0.11",
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 
 static QEMUMachine pc_machine_v0_10 = {
@@ -614,6 +658,10 @@ static QEMUMachine pc_machine_v0_10 = {
         { /* end of list */ }
     },
     .hw_version = "0.10",
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 
 static QEMUMachine isapc_machine = {
@@ -629,6 +677,10 @@ static QEMUMachine isapc_machine = {
         },
         { /* end of list */ }
     },
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 
 #ifdef CONFIG_XEN
@@ -638,6 +690,10 @@ static QEMUMachine xenfv_machine = {
     .init = pc_xen_hvm_init,
     .max_cpus = HVM_MAX_VCPUS,
     .default_machine_opts = "accel=xen",
+    .cpu_aliases = (CPUModelAlias[]) {
+        V1_1_CPU_ALIASES
+        {NULL, NULL},
+    },
 };
 #endif
 
diff --git a/sysconfigs/target/cpus-x86_64.conf b/sysconfigs/target/cpus-x86_64.conf
index cee0ea9..14c7891 100644
--- a/sysconfigs/target/cpus-x86_64.conf
+++ b/sysconfigs/target/cpus-x86_64.conf
@@ -1,7 +1,7 @@
 # x86 CPU MODELS
 
 [cpudef]
-   name = "Conroe"
+   name = "Conroe-1.1"
    level = "2"
    vendor = "GenuineIntel"
    family = "6"
@@ -15,7 +15,7 @@
    model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)"
 
 [cpudef]
-   name = "Penryn"
+   name = "Penryn-1.1"
    level = "2"
    vendor = "GenuineIntel"
    family = "6"
@@ -29,7 +29,7 @@
    model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)"
 
 [cpudef]
-   name = "Nehalem"
+   name = "Nehalem-1.1"
    level = "2"
    vendor = "GenuineIntel"
    family = "6"
@@ -43,7 +43,7 @@
    model_id = "Intel Core i7 9xx (Nehalem Class Core i7)"
 
 [cpudef]
-   name = "Westmere"
+   name = "Westmere-1.1"
    level = "11"
    vendor = "GenuineIntel"
    family = "6"
@@ -57,7 +57,7 @@
    model_id = "Westmere E56xx/L56xx/X56xx (Nehalem-C)"
 
 [cpudef]
-   name = "SandyBridge"
+   name = "SandyBridge-1.1"
    level = "0xd"
    vendor = "GenuineIntel"
    family = "6"
@@ -71,7 +71,7 @@
    model_id = "Intel Xeon E312xx (Sandy Bridge)"
 
 [cpudef]
-   name = "Opteron_G1"
+   name = "Opteron_G1-1.1"
    level = "5"
    vendor = "AuthenticAMD"
    family = "15"
@@ -85,7 +85,7 @@
    model_id = "AMD Opteron 240 (Gen 1 Class Opteron)"
 
 [cpudef]
-   name = "Opteron_G2"
+   name = "Opteron_G2-1.1"
    level = "5"
    vendor = "AuthenticAMD"
    family = "15"
@@ -99,7 +99,7 @@
    model_id = "AMD Opteron 22xx (Gen 2 Class Opteron)"
 
 [cpudef]
-   name = "Opteron_G3"
+   name = "Opteron_G3-1.1"
    level = "5"
    vendor = "AuthenticAMD"
    family = "15"
@@ -113,7 +113,7 @@
    model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)"
 
 [cpudef]
-   name = "Opteron_G4"
+   name = "Opteron_G4-1.1"
    level = "0xd"
    vendor = "AuthenticAMD"
    family = "21"
-- 
1.7.10.4

  parent reply	other threads:[~2012-07-25 18:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 18:18 [Qemu-devel] [QEMU PATCH 0/3] versioned CPU models / per-machine-type aliases Eduardo Habkost
2012-07-25 18:18 ` [Qemu-devel] [QEMU PATCH 1/3] vl.c: extract qemu_machine_init() function Eduardo Habkost
2012-07-25 22:18   ` [Qemu-devel] [libvirt] " Eric Blake
2012-07-30 16:19     ` Eduardo Habkost
2012-07-25 18:18 ` [Qemu-devel] [QEMU PATCH 2/3] per-machine-type CPU model alias system Eduardo Habkost
2012-07-25 22:46   ` Andreas Färber
2012-07-25 18:18 ` Eduardo Habkost [this message]
2012-07-25 22:52   ` [Qemu-devel] [QEMU PATCH 3/3] x86: pc: versioned CPU model names & compatibility aliases Andreas Färber
2012-07-26 14:24     ` Eduardo Habkost
2012-07-26 14:31       ` Andreas Färber
2012-07-26 14:48         ` Eduardo Habkost
2012-07-31 13:22           ` Igor Mammedov
2012-07-31 13:44             ` Eduardo Habkost
2012-07-26 14:33   ` Jiri Denemark
2012-07-26 14:54     ` Eduardo Habkost
2012-07-25 23:43 ` [Qemu-devel] [QEMU PATCH 0/3] versioned CPU models / per-machine-type aliases Anthony Liguori
2012-07-26 13:53   ` Eduardo Habkost
2012-07-26 14:06     ` Andreas Färber
2012-07-26 14:29       ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343240323-7402-4-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=gleb@redhat.com \
    --cc=jdenemar@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).