]> git.ipfire.org Git - thirdparty/linux.git/commit
iommu/vt-d: Simplify calculate_psi_aligned_address()
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 7 Apr 2026 06:45:22 +0000 (14:45 +0800)
committerJoerg Roedel <joerg.roedel@amd.com>
Tue, 19 May 2026 08:38:19 +0000 (10:38 +0200)
commit9785df3fd67083ac10f6bde83a316286044a66f1
tree1de18ca8572720444a1fd8c87ca5675af19e9980
parent5200f5f493f79f14bbdc349e402a40dfb32f23c8
iommu/vt-d: Simplify calculate_psi_aligned_address()

This is doing far too much math for the simple task of finding a
power of 2 that fully spans the given range. Use fls directly on
the xor which computes the common binary prefix.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/0-v2-895748900b39+5303-iommupt_inv_vtd_jgg@nvidia.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/intel/cache.c