Bug 1457610

Summary: libvirt should give a nicer error message when intremap='split' in iommu device
Product: Red Hat Enterprise Linux 7 Reporter: Jingjing Shao <jishao>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: Jingjing Shao <jishao>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: dyuan, jtomko, rbalakri, xuzhang, yalzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-3.8.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 10:46: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:

Description Jingjing Shao 2017-06-01 02:55:23 UTC
Description of problem:
libvirt should give a nicer error message when intremap='split'  in iommu device

Version-Release number of selected component (if applicable):
libvirt-3.2.0-6.el7

How reproducible:
100%

Steps to Reproduce:
1.Prepare a guest and add the xml as below without add " <ioapic driver='qemu'/> "
    <iommu model='intel'>
      <driver intremap='on'/>
    </iommu>

2.Start the guest and get the error

# virsh start q35-js
error: Failed to start domain q35-js
error: internal error: qemu unexpectedly closed the monitor: 2017-05-26T06:23:33.798217Z qemu-kvm: -chardev pty,id=charserial0: char device redirected to /dev/pts/1 (label charserial0)
2017-05-26T06:23:33.857340Z qemu-kvm: -device intel-iommu,intremap=on: Intel Interrupt Remapping cannot work with kernel-irqchip=on, please use 'split|off'.

3.change the attribute intremap='split' but also get error
 <iommu model='intel'>
    <driver intremap='split'/>
 </iommu>

# virsh edit q35-js
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element devices in interleave
Element domain failed to validate content
Failed. Try again? [y,n,i,f,?]: 
error: XML error: unknown intremap value: split


Actual results:
intremap='split' is not supported, but libvirt gives a confusing error info in step2

Expected results:
libvirt should give a nicer error message when 'intremap='split' or libvirt should support 'intremap='split'

Additional info:
N/A

Comment 2 Ján Tomko 2017-08-29 16:48:42 UTC
Upstream patch:
https://www.redhat.com/archives/libvir-list/2017-August/msg00919.html

Comment 3 Ján Tomko 2017-09-11 13:11:13 UTC
Pushed upstream as:
commit 90cd99a42e1afabc57f70a0e1e17e27f986ae04f
Author:     Ján Tomko <jtomko>
CommitDate: 2017-09-11 14:56:07 +0200

    conf: validate IOMMU interrupt remapping setting
    
    This option requires:
      <ioapic driver='qemu'/>
    
    Report an error in case someone tries to combine
    it with different ioapic setting.
    
    Setting 'eim' on without enabling 'intremap' does not make sense.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1457610

git describe: v3.7.0-40-g90cd99a42

Comment 5 Jingjing Shao 2017-11-02 12:17:35 UTC
Hi Ján,

With libvirt-3.8.0-1.el7.x86_64, I found something wrong when I add the xml as below to guest no matter add  <ioapic driver='qemu'/>  or not.

<iommu model='intel'>
  <driver intremap='on' caching='on'/>
</iommu>


# virsh edit q35-js
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element devices in interleave
Element domain failed to validate content



But with xml as below , the output are as expected.

<iommu model='intel'>
  <driver intremap='on'/>
</iommu>

and
  
<iommu model='intel'>
  <driver intremap='on' eim='on'/>
</iommu>are as expected.



(1) with <ioapic driver='qemu'/> ,  the xml as below can be edit and start successfully.


(2) Without  <ioapic driver='qemu'/>, the guest will output as below

# virsh edit q35-js
error: XML error: IOMMU interrupt remapping requires split I/O APIC (ioapic driver='qemu')
Failed. Try again? [y,n,i,f,?]:

Comment 6 Ján Tomko 2017-11-02 12:23:07 UTC
The attribute name is 'caching_mode'

Comment 7 Jingjing Shao 2017-11-02 12:57:16 UTC
Thanks‘s Ján' reply so soon and so sorry that I made a mistake.

Add the xml as below to guest xml.
<iommu model='intel'>
  <driver intremap='on' caching_mode='on'/>
</iommu>

 
(1) with <ioapic driver='qemu'/> ,  the  guest can be edit and start successfully.

(2) without <ioapic driver='qemu'/>, the guest get the output as below.

# virsh edit q35-js
error: XML error: IOMMU interrupt remapping requires split I/O APIC (ioapic driver='qemu')
Failed. Try again? [y,n,i,f,?]: 


So with the comment 5 and comment 7, I change the status to verified

Comment 11 errata-xmlrpc 2018-04-10 10:46:43 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