[libvirt] [PATCH] Support for cpu64-rhel* qemu cpu models

In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf --- src/cpu/cpu_map.xml | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 94 insertions(+), 0 deletions(-) diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml index 693caf1..be41253 100644 --- a/src/cpu/cpu_map.xml +++ b/src/cpu/cpu_map.xml @@ -327,6 +327,100 @@ <feature name='svm'/> </model> + <model name='cpu64-rhel5'> + <vendor name='AMD'/> + <feature name='sse2'/> + <feature name='sse'/> + <feature name='fxsr'/> + <feature name='mmx'/> + <feature name='clflush'/> + <feature name='pse36'/> + <feature name='pat'/> + <feature name='cmov'/> + <feature name='mca'/> + <feature name='pge'/> + <feature name='mtrr'/> + <feature name='sep'/> + <feature name='apic'/> + <feature name='cx8'/> + <feature name='mce'/> + <feature name='pae'/> + <feature name='msr'/> + <feature name='tsc'/> + <feature name='pse'/> + <feature name='de'/> + <feature name='fpu'/> + <feature name='sse3'/> + <feature name='3dnow'/> + <feature name='3dnowext'/> + <feature name='lm'/> + <feature name='fxsr'/> + <feature name='mmx'/> + <feature name='nx'/> + <feature name='pat'/> + <feature name='cmov'/> + <feature name='pge'/> + <feature name='syscall'/> + <feature name='apic'/> + <feature name='cx8'/> + <feature name='mce'/> + <feature name='pae'/> + <feature name='msr'/> + <feature name='tsc'/> + <feature name='pse'/> + <feature name='de'/> + <feature name='fpu'/> + <feature name='svm'/> + </model> + + <model name='cpu64-rhel6'> + <vendor name='AMD'/> + <feature name='sse2'/> + <feature name='sse'/> + <feature name='fxsr'/> + <feature name='mmx'/> + <feature name='clflush'/> + <feature name='pse36'/> + <feature name='pat'/> + <feature name='cmov'/> + <feature name='mca'/> + <feature name='pge'/> + <feature name='mtrr'/> + <feature name='sep'/> + <feature name='apic'/> + <feature name='cx8'/> + <feature name='mce'/> + <feature name='pae'/> + <feature name='msr'/> + <feature name='tsc'/> + <feature name='pse'/> + <feature name='de'/> + <feature name='fpu'/> + <feature name='cx16'/> + <feature name='sse3'/> + <feature name='lm'/> + <feature name='fxsr'/> + <feature name='mmx'/> + <feature name='nx'/> + <feature name='pat'/> + <feature name='cmov'/> + <feature name='pge'/> + <feature name='syscall'/> + <feature name='apic'/> + <feature name='cx8'/> + <feature name='mce'/> + <feature name='pae'/> + <feature name='msr'/> + <feature name='tsc'/> + <feature name='pse'/> + <feature name='de'/> + <feature name='fpu'/> + <feature name='sse4a'/> + <feature name='abm'/> + <feature name='svm'/> + <feature name='lahf_lm'/> + </model> + <model name='core2duo'> <model name='pentiumpro'/> <feature name='mtrr'/> -- 1.7.3.4

In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf --- v2: - removed duplicated entries src/cpu/cpu_map.xml | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-) diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml index 693caf1..638a587 100644 --- a/src/cpu/cpu_map.xml +++ b/src/cpu/cpu_map.xml @@ -327,6 +327,72 @@ <feature name='svm'/> </model> + <model name='cpu64-rhel5'> + <vendor name='AMD'/> + <feature name='3dnow'/> + <feature name='3dnowext'/> + <feature name='apic'/> + <feature name='clflush'/> + <feature name='cmov'/> + <feature name='cx8'/> + <feature name='de'/> + <feature name='fpu'/> + <feature name='fxsr'/> + <feature name='lm'/> + <feature name='mca'/> + <feature name='mce'/> + <feature name='mmx'/> + <feature name='msr'/> + <feature name='mtrr'/> + <feature name='nx'/> + <feature name='pae'/> + <feature name='pat'/> + <feature name='pge'/> + <feature name='pse'/> + <feature name='pse36'/> + <feature name='sep'/> + <feature name='sse'/> + <feature name='sse2'/> + <feature name='sse3'/> + <feature name='svm'/> + <feature name='syscall'/> + <feature name='tsc'/> + </model> + + <model name='cpu64-rhel6'> + <vendor name='AMD'/> + <feature name='abm'/> + <feature name='apic'/> + <feature name='clflush'/> + <feature name='cmov'/> + <feature name='cx16'/> + <feature name='cx8'/> + <feature name='de'/> + <feature name='fpu'/> + <feature name='fxsr'/> + <feature name='lahf_lm'/> + <feature name='lm'/> + <feature name='mca'/> + <feature name='mce'/> + <feature name='mmx'/> + <feature name='msr'/> + <feature name='mtrr'/> + <feature name='nx'/> + <feature name='pae'/> + <feature name='pat'/> + <feature name='pge'/> + <feature name='pse'/> + <feature name='pse36'/> + <feature name='sep'/> + <feature name='sse'/> + <feature name='sse2'/> + <feature name='sse3'/> + <feature name='sse4a'/> + <feature name='svm'/> + <feature name='syscall'/> + <feature name='tsc'/> + </model> + <model name='core2duo'> <model name='pentiumpro'/> <feature name='mtrr'/> -- 1.7.3.4

In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf --- v3: - fixed sse3 naming (it's 'pni' in the features) v2: - removed duplicated entries src/cpu/cpu_map.xml | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-) diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml index 693caf1..8c9da42 100644 --- a/src/cpu/cpu_map.xml +++ b/src/cpu/cpu_map.xml @@ -327,6 +327,72 @@ <feature name='svm'/> </model> + <model name='cpu64-rhel5'> + <vendor name='AMD'/> + <feature name='3dnow'/> + <feature name='3dnowext'/> + <feature name='apic'/> + <feature name='clflush'/> + <feature name='cmov'/> + <feature name='cx8'/> + <feature name='de'/> + <feature name='fpu'/> + <feature name='fxsr'/> + <feature name='lm'/> + <feature name='mca'/> + <feature name='mce'/> + <feature name='mmx'/> + <feature name='msr'/> + <feature name='mtrr'/> + <feature name='nx'/> + <feature name='pae'/> + <feature name='pat'/> + <feature name='pge'/> + <feature name='pse'/> + <feature name='pse36'/> + <feature name='sep'/> + <feature name='sse'/> + <feature name='sse2'/> + <feature name='pni'/> + <feature name='svm'/> + <feature name='syscall'/> + <feature name='tsc'/> + </model> + + <model name='cpu64-rhel6'> + <vendor name='AMD'/> + <feature name='abm'/> + <feature name='apic'/> + <feature name='clflush'/> + <feature name='cmov'/> + <feature name='cx16'/> + <feature name='cx8'/> + <feature name='de'/> + <feature name='fpu'/> + <feature name='fxsr'/> + <feature name='lahf_lm'/> + <feature name='lm'/> + <feature name='mca'/> + <feature name='mce'/> + <feature name='mmx'/> + <feature name='msr'/> + <feature name='mtrr'/> + <feature name='nx'/> + <feature name='pae'/> + <feature name='pat'/> + <feature name='pge'/> + <feature name='pse'/> + <feature name='pse36'/> + <feature name='sep'/> + <feature name='sse'/> + <feature name='sse2'/> + <feature name='pni'/> + <feature name='sse4a'/> + <feature name='svm'/> + <feature name='syscall'/> + <feature name='tsc'/> + </model> + <model name='core2duo'> <model name='pentiumpro'/> <feature name='mtrr'/> -- 1.7.3.4

On 01/30/2012 05:25 PM, Martin Kletzander wrote:
In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf
Bump up, could somebody please have a look at this? I'm waiting with one bug for this patch, thanks. Martin

On 01/30/2012 09:25 AM, Martin Kletzander wrote:
In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf --- v3: - fixed sse3 naming (it's 'pni' in the features)
v2: - removed duplicated entries
src/cpu/cpu_map.xml | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-)
I'm assuming that you tested this (I did not spend the time meticulously cross-checking qemu with this list). Upstream qemu does not provide these machine names; they are RHEL-specific. Is it going to be an issue where we use libvirt on something like F16 where qemu does not have these machine names? Or is it okay for libvirt to have a larger list of machine names, to make out-of-box installation of newer libvirt onto older RHEL/CentOS machines just work with those new names? I guess what I'm really asking is: Should this be a RHEL-specific patch for just the RHEL version of libvirt, rather than upstream? If we can get that answered, the patch itself looks reasonable, but I'm hesitant to ack without an answer. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Feb 10, 2012 at 11:22:09 -0700, Eric Blake wrote:
On 01/30/2012 09:25 AM, Martin Kletzander wrote:
In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf --- v3: - fixed sse3 naming (it's 'pni' in the features)
v2: - removed duplicated entries
src/cpu/cpu_map.xml | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-)
I'm assuming that you tested this (I did not spend the time meticulously cross-checking qemu with this list). Upstream qemu does not provide these machine names; they are RHEL-specific.
Is it going to be an issue where we use libvirt on something like F16 where qemu does not have these machine names? Or is it okay for libvirt to have a larger list of machine names, to make out-of-box installation of newer libvirt onto older RHEL/CentOS machines just work with those new names?
It was designed to be okay. Libvirt checks what CPU models are supported by qemu and avoids passing unsupported models to qemu. After all, we support running libvirt with older releases of qemu (we don't force their git HEAD).
Should this be a RHEL-specific patch for just the RHEL version of libvirt, rather than upstream?
I think having this patch in is better than the opposite :-) Allowing RHEL/CentOS users to install newer libvirt without losing functionality is nice and we already did so in the past: commit ff88cd590572277f10ecee4ebb1174d9b70fc0d7 Author: Eric Blake <eblake@redhat.com> Date: Wed Jan 25 21:33:21 2012 -0700 qemu: support qmp on RHEL/CentOS qemu Jirka

On 02/13/2012 07:32 AM, Jiri Denemark wrote:
On Fri, Feb 10, 2012 at 11:22:09 -0700, Eric Blake wrote:
On 01/30/2012 09:25 AM, Martin Kletzander wrote:
In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf
Is it going to be an issue where we use libvirt on something like F16 where qemu does not have these machine names? Or is it okay for libvirt to have a larger list of machine names, to make out-of-box installation of newer libvirt onto older RHEL/CentOS machines just work with those new names?
It was designed to be okay. Libvirt checks what CPU models are supported by qemu and avoids passing unsupported models to qemu. After all, we support running libvirt with older releases of qemu (we don't force their git HEAD).
True enough.
Should this be a RHEL-specific patch for just the RHEL version of libvirt, rather than upstream?
I think having this patch in is better than the opposite :-) Allowing RHEL/CentOS users to install newer libvirt without losing functionality is nice and we already did so in the past:
commit ff88cd590572277f10ecee4ebb1174d9b70fc0d7 Author: Eric Blake <eblake@redhat.com> Date: Wed Jan 25 21:33:21 2012 -0700
qemu: support qmp on RHEL/CentOS qemu
Sure, use my own patch against me to make your point :) All right, I think we're in agreement: ACK to applying this one. Even though the machine names are specific only to the RHEL port of qemu, it is a common enough user base that it is worth supporting in out-of-the-box libvirt installs, rather than relegating this patch to only the RHEL backport of libvirt. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Mon, Feb 13, 2012 at 03:32:26PM +0100, Jiri Denemark wrote:
On Fri, Feb 10, 2012 at 11:22:09 -0700, Eric Blake wrote:
On 01/30/2012 09:25 AM, Martin Kletzander wrote:
In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf --- v3: - fixed sse3 naming (it's 'pni' in the features)
v2: - removed duplicated entries
src/cpu/cpu_map.xml | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-)
I'm assuming that you tested this (I did not spend the time meticulously cross-checking qemu with this list). Upstream qemu does not provide these machine names; they are RHEL-specific.
Is it going to be an issue where we use libvirt on something like F16 where qemu does not have these machine names? Or is it okay for libvirt to have a larger list of machine names, to make out-of-box installation of newer libvirt onto older RHEL/CentOS machines just work with those new names?
It was designed to be okay. Libvirt checks what CPU models are supported by qemu and avoids passing unsupported models to qemu. After all, we support running libvirt with older releases of qemu (we don't force their git HEAD).
One day we should just stop using '-cpu', and simply write out a config file where we can put a full '[cpudef]' definition, and pass it to QEMU using -loadconfig. This will allow us to specify precise CPU models, without being tied to particular QEMU versions. It will also allow the end user / mgmt app to define new CPU models for libvirt to use. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Tue, Feb 21, 2012 at 14:54:39 +0000, Daniel P. Berrange wrote:
On Mon, Feb 13, 2012 at 03:32:26PM +0100, Jiri Denemark wrote:
It was designed to be okay. Libvirt checks what CPU models are supported by qemu and avoids passing unsupported models to qemu. After all, we support running libvirt with older releases of qemu (we don't force their git HEAD).
One day we should just stop using '-cpu', and simply write out a config file where we can put a full '[cpudef]' definition, and pass it to QEMU using -loadconfig. This will allow us to specify precise CPU models, without being tied to particular QEMU versions. It will also allow the end user / mgmt app to define new CPU models for libvirt to use.
Although, as someone already mentioned on this list, it's not so easy. Not every combination we/user/mgmt come up with may actually be supported, especially when migration comes into play. I guess we would need qemu to verify the model we want to use is sane/supported. Jirka

On Mon, Jan 30, 2012 at 17:25:19 +0100, Martin Kletzander wrote:
In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf
Hmm, I didn't actually look at the model definitions until now... I haven't checked them with qemu sources, but the definitions look weird.
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml index 693caf1..8c9da42 100644 --- a/src/cpu/cpu_map.xml +++ b/src/cpu/cpu_map.xml @@ -327,6 +327,72 @@ <feature name='svm'/> </model>
+ <model name='cpu64-rhel5'> + <vendor name='AMD'/> + <feature name='3dnow'/> + <feature name='3dnowext'/> ... + <feature name='svm'/> ... + </model>
Why are these virtual models marked as made by AMD and why do they contain those AMD-only features? The vendor is probably not a big deal, libvirt will just avoid using these models for describing a host CPU which is not made by AMD. However, the AMD-only features make these models incompatible with any Intel CPU. Thus the following guest CPU element <cpu match='exact'> <model>cpu64-rhel?</model> <feature name='3dnow' policy='disable'/> <feature name='3dnowext' policy='disable'/> <feature name='svm' policy='disable'/> </cpu> will be needed to use this model on Intel host. Are these features in fact emulated by qemu even if host CPU doesn't support them? Jirka

In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf The only difference is that AMD-specific features are removed so the processor type is not vendor-specific. --- v4: - removed AMD-specific features (3dnow, 3dnowext, svm) v3: - fixed sse3 naming (it's 'pni' in the features) v2: - removed duplicated entries src/cpu/cpu_map.xml | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 60 insertions(+), 0 deletions(-) diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml index 2053f96..da3db02 100644 --- a/src/cpu/cpu_map.xml +++ b/src/cpu/cpu_map.xml @@ -309,6 +309,66 @@ <feature name='pni'/> </model> + <model name='cpu64-rhel5'> + <feature name='apic'/> + <feature name='clflush'/> + <feature name='cmov'/> + <feature name='cx8'/> + <feature name='de'/> + <feature name='fpu'/> + <feature name='fxsr'/> + <feature name='lm'/> + <feature name='mca'/> + <feature name='mce'/> + <feature name='mmx'/> + <feature name='msr'/> + <feature name='mtrr'/> + <feature name='nx'/> + <feature name='pae'/> + <feature name='pat'/> + <feature name='pge'/> + <feature name='pse'/> + <feature name='pse36'/> + <feature name='sep'/> + <feature name='sse'/> + <feature name='sse2'/> + <feature name='pni'/> + <feature name='syscall'/> + <feature name='tsc'/> + </model> + + <model name='cpu64-rhel6'> + <feature name='abm'/> + <feature name='apic'/> + <feature name='clflush'/> + <feature name='cmov'/> + <feature name='cx16'/> + <feature name='cx8'/> + <feature name='de'/> + <feature name='fpu'/> + <feature name='fxsr'/> + <feature name='lahf_lm'/> + <feature name='lm'/> + <feature name='mca'/> + <feature name='mce'/> + <feature name='mmx'/> + <feature name='msr'/> + <feature name='mtrr'/> + <feature name='nx'/> + <feature name='pae'/> + <feature name='pat'/> + <feature name='pge'/> + <feature name='pse'/> + <feature name='pse36'/> + <feature name='sep'/> + <feature name='sse'/> + <feature name='sse2'/> + <feature name='pni'/> + <feature name='sse4a'/> + <feature name='syscall'/> + <feature name='tsc'/> + </model> + <model name='kvm32'> <model name='pentiumpro'/> <feature name='mtrr'/> -- 1.7.3.4

On Fri, Feb 24, 2012 at 10:44:19 +0100, Martin Kletzander wrote:
In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not supported by libvirt. This patch adds the support with the flags specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf The only difference is that AMD-specific features are removed so the processor type is not vendor-specific. --- v4: - removed AMD-specific features (3dnow, 3dnowext, svm)
ACK and pushed. Jirka
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Jiri Denemark
-
Martin Kletzander