Bug 1719149 - Aarch64 guest does not boot with a vfio-pci device and SMMUv3
Summary: Aarch64 guest does not boot with a vfio-pci device and SMMUv3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.0
Hardware: aarch64
OS: Linux
medium
medium
Target Milestone: rc
: 8.1
Assignee: Eric Auger
QA Contact: Qunfang Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-11 07:32 UTC by Eric Auger
Modified: 2020-05-05 09:46 UTC (History)
7 users (show)

Fixed In Version: qemu-kvm-4.2.0-12.module+el8.2.0+5858+afd073bc
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 09:46:14 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Eric Auger 2019-06-11 07:32:18 UTC
On ARM we currently do not support VFIO-PCI devices protected
by the SMMUv3. Any attempt to run such use case results in this
kind of warning:
    
"-device vfio-pci,host=0004:01:00.0,id=hostdev0,bus=pci.1,addr=0x0:
warning: SMMUv3 does not support notification on MAP: device vfio-pci
will not function properly".
    
However this is just a warning and this should not prevent the
guest from booting in a reasonable amount of time. This does not
happen currently.
    
This is due to the fact the VFIO vfio_listener_region_add() calls
memory_region_iommu_replay(). As the SMMUv3 IOMMUMemoryRegionClass
currently does not implement the replay() callback, the default
memory_region_iommu_replay() implementation is used. This latter
loops on the whole notifier's range (48b address space), translates
each page and call the notifier on the resulting entry. This totally
freezes the guest.
    
The Intel IOMMU implements the replay() function which only
notifies valid page table entries.
    
In the looming SMMUv3 nested stage VFIO integration, there will be
no need to replay() anything as there will not be any shadow page
tables: the stage 1 page tables are owned by the guest.
    
So the solution consists in implementing a dummy empty SMMUv3 replay() callback. This would satisfy both the current state (no VFIO-PCI support) and looming nested stage VFIO integration.

Comment 1 Eric Auger 2019-06-11 14:33:38 UTC
Sent "[PATCH 0/2] ARM SMMUv3: Fix spurious notification errors and stall with vfio-pci" upstream.

Comment 2 Eric Auger 2019-09-27 15:42:19 UTC
[PATCH v4 0/2] Allow memory_region_register_iommu_notifier() to fail
seem to have reached consensus and should be upstreamed

Comment 3 Eric Auger 2019-10-10 09:14:44 UTC
Landed upstream for 4.2 so move to POST

Comment 4 Ademar Reis 2020-02-05 22:59:05 UTC
QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks

Comment 7 Eric Auger 2020-03-10 09:31:04 UTC
Tested with qemu-kvm-4.2.0-13.module+el8.2.0+5898+fb4bceae:
-M virt-rhel8.2.0,gic-version=3,iommu=smmuv3 -device vfio-pci,host=0000:89:00.1

qemu outputs:
-device vfio-pci,host=0000:89:00.1: vfio 0000:89:00.1: failed to setup container for group 6: memory listener initialization failed: Region smmuv3-iommu-memory-region-16-0: device 00.02.0 requires iommu MAP notifier which is not currently supported

Can be moved to VERIFIED

Comment 8 Qunfang Zhang 2020-03-10 10:40:51 UTC
Thanks Eric.

Comment 10 errata-xmlrpc 2020-05-05 09:46:14 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:2017


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