Skip to content

Commit 486a384

Browse files
committed
RISC-V: KVM: Reduce KVM_MAX_VCPUS value
Currently, the KVM_MAX_VCPUS value is 16384 for RV64 and 128 for RV32. The KVM_MAX_VCPUS value is too high for RV64 and too low for RV32 compared to other architectures (e.g. x86 sets it to 1024 and ARM64 sets it to 512). The too high value of KVM_MAX_VCPUS on RV64 also leads to VCPU mask on stack consuming 2KB. We set KVM_MAX_VCPUS to 1024 for both RV64 and RV32 to be aligned other architectures. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]> Signed-off-by: Anup Patel <[email protected]>
1 parent 2415e46 commit 486a384

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/riscv/include/asm/kvm_host.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include <asm/kvm_vcpu_fp.h>
1717
#include <asm/kvm_vcpu_timer.h>
1818

19-
#define KVM_MAX_VCPUS \
20-
((HGATP_VMID_MASK >> HGATP_VMID_SHIFT) + 1)
19+
#define KVM_MAX_VCPUS 1024
2120

2221
#define KVM_HALT_POLL_NS_DEFAULT 500000
2322

0 commit comments

Comments
 (0)