On Sun, Apr 6, 2014 at 7:08 AM, Jonas Gorski <jogo@xxxxxxxxxxx> wrote: > On Sun, Apr 6, 2014 at 12:52 AM, Manuel Lauss <manuel.lauss@xxxxxxxxx> wrote: >> Add a config option to disable the FPU emulator. >> Saves around 56kB on 32bit, and kills FPU users with SIGILL. > > Looks similar to what we do in OpenWrt[1]. Main differences are we > also stub out process_fpemu_return and emit a notice into the kernel > log that the FPU emulator is disabled. Does Florian have any plans to upstream it? I kept process_fpuemu_return() because it actually emits the SIGILL I want, and that was the quickest way to get the result I want. >> --- a/arch/mips/Kbuild >> +++ b/arch/mips/Kbuild >> @@ -16,7 +16,9 @@ obj- := $(platform-) >> >> obj-y += kernel/ >> obj-y += mm/ >> +ifdef CONFIG_MIPS_FPU_EMULATOR >> obj-y += math-emu/ >> +endif > > You can write this as obj-$(CONFIG_MIPS_FPU_EMULATOR) += math-emu/ Done... >> --- a/arch/mips/include/asm/fpu.h >> +++ b/arch/mips/include/asm/fpu.h >> @@ -161,7 +161,9 @@ static inline int init_fpu(void) >> if (!ret) >> _init_fpu(); >> } else { >> +#ifdef CONFIG_MIPS_FPU_EMULATOR >> fpu_emulator_init_fpu(); >> +#endif > > Maybe do something like > > } else if (IS_ENABLED(CONFIG_MIPS_FPU_EMULATOR)) { > fpu_emulator_init_fpu(); > > which kooks a bit nicer IMHO. and done. >> --- a/arch/mips/include/asm/fpu_emulator.h >> +++ b/arch/mips/include/asm/fpu_emulator.h >> @@ -53,13 +53,35 @@ do { \ [...] >> +static inline int mm_isBranchInstr(struct pt_regs *regs, >> + struct mm_decoded_insn dec_insn, >> + unsigned long *contpc) >> +{ >> + return 0; >> +} > > Won't this break micromips support? mm_isBranchInstr is called from a > few other places outside the FPU emulator. True. I get the impression that it doesn't really belong in the fpu emu code, it looks like generic umips support code for e.g. kernel/branch.c Thanks! Mano