RISC-V: KVM: Add Svade and Svadu Extensions Support for Guest/VM
authorYong-Xuan Wang <yongxuan.wang@sifive.com>
Fri, 26 Jul 2024 08:49:28 +0000 (16:49 +0800)
committerAnup Patel <anup@brainfault.org>
Thu, 21 Nov 2024 12:10:14 +0000 (17:40 +0530)
commit97eccf7db4f2e5e59d16bca45f7803ae3aeff6e1
tree15a362d8e87a3ec3394926fb86b6974a7948126f
parentb8d481671703c4ba24bb250a99225e0e3d8aedac
RISC-V: KVM: Add Svade and Svadu Extensions Support for Guest/VM

We extend the KVM ISA extension ONE_REG interface to allow VMM tools to
detect and enable Svade and Svadu extensions for Guest/VM. Since the
henvcfg.ADUE is read-only zero if the menvcfg.ADUE is zero, the Svadu
extension is available for Guest/VM and the Svade extension is allowed
to disabledonly when arch_has_hw_pte_young() is true.

Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Samuel Holland <samuel.holland@sifive.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/20240726084931.28924-4-yongxuan.wang@sifive.com
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/include/uapi/asm/kvm.h
arch/riscv/kvm/vcpu.c
arch/riscv/kvm/vcpu_onereg.c