mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
KVM: riscv: Fix infinite loop in NACL hfence entry allocation
try_count is initialized to 5 but never decremented in the retry path,
making the `if (try_count)` check always true. If all NACL shared memory
hfence entries remain in the pending state after sync, the function loops
forever, causing a soft lockup. Decrement try_count on each retry so the
fallback warning and return become reachable.
Fixes: d466c19cea ("RISC-V: KVM: Add common nested acceleration support")
Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260716073756.44153-1-min_halo@163.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
b7a4bd0c80
commit
e971f19e4c
|
|
@ -33,7 +33,7 @@ void __kvm_riscv_nacl_hfence(void *shmem,
|
|||
}
|
||||
|
||||
if (ent < 0) {
|
||||
if (try_count) {
|
||||
if (try_count--) {
|
||||
nacl_sync_hfence(-1UL);
|
||||
goto again;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user