[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend
From: |
Jason Gunthorpe |
Subject: |
Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend |
Date: |
Tue, 26 Apr 2022 11:11:56 -0300 |
On Tue, Apr 26, 2022 at 10:08:30PM +0800, Yi Liu wrote:
> > I think it is strange that the allowed DMA a guest can do depends on
> > the order how devices are plugged into the guest, and varys from
> > device to device?
> >
> > IMHO it would be nicer if qemu would be able to read the new reserved
> > regions and unmap the conflicts before hot plugging the new device. We
> > don't have a kernel API to do this, maybe we should have one?
>
> For userspace drivers, it is fine to do it. For QEMU, it's not quite easy
> since the IOVA is GPA which is determined per the e820 table.
Sure, that is why I said we may need a new API to get this data back
so userspace can fix the address map before attempting to attach the
new device. Currently that is not possible at all, the device attach
fails and userspace has no way to learn what addresses are causing
problems.
> > eg currently I see the log messages that it is passing P2P BAR memory
> > into iommufd map, this should be prevented inside qemu because it is
> > not reliable right now if iommufd will correctly reject it.
>
> yeah. qemu can filter the P2P BAR mapping and just stop it in qemu. We
> haven't added it as it is something you will add in future. so didn't
> add it in this RFC. :-) Please let me know if it feels better to filter
> it from today.
I currently hope it will use a different map API entirely and not rely
on discovering the P2P via the VMA. eg using a DMABUF FD or something.
So blocking it in qemu feels like the right thing to do.
Jason
- [RFC 13/18] vfio/container-obj: Introduce VFIOContainer reset callback, (continued)
- [RFC 13/18] vfio/container-obj: Introduce VFIOContainer reset callback, Yi Liu, 2022/04/14
- [RFC 12/18] vfio/container-obj: Introduce [attach/detach]_device container callbacks, Yi Liu, 2022/04/14
- [RFC 14/18] hw/iommufd: Creation, Yi Liu, 2022/04/14
- [RFC 15/18] vfio/iommufd: Implement iommufd backend, Yi Liu, 2022/04/14
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Jason Gunthorpe, 2022/04/22
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Alex Williamson, 2022/04/22
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Yi Liu, 2022/04/26
- RE: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Tian, Kevin, 2022/04/26
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Jason Gunthorpe, 2022/04/26
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Yi Liu, 2022/04/26
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend,
Jason Gunthorpe <=
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Alex Williamson, 2022/04/26
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Jason Gunthorpe, 2022/04/26
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Alex Williamson, 2022/04/26
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Jason Gunthorpe, 2022/04/26
- Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend, Jason Gunthorpe, 2022/04/26
[RFC 16/18] vfio/iommufd: Add IOAS_COPY_DMA support, Yi Liu, 2022/04/14
[RFC 17/18] vfio/as: Allow the selection of a given iommu backend, Yi Liu, 2022/04/14
[RFC 18/18] vfio/pci: Add an iommufd option, Yi Liu, 2022/04/14
Re: [RFC 00/18] vfio: Adopt iommufd, Nicolin Chen, 2022/04/15