Xenomai and MSI enabled crashes kernel
Hi Jan,
I have looked closed into that issue.
For that I have added a global array that is written within __ipipe_handle_irq() (file arch/i386/kernel/ipipe.c):
extern int xxx_int[];
irq = ~irq;
xxx_int[0] = irq;#ifdef CONFIG_X86_LOCAL_APIC
{
unsigned vector = irq + FIRST_EXTERNAL_VECTOR;
if (vector >= FIRST_SYSTEM_VECTOR)
irq = ipipe_apic_vector_irq(vector);
}
xxx_int[1] = irq;This global variable is printed out within the kernel trap.
It returns the values 0xcf and 0xe0 (207 and 224) for xxx_int[0], xxx_int[1].
And this is the really strange thing as the IRQ for the e1000 should be 219 (on a non-adeos-patched kernel). I do not know what happens here, but it looks really strange...
Regards
Mathias
---------------------------------------
Intel(R) PRO/1000 Network Driver - version 7.3.15-k2
Copyright (c) 1999-2006 Intel Corporation.
ACPI: PCI Interrupt 0000:05:00.0[A] -> GSI 16 (level, low) -> IRQ 16
e1000: 0000:05:00.0: e1000_probe: (PCI Express:2.5Gb/s:Width x1) 00:30:48:5a:f9:0a
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000 printing eip: 00000000 *pde = 00000000 Oops: 0000 [#1] SMP Modules linked in: e1000 xxx_int: cf e0 0 0 CPU: 0 EIP: 0060:[<00000000>] Not tainted VLI EFLAGS: 00010086 (2.6.20.4-msi2 #11)
EIP is at _stext+0x3feffc70/0x14
eax: c0112410 ebx: 00000007 ecx: c0114519 edx: df048000
esi: 00000006 edi: 00000046 ebp: ffffffff esp: df049e20
ds: 007b es: 007b ss: 0068
Process ifconfig (pid: 1241, ti=df048000 task=c173e030 task.ti=df048000)
Stack: c03e6f00 000000ec 00000000 c03d9180 c010f14d 00007600 00000001 00000060
e099a1ed 00000286 ffffff24 df75b5c8 00000000 0000000f 00000001 c01035b9
df75b5c8 e099a0ff e09c0000 00000000 0000000f 00000001 80080740 dfc7007b
Call Trace:
[<c010f14d>] __ipipe_handle_irq+0x1d3/0x225
[<e099a1ed>] e1000_set_multi+0xee/0x189 [e1000]
[<c01035b9>] common_interrupt+0x21/0x38
[<e099a0ff>] e1000_set_multi+0x0/0x189 [e1000]
[<e099a1ed>] e1000_set_multi+0xee/0x189 [e1000]
[<c02dd151>] __dev_mc_upload+0x1d/0x1e
[<c02dd271>] dev_mc_upload+0x24/0x37
[<c02db77c>] dev_open+0x44/0x62
[<c02da249>] dev_change_flags+0x47/0xe4
[<c030d362>] devinet_ioctl+0x252/0x56f
[<c02db35a>] dev_ifsioc+0x113/0x38d
[<c02d1774>] sock_ioctl+0x0/0x1ad
[<c02d1902>] sock_ioctl+0x18e/0x1ad
[<c02d1774>] sock_ioctl+0x0/0x1ad
[<c015e35b>] do_ioctl+0x1f/0x62
[<c015e5e2>] vfs_ioctl+0x244/0x256
[<c015e627>] sys_ioctl+0x33/0x4c
[<c01029f3>] sysenter_past_esp+0x6c/0x70
=======================
Code: Bad EIP value.
EIP: [<00000000>] _stext+0x3feffc70/0x14 SS:ESP 0068:df049e20
<0>Kernel panic - not syncing: Fatal exception in interrupt
BUG: at arch/i386/kernel/smp.c:565 smp_call_function()
[<c010bab3>] smp_call_function+0x66/0x10a
[<c0118fde>] printk+0x62/0xd5
[<c010bb72>] smp_send_stop+0x1b/0x2b
[<c0118579>] panic+0x4d/0xe4
[<c0104121>] die+0x1f2/0x226
[<c0111848>] do_page_fault+0x447/0x517
[<c010f7e7>] __ipipe_handle_exception+0xce/0x158
[<c010bcce>] smp_call_function_interrupt+0x31/0x4c
[<c033353d>] error_code+0x81/0x90
[<c0114519>] try_to_wake_up+0x33c/0x346
[<c0112410>] __activate_task+0x1c/0x29
[<c010f14d>] __ipipe_handle_irq+0x1d3/0x225
[<e099a1ed>] e1000_set_multi+0xee/0x189 [e1000]
[<c01035b9>] common_interrupt+0x21/0x38
[<e099a0ff>] e1000_set_multi+0x0/0x189 [e1000]
[<e099a1ed>] e1000_set_multi+0xee/0x189 [e1000]
[<c02dd151>] __dev_mc_upload+0x1d/0x1e
[<c02dd271>] dev_mc_upload+0x24/0x37
[<c02db77c>] dev_open+0x44/0x62
[<c02da249>] dev_change_flags+0x47/0xe4
[<c030d362>] devinet_ioctl+0x252/0x56f
[<c02db35a>] dev_ifsioc+0x113/0x38d
[<c02d1774>] sock_ioctl+0x0/0x1ad
[<c02d1902>] sock_ioctl+0x18e/0x1ad
[<c02d1774>] sock_ioctl+0x0/0x1ad
[<c015e35b>] do_ioctl+0x1f/0x62
[<c015e5e2>] vfs_ioctl+0x244/0x256
[<c015e627>] sys_ioctl+0x33/0x4c
[<c01029f3>] sysenter_past_esp+0x6c/0x70
=======================----- Original Nachricht ----
Von: Jan Kiszka <[email protected]> An: "M. Koehrer" <[email protected]> Datum: 02.05.2007 11:39 Betreff: Re: [Xenomai-help] Xenomai and MSI enabled crashes kernel
Quoted 53 lines
Quoted 5 lines · M. Koehrer
Hi Jan,
here is the result of this patch.
I patched in addition to Philippe's patches.Quoted 8 lines
Regards
Mathias
---------
Intel(R) PRO/1000 Network Driver - version 7.3.15-k2 Copyright (c) 1999-2006 Intel Corporation.
ACPI: PCI Interrupt 0000:05:00.0[A] -> GSI 16 (level, low) -> IRQ 16
e1000: 0000:05:00.0:e1000_probe: (PCI Express:2.5Gb/s:Width x1)00:30:48:5a:f9:0a
Quoted 2 lines
e1000: eth0:
e1000_probe: Intel(R) PRO/1000 Network ConnectionBUG: unable to handle kernel NULL pointer dereference at virtual address00000000
Quoted 9 lines
printing eip:
dfedd3ca
*pde = 00000000Oops: 0000 [#1] SMP Modules linked in: e1000 CPU: 0 EIP: 0060:[<dfedd3ca>] Not tainted VLI EFLAGS: 00010082 (2.6.20.4 #7)Quoted 6 lines
EIP is at
0xdfedd3ca
eax:c0112478ebx: 00000001 ecx:c0114581edx:df06c001
esi:dfedf6c0edi:dfedc240ebp: 00000000 esp:df06ddf8
ds: 007b es: 007b ss: 0068
Process ifconfig (pid: 1242, ti=df06c000 task=c16f9030 task.ti=df06c000)Stack: 00000040 ffffffff 00000000 00000007 c03e6f00 000000ec 00000000
c03d9180Quoted 1 line
c010f1b5 c015291a decbe080 00000680 decbe080 00000724 c02d6dfd00007600
Quoted 1 line
00000001 00000060 e099a210 00000286 ffffff24 df7065c8 00000000
0000000fQuoted 2 lines
Call Trace: [<c010f1b5>] __ipipe_handle_irq+0x26b/0x2bdI must have patched crap into this, but I don't see it. Could someone have a look why there is no printk output related to #IRQ 219 (~0xffffff24, see stack content)?
BTW, Mathias, forcing your kernel into single CPU mode via kernel command line "cpus=1" doesn't expose the issue, right? Could we face some kind of setup race across the CPUs here?
Thanks,
Jan
Signature · 9 lines
Mathias Koehrer [email protected] Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer, nur 39,85 € inkl. DSL- und ISDN-Grundgebühr! http://www.arcor.de/rd/emf-dsl-2
Quoted 21 lines · M. Koehrer
Hi Jan,
I have looked closed into that issue.
For that I have added a global array that is written within__ipipe_handle_irq()(filearch/i386/kernel/ipipe.c):extern int xxx_int[]; irq = ~irq; xxx_int[0] = irq;#ifdef CONFIG_X86_LOCAL_APIC { unsigned vector = irq + FIRST_EXTERNAL_VECTOR; if (vector >= FIRST_SYSTEM_VECTOR) irq = ipipe_apic_vector_irq(vector); } xxx_int[1] = irq;
Quoted 5 lines
This global variable is printed out within the kernel trap.
It returns the values0xcfand0xe0(207 and 224) for xxx_int[0], xxx_int[1].
And this is the really strange thing as the IRQ for the e1000 should be 219 (on a non-adeos-patched kernel). I do not know what happens here, but it looks really strange...
Please make xxx_irq per-cpu to exclude ugly races with the second CPU handling IRQs in parallel. Also re-apply Philippe's vectoring instrumentation and post the full kernel log to have a consistent picture.
Jan
Quoted 21 lines · M. Koehrer
Hi Jan,
I have looked closed into that issue.
For that I have added a global array that is written within__ipipe_handle_irq()(filearch/i386/kernel/ipipe.c):extern int xxx_int[]; irq = ~irq; xxx_int[0] = irq;#ifdef CONFIG_X86_LOCAL_APIC { unsigned vector = irq + FIRST_EXTERNAL_VECTOR; if (vector >= FIRST_SYSTEM_VECTOR) irq = ipipe_apic_vector_irq(vector); } xxx_int[1] = irq;
Quoted 5 lines
This global variable is printed out within the kernel trap.
It returns the values0xcfand0xe0(207 and 224) for xxx_int[0], xxx_int[1].
And this is the really strange thing as the IRQ for the e1000 should be 219 (on a non-adeos-patched kernel). I do not know what happens here, but it looks really strange...
It's not, this is ok. Fact is that 0xcf is the LAPIC's local timer interrupt vectored from 0xef, this has nothing to do with the e1000 IRQ. The effect of my latest patch is to remap this value to the 224-256 range for IRQ numbers which Adeos now reserves to system interrupts on your setup, i.e. 0xcf becomes interrupt number 224, because it is a system interrupt.
As a sidenote, let's not draw any conclusion regarding the interrupt number that might cause the bug for now, we just don't have any guarantee that the boot log is not lying at us so far; e.g. the latest IRQ trace could well be stuck into the printk() ring buffer, regardless of ipipe_set_printk_sync() being in effect for the root domain or not. What we'd need is a raw serial console output routine (i.e. __ipipe_debug_serial() from other Adeos ports), but I've not implemented this for x86, unfortunately.
The sole and only important thing to achieve right now, is to have this bug 100% reproducible on a stabilized setup, which also provides enough instrumentation to allow further debugging without moving targets. It's an interrupt-related bug, no wonder it may have multiple incarnations, so let's choose one and only one of them, we could trace.
What I need to know, is which code is laid at address __ipipe_handle_irq+0x26b, this is why I asked for the disassembly. Each change in the kernel code or configuration option will much likely change this address, for that reason, what we need is:
- get back to CONFIG_DEBUG_KERNEL off, since enabling it changes the behaviour
- boot the machine, and hopefully get back to the usual BUG() message,
- send a copy of the kernel disassembly along with the boot log.
Without that, I have no mean to help debugging anything, I'm afraid.
Signature · 1 line
Philippe.
Hi Philippe,
I have restored the original kernel configuration and I got the crash again. As it happens during the boot, it is reproducible.
Enclosed is the console log (including the oops), the relevant disassemble part, the output of "nm vmlinux" and my kernel config.
If you like I can mail you privately the vmlinux aswell.
What I see from the disassembler listing
c010f10b: e8 5e ae 02 00 call c0139f6e <__ipipe_walk_pipeline> c010f110: ff 15 68 70 3d c0 call *0xc03d7068
is that ipipe_walk_pipeline is called followed by a indirect call to 0xc03d7068. I looked at nm vmlinux and found out that 0xc03d7068 is __ipipe_logical_cpuid.
I hope that helps to get closer to this bug...
Regards
Mathias
Quoted 34 lines
It's not, this is ok. Fact is that
0xcfis the LAPIC's local timer interrupt vectored from0xef, this has nothing to do with the e1000 IRQ. The effect of my latest patch is to remap this value to the 224-256 range for IRQ numbers which Adeos now reserves to system interrupts on your setup, i.e.0xcfbecomes interrupt number 224, because it is a system interrupt.As a sidenote, let's not draw any conclusion regarding the interrupt number that might cause the bug for now, we just don't have any guarantee that the boot log is not lying at us so far; e.g. the latest IRQ trace could well be stuck into the
printk()ring buffer, regardless ofipipe_set_printk_sync()being in effect for the root domain or not. What we'd need is a raw serial console output routine (i.e.__ipipe_debug_serial()from other Adeos ports), but I've not implemented this for x86, unfortunately.The sole and only important thing to achieve right now, is to have this bug 100% reproducible on a stabilized setup, which also provides enough instrumentation to allow further debugging without moving targets. It's an interrupt-related bug, no wonder it may have multiple incarnations, so let's choose one and only one of them, we could trace.
What I need to know, is which code is laid at address
__ipipe_handle_irq+0x26b, this is why I asked for the disassembly. Each change in the kernel code or configuration option will much likely change this address, for that reason, what we need is:- get back to
CONFIG_DEBUG_KERNELoff, since enabling it changes the behaviour
- boot the machine, and hopefully get back to the usualBUG()message,
- send a copy of the kernel disassembly along with the boot log.Without that, I have no mean to help debugging anything, I'm afraid.
Signature · 9 lines
Mathias Koehrer [email protected] Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer, nur 39,85 € inkl. DSL- und ISDN-Grundgebühr! http://www.arcor.de/rd/emf-dsl-2
Quoted 8 lines · M. Koehrer
Hi Philippe,
I have restored the original kernel configuration and I got the crash again. As it happens during the boot, it is reproducible.
Enclosed is the console log (including the oops), the relevant disassemble part, the output of "nm vmlinux" and my kernel config.
If you like I can mail you privately the vmlinux aswell.
What I see from the disassembler listing
Quoted 7 lines
c010f10b: e8 5e ae 02 00 call c0139f6e <__ipipe_walk_pipeline> c010f110: ff 15 68 70 3d c0 call *0xc03d7068is that
ipipe_walk_pipelineis called followed by a indirect call to0xc03d7068. I looked atnm vmlinuxand found out that0xc03d7068is__ipipe_logical_cpuid.I hope that helps to get closer to this bug...
Should be ok, thanks. I will have a close look at this.
Signature · 1 line
Philippe.