Am 27.01.20 um 17:58 schrieb Logan Gunthorpe:
On 2020-01-27 1:18 a.m., Christian König wrote:
Am 27.01.20 um 08:18 schrieb Skidanov, Alexey:
Hello,
I have recently found the below commit to disabling ACS bits. Using kernel parameter is pretty simple but requires to know in advance which devices might be participated in peer-to-peer sessions.
Why we can't disable the ACS bits *after* the driver is initialized (and there is a request to connect between two peers) and not *during* device discovering?.
That's exactly what was initially proposed but we have seen hardware
which reacts allergic to disabling those bits on the fly.
I wasn't aware of that and haven't seen anything like that.
Please read up the discussion on the mailing list leading to this patch.
The issue was the IOMMU code does not allow for any kind of dynamic
changes in the groups devices are assigned in. In theory, this could be
possible but you'd still at least have to unbind the devices from their
driver because you definitely can't change the IOMMU group while there
are DMA requests in flight. Ultimately it's easier for most use cases to
just disable it on boot.
As far as I know you can't change the ACS bit either when there are
transactions in flight on the affected devices/bridges.
Otherwise what could happen is that the response of an transaction takes
a different path than the request. That in turn can result in quite a
bunch of ordering problem on the PCIe bus.
But the idea of unbinding a device, changing the bit and rebinding it
would probably work.
Regards,
Christian.
Logan