iommu/amd: Selective flush on unmap
authorNadav Amit <namit@vmware.com>
Fri, 23 Jul 2021 09:32:03 +0000 (02:32 -0700)
committerJoerg Roedel <jroedel@suse.de>
Mon, 2 Aug 2021 09:26:05 +0000 (11:26 +0200)
commitfc65d0acaf23179b94de399c204328fa259acb90
treec18bd9e40c6e6c214f18e34f7b74cc8699c189bc
parentee974d9625c405977ef5d9aedc476be1d0362ebf
iommu/amd: Selective flush on unmap

Recent patch attempted to enable selective page flushes on AMD IOMMU but
neglected to adapt amd_iommu_iotlb_sync() to use the selective flushes.

Adapt amd_iommu_iotlb_sync() to use selective flushes and change
amd_iommu_unmap() to collect the flushes. As a defensive measure, to
avoid potential issues as those that the Intel IOMMU driver encountered
recently, flush the page-walk caches by always setting the "pde"
parameter. This can be removed later.

Cc: Joerg Roedel <joro@8bytes.org>
Cc: Will Deacon <will@kernel.org>
Cc: Jiajun Cao <caojiajun@vmware.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Cc: iommu@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Nadav Amit <namit@vmware.com>
Link: https://lore.kernel.org/r/20210723093209.714328-2-namit@vmware.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/iommu.c