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 1532980 - guest shutoff after upgrade from 7.3 to 7.5 on skylake host
Summary: guest shutoff after upgrade from 7.3 to 7.5 on skylake host
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.5
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Luyao Huang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-10 07:20 UTC by Luyao Huang
Modified: 2018-04-10 11:05 UTC (History)
7 users (show)

Fixed In Version: libvirt-3.9.0-8.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 11:04:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0704 0 None None None 2018-04-10 11:05:38 UTC

Description Luyao Huang 2018-01-10 07:20:19 UTC
Description of problem:
guest shutoff after upgrade from 7.3 to 7.5 on skylake host

Version-Release number of selected component (if applicable):
7.3:
libvirt-2.0.0-10.el7_3.10.x86_64
qemu-img-rhev-2.6.0-28.el7_3.15.x86_64

7.5:
qemu-kvm-rhev-2.10.0-15.el7.x86_64
libvirt-3.9.0-7.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start a guest with host-model cpu on 7.3

  <cpu mode='host-model' check='partial'>
    <model fallback='forbid'/>
    <numa>
      <cell id='0' cpus='0-3' memory='512000' unit='KiB'/>
      <cell id='1' cpus='4-7' memory='512000' unit='KiB'/>
      <cell id='2' cpus='8-11' memory='512000' unit='KiB'/>
      <cell id='3' cpus='12-15' memory='512000' unit='KiB'/>
    </numa>
  </cpu>


2. and check qemu command line:

 -cpu Skylake-Client-IBRS,+ds,+acpi,+ss,+ht,+tm,+pbe,+dtes64,+monitor,+ds_cpl,+vmx,+smx,+est,+tm2,+xtpr,+pdcm,+dca,+osxsave,+tsc_adjust,+avx512f,+clflushopt,+avx512cd,+stibp,+pdpe1gb

3. upgrade libvirt and qemu to 7.5:

4. recheck guest status

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     vm1                            shut off
 -     vm2                            shut off

5. check log and libvirtd shut down the vm:

2018-01-10 06:58:51.369+0000: 21017: error : virCPUTranslate:911 : unsupported configuration: CPU model Skylake-Server is not supported by hypervisor
...
2018-01-10 06:58:51.369+0000: 21017: debug : qemuProcessStop:6337 : Shutting down vm=0x7f8b942d7e30 name=vm1 id=1 pid=20765, reason=crashed, asyncJob=none, flags=0x0


Actual results:

guest shut down after upgrade

Expected results:

guest still running

Additional info:

Comment 4 Jiri Denemark 2018-01-11 09:00:08 UTC
The problem is in the fallback attribute:

  <cpu mode='host-model' check='partial'>
    <model fallback='forbid'/>
  </cpu>

when libvirtd reconnects to a domain with such CPU configuration started by old libvirt, the host-model CPU gets replaced with a custom one (the one found in host capabilities), but the fallback attribute remains 'forbid'. If libvirtd detects the host CPU as a model which is too new to be supported by the already running QEMU, we need to translate it to a supported model. But this is impossible if fallback == 'forbid'. So the translation fails, reconnecting to the domains fails, and the domain gets killed by libvirtd.

We need to reset the fallback attribute to 'allow' when replacing host-model with the CPU model from host capabilities as such CPU is not (by design) tailored to any specific QEMU binary and it is expected to be translated when being passed to QEMU.

Comment 5 Jiri Denemark 2018-01-12 10:23:11 UTC
This is now fixed upstream by

commit 237f045d9a9d84a52e645b490d14ad0b66e5b8ed
Refs: v3.10.0-182-g237f045d9a
Author:     Jiri Denemark <jdenemar>
AuthorDate: Wed Jan 10 15:56:21 2018 +0100
Commit:     Jiri Denemark <jdenemar>
CommitDate: Fri Jan 12 10:45:31 2018 +0100

    qemu: Ignore fallback CPU attribute on reconnect

    When reconnecting to a running domain with host-model CPU started by old
    libvirt which did not store the actual CPU in the status XML, we need to
    ignore the fallback attribute to make sure we can translate the detected
    host CPU model to a model which is supported by the running QEMU.

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

    Signed-off-by: Jiri Denemark <jdenemar>
    Reviewed-by: Pavel Hrdina <phrdina>

Comment 8 Luyao Huang 2018-01-22 08:42:55 UTC
Verify this bug on libvirt-3.9.0-8.el7.x86_64:

1. guest xml on 7.3:

  <cpu mode='host-model'>
    <model fallback='forbid'/>
    <numa>
      <cell id='0' cpus='0-1' memory='512000' unit='KiB'/>
      <cell id='1' cpus='2-3' memory='512000' unit='KiB'/>
    </numa>
  </cpu>

2. start guest:

# virsh start vm1
Domain vm1 started

3. update libvirt and qemu to 7.5:

4. check guest status:

# virsh list
 Id    Name                           State
----------------------------------------------------
 1     vm1                            running

5. check guest xml

# virsh dumpxml vm1

  <cpu mode='custom' match='exact' check='full'>
    <model fallback='allow'>Skylake-Client-IBRS</model>
    <vendor>Intel</vendor>

Comment 12 errata-xmlrpc 2018-04-10 11:04:21 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-2018:0704


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