WSL2-Linux-Kernel/arch/riscv/kvm
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: 8f5cb44b1b ("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
..
Kconfig RISC-V: KVM: Use generic guest entry infrastructure 2022-10-02 10:19:25 +05:30
Makefile RISC-V: KVM: Factor-out instruction emulation into separate sources 2022-07-29 17:14:40 +05:30
main.c RISC-V: KVM: add __init annotation to riscv_kvm_init() 2022-10-02 10:19:11 +05:30
mmu.c KVM: Rename mmu_notifier_* to mmu_invalidate_* 2022-08-19 04:05:41 -04:00
tlb.c RISC-V: KVM: Use Svinval for local TLB maintenance when available 2022-10-02 10:18:37 +05:30
vcpu.c RISC-V: KVM: Fix kvm_riscv_vcpu_timer_pending() for Sstc 2022-10-21 11:52:45 +05:30
vcpu_exit.c riscv: KVM: Apply insn-def to hlv encodings 2022-10-02 10:18:20 +05:30
vcpu_fp.c RISC-V: KVM: Improve ISA extension by using a bitmap 2022-07-29 17:14:11 +05:30
vcpu_insn.c KVM: remove KVM_REQ_UNHALT 2022-09-26 12:37:21 -04:00
vcpu_sbi.c riscv: kvm: move extern sbi_ext declarations to a header 2022-08-19 23:22:47 +05:30
vcpu_sbi_base.c
vcpu_sbi_hsm.c
vcpu_sbi_replace.c
vcpu_sbi_v01.c
vcpu_switch.S
vcpu_timer.c RISC-V: KVM: Fix kvm_riscv_vcpu_timer_pending() for Sstc 2022-10-21 11:52:45 +05:30
vm.c RISC-V: KVM: Make kvm_riscv_guest_timer_init a void function 2022-07-29 17:14:26 +05:30
vmid.c