target/riscv/pmp: fix NAPOT range computation overflow
There is an overflow with the current code where a pmpaddr value of
0x1fffffff is decoded as sa=0 and ea=0 whereas it should be sa=0 and
ea=0xffffffff.
Fix that by simplifying the computation. There is in fact no need for
ctz64() nor special case for -1 to achieve proper results.
Signed-off-by: Nicolas Pitre <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-Id: <
[email protected]>
Signed-off-by: Alistair Francis <[email protected]>