MIPS: Repair some of the microMIPS patches.
cover MIPS: Repair some of the microMIPS patches.
From: David Daney <[email protected]>
These are a few things I noticed while working on unrelated code. They should make the kernel smaller for systems that don't have microMIPS.
David Daney (3):
MIPS: Declare emulate_load_store_microMIPS as a static function.
MIPS: Don't try to decode microMIPS branch instructions where they
cannot exist.
MIPS: Only set cpu_has_mmips if SYS_SUPPORTS_MICROMIPS
arch/mips/include/asm/cpu-features.h | 6 +++++- arch/mips/kernel/unaligned.c | 3 ++- arch/mips/math-emu/cp1emu.c | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.11.7
PATCH 1/3 MIPS: Declare emulate_load_store_microMIPS as a static function.
From: David Daney <[email protected]>
It is only used from within a single file, it should not be globally visible.
--- arch/mips/kernel/unaligned.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/kernel/unaligned.c +2 -1
@@ -684,7 +684,8 @@ const int reg16to32[] = { 16, 17, 2, 3, 4, 5, 6, 7 };/* Recode table from 16-bit STORE register notation to 32-bit GPR. */ const int reg16to32st[] = {0 ,17 ,2 ,3 ,4 ,5 ,6 ,7 }; -void emulate_load_store_microMIPS (struct pt_regs *regs,void __user * addr) +static void emulate_load_store_microMIPS (struct pt_regs *regs, +void __user *addr) {unsigned long value;unsigned int res;
Signature · 1 line
1.7.11.7
Re: [PATCH 1/3] MIPS: Declare emulate_load_store_microMIPS as a static function.
Quoted 8 lines · David Daney
From: David Daney <[email protected]>
It is only used from within a single file, it should not be globally visible.
Signed-off-by David Daney <[email protected]>Cc Steven J. Hill <[email protected]>
PATCH 2/3 MIPS: Don't try to decode microMIPS branch instructions where they cannot exist.
In reply to David DaneyFrom: David Daney <[email protected]>
In mm_isBranchInstr() we can short circuit the entire function if !cpu_has_mmips.
--- arch/mips/math-emu/cp1emu.c | 3 +++ 1 file changed, 3 insertions(+)
arch/mips/math-emu/cp1emu.c +3 -0
@@ -471,6 +471,9 @@ int mm_isBranchInstr(struct pt_regs *regs, struct mm_decoded_insn dec_insn,unsigned int fcr31;unsigned int bit; +if (!cpu_has_mmips) +return 0 ; +switch (insn.mm_i_format.opcode) {case mm_pool32a_op: if ((insn.mm_i_format.simmediate & MM_POOL32A_MINOR_MASK) ==
Signature · 1 line
1.7.11.7
Re: [PATCH 2/3] MIPS: Don't try to decode microMIPS branch instructions where they cannot exist.
Quoted 8 lines · David Daney
From: David Daney <[email protected]>
In
mm_isBranchInstr()we can short circuit the entire function if !cpu_has_mmips.Signed-off-by David Daney <[email protected]>Cc Steven J. Hill <[email protected]>
PATCH 3/3 MIPS: Only set cpu_has_mmips if SYS_SUPPORTS_MICROMIPS
In reply to David DaneyFrom: David Daney <[email protected]>
As Jonas Gorske said in his patch:
Disable cpu_has_mmips for everything but SEAD3 and MALTA. Most of these platforms are from before the micromips introduction, so they are very unlikely to implement it.
Reduces an -Os compiled, uncompressed kernel image by 8KiB for BCM63XX.
This patch taks a different approach than his, we gate the runtime test for microMIPS by the config symbol SYS_SUPPORTS_MICROMIPS.
--- arch/mips/include/asm/cpu-features.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/mips/include/asm/cpu-features.h +5 -1
@@ -99,7 +99,11 @@#define cpu_has_rixi (cpu_data[0].options & MIPS_CPU_RIXI)#endif #ifndef cpu_has_mmips -#define cpu_has_mmips (cpu_data[0].options & MIPS_CPU_MICROMIPS) +# ifdef CONFIG_SYS_SUPPORTS_MICROMIPS +# define cpu_has_mmips (cpu_data[0].options & MIPS_CPU_MICROMIPS) +# else +# define cpu_has_mmips 0 +# endif #endif #ifndef cpu_has_vtag_icache#define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG)
Signature · 1 line
1.7.11.7
Re: [PATCH 3/3] MIPS: Only set cpu_has_mmips if SYS_SUPPORTS_MICROMIPS
Quoted 11 lines · David Daney
From: David Daney <[email protected]>
As Jonas Gorske said in his patch:
Disable
cpu_has_mmipsfor everything but SEAD3 and MALTA. Most of these platforms are from before the micromips introduction, so they are very unlikely to implement it.Reduces an -Os compiled, uncompressed kernel image by 8KiB for BCM63XX.
Quoted 7 lines
This patch taks a different approach than his, we gate the runtime test for microMIPS by the config symbol
SYS_SUPPORTS_MICROMIPS.Signed-off-by David Daney <[email protected]>Cc Jonas Gorski <[email protected]>Cc Steven J. Hill <[email protected]>
Ralf Baechle
AppliedRe: [PATCH 3/3] MIPS: Only set cpu_has_mmips if SYS_SUPPORTS_MICROMIPS
In reply to David DaneyQuoted 8 lines · David Daney
From: David Daney <[email protected]>
As Jonas Gorske said in his patch:
Disable
cpu_has_mmipsfor everything but SEAD3 and MALTA. Most of these platforms are from before the micromips introduction, so they are very unlikely to implement it.
Quoted 5 lines
Reduces an -Os compiled, uncompressed kernel image by 8KiB for BCM63XX.
This patch taks a different approach than his, we gate the runtime test for microMIPS by the config symbol
SYS_SUPPORTS_MICROMIPS.
Sounds like a good approach also for other ASEs.
Applied.
Ralf