aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Daney <david.daney@cavium.com>2014-12-03 14:12:23 -0500
committerRalf Baechle <ralf@linux-mips.org>2015-04-01 11:21:57 -0400
commit2707cd293cc2386f8eea6fee1ba72e8b190f25cc (patch)
treeeaf18d32c09f61a82a2bf33746a8d93c7567753a
parent7d168923a35551ed6572d02a0f159e7d61f62cfc (diff)
MIPS: Add FPU emulator counter for emulated delay slots.
Delay slot emulation in the FPU emulator is the only kernel user of an executable stack, it is also very slow. Add a counter so we can see how many of these emulations are done. Signed-off-by: David Daney <david.daney@cavium.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/8634/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/include/asm/fpu_emulator.h1
-rw-r--r--arch/mips/math-emu/dsemul.c2
-rw-r--r--arch/mips/math-emu/me-debugfs.c1
3 files changed, 3 insertions, 1 deletions
diff --git a/arch/mips/include/asm/fpu_emulator.h b/arch/mips/include/asm/fpu_emulator.h
index 3ee347713307..6370c82eb5e1 100644
--- a/arch/mips/include/asm/fpu_emulator.h
+++ b/arch/mips/include/asm/fpu_emulator.h
@@ -44,6 +44,7 @@ struct mips_fpu_emulator_stats {
44 unsigned long ieee754_overflow; 44 unsigned long ieee754_overflow;
45 unsigned long ieee754_zerodiv; 45 unsigned long ieee754_zerodiv;
46 unsigned long ieee754_invalidop; 46 unsigned long ieee754_invalidop;
47 unsigned long ds_emul;
47}; 48};
48 49
49DECLARE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats); 50DECLARE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats);
diff --git a/arch/mips/math-emu/dsemul.c b/arch/mips/math-emu/dsemul.c
index 4f514f3724cb..58f58185f1c4 100644
--- a/arch/mips/math-emu/dsemul.c
+++ b/arch/mips/math-emu/dsemul.c
@@ -158,6 +158,6 @@ int do_dsemulret(struct pt_regs *xcp)
158 158
159 /* Set EPC to return to post-branch instruction */ 159 /* Set EPC to return to post-branch instruction */
160 xcp->cp0_epc = epc; 160 xcp->cp0_epc = epc;
161 161 MIPS_FPU_EMU_INC_STATS(ds_emul);
162 return 1; 162 return 1;
163} 163}
diff --git a/arch/mips/math-emu/me-debugfs.c b/arch/mips/math-emu/me-debugfs.c
index becdd63e14a9..f308e0f05fc5 100644
--- a/arch/mips/math-emu/me-debugfs.c
+++ b/arch/mips/math-emu/me-debugfs.c
@@ -61,6 +61,7 @@ do { \
61 FPU_STAT_CREATE(ieee754_overflow); 61 FPU_STAT_CREATE(ieee754_overflow);
62 FPU_STAT_CREATE(ieee754_zerodiv); 62 FPU_STAT_CREATE(ieee754_zerodiv);
63 FPU_STAT_CREATE(ieee754_invalidop); 63 FPU_STAT_CREATE(ieee754_invalidop);
64 FPU_STAT_CREATE(ds_emul);
64 65
65 return 0; 66 return 0;
66} 67}