iommu/amd/pgtbl_v2: Invalidate updated page ranges only
authorVasant Hegde <vasant.hegde@amd.com>
Wed, 22 Nov 2023 09:02:15 +0000 (09:02 +0000)
committerJoerg Roedel <jroedel@suse.de>
Mon, 11 Dec 2023 14:25:38 +0000 (15:25 +0100)
commitc7fc12354be0ba47566d55f4ebdc6a47bd69d5ed
tree16ba23e4cdadbcc35a195b922ef0b80e733dc044
parent2c535dd37d677abd11b278fce89b8bdb0a55facb
iommu/amd/pgtbl_v2: Invalidate updated page ranges only

Enhance __domain_flush_pages() to detect domain page table mode and use
that info to build invalidation commands. So that we can use
amd_iommu_domain_flush_pages() to invalidate v2 page table.

Also pass PASID, gn variable to device_flush_iotlb() so that it can build
IOTLB invalidation command for both v1 and v2 page table.

Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20231122090215.6191-10-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/io_pgtable_v2.c
drivers/iommu/amd/iommu.c