Commit 74c2e97b authored by Anup Patel's avatar Anup Patel Committed by Anup Patel
Browse files

RISC-V: KVM: Fix incorrect KVM_MAX_VCPUS value



The KVM_MAX_VCPUS value is supposed to be aligned with number of
VMID bits in the hgatp CSR but the current KVM_MAX_VCPUS value
is aligned with number of ASID bits in the satp CSR.

Fixes: 99cdc6c1 ("RISC-V: Add initial skeletal KVM support")
Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
Reviewed-by: default avatarAtish Patra <atishp@rivosinc.com>
parent 756e1fc1
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -12,14 +12,12 @@
#include <linux/types.h>
#include <linux/kvm.h>
#include <linux/kvm_types.h>
#include <asm/csr.h>
#include <asm/kvm_vcpu_fp.h>
#include <asm/kvm_vcpu_timer.h>

#ifdef CONFIG_64BIT
#define KVM_MAX_VCPUS			(1U << 16)
#else
#define KVM_MAX_VCPUS			(1U << 9)
#endif
#define KVM_MAX_VCPUS			\
	((HGATP_VMID_MASK >> HGATP_VMID_SHIFT) + 1)

#define KVM_HALT_POLL_NS_DEFAULT	500000