[PATCH] lib: sbi: Fix shift bug in sbi_system_reset

Andreas Schwab schwab at linux-m68k.org
Mon Dec 25 01:48:35 PST 2023


On Dez 25 2023, Anup Patel wrote:

> If "cur_hartid < hbase + BITS_PER_LONG" then
> "1UL << (cur_hartid - hbase) == 0x0"

If cur_hartid - hbase < BITS_PER_LONG, then 1UL << (cur_hartid - hbase)
will not be 0.  If cur_hartid - hbase >= BITS_PER_LONG, then 1UL <<
(cur_hartid - hbase) will overflow and be undefined.

-- 
Andreas Schwab, schwab at linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



More information about the opensbi mailing list