dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers
Christian Borntraeger 370076d932 virtio net: fix oops on interface-up
I got the following oops during interface ifup. Unfortunately its not
easily reproducable so I cant say for sure that my fix fixes this
problem, but I am confident and I think its correct anyway:

   <2>kernel BUG at /space/kvm/drivers/virtio/virtio_ring.c:234!
    <4>illegal operation: 0001 [#1] PREEMPT SMP
    <4>Modules linked in:
    <4>CPU: 0 Not tainted 2.6.24zlive-guest-07293-gf1ca151-dirty #91
    <4>Process swapper (pid: 0, task: 0000000000800938, ksp: 000000000084ddb8)
    <4>Krnl PSW : 0404300180000000 0000000000466374 (vring_disable_cb+0x30/0x34)
    <4>           R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:0 CC:3 PM:0 EA:3
    <4>Krnl GPRS: 0000000000000001 0000000000000001 0000000010003800 0000000000466344
    <4>           000000000e980900 00000000008848b0 000000000084e748 0000000000000000
    <4>           000000000087b300 0000000000001237 0000000000001237 000000000f85bdd8
    <4>           000000000e980920 00000000001137c0 0000000000464754 000000000f85bdd8
    <4>Krnl Code: 0000000000466368: e3b0b0700004        lg      %r11,112(%r11)
    <4>           000000000046636e: 07fe                bcr     15,%r14
    <4>           0000000000466370: a7f40001            brc     15,466372
    <4>          >0000000000466374: a7f4fff6            brc     15,466360
    <4>           0000000000466378: eb7ff0500024        stmg    %r7,%r15,80(%r15)
    <4>           000000000046637e: a7f13e00            tmll    %r15,15872
    <4>           0000000000466382: b90400ef            lgr     %r14,%r15
    <4>           0000000000466386: a7840001            brc     8,466388
    <4>Call Trace:
    <4>([<000201500f85c000>] 0x201500f85c000)
    <4> [<0000000000466556>] vring_interrupt+0x72/0x88
    <4> [<00000000004801a0>] kvm_extint_handler+0x34/0x44
    <4> [<000000000010d22c>] do_extint+0xbc/0xf8
    <4> [<0000000000113f98>] ext_no_vtime+0x16/0x1a
    <4> [<000000000010a182>] cpu_idle+0x216/0x238
    <4>([<000000000010a162>] cpu_idle+0x1f6/0x238)
    <4> [<0000000000568656>] rest_init+0xaa/0xb8
    <4> [<000000000084ee2c>] start_kernel+0x3fc/0x490
    <4> [<0000000000100020>] _stext+0x20/0x80
    <4>
    <4> <0>Kernel panic - not syncing: Fatal exception in interrupt
    <4>

After looking at the code and the dump I think the following scenario
happened: Ifup was running on cpu2 and the interrupt arrived on cpu0.
Now virtnet_open on cpu 2 managed to execute napi_enable and disable_cb
but did not execute rx_schedule. Meanwhile on cpu 0 skb_recv_done was
called by vring_interrupt, executed netif_rx_schedule_prep, which
succeeded and therefore called disable_cb. This triggered the BUG_ON,
as interrupts were already disabled by cpu 2.

I think the proper solution is to make the call to disable_cb depend on
the atomic update of NAPI_STATE_SCHED by using netif_rx_schedule_prep
in the same way as skb_recv_done.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-06 06:42:30 -05:00
..
acorn/char
acpi drivers/acpi/: Spelling fixes 2008-02-03 17:06:17 +02:00
amba
ata drivers/ata/: Spelling fixes 2008-02-03 17:08:11 +02:00
atm
auxdisplay
base Driver core: Remove unneeded get_{device,driver}() calls. 2008-02-02 15:14:49 -08:00
block Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus 2008-02-04 08:00:54 -08:00
bluetooth drivers/bluetooth/: Spelling fixes 2008-02-03 17:10:31 +02:00
cdrom ide-cd: move lba_to_msf() and msf_to_lba() to <linux/cdrom.h> 2008-02-01 23:09:24 +01:00
char Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus 2008-02-04 08:00:54 -08:00
clocksource
connector [NETNS]: Consolidate kernel netlink socket destruction. 2008-01-28 15:08:07 -08:00
cpufreq cpufreq: fix obvious condition statement error 2008-01-30 13:33:34 +01:00
cpuidle
crypto
dca
dio dio: fix kernel-doc notation 2008-02-03 16:29:12 +02:00
dma
edac drivers/edac/: Spelling fixes 2008-02-03 17:12:34 +02:00
eisa
firewire firewire: fw-sbp2: Use sbp2 device-provided mgt orb timeout for logins 2008-01-30 22:22:29 +01:00
firmware drivers/firmware/: Spelling fixes 2008-02-03 17:13:40 +02:00
hid
hwmon
i2c PCI: Remove users of pci_enable_device_bars() 2008-02-01 15:04:27 -08:00
ide Spelling fixes: lenght->length 2008-02-03 15:42:53 +02:00
ieee1394 ieee1394: sbp2: fix bogus s/g access change 2008-02-02 13:48:16 +01:00
infiniband [SCSI] remove use_sg_chaining 2008-01-30 13:14:02 -06:00
input drivers/input/: Spelling fixes 2008-02-03 17:15:20 +02:00
isdn drivers/isdn/: Spelling fixes 2008-02-03 17:16:28 +02:00
leds
lguest virtio: reset function 2008-02-04 23:50:03 +11:00
macintosh Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2008-02-04 07:58:52 -08:00
mca
md
media drivers/media/: Spelling fixes 2008-02-03 17:18:59 +02:00
message drivers/message/: Spelling fixes 2008-02-03 17:21:01 +02:00
mfd
misc
mmc
mtd drivers/mtd/: Spelling fixes 2008-02-03 17:22:34 +02:00
net virtio net: fix oops on interface-up 2008-02-06 06:42:30 -05:00
nubus drivers/nubus/: Spelling fixes 2008-02-03 17:23:36 +02:00
of
oprofile
parisc drivers/parisc/: Spelling fixes 2008-02-03 17:24:37 +02:00
parport Spelling fixes: lenght->length 2008-02-03 15:42:53 +02:00
pci PCI: fix 4x section mismatch warnings 2008-02-02 15:08:04 -08:00
pcmcia Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-02-04 15:29:53 -08:00
pnp git-x86: drivers/pnp/pnpbios/bioscalls.c build fix 2008-01-30 13:32:31 +01:00
power apm_power: check I.intval for zero value, we use it as the divisor 2008-02-02 02:44:34 +03:00
ps3
rapidio Merge branch 'linux-2.6' 2008-01-31 11:25:51 +11:00
rtc
s390 [SCSI] zfcp: fix sense_buffer access bug 2008-01-30 13:03:39 -06:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2008-02-04 07:58:52 -08:00
serial Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-02-04 15:29:53 -08:00
sh
sn
spi Spelling fixes: lenght->length 2008-02-03 15:42:53 +02:00
ssb drivers/ssb/: Spelling fixes 2008-02-03 17:30:25 +02:00
tc
telephony
uio
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6 2008-02-02 14:29:33 +11:00
video drivers/video/: Spelling fixes 2008-02-03 17:31:49 +02:00
virtio virtio: balloon driver 2008-02-04 23:50:13 +11:00
w1
watchdog drivers/watchdog/: Spelling fixes 2008-02-03 17:32:52 +02:00
xen
zorro
Kconfig virtio: Put the virtio under the virtualization menu 2008-02-04 23:50:05 +11:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus 2008-01-31 09:35:32 +11:00