Bug 1719149
| Summary: | Aarch64 guest does not boot with a vfio-pci device and SMMUv3 | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Eric Auger <eric.auger> |
| Component: | qemu-kvm | Assignee: | Eric Auger <eric.auger> |
| qemu-kvm sub component: | General | QA Contact: | Qunfang Zhang <qzhang> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | medium | ||
| Priority: | medium | CC: | abologna, ddepaula, drjones, jinzhao, juzhang, qzhang, virt-maint |
| Version: | 8.0 | Keywords: | OtherQA |
| Target Milestone: | rc | ||
| Target Release: | 8.1 | ||
| Hardware: | aarch64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| 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: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-05-05 09:46:14 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: | |||
Sent "[PATCH 0/2] ARM SMMUv3: Fix spurious notification errors and stall with vfio-pci" upstream. [PATCH v4 0/2] Allow memory_region_register_iommu_notifier() to fail seem to have reached consensus and should be upstreamed Landed upstream for 4.2 so move to POST 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 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 Thanks Eric. 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 |
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.