diff options
| author | Francois Dugast <[email protected]> | 2024-05-02 14:43:10 +0200 |
|---|---|---|
| committer | Lucas De Marchi <[email protected]> | 2024-05-02 10:46:02 -0700 |
| commit | 8ad0e1810bf23f22cedb8a2664548b15646570c7 (patch) | |
| tree | 868903291505117f62b625a11cf8c8cb6a15a02c /tools/perf/scripts/python/flamegraph.py | |
| parent | ae22b2f1c8ccd9a3e5f19e3ebb4ef6ec1e8655e0 (diff) | |
drm/xe/gt: Fix assert in L3 bank mask generation
What needs to be asserted is that the pattern fits in the number
of bits provided by the user in patternbits, otherwise it would
be truncated when replicated according to the mask, which is
likely not the intended use of this function.
The pattern argument is a bitmap so use find_last_bit() instead
of fls(). The bit position starts at index 0 so remove "or equal"
from the comparison. XE_MAX_L3_BANK_MASK_BITS would be the
returned value if the pattern is 0, which can be the case on some
platforms.
v2: Check the result does not overflow the array (Lucas De Marchi)
v3: Use __fls() for long and handle mask == 0 (Lucas De Marchi)
Cc: Matt Roper <[email protected]>
Cc: Lucas De Marchi <[email protected]>
Signed-off-by: Francois Dugast <[email protected]>
Reviewed-by: Lucas De Marchi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Lucas De Marchi <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions