]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: KVM: Add VM capability to allow userspace get GPA bits
authorAnup Patel <anup.patel@wdc.com>
Fri, 26 Nov 2021 11:35:51 +0000 (17:05 +0530)
committerAnup Patel <anup@brainfault.org>
Thu, 6 Jan 2022 09:46:58 +0000 (15:16 +0530)
commit4b39dd7f0354d445d70d37ad04846190e1dd0967
tree74381143d7ad54e9dd3238f35cc79257070a355d
parent0dd43458e55e2b2e5c1553212f578fced548e74b
RISC-V: KVM: Add VM capability to allow userspace get GPA bits

The number of GPA bits supported for a RISC-V Guest/VM is based on the
MMU mode used by the G-stage translation. The KVM RISC-V will detect and
use the best possible MMU mode for the G-stage in kvm_arch_init().

We add a generic VM capability KVM_CAP_VM_GPA_BITS which can be used by
the KVM userspace to get the number of GPA (guest physical address) bits
supported for a Guest/VM.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-and-tested-by: Atish Patra <atishp@rivosinc.com>
arch/riscv/include/asm/kvm_host.h
arch/riscv/kvm/mmu.c
arch/riscv/kvm/vm.c
include/uapi/linux/kvm.h