diff options
| author | Samuel Holland <[email protected]> | 2025-02-20 10:42:27 -0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2025-03-24 17:56:04 +0530 |
| commit | ef4ed2dda76648171d551537443a16b5db712284 (patch) | |
| tree | 63bf0bf2d1a1667f36e45e8c43d7ae4ac351d442 /lib/utils/cppc | |
| parent | 86c01a73ff9d34d21f7e7afca79315a411bfce15 (diff) | |
lib: sbi_scratch: Apply bounds check to platform hart_count
The internal limit on the number of harts is SBI_HARTMASK_MAX_BITS, as
this value determines the size of various bitmaps and arrays (including
hartindex_to_hartid_table and hartindex_to_scratch_table). Clamp the
value provided by the platform, and drop the extra array element.
Update the documentation to indicate that hart_index2id must be sized
based on hart_count, and that hart indexes must be contiguous. As of
commit 5e90e54a1a53 ("lib: utils:Check that hartid is valid"), there is
no restriction on the valid hart ID values.
Signed-off-by: Samuel Holland <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib/utils/cppc')
0 files changed, 0 insertions, 0 deletions
