diff options
author | Atish Patra <atish.patra@wdc.com> | 2021-09-27 17:10:11 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-10-04 16:07:16 +0530 |
commit | 3a9f66cb25e18a3eeca36c08d9f823a35b3ddc22 (patch) | |
tree | a15be60b9addd26c0fde559d2f2a80cad0bda612 /arch/riscv/kvm/vm.c | |
parent | 9955371cc014e02a1ef2d13c4aaf743d18bd66aa (diff) | |
download | linux-stable-3a9f66cb25e18a3eeca36c08d9f823a35b3ddc22.tar.gz linux-stable-3a9f66cb25e18a3eeca36c08d9f823a35b3ddc22.tar.bz2 linux-stable-3a9f66cb25e18a3eeca36c08d9f823a35b3ddc22.zip |
RISC-V: KVM: Add timer functionality
The RISC-V hypervisor specification doesn't have any virtual timer
feature.
Due to this, the guest VCPU timer will be programmed via SBI calls.
The host will use a separate hrtimer event for each guest VCPU to
provide timer functionality. We inject a virtual timer interrupt to
the guest VCPU whenever the guest VCPU hrtimer event expires.
This patch adds guest VCPU timer implementation along with ONE_REG
interface to access VCPU timer state from user space.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/kvm/vm.c')
-rw-r--r-- | arch/riscv/kvm/vm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/kvm/vm.c b/arch/riscv/kvm/vm.c index 892d020674c0..26399df15b63 100644 --- a/arch/riscv/kvm/vm.c +++ b/arch/riscv/kvm/vm.c @@ -41,7 +41,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) return r; } - return 0; + return kvm_riscv_guest_timer_init(kvm); } void kvm_arch_destroy_vm(struct kvm *kvm) |