Description of problem: KVM虚拟机以32vcpu启动时内核报错。 KVM虚拟机以2、4、8、16vcpu启动时内核没有报错。 Version-Release number of selected component (if applicable): 内核版本: kernel-4.19.190-7.11.an8.loongarch64 qemu版本: qemu-kvm-6.2.0-53.0.3.module+an8.9.0+11292+334bc2d1.2 How reproducible: Steps to Reproduce: 1. 使用virt-manager创建一个32vcpu的虚拟机。观察内核启动信息。 Actual results: KVM虚拟机以32vcpu启动时内核报错。信息如下: [ 4.343355] ACPI: Power Button [PWRF] [ 4.351176] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled [ 4.374983] 00:00: ttyS0 at MMIO 0x1fe001e0 (irq = 18, base_baud = 115200) is a 16550A [ 4.686325] console [ttyS0] enabled [ 4.688153] loongarch_iommu_ivrs_init get ivrs table failed [ 4.688732] Failed to init iommu by ivrs [ 4.696894] brd: module loaded [ 4.701938] loop: module loaded [ 4.704823] WARNING: CPU: 23 PID: 1 at drivers/pci/msi.c:1259 pci_irq_vector+0x44/0x98 [ 4.705643] Modules linked in: [ 4.706667] CPU: 23 PID: 1 Comm: swapper/0 Not tainted 4.19.190+ #2 [ 4.707935] Hardware name: Loongson KVM, BIOS 0.0.0 02/06/2015 [ 4.709158] pc 9000000000a047fc ra 9000000000a9cb28 tp 90000000f4570000 sp 90000000f4573a90 [ 4.710770] a0 90000000f5b0b000 a1 0000000000000020 a2 90000000daad6100 a3 ffff0a00ffffff04 [ 4.712235] a4 90000000dab7dfcc a5 0000000000001000 a6 9000000000bd0e38 a7 90000000dab7dfcc [ 4.713742] t0 90000000f5b0b2a0 t1 0000000000000020 t2 90000000f5b0b2a0 t3 0000000000000020 [ 4.715215] t4 0000000025482034 t5 900000000129c268 t6 00000000000000d7 t7 0000000000000000 [ 4.716669] t8 90000000ece9c000 u0 0000000000000020 s9 000000000000001f s0 90000000da8e3cf8 [ 4.718138] s1 0000000000000000 s2 90000000da8e2300 s3 90000000da48ac00 s4 90000000da8e3400 [ 4.719588] s5 90000000da8e34f8 s6 0000000000000020 s7 0000000000000020 s8 0000000000002000 [ 4.721044] ra: 9000000000a9cb28 vp_find_vqs_msix+0x240/0x458 [ 4.722279] ERA: 9000000000a047fc pci_irq_vector+0x44/0x98 [ 4.723459] CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE) [ 4.724699] PRMD: 00000004 (PPLV0 +PIE -PWE) [ 4.725781] EUEN: 00000000 (-FPE -SXE -ASXE -BTE) [ 4.726873] ECFG: 00071c1c (LIE=2-4,10-12 VS=7) [ 4.727931] ESTAT: 000c0000 [ 4.728806] ExcCode : c (SubCode 0) [ 4.729752] PRID: 0014c010 (Loongson-64bit, Loongson-3C5000) [ 4.730895] CPU: 23 PID: 1 Comm: swapper/0 Not tainted 4.19.190+ #2 [ 4.732083] Hardware name: Loongson KVM, BIOS 0.0.0 02/06/2015 [ 4.733236] Stack : 0000000000000000 90000000010fa3d8 90000000f4570000 90000000f4573730 [ 4.734607] 0000000000000000 90000000f4573730 0000000000000000 fffffffffffffff8 [ 4.735966] 0000000000000000 0000000000000001 90000000ed1c8600 ffffffffffffffff [ 4.737311] 90000000010fa3d8 90000000016370d8 0000000000000001 0000000000000001 [ 4.738667] 90000000ed1c8600 ffff80010c5cdba0 000000000000029a ffff80010c5cdba0 [ 4.740001] 0000000000000001 0000000007978000 000000000000001f 0000000000000000 [ 4.741324] 90000000017495f0 0000000000000000 9000000000a047fc 90000000014e727d [ 4.742665] 00000000000004eb 0000000000000020 0000000000000020 0000000000002000 [ 4.743971] 900000000020a11c 0000000000000000 00000000000000b0 0000000000000004 [ 4.745257] 0000000000000000 0000000000071c1c 0000000000000000 90000000017495f0 [ 4.746559] ... [ 4.747327] Call Trace: [ 4.748176] [<900000000020a11c>] show_stack+0x34/0x140 [ 4.749200] [<90000000010fa3d4>] dump_stack+0x98/0xd0 [ 4.750213] [<9000000000228b10>] __warn+0xa8/0x120 [ 4.751175] [<90000000010d5608>] report_bug+0x98/0x130 [ 4.752158] [<900000000020aa90>] do_bp+0x288/0x318 [ 4.753105] [<90000000002036d4>] handle_bp_int+0x4c/0x78 [ 4.754100] [<9000000000a047fc>] pci_irq_vector+0x44/0x98 [ 4.755086] [<9000000000a9cb24>] vp_find_vqs_msix+0x23c/0x458 [ 4.756098] [<9000000000a9cda0>] vp_find_vqs+0x60/0x210 [ 4.757061] [<9000000000a9b6c0>] vp_modern_find_vqs+0x18/0x68 [ 4.758081] [<9000000000bd1214>] init_vq+0x1ac/0x350 [ 4.759012] [<9000000000bd244c>] virtblk_probe+0xf4/0x6d0 [ 4.759982] [<9000000000a986ec>] virtio_dev_probe+0x194/0x288 [ 4.761021] [<9000000000b9e4f4>] really_probe+0x1fc/0x2c0 [ 4.761989] [<9000000000b9e768>] driver_probe_device+0x68/0x108 [ 4.763079] [<9000000000b9e920>] __driver_attach+0x118/0x120 [ 4.764210] [<9000000000b9be18>] bus_for_each_dev+0x68/0xb0 [ 4.765174] [<9000000000b9d64c>] bus_add_driver+0x1fc/0x238 [ 4.766155] [<9000000000b9f668>] driver_register+0x68/0x138 [ 4.767119] [<9000000001ce18a4>] init+0x7c/0xbc [ 4.767978] [<9000000000200bd0>] do_one_initcall+0x40/0x1c8 [ 4.768942] [<9000000001c88f64>] kernel_init_freeable+0x2f4/0x3c0 [ 4.769966] [<90000000010fc0d4>] kernel_init+0x14/0x100 [ 4.770881] [<90000000002031a8>] ret_from_kernel_thread+0x8/0x10 [ 4.771884] ---[ end trace f63b14405679940b ]--- [ 4.792779] virtio_blk virtio5: [vda] 104857600 512-byte logical blocks (53.7 GB/50.0 GiB) [ 4.797472] vda: vda1 vda2 vda3 Expected results: KVM虚拟机以32vcpu启动时内核没有报错。 Additional info:
3C5000、3D5000的cpu最大可处理的扩展中断最多是256个,其中有一部分桥片内的设备使用了,留给pci设备的只有192个,当多队列pci设备过多的情况下,中断就不够用了。系统启动过程中会导致申请中断失败而启动失败。 所以内核做了限制队列pci设备申请的中断数需要小于32个,而pci设备的队列数在qemu仿真的时候是根据vcpu个数来仿真的,所以,当vcpu数达到32个时,会超过设定的限制打印调用栈并错误返回, 这个是平台固有限制,我们不做修复
平台固有限制,暂不做修复