[PATCH v2] target/loongarch: fix bad shift in check_ps()

2025-04-05 Thread Song Gao
In expression 1ULL << tlb_ps, left shifting by more than 63 bits has undefined behavior. The shift amount, tlb_ps, is as much as 64. check "tlb_ps >=64" to fix. Resolves: Coverity CID 1593475 Fixes: d882c284a3 ("target/loongarch: check tlb_ps") Suggested-by: Peter Maydell Signed-off-by: Song G

Re: [PATCH v2] target/loongarch: fix bad shift in check_ps()

2025-03-20 Thread bibo mao
On 2025/3/21 上午9:13, Song Gao wrote: In expression 1ULL << tlb_ps, left shifting by more than 63 bits has undefined behavior. The shift amount, tlb_ps, is as much as 64. check "tlb_ps >=64" to fix. Resolves: Coverity CID 1593475 Fixes: d882c284a3 ("target/loongarch: check tlb_ps") Suggested-