<br><tt><font size=2>crash-utility-bounces@redhat.com wrote on 27/09/2007
15:45:21:<br>
<br>
> Richard J Moore wrote:<br>
> <br>
> > On looking at the code in entry.S at page_fault and the other
exception <br>
> > entry points I see no attempt to save regs to create a pt_regs
struct. <br>
> > The fact that do_page_fault takes pt_regs as the first arg is
a hack to <br>
> > get at CS:EIP and SS:ESP at the time of exception. <br>
> <br>
> KPROBE_ENTRY(page_fault)<br>
> RING0_EC_FRAME<br>
> pushl $do_page_fault<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> ALIGN<br>
> error_code:<br>
> /* the function address is in %fs's slot on the stack
*/<br>
> pushl %es<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> /*CFI_REL_OFFSET es, 0*/<br>
> pushl %ds<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> /*CFI_REL_OFFSET ds, 0*/<br>
> pushl %eax<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> CFI_REL_OFFSET eax, 0<br>
> pushl %ebp<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> CFI_REL_OFFSET ebp, 0<br>
> pushl %edi<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> CFI_REL_OFFSET edi, 0<br>
> pushl %esi<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> CFI_REL_OFFSET esi, 0<br>
> pushl %edx<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> CFI_REL_OFFSET edx, 0<br>
> pushl %ecx<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> CFI_REL_OFFSET ecx, 0<br>
> pushl %ebx<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> CFI_REL_OFFSET ebx, 0<br>
> cld<br>
> pushl %fs<br>
> CFI_ADJUST_CFA_OFFSET 4<br>
> /*CFI_REL_OFFSET fs, 0*/<br>
> movl $(__KERNEL_PERCPU), %ecx<br>
> movl %ecx, %fs<br>
> UNWIND_ESPFIX_STACK<br>
> popl %ecx<br>
> CFI_ADJUST_CFA_OFFSET -4<br>
> /*CFI_REGISTER es, ecx*/<br>
> movl PT_FS(%esp), %edi # get the
function address<br>
> movl PT_ORIG_EAX(%esp), %edx # get the error code<br>
> movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart<br>
> mov %ecx, PT_FS(%esp)<br>
> /*CFI_REL_OFFSET fs, ES*/<br>
> movl $(__USER_DS), %ecx<br>
> movl %ecx, %ds<br>
> movl %ecx, %es<br>
> movl %esp,%eax # pt_regs
pointer<br>
> call *%edi<br>
> jmp ret_from_exception<br>
> CFI_ENDPROC<br>
> KPROBE_END(page_fault)<br>
> </font></tt>
<br>
<br><tt><font size=2>Dave, it looks like error_code: has been change relatively
recently. My source starts:</font></tt>
<br><tt><font size=2>error_code:</font></tt>
<br><tt><font size=2> pushl %ds</font></tt>
<br><tt><font size=2> pushl %eax</font></tt>
<br><tt><font size=2> xorl %eax,%eax</font></tt>
<br><tt><font size=2> pushl %ebp</font></tt>
<br><tt><font size=2> </font></tt>
<br><tt><font size=2>and so on. Clearly not a valid pt_regs struct.</font></tt>
<br><tt><font size=2>The source I'm working with is from FC5. On your version
of the kernel only the ERR, SS and ESP would be invalid. </font></tt>
<br><tt><font size=2>What tree is yours taken from?</font></tt>
<br>
<br><tt><font size=2>Richard</font></tt>
<br><tt><font size=2><br>
</font></tt><font size=3 face="sans-serif"><br>
</font>
<br><font size=3 face="sans-serif"><br>
</font>
<hr><font size=2 face="sans-serif"><br>
<i><br>
</i></font>
<p><font size=2 face="sans-serif"><i>Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU</i></font>
<p><font size=2 face="sans-serif"><br>
</font><font size=3 face="sans-serif"><br>
</font>
<br>
<br><font size=3 face="sans-serif"><br>
</font>