]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommu/amd: Store the nid in io_pgtable_cfg instead of the domain
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 30 Aug 2024 00:06:17 +0000 (21:06 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:53:34 +0000 (13:53 +0100)
commitbbd92f5b718618c888d945b883e6bdac4ca97852
treeef24428a17f7e758bdbd135d9cf6cb335b376c1a
parent5be80f0119ea46f44331453c0a03bd22c4b456fc
iommu/amd: Store the nid in io_pgtable_cfg instead of the domain

[ Upstream commit 47f218d108950984b24af81f66356ceda380eb74 ]

We already have memory in the union here that is being wasted in AMD's
case, use it to store the nid.

Putting the nid here further isolates the io_pgtable code from the struct
protection_domain.

Fixup protection_domain_alloc so that the NID from the device is provided,
at this point dev is never NULL for AMD so this will now allocate the
first table pointer on the correct NUMA node.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/8-v2-831cdc4d00f3+1a315-amd_iopgtbl_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Stable-dep-of: 016991606aa0 ("iommu/amd/pgtbl_v2: Take protection domain lock before invalidating TLB")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/amd/amd_iommu.h
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/io_pgtable.c
drivers/iommu/amd/io_pgtable_v2.c
drivers/iommu/amd/iommu.c
drivers/iommu/amd/pasid.c
include/linux/io-pgtable.h