Hi,
On 05/03/2026 23:28, Andrew Cooper wrote:
lr_mask doesn't have bits set beyond the hardware limit, with the upper bits
remaining zero. Therefore, for_each_set_bit() is a better option.
For ARM64, bloat-o-meter reports:
Function old new delta
vgic_sync_from_lrs 208 168 -40
but this doesn't highlight that it also removes a call to find_next_bit() from
each loop iteration.
No functional change.
Signed-off-by: Andrew Cooper <[email protected]>
Acked-by: Julien Grall <[email protected]>
---
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Ayan Kumar Halder <[email protected]>
RFC. This form also doesn't suffer an OoB read when lr_mask changes type.
And potentially unaligned as well. On Arm 32, this would result to a
crash because for forbid unaligned access.
Cheers,
--
Julien Grall