1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
id = 1999
title = "qemu got sigabrt when using vpp in guest and dpdk for qemu"
state = "opened"
created_at = "2023-11-23T06:04:09.084Z"
closed_at = "n/a"
labels = ["accel: KVM"]
url = "https://gitlab.com/qemu-project/qemu/-/issues/1999"
host-os = "Rockylinux 8"
host-arch = "x86"
qemu-version = "qemu-kvm-7.2.0-14.el9 (in a container)"
guest-os = "Ubuntu 22.04.3 LTS"
guest-arch = "x86"
description = """When set the interface up in vpp, the qemu process is crashed with signal sigabrt.
After some debug, i have identified that the problem lies in the following function.
```c
static int setup_routing_entry(struct kvm *kvm,
\t\t\t struct kvm_irq_routing_table *rt,
\t\t\t struct kvm_kernel_irq_routing_entry *e,
\t\t\t const struct kvm_irq_routing_entry *ue)
{
\tstruct kvm_kernel_irq_routing_entry *ei;
\tint r;
\tu32 gsi = array_index_nospec(ue->gsi, KVM_MAX_IRQ_ROUTES);
\t/*
\t * Do not allow GSI to be mapped to the same irqchip more than once.
\t * Allow only one to one mapping between GSI and non-irqchip routing.
\t */
\thlist_for_each_entry(ei, &rt->map[gsi], link)
\t\tif (ei->type != KVM_IRQ_ROUTING_IRQCHIP ||
\t\t ue->type != KVM_IRQ_ROUTING_IRQCHIP ||
\t\t ue->u.irqchip.irqchip == ei->irqchip.irqchip)
\t\t\treturn -EINVAL;
```
I added some debug printk like following
```c
hlist_for_each_entry(ei, &rt->map[gsi], link)
if (ei->type != KVM_IRQ_ROUTING_IRQCHIP ||
ue->type != KVM_IRQ_ROUTING_IRQCHIP ||
ue->u.irqchip.irqchip == ei->irqchip.irqchip){
printk("ei->type: %u, KVM_IRQ_ROUTING_IRQCHIP: %u, ue->type: %u, ue->u.irqchip.irqchip: %u , ei->irqchip.irqchip: %u", ei->type, KVM_IRQ_ROUTING_IRQCHIP , ue->type, ue->u.irqchip.irqchip , ei->irqchip.irqchip);
return -EINVAL;
}
```
Then i got following in dmesg
```
[Thu Nov 23 09:29:10 2023] ei->type: 2, KVM_IRQ_ROUTING_IRQCHIP: 1, ue->type: 1, ue->u.irqchip.irqchip: 2 , ei->irqchip.irqchip: 4276097024
[Thu Nov 23 09:29:10 2023] ei->type: 2, KVM_IRQ_ROUTING_IRQCHIP: 1, ue->type: 1, ue->u.irqchip.irqchip: 2 , ei->irqchip.irqchip: 4276097024
```"""
reproduce = """This is a kube-ovn + dpdk env, not easy to reproduce now.."""
additional = """* I also file a bug on kernel.org: https://bugzilla.kernel.org/show_bug.cgi?id=218177
* the libvirt xml file is also attached [instance.xml](/uploads/05b391046fdc1263fd7e63bcfab6f4fb/instance.xml)"""
|