Bug 761005 - libvirt [RFE] Add support for new sandy bridge cpu
libvirt [RFE] Add support for new sandy bridge cpu
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
Unspecified Unspecified
high Severity medium
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
: FutureFeature
Depends On: 760953
Blocks: 760952 761015 773650 773651 773677 773696
  Show dependency treegraph
 
Reported: 2011-12-07 09:58 EST by Andrew Cathrow
Modified: 2014-09-07 18:54 EDT (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-6.el6
Doc Type: Enhancement
Doc Text:
In Red Hat Enterprise Linux 6.3, libvirt has been updated to add support for the latest Intel processors and new features these processors include.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:38:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andrew Cathrow 2011-12-07 09:58:53 EST
qemu-kvm is adding support for the new sandy bridge cpu, including features such as TSC Deadline timer, XSAVE/XRSTOR, etc

libvirt would need to add a new CPU type
Comment 2 Peter Krempa 2011-12-09 07:24:56 EST
Upstream commit:

commit b2cb24f48ba568659e47da26078974ab78161df9
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Dec 8 15:11:52 2011 +0100

    cpu: Add cpu flags supported by newest qemu
    
    Add support for newly supported Intel cpu features. Newly supported
    flags are: pclmuldq, dtes64, smx, fma, pdcm, movbe, xsave, osxsave and
    avx. This adds support for Intel's Sandy Bridge platform.


adds support for feature flags added newly to qemu. QEmu does not yet expose a Sandy Bridge model, so libvirt does not add it yet either.
Comment 4 min zhan 2012-01-10 22:40:47 EST
Test with libvirt-0.9.9-1.el6.x86_64 using intel-e31225-8-1:

# virsh capabilities
<capabilities>

  <host>
    <uuid>322008c7-3452-0943-3c7a-09732431099f</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Westmere</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='4' threads='1'/>
      <feature name='rdtscp'/>
      <feature name='avx'/>
      <feature name='osxsave'/>
      <feature name='xsave'/>
      <feature name='x2apic'/>
      <feature name='pdcm'/>
      <feature name='xtpr'/>
      <feature name='tm2'/>
      <feature name='est'/>
      <feature name='smx'/>
      <feature name='vmx'/>
      <feature name='ds_cpl'/>
      <feature name='dtes64'/>
      <feature name='pclmuldq'/>
      <feature name='pbe'/>
      <feature name='tm'/>
      <feature name='ht'/>
      <feature name='ss'/>
      <feature name='acpi'/>
      <feature name='ds'/>
      <feature name='vme'/>
    </cpu>
....

We can see these new flags: pclmuldq, dtes64, smx, pdcm, xsave, osxsave, avx.

Since QEMU does not yet expose a Sandy Bridge model, so will verify this bug again after bug 760953[Assigned] verified.
Comment 5 min zhan 2012-01-11 01:17:47 EST
(In reply to comment #4)

# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.213.el6.x86_64
# rpm -q kernel
kernel-2.6.32-220.el6.x86_64
Comment 6 Peter Krempa 2012-01-16 11:34:38 EST
I'm setting this bug to ASSIGNED as we should also add the model to the XML. We need to do some research on the minimum set of flags to be supported by the Sandy bridge cpu.
Comment 7 Peter Krempa 2012-02-06 07:58:10 EST
The upstream support for Sandy Bridge should be ready soon (patches are submitted). The fix in libvirt will be trivial after qemu will support the new model.
Comment 8 Dave Allan 2012-02-06 11:01:29 EST
(In reply to comment #7)
> The upstream support for Sandy Bridge should be ready soon (patches are
> submitted). The fix in libvirt will be trivial after qemu will support the new
> model.

Upstream qemu or libvirt or both?
Comment 10 Dave Allan 2012-02-16 09:41:18 EST
I removed the Failed QA flag as this BZ has not yet been implemented in qemu and should not have been tested.
Comment 15 min zhan 2012-03-19 05:33:54 EDT
Tested with libvirt-0.9.10-6.el6 in the same machine of Comment 4:

Pkgs:
libvirt-0.9.10-6.el6
qemu-kvm-0.12.1.2-2.248.el6
# uname -r
2.6.32-244.el6.x86_64

# virsh capabilities
<capabilities>

  <host>
    <uuid>322008c7-3452-0943-3c7a-09732431099f</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>SandyBridge</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='4' threads='1'/>
      <feature name='osxsave'/>
      <feature name='tsc-deadline'/>
      <feature name='pdcm'/>
      <feature name='xtpr'/>
      <feature name='tm2'/>
      <feature name='est'/>
      <feature name='smx'/>
      <feature name='vmx'/>
      <feature name='ds_cpl'/>
      <feature name='dtes64'/>
      <feature name='pbe'/>
      <feature name='tm'/>
      <feature name='ht'/>
      <feature name='ss'/>
      <feature name='acpi'/>
      <feature name='ds'/>
      <feature name='vme'/>
    </cpu>

The model is SandyBridge, but the flags are missing some, like avx, xsave, pclmuldq. Is it expected?
Comment 16 Peter Krempa 2012-03-19 10:08:53 EDT
Those features that are shown by the capabilities command are extra features that are supported by the host CPU (and inquired by the CPUID instruction) and not defined in the SandyBridge model definition.

The SandyBride model in qemu that is present in rhel6.3 is defined as:

[cpudef]
   name = "SandyBridge"
   level = "0xd"
   vendor = "GenuineIntel"
   family = "6"
   model = "42"
   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 = "avx xsave aes popcnt x2apic sse4.2 sse4.1 cx16 ssse3 pclmulqdq sse3"
   extfeature_edx = "i64 rdtscp nx syscall "
   extfeature_ecx = "lahf_lm"
   xlevel = "0x8000000A"
   model_id = "Intel Xeon E312xx (Sandy Bridge)"

(note that libvirt uses other names for some flags).
Comment 17 Eduardo Habkost 2012-03-19 13:46:13 EDT
The SandyBridge CPU model on qemu-kvm will be updated due to bug 767944 (TSC-deadline feature), so libvirt will have to be updated as well.

Is it better to reopen this bug so the model can be fixed after qemu-kvm changes, or open a new bug for libvirt?
Comment 18 Peter Krempa 2012-03-19 14:03:38 EDT
After discussing with Dave, please open a new bug. We will need to revert a RHEL-specific patch that disabled the tsc-deadline feature in SandyBridge that was backported completly from upstream.
Comment 19 min zhan 2012-03-20 02:09:24 EDT
Check SandyBridge definition in /usr/share/libvirt/cpu_map.xml, it has the flags such as pclmuldq, avx, xsave:

<model name='SandyBridge'>
      <vendor name='Intel'/>
      <feature name='aes'/>
      <feature name='apic'/>
      <feature name='avx'/>
      <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='pclmuldq'/>
      <feature name='pge'/>
      <feature name='pni'/>
      <feature name='popcnt'/>
      <feature name='pse'/>
      <feature name='pse36'/>
      <feature name='rdtscp'/>
      <feature name='sep'/>
      <feature name='sse'/>
      <feature name='sse2'/>
      <feature name='sse4.1'/>
      <feature name='sse4.2'/>
      <feature name='ssse3'/>
      <feature name='syscall'/>
      <feature name='tsc'/>
      <feature name='x2apic'/>
      <feature name='xsave'/>
    </model>

Together with comment 15 and comment 16, move this bug to verified.
Comment 20 Peter Krempa 2012-05-02 08:41:06 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Libvirt now supports features provided by the most recent Intel processors.
Comment 21 Martin Prpic 2012-05-09 05:39:39 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Libvirt now supports features provided by the most recent Intel processors.+In Red Hat Enterprise Linux 6.3, libvirt has been updated to add support for the latest Intel processors and new features these processors include.
Comment 23 errata-xmlrpc 2012-06-20 02:38:04 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0748.html

Note You need to log in before you can comment on or make changes to this bug.