RISC-V: KVM: Add SBI system suspend support
authorAndrew Jones <ajones@ventanamicro.com>
Thu, 17 Oct 2024 07:45:40 +0000 (09:45 +0200)
committerAnup Patel <anup@brainfault.org>
Mon, 30 Dec 2024 08:31:01 +0000 (14:01 +0530)
commit023c15151fbb65f8dde23e28af1d6d4382404d58
treea16a926c64945a7899b45d72090c2f2f08c5a6ee
parentfc033cf25e612e840e545f8d5ad2edd6ba613ed5
RISC-V: KVM: Add SBI system suspend support

Implement a KVM SBI SUSP extension handler. The handler only
validates the system suspend entry criteria and prepares for resuming
in the appropriate state at the resume_addr (as specified by the SBI
spec), but then it forwards the call to the VMM where any system
suspend behavior may be implemented. Since VMM support is needed, KVM
disables the extension by default.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20241017074538.18867-5-ajones@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/include/asm/kvm_vcpu_sbi.h
arch/riscv/include/uapi/asm/kvm.h
arch/riscv/kvm/Makefile
arch/riscv/kvm/vcpu_sbi.c
arch/riscv/kvm/vcpu_sbi_system.c [new file with mode: 0644]