Re: Bug in the syscall tracing code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

4. I know there should be yet another way.

The way is to load a saved register in the delay slot of jalr. The saved register shall not be s0, of course, because it's saved by the first instruction in save_static_function. So the proposed patch is

arch/mips/kernel/scall32-o32.S:

syscall_trace_entry:
        SAVE_STATIC
-	move	s0, t2
+	move	s1, t2
        move    a0, sp
        li      a1, 0
        jal     do_syscall_trace

        lw      a0, PT_R4(sp)           # Restore argument registers
        lw      a1, PT_R5(sp)
        lw      a2, PT_R6(sp)
        lw      a3, PT_R7(sp)
-        jalr	s0
+	.set push
+	.set noreorder
+	jalr	s1
+	 lw	s1, PT_R17(sp)
+	.set pop

The rest of ABIs shall be implemented in the same way.

Regards,
Gleb.


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux