Discussion:
[pve-devel] Add modern cpu models
Derumier Alexandre
2012-01-30 13:10:20 UTC
Permalink
Since qemu 0.13, new cpu model exists through a config file : target-x86_64.conf.

http://wiki.qemu.org/Features/CPUModels

target-x86_64.conf currently exist in /etc/qemu , but this is the wrong directory as we use /etc/kvm

also, upstream target-x86_64.conf is not the last version.
The redhat owner developper had made cpu flags bugfix and add new models.

http://permalink.gmane.org/gmane.comp.emulators.qemu/105002

So I put the target-x86_64.conf from rhel 6.2.

New cpu models are: (kvm -cpu ?)

Intel specific
----------
Conroe
Penryn
Nehalem
Westmere

Amd specific
-------
Opteron_G1
Opteron_G2
Opteron_G3

Intel and Amd compatible (like qemu64 with more flags)
------------------------------------------------------
cpu64-rhel6
cpu64-rhel5
Derumier Alexandre
2012-01-30 13:10:22 UTC
Permalink
Signed-off-by: Derumier Alexandre <***@odiso.com>
---
debian/rules | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/debian/rules b/debian/rules
index e5ee1bf..4ed3a23 100755
--- a/debian/rules
+++ b/debian/rules
@@ -76,6 +76,10 @@ install: build
mv $(destdir)/usr/bin/qemu-system-x86_64 $(destdir)/usr/bin/kvm
mv $(destdir)/usr/share/man/man1/qemu.1 $(destdir)/usr/share/man/man1/kvm.1

+ #remove cpumodel file from wrong /etc/qemu directory and install the rhel6.2 new version in /etc/kvm
+ rm $(destdir)/etc/qemu/target-x86_64.conf
+ install -D -m 0644 $(CURDIR)/debian/target-x86_64.conf $(destdir)/etc/kvm/target-x86_64.conf
+
# Install the userspace utilities
install -m 0755 kvm/kvm_stat $(destdir)/usr/bin/
--
1.7.2.5
Dietmar Maurer
2012-01-31 06:16:33 UTC
Permalink
OK, committed a slightly different patch:

- install file from qemu-kvm/ sysconfigs/ target/target-x86_64.conf
- make sure /etc/qemu is empty
- and try to remove old /etc/qemu in postinst script

https://git.proxmox.com/?p=pve-qemu-kvm.git;a=commit;h=8b7e35182aba87372ba5da5d322791557b744c15

- Dietmar
-----Original Message-----
Sent: Montag, 30. Jänner 2012 14:10
Subject: [pve-devel] [PATCH 2/2] install target-x86_64.conf new version in
/etc/kvm/
---
debian/rules | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/debian/rules b/debian/rules index e5ee1bf..4ed3a23 100755
--- a/debian/rules
+++ b/debian/rules
@@ -76,6 +76,10 @@ install: build
mv $(destdir)/usr/bin/qemu-system-x86_64 $(destdir)/usr/bin/kvm
mv $(destdir)/usr/share/man/man1/qemu.1
$(destdir)/usr/share/man/man1/kvm.1
+ #remove cpumodel file from wrong /etc/qemu directory and install the
rhel6.2 new version in /etc/kvm
+ rm $(destdir)/etc/qemu/target-x86_64.conf
+ install -D -m 0644 $(CURDIR)/debian/target-x86_64.conf
+$(destdir)/etc/kvm/target-x86_64.conf
+
# Install the userspace utilities
install -m 0755 kvm/kvm_stat $(destdir)/usr/bin/
--
1.7.2.5
_______________________________________________
pve-devel mailing list
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Derumier Alexandre
2012-01-30 13:10:21 UTC
Permalink
Signed-off-by: Derumier Alexandre <***@odiso.com>
---
debian/target-x86_64.conf | 128 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 128 insertions(+), 0 deletions(-)
create mode 100644 debian/target-x86_64.conf

diff --git a/debian/target-x86_64.conf b/debian/target-x86_64.conf
new file mode 100644
index 0000000..f4330ed
--- /dev/null
+++ b/debian/target-x86_64.conf
@@ -0,0 +1,128 @@
+# x86 CPU MODELS
+
+[cpudef]
+ name = "cpu64-rhel6"
+ level = "4"
+ vendor = "AuthenticAMD"
+ family = "6"
+ model = "13"
+ stepping = "3"
+ feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
+ feature_ecx = "cx16 sse3 x2apic"
+ extfeature_edx = "lm fxsr mmx nx pat cmov pge syscall apic cx8 mce pae msr tsc pse de fpu"
+ extfeature_ecx = "sse4a abm svm lahf_lm"
+ xlevel = "0x8000000A"
+ model_id = "QEMU Virtual CPU version (cpu64-rhel6)"
+
+[cpudef]
+ name = "cpu64-rhel5"
+ level = "4"
+ vendor = "AuthenticAMD"
+ family = "6"
+ model = "6"
+ stepping = "3"
+ feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
+ feature_ecx = "sse3"
+ extfeature_edx = "3dnow 3dnowext lm fxsr mmx nx pat cmov pge syscall apic cx8 mce pae msr tsc pse de fpu"
+ extfeature_ecx = "svm"
+ xlevel = "0x8000000A"
+ model_id = "QEMU Virtual CPU version (cpu64-rhel5)"
+
+[cpudef]
+ name = "Conroe"
+ level = "2"
+ vendor = "GenuineIntel"
+ family = "6"
+ model = "15"
+ stepping = "3"
+ feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
+ feature_ecx = "x2apic ssse3 sse3"
+ extfeature_edx = "lm syscall nx"
+ extfeature_ecx = "lahf_lm"
+ xlevel = "0x8000000A"
+ model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)"
+
+[cpudef]
+ name = "Penryn"
+ level = "2"
+ vendor = "GenuineIntel"
+ family = "6"
+ model = "23"
+ stepping = "3"
+ feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
+ feature_ecx = "x2apic sse4.1 cx16 ssse3 sse3"
+ extfeature_edx = "lm syscall nx"
+ extfeature_ecx = "lahf_lm"
+ xlevel = "0x8000000A"
+ model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)"
+
+[cpudef]
+ name = "Nehalem"
+ level = "2"
+ vendor = "GenuineIntel"
+ family = "6"
+ model = "26"
+ stepping = "3"
+ feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
+ feature_ecx = "popcnt x2apic sse4.2 sse4.1 cx16 ssse3 sse3"
+ extfeature_edx = "lm syscall nx"
+ extfeature_ecx = "lahf_lm"
+ xlevel = "0x8000000A"
+ model_id = "Intel Core i7 9xx (Nehalem Class Core i7)"
+
+[cpudef]
+ name = "Westmere"
+ level = "11"
+ vendor = "GenuineIntel"
+ family = "6"
+ model = "44"
+ stepping = "1"
+ feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu mtrr clflush mca pse36"
+ feature_ecx = "sse3 cx16 ssse3 sse4.1 sse4.2 x2apic popcnt aes"
+ extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu lm syscall nx"
+ extfeature_ecx = "lahf_lm"
+ xlevel = "0x8000000A"
+ model_id = "Westmere E56xx/L56xx/X56xx (Nehalem-C)"
+
+[cpudef]
+ name = "Opteron_G1"
+ level = "5"
+ vendor = "AuthenticAMD"
+ family = "15"
+ model = "6"
+ stepping = "1"
+ feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
+ feature_ecx = "x2apic sse3" # x2apic kvm emulated
+ extfeature_edx = "lm fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu"
+ extfeature_ecx = " "
+ xlevel = "0x80000008"
+ model_id = "AMD Opteron 240 (Gen 1 Class Opteron)"
+
+[cpudef]
+ name = "Opteron_G2"
+ level = "5"
+ vendor = "AuthenticAMD"
+ family = "15"
+ model = "6"
+ stepping = "1"
+ feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
+ feature_ecx = "x2apic cx16 sse3" # x2apic kvm emulated
+ extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu"
+ extfeature_ecx = "svm lahf_lm"
+ xlevel = "0x80000008"
+ model_id = "AMD Opteron 22xx (Gen 2 Class Opteron)"
+
+[cpudef]
+ name = "Opteron_G3"
+ level = "5"
+ vendor = "AuthenticAMD"
+ family = "15"
+ model = "6"
+ stepping = "1"
+ feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
+ feature_ecx = "popcnt x2apic cx16 monitor sse3" # x2apic kvm emulated
+ extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu"
+ extfeature_ecx = "misalignsse sse4a abm svm lahf_lm"
+ xlevel = "0x80000008"
+ model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)"
+
--
1.7.2.5
Dietmar Maurer
2012-01-31 05:39:02 UTC
Permalink
Is there any reason why that can't be included into upstream?

If not, I would prefer if you sent that patch to qemu-devel for inclusion into upstream.

- Dietmar
-----Original Message-----
Sent: Montag, 30. Jänner 2012 14:10
Subject: [pve-devel] [PATCH 1/2] add target-x86_64.conf from rhel6.2
---
debian/target-x86_64.conf | 128
+++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 128 insertions(+), 0 deletions(-) create mode 100644
debian/target-x86_64.conf
diff --git a/debian/target-x86_64.conf b/debian/target-x86_64.conf new file
mode 100644 index 0000000..f4330ed
--- /dev/null
+++ b/debian/target-x86_64.conf
@@ -0,0 +1,128 @@
+# x86 CPU MODELS
+
+[cpudef]
+ name = "cpu64-rhel6"
+ level = "4"
+ vendor = "AuthenticAMD"
+ family = "6"
+ model = "13"
+ stepping = "3"
+ feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep
apic cx8 mce pae msr tsc pse de fpu"
+ feature_ecx = "cx16 sse3 x2apic"
+ extfeature_edx = "lm fxsr mmx nx pat cmov pge syscall apic cx8 mce pae msr
tsc pse de fpu"
+ extfeature_ecx = "sse4a abm svm lahf_lm"
+ xlevel = "0x8000000A"
+ model_id = "QEMU Virtual CPU version (cpu64-rhel6)"
...
Dietmar Maurer
2012-01-31 06:10:23 UTC
Permalink
Seems many of those definitions are already included? You
should generate a diff to sysconfigs/target/target-x86_64.conf

- Dietmar
-----Original Message-----
Sent: Montag, 30. Jänner 2012 14:10
Subject: [pve-devel] [PATCH 1/2] add target-x86_64.conf from rhel6.2
---
debian/target-x86_64.conf | 128
+++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 128 insertions(+), 0 deletions(-) create mode 100644
debian/target-x86_64.conf
Alexandre DERUMIER
2012-01-31 07:27:29 UTC
Permalink
Yes, they are 3 new def (westmere, cpu-rhel6,cpu-rhel5).


for other def, some flags add , flags reordering et cpufamily/model corrections.



I will send you the diff today.





----- Mail original -----

De: "Dietmar Maurer" <***@proxmox.com>
À: "Derumier Alexandre" <***@odiso.com>, pve-***@pve.proxmox.com
Envoyé: Mardi 31 Janvier 2012 07:10:23
Objet: RE: [pve-devel] [PATCH 1/2] add target-x86_64.conf from rhel6.2

Seems many of those definitions are already included? You
should generate a diff to sysconfigs/target/target-x86_64.conf

- Dietmar
-----Original Message-----
Sent: Montag, 30. JÀnner 2012 14:10
Subject: [pve-devel] [PATCH 1/2] add target-x86_64.conf from rhel6.2
---
debian/target-x86_64.conf | 128
+++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 128 insertions(+), 0 deletions(-) create mode 100644
debian/target-x86_64.conf
--
Alexandre Derumier
Ingénieur systÚme
e-mail : ***@odiso.com
Tél : +33 (0)3 20 68 88 90
Fax : +33 (0)3 20 68 90 81
45 Bvd du Général Leclerc
59100 ROUBAIX - FRANCE
Alexandre DERUMIER
2012-01-31 09:35:01 UTC
Permalink
because they submit the target-x86_64.conf change and qemu change in the same patches series,
and 1 qemu patch was rejected
RHEL6 qemu-kvm PATCH 02/11] Allow an optional qemu_early_init_vcpu()
http://lists.gnu.org/archive/html/qemu-devel/2011-06/msg00294.html

http://lists.gnu.org/archive/html/qemu-devel/2011-06/msg00360.html


But changes in target-x86_64.conf are really benefit, they really correct some bugs (like 01/11), add performance (like 03/11).

Also this is the models supported by Redhat, so I think they have really good reasons to have made change and bugfix ;)


As proxmox users don't yet use thoses cpu models, i think it could be great to have the updated version for proxmox2 release.



here a details of changes of target-x86_64.conf patches


[RHEL6 qemu-kvm PATCH 01/11] correct archaic CPU model "model" field for Intel CPUs.
The old "model" values caused two known problems:

- Skype crashes on a winxp guest if model < 6, due to syscall vs.
sysenter confusion.

- 32 bit windows doesn't enable MSI support if model < 13.

After consulting with Intel the following recommendations were
received which more accurately represent shipped silicon.
[RHEL6 qemu-kvm PATCH 07/11] cpu defs: uncomment empty extfeatures_ecx definition for Opteron_G1
This should have no visible effect, but it should just clean up the
config file a bit.

[RHEL6 qemu-kvm PATCH 03/11] Add kvm emulated x2apic flag to config defined cpu models (v2)

Add kvm emulated x2apic flag to config defined cpu models
and general support for such hypervisor emulated flags.

In addition to checking user request flags against the host
we also selectively check against kvm for emulated flags.
[RHEL6 qemu-kvm PATCH 08/11] reorder cpuid feature bits on
This makes the flag order match the bit order in the CPU. This patch just
changes the ordering on the config file, and should have no visible effect.

[RHEL6 qemu-kvm PATCH 09/11] cpu defs: add pse36, mca, mtrr
cpu model bug fixes and definition corrections

This patch was intended to address the replicated feature
flags in cpuid 8000_0001:edx from cpuid 0000_0001:edx.
This is due to AMD's definition where these flags are
mostly cloned in the 8000_0001:edx cpuid function.
qemu64 attempted to glue together the respective Intel
and AMD nearly disjoint features and this propagated to
the new Intel models as doing so was believed conservative
at the time. However after further soak and test lugging
around this cruft doesn't provide any value, could
conceivably confuse a guest, and has confused users trying
to maintain/add cpu definitions. This also caused issues
for libvirt attempting to track this mis-encoding.

So we've here tossed out the AMD replicated definitions
from the Intel models, added a few replications into AMD
definitions which were missing according to AMD's latest
CPUID document, and reordered the config file flags to
follow intuitive sequential bit ordering. Also two flag
name aliases were added for clarity to Intel models. The
end result being the models definitions now conform to
their respective cpuid specifications sans x2apic which is
emulated by kvm.

[RHEL6 qemu-kvm PATCH 10/11] add Westmere as a qemu cpu model
This patch adds Westmere as a qemu cpu model. The only
additional guest visible feature of a Westmere relative
to Nehalem is the inclusion of AES instructions. However
as other non-ABI visible modifications exist along with
fabrication changes, the CPUID data of the corresponding
deployed silicon was altered slightly to reflect this.

We've seen isolated cases where apparently unrelated yet
slightly incoherent CPUID data has caused problems, most
notably during guest boot. Providing Westmere as a
model separate fro Nehalem allows us to more easily address
such quirks.





----- Mail original -----

De: "Dietmar Maurer" <***@proxmox.com>
À: "Derumier Alexandre" <***@odiso.com>, pve-***@pve.proxmox.com
Envoyé: Mardi 31 Janvier 2012 06:39:02
Objet: RE: [pve-devel] [PATCH 1/2] add target-x86_64.conf from rhel6.2

Is there any reason why that can't be included into upstream?

If not, I would prefer if you sent that patch to qemu-devel for inclusion into upstream.

- Dietmar
-----Original Message-----
Sent: Montag, 30. JÀnner 2012 14:10
Subject: [pve-devel] [PATCH 1/2] add target-x86_64.conf from rhel6.2
---
debian/target-x86_64.conf | 128
+++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 128 insertions(+), 0 deletions(-) create mode 100644
debian/target-x86_64.conf
diff --git a/debian/target-x86_64.conf b/debian/target-x86_64.conf new file
mode 100644 index 0000000..f4330ed
--- /dev/null
+++ b/debian/target-x86_64.conf
@@ -0,0 +1,128 @@
+# x86 CPU MODELS
+
+[cpudef]
+ name = "cpu64-rhel6"
+ level = "4"
+ vendor = "AuthenticAMD"
+ family = "6"
+ model = "13"
+ stepping = "3"
+ feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep
apic cx8 mce pae msr tsc pse de fpu"
+ feature_ecx = "cx16 sse3 x2apic"
+ extfeature_edx = "lm fxsr mmx nx pat cmov pge syscall apic cx8 mce pae msr
tsc pse de fpu"
+ extfeature_ecx = "sse4a abm svm lahf_lm"
+ xlevel = "0x8000000A"
+ model_id = "QEMU Virtual CPU version (cpu64-rhel6)"
...
--
--
Alexandre Derumier
Ingénieur systÚme
e-mail : ***@odiso.com
Tél : +33 (0)3 20 68 88 90
Fax : +33 (0)3 20 68 90 81
45 Bvd du Général Leclerc
59100 ROUBAIX - FRANCE
Dietmar Maurer
2012-01-31 09:39:25 UTC
Permalink
ok, will include it if you send a diff.
-----Original Message-----
Sent: Dienstag, 31. Jänner 2012 10:35
To: Dietmar Maurer
Subject: Re: [pve-devel] [PATCH 1/2] add target-x86_64.conf from rhel6.2
because they submit the target-x86_64.conf change and qemu change in the
same patches series, and 1 qemu patch was rejected
RHEL6 qemu-kvm PATCH 02/11] Allow an optional qemu_early_init_vcpu()
http://lists.gnu.org/archive/html/qemu-devel/2011-06/msg00294.html
http://lists.gnu.org/archive/html/qemu-dev
Continue reading on narkive:
Loading...