summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2026-05-12 19:46:17 +0300
committerJoerg Roedel <joerg.roedel@amd.com>2026-05-15 08:29:16 +0300
commit58829512ad461af8f35941069c209941e3a97b65 (patch)
treeb821e62afb5ebd5b8d7a711eac69f26cbc025175 /drivers/gpu
parent8ef3f77c440005c7f04229a75976bfc078364247 (diff)
downloadlinux-58829512ad461af8f35941069c209941e3a97b65.tar.xz
iommupt: Fix the end_index calculation in __map_range_leaf()
Sashiko noticed a mismatch of units in this math: num_leaves is actually the number of leaf *entries* (so a 16-item contiguous leaf is one num_leaves), while index is in items. The mismatch in maths causes __map_range_leaf() to exit early instead of efficiently filling a larger range of contiguous PTEs. The early exit is caught by the functions above and then __map_range_leaf() is re-invoked, so there is no functional issue. Correct the misuse of units by adjusting num_leaves with the leaf size and avoid the performance cost of looping externally. There are also some mismatched types for num_leaves; simplify things to remove the duplicated calculations. Fixes: d6c65b0fd621 ("iommupt: Avoid rewalking during map") Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Samiullah Khawaja <skhawaja@google.com> Reviewd-by: Pranjal Shrivastava <praan@google.com> Tested-by: Josua Mayer <josua@solid-run.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/gpu')
0 files changed, 0 insertions, 0 deletions