Running gdb 4.17 on vmlinux (2.1.117) displays the following output:
(gdb) x/10i __switch_to
0xc01088d0 <__switch_to>: pushl %esi
0xc01088d1 <__switch_to+1>: pushl %ebx
0xc01088d2 <__switch_to+2>: movl 0xc(%esp,1),%ebx
0xc01088d6 <__switch_to+6>: movl 0x10(%esp,1),%ecx
0xc01088da <__switch_to+10>: movl 0x4(%ebx),%eax
0xc01088dd <__switch_to+13>: testl $0x100000,%eax
0xc01088e2 <__switch_to+18>: je 0xc01088fc <__switch_to+44>
0xc01088e4 <__switch_to+20>: andl $0xffefffff,%eax
0xc01088e9 <__switch_to+25>: movl %eax,0x4(%ebx)
0xc01088ec <__switch_to+28>: fnsave 0x400(%ebx)
Your interpretation? Shall I reinstall GNU gcc and abandon egcs?
Thanks.
On Thu, 20 Aug 1998, Linus Torvalds wrote:
> On Thu, 20 Aug 1998, rbarnett wrote:
> >
> > For kernel 2.1.117 at bootup time:
> >
> > Unable to handle kernel NULL pointer dereference at virtual address 00000f04
>
> Hmm.. What compiler are you using? It doesn't seem to be the same as I
> have, and this function _is_ kind of special in that __switch_to() uses
> the special FASTCALL() semantics..
>
> Judging by the offsets in your __switch_to(), it might be that the thing
> that happens is that gcc doesn't do the proper fast-call thing for you.
>
> > Code: c01088da <__switch_to+a/d0> 8b 43 04 movl 0x4(%ebx),%eax
> > Code: c01088dd <__switch_to+d/d0> a9 00 00 10 00 testl $0x100000,%eax
> > Code: c01088e2 <__switch_to+12/d0> 74 18 je c01088fc <__switch_to+2c/d0>
> > Code: c01088e4 <__switch_to+14/d0> 25 ff ff ef ff andl $0xffefffff,%eax
> > Code: c01088e9 <__switch_to+19/d0> 89 43 04 movl %eax,0x4(%ebx)
> > Code: c01088ec <__switch_to+1c/d0> dd b3 00 90 90 fnsave 0x90909000(%ebx)
>
> __switch_to _should_ disassemble to:
>
> <__switch_to>: pushl %esi
> <__switch_to+1>: pushl %ebx
> <__switch_to+2>: movl %eax,%ebx
> <__switch_to+4>: movl %edx,%ecx
> <__switch_to+6>: movl 0x4(%ebx),%eax
> <__switch_to+9>: testl $0x100000,%eax
> <__switch_to+14>: je 0xc0108908 <__switch_to+40>
> ....
>
> and your disassembly seems to indicate that yu have the offending "movl"
> at offset 10 instead of offset 6. That would be explained by the compiler
> for some reason compiling the function with the "normal" slow calling
> convention.
>
> So do a
>
> gdb vmlinux
> x/10i __switch_to
>
> to see what your version of __switch_to() has been compiled as. If it
> doesn't get the arguments from %eax and %edx, then you have a compiler
> problem.
>
> Linus
>
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html