Bug 1377913
Summary: | Libvirt should refuse to start a Skylake-Client VM on a non-Skylake CPU. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | chhu |
Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
Status: | CLOSED ERRATA | QA Contact: | Jing Qi <jinqi> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.3 | CC: | chhu, dyuan, jdenemar, lhuang, rbalakri, xuzhang, yalzhang |
Target Milestone: | rc | ||
Target Release: | 7.4 | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-2.5.0-1.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-01 17:16:43 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1199452 |
Description
chhu
2016-09-21 02:00:25 UTC
This should be fixed upstream as of commit 7ce711a30eaf882ccd0217b2528362b563b6d670 Refs: v2.2.0-199-g7ce711a Author: Jiri Denemark <jdenemar> AuthorDate: Wed Jun 22 15:53:48 2016 +0200 Commit: Jiri Denemark <jdenemar> CommitDate: Thu Sep 22 15:40:09 2016 +0200 qemu: Update guest CPU def in live XML Storing the updated CPU definition in the live domain definition saves us from having to update it over and over when we need it. Not to mention that we will soon further update the CPU definition according to QEMU once it's started. A highly wanted side effect of this patch, libvirt will pass all CPU features explicitly specified in domain XML to QEMU, even those that are already included in the host model. This patch should fix the following bugs: https://bugzilla.redhat.com/show_bug.cgi?id=1207095 https://bugzilla.redhat.com/show_bug.cgi?id=1339680 https://bugzilla.redhat.com/show_bug.cgi?id=1371039 https://bugzilla.redhat.com/show_bug.cgi?id=1373849 https://bugzilla.redhat.com/show_bug.cgi?id=1375524 https://bugzilla.redhat.com/show_bug.cgi?id=1377913 Signed-off-by: Jiri Denemark <jdenemar> Verified with version: libvirt-2.5.0-1.el7.x86_64 qemu-kvm-rhev-2.8.0-3.el7.x86_64 On a host with CPU type of "SandyBridge" and the cpu part in domain xml file is as below, the guest vm can't be started. <cpu mode='host-model'> <model fallback='allow'>Skylake-Client</model> </cpu> #virsh start rhel7 error: Failed to start domain rhel7 error: the CPU is incompatible with host CPU: Host CPU does not provide required features: fma, movbe, f16c, rdrand, fsgsbase, bmi1, hle, avx2, smep, bmi2, erms, invpcid, rtm, mpx, rdseed, adx, smap, xsavec, xgetbv1, abm, 3dnowprefetch Hi Jiri, I have a question about this bug. In libvirt.org page, it is said that for <cpu mode='host-model'> : "The match attribute can't be used in this mode. Specifying CPU model is not supported either, but model's fallback attribute may still be used." Refer to: http://libvirt.org/formatdomain.html#elementsCPU As it is described in comment 0, the guest started but with the host-model cpu(Haswell-noTSX/Broadwell/SandyBridge), not Skylake-Client which is specified in the xml. I think it is acceptable, and libvirt just need to ignore the model setting in the xml: <model>Skylake-Client</model> or <model fallback='forbid'>Skylake-Client</model> or report error to such setting such as "Specifying CPU model is not supported in <cpu mode='host-model'>" If the customer want to use Skylake-Client, he need to set like this: <cpu mode='custom'> <model>Skylake-Client</model> </cpu> Could you help to confirm? thank you very much! (In reply to yalzhang from comment #7) > As it is described in comment 0, the guest started but with the host-model > cpu(Haswell-noTSX/Broadwell/SandyBridge), not Skylake-Client which is > specified in the xml. I think it is acceptable, and libvirt just need to > ignore the model setting in the xml: > > <model>Skylake-Client</model> or <model > fallback='forbid'>Skylake-Client</model> > > or report error to such setting such as "Specifying CPU model is not > supported in <cpu mode='host-model'>" No, we need to ignore it to maintain backward compatibility. Reporting an error could break existing domains. > If the customer want to use Skylake-Client, he need to set like this: > > <cpu mode='custom'> > <model>Skylake-Client</model> > </cpu> Yes. (In reply to Jiri Denemark from comment #8) > (In reply to yalzhang from comment #7) > > As it is described in comment 0, the guest started but with the host-model > > cpu(Haswell-noTSX/Broadwell/SandyBridge), not Skylake-Client which is > > specified in the xml. I think it is acceptable, and libvirt just need to > > ignore the model setting in the xml: > > > > <model>Skylake-Client</model> or <model > > fallback='forbid'>Skylake-Client</model> > > How do you think about this proposal? As it is said in libvirt.org: "The host-model mode is essentially a shortcut to copying host CPU definition from capabilities XML into domain XML. Since the CPU definition is copied just before starting a domain, ..." and "Specifying CPU model is not supported either..." As in comment 6, libvirt check the model and fails, but in fact, the model will not be used in the running guest. So the checking just makes no sense. For PowerISA, it seems different, may be current behavior is needed for the compatibility or the document need to be modified. Please help to confirm, thank you! Refer to http://libvirt.org/formatdomain.html#elementsCPU the "host-model" part there is an example like this: <cpu mode='host-model'> <model>power7</model> </cpu> The documentation already says power is different: "PowerISA allows processors to run VMs in binary compatibility mode supporting an older version of ISA. Libvirt on PowerPC architecture uses the host-model to signify a guest mode CPU running in binary compatibility mode. Example: When a user needs a power7 VM to run in compatibility mode on a Power8 host, this can be described in XML as follows : <cpu mode='host-model'> <model>power7</model> </cpu>" Hi, Jiri, sorry for that I did not make it clear. Please help to confirm, thank you very much. As it is described in comment 0, the guest started but with the host-model cpu(Haswell-noTSX/Broadwell/SandyBridge), not Skylake-Client which is specified in the xml. In addition, As it is said in libvirt.org: "The host-model mode is essentially a shortcut to copying host CPU definition from capabilities XML into domain XML. Since the CPU definition is copied just before starting a domain, ..." and "Specifying CPU model is not supported either..." As in comment 6, libvirt check the model and fails, but in fact, the model will not be used in the running guest. So the checking just makes no sense. I think libvirt may need to only ignore the model setting in the xml(may be only for x86_64 model, not for power). Expected: When set host-model with skylake-client model like this: <cpu mode='host-model'> <model fallback='allow'>Skylake-Client</model> </cpu> libvirt ignore the model setting in inactive xml <cpu mode='host-model'/> and the guest can start with the cpu xml copy from "# virsh domcapabilites" I somehow didn't notice the bugs description was talking about <cpu mode='host-model'><model>Skylake-Client</model></cpu>. This is a valid configuration sent by old libvirt during migration (new libvirt transforms host-model into custom CPU), but it's not something users should add into the XML. Libvirt will honor the CPU model for incoming migration, but it may just ignore it when starting a fresh domain. This applies to x86_64, of course. On Power, the model in a host-model CPU will always be honored. 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 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 |