On 2022-02-02 08:12, Christoph Hellwig wrote:
I think this interface is a little too hacky. In the end all the non-trusted hypervisor schemes (including the per-device swiotlb one) can allocate the memory from everywhere and want for force use of swiotlb. I think we need some kind of proper interface for that instead of setting all kinds of global variables.
Right, if platform/hypervisor code knows enough to be able to set magic non-standard allocation flags correctly, surely it could equally just perform whatever non-standard allocation it needs and call swiotlb_init_with_tbl() instead of swiotlb_init().
Robin.