[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ARM/vgic: Use for_each_set_bit() in vgic_sync_from_lrs()



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 <andrew.cooper3@xxxxxxxxxx>

Acked-by: Julien Grall <julien@xxxxxxx>

---
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Julien Grall <julien@xxxxxxx>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
CC: Bertrand Marquis <bertrand.marquis@xxxxxxx>
CC: Michal Orzel <michal.orzel@xxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>

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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.