RISC-V: KVM: Expose Zicbom to the guest
authorAndrew Jones <ajones@ventanamicro.com>
Sun, 2 Oct 2022 04:49:05 +0000 (10:19 +0530)
committerAnup Patel <anup@brainfault.org>
Sun, 2 Oct 2022 04:49:05 +0000 (10:19 +0530)
commit56852c6211971798dfbe4098c8a8528b59234de2
tree631a9fc4677d51f62689adf8c2b95beca7ae9d56
parentafd5dde9a186b8fc5742fff707f184760c4af1a9
RISC-V: KVM: Expose Zicbom to the guest

Guests may use the cbo.inval,clean,flush instructions when the
CPU has the Zicbom extension and the hypervisor sets henvcfg.CBIE
(for cbo.inval) and henvcfg.CBCFE (for cbo.clean,flush).

Add Zicbom support for KVM guests which may be enabled and
disabled from KVM userspace using the ISA extension ONE_REG API.

Also opportunistically switch the other isa extension checks in
kvm_riscv_vcpu_update_config() to riscv_isa_extension_available().

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/include/uapi/asm/kvm.h
arch/riscv/kvm/vcpu.c