On 12/10/24 3:58 AM, David Hildenbrand wrote: > Maybe there is a reason s390x needs to handle this using > memory_region_notify_iommu() callbacks instead of doing it similar to "struct > vfio_memory_listener" when registered on &address_space_memory without a > viommu. >
Hi David, I think I sorted a way to handle this such that, when direct mapping, we use a memory region alias instead so that vfio can ultimately handle all of the pinning/unpinning in the non-iommu path of vfio_listener_region_add/del, just like it does for other platforms. But for s390 the alias is needed to provide the SDMA offset so as to ensure that e.g. GPA X maps to iova SDMA+X. Looks to be working nicely so far with my rework of the associated kernel series -- Going to send as part of v2, would appreciate it if you'd give that a look. Thanks, Matt