RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1444421 - Fail to start a domain which cpu part is generated by "cpu-baseline"
Summary: Fail to start a domain which cpu part is generated by "cpu-baseline"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Jing Qi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-21 10:06 UTC by Yanqiu Zhang
Modified: 2017-08-02 01:32 UTC (History)
19 users (show)

Fixed In Version: libvirt-3.2.0-4.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-02 00:08:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description Yanqiu Zhang 2017-04-21 10:06:57 UTC
Description of problem:
Fail to start a domain which cpu part is generated by "cpu-baseline"

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.9.0-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1.prepare 2 hosts both have intel cpu
hostA: # virsh capabilities
<capabilities>
  <host>
    <uuid>4c4c4544-0038-3710-8048-c6c04f353358</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Nehalem</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='4' threads='2'/>
      <feature name='vme'/>
      <feature name='ds'/>
      <feature name='acpi'/>
      <feature name='ss'/>
      <feature name='ht'/>
      <feature name='tm'/>
      <feature name='pbe'/>
      <feature name='dtes64'/>
      <feature name='monitor'/>
      <feature name='ds_cpl'/>
      <feature name='vmx'/>
      <feature name='est'/>
      <feature name='tm2'/>
      <feature name='xtpr'/>
      <feature name='pdcm'/>
      <feature name='dca'/>
      <feature name='rdtscp'/>
      <feature name='invtsc'/>
      <pages unit='KiB' size='4'/>
      <pages unit='KiB' size='2048'/>
    </cpu>
...
hostB:# virsh capabilities
<capabilities>
  <host>
    <uuid>44454c4c-4d00-1046-8053-b8c04f563258</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Penryn</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='4' threads='1'/>
      <feature name='vme'/>
      <feature name='ds'/>
      <feature name='acpi'/>
      <feature name='ss'/>
      <feature name='ht'/>
      <feature name='tm'/>
      <feature name='pbe'/>
      <feature name='dtes64'/>
      <feature name='monitor'/>
      <feature name='ds_cpl'/>
      <feature name='vmx'/>
      <feature name='smx'/>
      <feature name='est'/>
      <feature name='tm2'/>
      <feature name='xtpr'/>
      <feature name='pdcm'/>
      <feature name='xsave'/>
      <feature name='osxsave'/>
      <pages unit='KiB' size='4'/>
      <pages unit='KiB' size='2048'/>
    </cpu>
...
2.define a domain on hostB
[root@hostB ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     V                              shut off

3.generate cpu elements for migration
copy the outputed cpu part of two hosts in step1 to a file "base2hostB.xml", then
#  virsh cpu-baseline base2hostB.xml
<cpu mode='custom' match='exact'>
  <model fallback='allow'>Penryn</model>
  <vendor>Intel</vendor>
  <feature policy='require' name='vme'/>
  <feature policy='require' name='ds'/>
  <feature policy='require' name='acpi'/>
  <feature policy='require' name='ss'/>
  <feature policy='require' name='ht'/>
  <feature policy='require' name='tm'/>
  <feature policy='require' name='pbe'/>
  <feature policy='require' name='dtes64'/>
  <feature policy='require' name='monitor'/>
  <feature policy='require' name='ds_cpl'/>
  <feature policy='require' name='vmx'/>
  <feature policy='require' name='est'/>
  <feature policy='require' name='tm2'/>
  <feature policy='require' name='xtpr'/>
  <feature policy='require' name='pdcm'/>
</cpu>

4. copy the output in step3 to replace the cpu part in domain xml, and try to start the domain
[root@hostB ~]# virsh start V
error: Failed to start domain V
error: the CPU is incompatible with host CPU: Host CPU does not provide required features: ds, acpi, ht, tm, pbe, dtes64, monitor, ds_cpl, vmx, est, tm2, xtpr, pdcm

Actual results:
As in step4, fail to start a domain which cpu part is generated by "cpu-baseline"

Expected results:
Should succeed to start a domain which cpu part is generated by "cpu-baseline"
 
Additional info:
works well with qemu-kvm-rhev-2.8.0-6.el7.x86_64

Comment 3 Eduardo Habkost 2017-04-25 14:23:49 UTC
All the features mentioned in the error message (ds, acpi, ht, tm, pbe, dtes64, monitor, ds_cpl, vmx, est, tm2, xtpr, pdcm) can't be enabled in a VCPU, so they are correctly being reported as unsupported.

But I am not sure if this should be considered a real libvirt bug (that shouldn't report the features on virsh capabilities), or if this is invalid usage (is "virsh capabilities" output meant to report every feature in the host CPU, or only the ones that can be virtualized by KVM?). Moving to libvirt and reassigning to Jiri.

Comment 4 Jiri Denemark 2017-05-02 12:14:03 UTC
This should already be fixed upstream by

commit 5b4a6adb5ca24a6cb91cdc55c31506fb278d3a91
Refs: v3.2.0-197-g5b4a6adb5
Author:     Jiri Denemark <jdenemar>
AuthorDate: Tue Apr 11 20:46:05 2017 +0200
Commit:     Jiri Denemark <jdenemar>
CommitDate: Wed Apr 19 16:36:38 2017 +0200

    qemu: Use more data for comparing CPUs

    With QEMU older than 2.9.0 libvirt uses CPUID instruction to determine
    what CPU features are supported on the host. This was later used when
    checking compatibility of guest CPUs. Since QEMU 2.9.0 we ask QEMU for
    the host CPU data. But the two methods we use usually provide disjoint
    sets of CPU features because QEMU/KVM does not support all features
    provided by the host CPU and on the other hand it can enable some
    feature even if the host CPU does not support them.

    So if there is a domain which requires a CPU features disabled by
    QEMU/KVM, libvirt will refuse to start it with QEMU > 2.9.0 as its guest
    CPU is incompatible with the host CPU data we got from QEMU. But such
    domain would happily start on older QEMU (of course, the features would
    be missing the guest CPU). To fix this regression, we need to combine
    both CPU feature sets when checking guest CPU compatibility.

    https://bugzilla.redhat.com/show_bug.cgi?id=1439933

    Signed-off-by: Jiri Denemark <jdenemar>

Comment 7 Jing Qi 2017-05-17 02:58:19 UTC
Verified this bug with libvirt-libs-3.2.0-4.el7.x86_64 and qemu-kvm-rhev-2.9.0-5.el7.x86_64. The issue in the bug  is fixed.

And there is a new bug found : 1450317 -"cpu-baseline" command doesn't deal with "cmt" feature.

Comment 8 errata-xmlrpc 2017-08-02 00:08:25 UTC
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.

https://access.redhat.com/errata/RHEA-2017:1846

Comment 9 errata-xmlrpc 2017-08-02 01:32:35 UTC
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.

https://access.redhat.com/errata/RHEA-2017:1846


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