6eff380489
In case when VCPU is blocked due to WFI, we schedule the timer
from `kvm_riscv_vcpu_timer_blocking()` to keep timer interrupt
ticking.
But in case when delta_ns comes to be zero, we never schedule
the timer and VCPU keeps sleeping indefinitely until any activity
is done with VM console.
This is easily reproduce-able using kvmtool.
./lkvm-static run -c1 --console virtio -p "earlycon root=/dev/vda" \
-k ./Image -d rootfs.ext4
Also, just add a print in kvm_riscv_vcpu_vstimer_expired() to
check the interrupt delivery and run `top` or similar auto-upating
cmd from guest. Within sometime one can notice that print from
timer expiry routine stops and the `top` cmd output will stop
updating.
This change fixes this by making sure we schedule the timer even
with delta_ns being zero to bring the VCPU out of sleep immediately.
Fixes:
|
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
main.c | ||
mmu.c | ||
tlb.c | ||
vcpu.c | ||
vcpu_exit.c | ||
vcpu_fp.c | ||
vcpu_insn.c | ||
vcpu_pmu.c | ||
vcpu_sbi.c | ||
vcpu_sbi_base.c | ||
vcpu_sbi_hsm.c | ||
vcpu_sbi_pmu.c | ||
vcpu_sbi_replace.c | ||
vcpu_sbi_v01.c | ||
vcpu_switch.S | ||
vcpu_timer.c | ||
vm.c | ||
vmid.c |