]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/powerpc/perf/8xx-pmu.c
csky: Minimize defconfig to support buildroot config.fragment
[linux.git] / arch / powerpc / perf / 8xx-pmu.c
index 19124b0b171a9dc13ed3c270052e7636994d9443..1ad03c55c88c35c2274ed0a9649e6c221f342d94 100644 (file)
@@ -157,10 +157,6 @@ static void mpc8xx_pmu_read(struct perf_event *event)
 
 static void mpc8xx_pmu_del(struct perf_event *event, int flags)
 {
-       /* mfspr r10, SPRN_SPRG_SCRATCH0 */
-       unsigned int insn = PPC_INST_MFSPR | __PPC_RS(R10) |
-                           __PPC_SPR(SPRN_SPRG_SCRATCH0);
-
        mpc8xx_pmu_read(event);
 
        /* If it was the last user, stop counting to avoid useles overhead */
@@ -173,6 +169,10 @@ static void mpc8xx_pmu_del(struct perf_event *event, int flags)
                break;
        case PERF_8xx_ID_ITLB_LOAD_MISS:
                if (atomic_dec_return(&itlb_miss_ref) == 0) {
+                       /* mfspr r10, SPRN_SPRG_SCRATCH0 */
+                       unsigned int insn = PPC_INST_MFSPR | __PPC_RS(R10) |
+                                           __PPC_SPR(SPRN_SPRG_SCRATCH0);
+
                        patch_instruction_site(&patch__itlbmiss_exit_1, insn);
 #ifndef CONFIG_PIN_TLB_TEXT
                        patch_instruction_site(&patch__itlbmiss_exit_2, insn);
@@ -181,6 +181,10 @@ static void mpc8xx_pmu_del(struct perf_event *event, int flags)
                break;
        case PERF_8xx_ID_DTLB_LOAD_MISS:
                if (atomic_dec_return(&dtlb_miss_ref) == 0) {
+                       /* mfspr r10, SPRN_DAR */
+                       unsigned int insn = PPC_INST_MFSPR | __PPC_RS(R10) |
+                                           __PPC_SPR(SPRN_DAR);
+
                        patch_instruction_site(&patch__dtlbmiss_exit_1, insn);
                        patch_instruction_site(&patch__dtlbmiss_exit_2, insn);
                        patch_instruction_site(&patch__dtlbmiss_exit_3, insn);