Re: [PATCH v4 6/6] iommu/amd: Lock DTE before updating the entry with WRITE_ONCE()

From: Jason Gunthorpe
Date: Thu Sep 26 2024 - 15:58:53 EST


On Mon, Sep 16, 2024 at 05:18:05PM +0000, Suravee Suthikulpanit wrote:
> When updating only within a 64-bit tuple of a DTE, just lock the DTE and
> use WRITE_ONCE() because it is writing to memory read back by HW.
>
> Suggested-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
> ---
> drivers/iommu/amd/iommu.c | 42 ++++++++++++++++++++++-----------------
> 1 file changed, 24 insertions(+), 18 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Jason