Anup Patel cea8896bd9 RISC-V: KVM: Fix kvm_riscv_vcpu_timer_pending() for Sstc
The kvm_riscv_vcpu_timer_pending() checks per-VCPU next_cycles
and per-VCPU software injected VS timer interrupt. This function
returns incorrect value when Sstc is available because the per-VCPU
next_cycles are only updated by kvm_riscv_vcpu_timer_save() called
from kvm_arch_vcpu_put(). As a result, when Sstc is available the
VCPU does not block properly upon WFI traps.

To fix the above issue, we introduce kvm_riscv_vcpu_timer_sync()
which will update per-VCPU next_cycles upon every VM exit instead
of kvm_riscv_vcpu_timer_save().

Fixes: 8f5cb44b1bae ("RISC-V: KVM: Support sstc extension")
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
2022-10-21 11:52:45 +05:30
..
2022-08-11 08:03:49 -07:00
2022-03-10 09:29:21 -08:00
2022-08-11 14:41:52 -07:00
2022-06-28 20:13:09 +02:00
2021-03-09 20:46:00 -08:00
2022-01-19 17:54:09 -08:00
2022-05-11 11:50:10 -07:00
2020-05-18 11:38:10 -07:00
2021-06-30 20:55:41 -07:00
2022-03-29 14:31:07 -07:00
2022-06-28 13:20:21 +02:00
2022-07-11 09:33:35 +05:30
2021-01-14 15:09:06 -08:00
2020-06-03 20:09:50 -07:00
2021-07-05 20:53:09 -07:00
2022-08-11 14:58:32 -07:00
2021-01-07 19:00:50 -08:00
2021-03-09 18:18:31 -08:00
2022-02-25 09:36:05 +01:00
2021-01-14 15:09:08 -08:00