Skip to content

Commit 237e74b

Browse files
bibo-maochenhuacai
authored andcommitted
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: 47256c4 ("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>
1 parent 11f340e commit 237e74b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/loongarch/kvm/intc/eiointc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ static int kvm_eiointc_ctrl_access(struct kvm_device *dev,
439439
spin_lock_irqsave(&s->lock, flags);
440440
switch (type) {
441441
case KVM_DEV_LOONGARCH_EXTIOI_CTRL_INIT_NUM_CPU:
442-
if (val >= EIOINTC_ROUTE_MAX_VCPUS)
442+
if (val > EIOINTC_ROUTE_MAX_VCPUS)
443443
ret = -EINVAL;
444444
else
445445
s->num_cpu = val;

0 commit comments

Comments
 (0)