Bug 1829729 - Guest can not start with eoi attribute ('on' or 'off') in apic element
Summary: Guest can not start with eoi attribute ('on' or 'off') in apic element
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.2
Hardware: ppc64le
OS: Linux
low
low
Target Milestone: rc
: 8.2
Assignee: Daniel Henrique Barboza (IBM)
QA Contact: Dan Zheng
URL:
Whiteboard:
Depends On: 1236440
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-30 08:11 UTC by Jiri Denemark
Modified: 2020-07-28 07:13 UTC (History)
13 users (show)

Fixed In Version: libvirt-6.0.0-18.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1236440
Environment:
Last Closed: 2020-07-28 07:12:15 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:3172 0 None None None 2020-07-28 07:13:08 UTC

Description Jiri Denemark 2020-04-30 08:11:13 UTC
+++ This bug was initially created as a clone of Bug #1236440 +++

Version-Release number of selected component (if applicable):
libvirt-1.2.16-1.el7.ppc64le
qemu-kvm-rhev-2.3.0-5.el7.ppc64le
kernel-3.10.0-282.el7.ppc64le


How reproducible:
100%

Steps to Reproduce:
1. Edit XML with eoi='on':
<domain type='kvm' id='7'>
......
<features>
  <acpi/>
  <apic eoi='on'/>
  <pae/>
</features>
<cpu mode='host-model'>
  <model fallback='allow'/>
  <topology sockets='1' cores='5' threads='1'/>
</cpu>

......
</domain>

2. Start guest
[root@ibm-p8-kvm-02-qe var]# virsh start dzhengvm1
error: Failed to start domain dzhengvm1
error: internal error: process exited while connecting to monitor: 2015-06-29T02:28:33.954643Z qemu-kvm: Expected key=value format, found +kvm_pv_eoi.
Unable to find PowerPC CPU definition

3. Edit XML with eoi='off'
<domain type='kvm' id='7'>
......
<features>
  <acpi/>
  <apic eoi='off'/>
  <pae/>
</features>
<cpu mode='host-model'>
  <model fallback='allow'/>
  <topology sockets='1' cores='5' threads='1'/>
</cpu>
......
</domain>

4. Start guest
[root@ibm-p8-kvm-02-qe var]# virsh start dzhengvm1
error: Failed to start domain dzhengvm1
error: internal error: process exited while connecting to monitor: 2015-06-29T02:29:03.297787Z qemu-kvm: Expected key=value format, found -kvm_pv_eoi.
Unable to find PowerPC CPU definition




Actual result:
Guest can not start.

Expected result:
Guest should start correctly.

Additional information:
-- 
No error info in libvirt log and guest log.

--- Additional comment from David Gibson on 2015-11-05 03:50:10 UTC ---

Setting APIC options makes no sense for a Power system, since the APIC is x86 specific.


So, I think all that needs to happen here is a more helpful error message from libvirt.

--- Additional comment from Andrea Bolognani on 2016-08-04 12:27:01 UTC ---

(In reply to David Gibson from comment #5)
> Setting APIC options makes no sense for a Power system, since the APIC is
> x86 specific.
> 
> So, I think all that needs to happen here is a more helpful error message
> from libvirt.

Seems like QEMU's behavior has changed with respect to
these flags, eg.

  /usr/libexec/qemu-kvm \
    -nographic -no-user-config -nodefaults \
    -M pseries,accel=kvm \
    -cpu POWER8E,+kvm_pv_eoi

used to fail with the message reported above, but now it
seems like unrecognized features are simply being ignored,
even with something like

  /usr/libexec/qemu-kvm \
    -nographic -no-user-config -nodefaults \
    -M pseries,accel=kvm \
    -cpu POWER8E,-some,completely=random,+crap

Was this changed on purpose?

It would of course be better to catch such configuration
errors at the libvirt level rather than letting users
create a configuration that results in a nonsensical QEMU
command line, but I'm wondering whether it's a good idea
for QEMU to be so relaxed when it comes to CPU flags...

--- Additional comment from David Gibson on 2016-09-06 00:43:10 UTC ---

No, it wasn't changed deliberately.  That must have been a side effect of something else, though I'm not immediately sure what.

I'll try to bisect and find out what changed this.

--- Additional comment from David Gibson on 2017-01-06 00:32:30 UTC ---

I finally got around to investingating this more deeply.

I can't actually find any upstream versions exhibiting the problem, nor did the most recent 2.6 based downstream version when built from source.  Can we retry with the latest release qemu-kvm-rhev and see if this still has the problem.

--- Additional comment from Dan Zheng on 2017-01-12 08:35:43 UTC ---

Retest with packages:

qemu-kvm-rhev-2.8.0-1.el7.ppc64le
kernel-3.10.0-537.el7.ppc64le
libvirt-2.5.0-1.el7.ppc64le

OS tree: RHEL-7.4-20170106.n.1

1. Guest uses below XML
<features>
  <acpi/>
  <apic eoi='on'/>
  <pae/>
</features>

# virsh start test
error: Failed to start domain test
error: internal error: process exited while connecting to monitor: 2017-01-12T08:08:27.696881Z qemu-kvm: Expected key=value format, found +kvm_pv_eoi.

2. Guest uses below XML
<features>
  <acpi/>
  <apic eoi='off'/>
  <pae/>
</features>
# virsh start test
error: Failed to start domain test
error: internal error: process exited while connecting to monitor: 2017-01-12T08:13:34.026009Z qemu-kvm: Expected key=value format, found -kvm_pv_eoi.

===> The error message is not accurate.

3. Guest uses below XML
<features>
  <acpi/>
  <pae/>
</features>

or 
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>

# virsh start test
Domain test started

qemu     46132     1 99 03:29 ?        00:00:10 /usr/libexec/qemu-kvm -name guest=test,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-9-test/master-key.aes -machine pseries-rhel7.3.0,accel=kvm,usb=off,dump-guest-core=off -cpu host -m 1024 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -u

===> With both XMLs above, the guest can be started, and 'apic' is ignored in case of the second XML.

--- Additional comment from  on 2020-03-19 21:46:23 UTC ---

Patch was sent to the mailing list:

https://www.redhat.com/archives/libvir-list/2020-March/msg00717.html


The approach is the one from comment #5: refuse to launch the guest and provide
a more helpful error message for the user.

--- Additional comment from  on 2020-03-30 21:27:24 UTC ---

Fix merged upstream:


commit dbda73ff27cf185fb5db498cc4db281b2d76778d
Author: Daniel Henrique Barboza <danielhb413>
Date:   Tue Mar 24 14:33:21 2020 -0300

    qemu: avoid launching non-x86 guests with APIC-EOI setting

v6.1.0-276-gdbda73ff27

Comment 4 Dan Zheng 2020-05-11 04:12:20 UTC
Package:
libvirt-6.0.0-19.module+el8.2.1+6538+c148631f.ppc64le

1.Define a guest with eoi:
Add below in xml and define a guest, then an error is raised as below. - PASS
<features>
  <acpi/>
  <apic eoi='on'/>
  <pae/>
</features>
# virsh define dz.xml 
error: Failed to define domain from dz.xml
error: unsupported configuration: The 'eoi' attribute of the 'apic' feature is not supported for architecture 'ppc64le' or machine type 'pseries-rhel8.2.0'


2. Edit a guest with eoi
Add below into a guest xml, then an error is raised as below. - PASS
<features>
  <acpi/>
  <apic eoi='off'/>
  <pae/>
</features>
# virsh edit dz1
error: unsupported configuration: The 'eoi' attribute of the 'apic' feature is not supported for architecture 'ppc64le' or machine type 'pseries-rhel8.2.0'

So I mark it verified.

Comment 7 errata-xmlrpc 2020-07-28 07:12:15 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/RHBA-2020:3172


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