]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
powerpc/32: Entry cpu time accounting in C
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Fri, 12 Mar 2021 12:50:18 +0000 (12:50 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 29 Mar 2021 02:22:04 +0000 (13:22 +1100)
There is no need for this to be in asm,
use the new interrupt entry wrapper.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/daca4c3e05cdfe54d237162a0718b3aaca897662.1615552866.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/interrupt.h
arch/powerpc/include/asm/ppc_asm.h
arch/powerpc/kernel/entry_32.S

index b2f69e5dcb50bc1f9f8a1d1cbba12865afee517f..c35368adbe7188df2a2567e548a688bfdf87e62b 100644 (file)
@@ -32,6 +32,9 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup
 #ifdef CONFIG_PPC32
        if (!arch_irq_disabled_regs(regs))
                trace_hardirqs_off();
+
+       if (user_mode(regs))
+               account_cpu_user_entry();
 #endif
        /*
         * Book3E reconciles irq soft mask in asm
index 3dceb64fc9af24855d76b6aa9df7a99cb78217c9..8998122fc7e22d7dda455da996a2315640d401f4 100644 (file)
  */
 
 #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
-#define ACCOUNT_CPU_USER_ENTRY(ptr, ra, rb)
 #define ACCOUNT_CPU_USER_EXIT(ptr, ra, rb)
 #else
-#define ACCOUNT_CPU_USER_ENTRY(ptr, ra, rb)                            \
-       MFTB(ra);                       /* get timebase */              \
-       PPC_LL  rb, ACCOUNT_STARTTIME_USER(ptr);                        \
-       PPC_STL ra, ACCOUNT_STARTTIME(ptr);                             \
-       subf    rb,rb,ra;               /* subtract start value */      \
-       PPC_LL  ra, ACCOUNT_USER_TIME(ptr);                             \
-       add     ra,ra,rb;               /* add on to user time */       \
-       PPC_STL ra, ACCOUNT_USER_TIME(ptr);                             \
-
 #define ACCOUNT_CPU_USER_EXIT(ptr, ra, rb)                             \
        MFTB(ra);                       /* get timebase */              \
        PPC_LL  rb, ACCOUNT_STARTTIME(ptr);                             \
index 0f18fe14649c6689821c97a6eb00de4b0d9ec22a..0f3f1bdd909eb8e86e8f0893b0c4236c546fec64 100644 (file)
@@ -152,7 +152,6 @@ transfer_to_handler:
        lwz     r12,THREAD_DBCR0(r12)
        andis.  r12,r12,DBCR0_IDM@h
 #endif
-       ACCOUNT_CPU_USER_ENTRY(r2, r11, r12)
 #ifdef CONFIG_PPC_BOOK3S_32
        kuep_lock r11, r12
 #endif