]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/intc/loongarch_ipi: Fix start fail with smp cpu < smp maxcpus on KVM
authorSong Gao <gaosong@loongson.cn>
Fri, 25 Jul 2025 08:12:13 +0000 (16:12 +0800)
committerSong Gao <gaosong@loongson.cn>
Thu, 31 Jul 2025 08:57:01 +0000 (16:57 +0800)
commit31995cc4087123a13e9345153e0c39ffb44b9277
tree15a3940390ffc4735e0a41c418aaf8ee6761cdd1
parentcaab7ac83507e3e9a5fe2f37be5cfa759e766ba2
hw/intc/loongarch_ipi: Fix start fail with smp cpu < smp maxcpus on KVM

QEMU start failed when smp cpu < smp maxcpus , because qemu send a NULL
cpu to KVM, this patch adds a check for kvm_ipi_access_regs() to fix it.

run with '-smp 1,maxcpus=4,sockets=4,cores=1,threads=1'

we got:
Unexpected error in kvm_device_access() at ../accel/kvm/kvm-all.c:3477:
qemu-system-loongarch64: KVM_SET_DEVICE_ATTR failed: Group 1073741825 attr 0x0000000000010000: Invalid argument

Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Message-ID: <20250725081213.3867592-1-gaosong@loongson.cn>
hw/intc/loongarch_ipi_kvm.c