Re: [PATCH] iommu/amd: Mark translation invalid during device detach

From: Suthikulpanit, Suravee
Date: Wed Jan 16 2019 - 09:35:56 EST


Joerg,

On 1/16/19 8:03 PM, joro@xxxxxxxxxx wrote:
> Hi Suravee,
>
> On Wed, Jan 16, 2019 at 04:15:10AM +0000, Suthikulpanit, Suravee wrote:
>> From: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
>>
>> When a device switches domain, IOMMU driver detach device from the old
>> domain, and attach device to the new domain. During this period
>> the host table root pointer is not set, which means DMA translation
>> should be marked as invalid (clear TV bit).
>>
>> So, clear the TV bit when detach the device. The TV bit will be set
>> again when attaching device to the new domain.
>
> Is there a specific problem with setting the TV bit?

We are not currently seeing issue.

> Note that the update will clear all other fields in the first 128 bits
> of the DTE, which means that IR, IW and Mode are all set to 0. This
> effectivly blocks all DMA requests from the device, which is by design.

Ahh.. This makes sense now. I missed the IR/IW/Mode=0 part.
It was not clear to us earlier. Thanks for clarification.

Regards,
Suravee