Merge master.kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6
[sfrench/cifs-2.6.git] / arch / ppc64 / kernel / entry.S
index b61572eb2a7130d7a46924f8412024b9879286e7..e8c0bbf4d000353c176b55d4da7c36b628b19b65 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/mmu.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/cputable.h>
 
 #ifdef CONFIG_PPC_ISERIES
@@ -276,12 +276,22 @@ _GLOBAL(ppc64_rt_sigsuspend)
 _GLOBAL(ppc32_rt_sigsuspend)
        bl      .save_nvgprs
        bl      .sys32_rt_sigsuspend
-       /* If sigsuspend() returns zero, we are going into a signal handler */
 70:    cmpdi   0,r3,0
-       beq     .ret_from_except
-       /* If it returned -EINTR, we need to return via syscall_exit to set
+       /* If it returned an error, we need to return via syscall_exit to set
           the SO bit in cr0 and potentially stop for ptrace. */
-       b       syscall_exit
+       bne     syscall_exit
+       /* If sigsuspend() returns zero, we are going into a signal handler. We
+          may need to call audit_syscall_exit() to mark the exit from sigsuspend() */
+#ifdef CONFIG_AUDIT
+       ld      r3,PACACURRENT(r13)
+       ld      r4,AUDITCONTEXT(r3)
+       cmpdi   0,r4,0
+       beq     .ret_from_except        /* No audit_context: Leave immediately. */
+       li      r4, 2                   /* AUDITSC_FAILURE */
+       li      r5,-4                   /* It's always -EINTR */
+       bl      .audit_syscall_exit
+#endif
+       b       .ret_from_except
 
 _GLOBAL(ppc_fork)
        bl      .save_nvgprs
@@ -400,15 +410,14 @@ BEGIN_FTR_SECTION
        cmpd    cr1,r6,r9       /* or is new ESID the same as current ESID? */
        cror    eq,4*cr1+eq,eq
        beq     2f              /* if yes, don't slbie it */
-       oris    r0,r6,0x0800    /* set C (class) bit */
 
        /* Bolt in the new stack SLB entry */
        ld      r7,KSP_VSID(r4) /* Get new stack's VSID */
-       oris    r6,r6,(SLB_ESID_V)@h
-       ori     r6,r6,(SLB_NUM_BOLTED-1)@l
-       slbie   r0
-       slbie   r0              /* Workaround POWER5 < DD2.1 issue */
-       slbmte  r7,r6
+       oris    r0,r6,(SLB_ESID_V)@h
+       ori     r0,r0,(SLB_NUM_BOLTED-1)@l
+       slbie   r6
+       slbie   r6              /* Workaround POWER5 < DD2.1 issue */
+       slbmte  r7,r0
        isync
 
 2: