aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorBibo Mao <maobibo@loongson.cn>2025-11-09 16:02:09 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2025-11-10 08:37:07 +0800
commit237e74bfa261fb0cf75bd08c9be0c5094018ee20 (patch)
treec9732344a0f15e15087493b1af0eee10f3083d13
parentLoongArch: KVM: Skip PMU checking on vCPU context switch (diff)
downloadwireguard-linux-237e74bfa261fb0cf75bd08c9be0c5094018ee20.tar.xz
wireguard-linux-237e74bfa261fb0cf75bd08c9be0c5094018ee20.zip
LoongArch: KVM: Fix max supported vCPUs set with EIOINTC
VM fails to boot with 256 vCPUs, the detailed command is qemu-system-loongarch64 -smp 256 and there is an error reported as follows: KVM_LOONGARCH_EXTIOI_INIT_NUM_CPU failed: Invalid argument There is typo issue in function kvm_eiointc_ctrl_access() when set max supported vCPUs. Cc: stable@vger.kernel.org Fixes: 47256c4c8b1b ("LoongArch: KVM: Avoid copy_*_user() with lock hold in kvm_eiointc_ctrl_access()") Signed-off-by: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
-rw-r--r--arch/loongarch/kvm/intc/eiointc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/kvm/intc/eiointc.c b/arch/loongarch/kvm/intc/eiointc.c
index c32333695381..a1cc116b4dac 100644
--- a/arch/loongarch/kvm/intc/eiointc.c
+++ b/arch/loongarch/kvm/intc/eiointc.c
@@ -439,7 +439,7 @@ static int kvm_eiointc_ctrl_access(struct kvm_device *dev,
spin_lock_irqsave(&s->lock, flags);
switch (type) {
case KVM_DEV_LOONGARCH_EXTIOI_CTRL_INIT_NUM_CPU:
- if (val >= EIOINTC_ROUTE_MAX_VCPUS)
+ if (val > EIOINTC_ROUTE_MAX_VCPUS)
ret = -EINVAL;
else
s->num_cpu = val;