diff options
| author | Jason Gunthorpe <jgg@nvidia.com> | 2026-03-27 18:23:55 +0300 |
|---|---|---|
| committer | Joerg Roedel <joerg.roedel@amd.com> | 2026-06-12 10:17:05 +0300 |
| commit | 144c05d88c7f459c22abafe891ee149692f29734 (patch) | |
| tree | 9de4b8022c5fa6f32707c6b148883720b18f43c6 /include | |
| parent | 69fe699afe1afcb730164b86c228483c2da05f94 (diff) | |
| download | linux-144c05d88c7f459c22abafe891ee149692f29734.tar.xz | |
iommu/amd: Simplify build_inv_address()
This function is doing more work than it needs to:
- iommu_num_pages() is pointless, the fls() is going to compute the
required page size already.
- It is easier to understand as sz_lg2, which is 12 if size is 4K,
than msb_diff which is 11 if size is 4K.
- Simplify the control flow to early exit on the out of range cases.
- Use the usual last instead of end to signify an inclusive last
address.
- Use GENMASK to compute the 1's mask.
- Use GENMASK to compute the address mask for the command layout,
not PAGE_MASK.
- Directly reference the spec language that defines the 52 bit
limit.
No functional change intended.
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Wei Wang <wei.w.wang@hotmail.com>
Tested-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
