Skip to contentSkip to conversation

MIPS: Add FPU emulator counter for emulated delay slots.

PATCH New David Daney 1 participant 1 message Dec 3, 2014 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Add FPU emulator counter for emulated delay slots.

From: David Daney <[email protected]>

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.

---
 arch/mips/include/asm/fpu_emulator.h | 1 +
 arch/mips/math-emu/dsemul.c          | 2 +-
 arch/mips/math-emu/me-debugfs.c      | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
arch/mips/include/asm/fpu_emulator.h +1 -0
index 3ee3477..6370c82 100644
@@ -44,6 +44,7 @@ struct mips_fpu_emulator_stats {
 	unsigned long ieee754_overflow;
 	unsigned long ieee754_zerodiv;
 	unsigned long ieee754_invalidop;
+	unsigned long ds_emul;
 };
 
 DECLARE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats);
arch/mips/math-emu/dsemul.c +1 -1
index 4f514f3..58f5818 100644
@@ -158,6 +158,6 @@ int do_dsemulret(struct pt_regs *xcp)
 
 	/* Set EPC to return to post-branch instruction */
 	xcp->cp0_epc = epc;
-
+	MIPS_FPU_EMU_INC_STATS(ds_emul);
 	return 1;
 }
arch/mips/math-emu/me-debugfs.c +1 -0
index becdd63..f308e0f 100644
@@ -61,6 +61,7 @@ do {									\
 	FPU_STAT_CREATE(ieee754_overflow);
 	FPU_STAT_CREATE(ieee754_zerodiv);
 	FPU_STAT_CREATE(ieee754_invalidop);
+	FPU_STAT_CREATE(ds_emul);
 
 	return 0;
 }
Signature · 1 line
1.7.11.7