MIPS: mm: Fix broken microMIPS kernel regression.

Message ID 1397156777-18759-1-git-send-email-Steven.Hill@imgtec.com
State Accepted
Delegated to: Ralf Baechle
Headers show

Commit Message

Steven J. Hill April 10, 2014, 7:06 p.m.
From: "Steven J. Hill" <Steven.Hill@imgtec.com>

Commit f4ae17aa0f2122b52f642985b46210a1f2eceb0a broke microMIPS
kernel builds. This patch refactors that code similar to what
was done for the 'clear_page' and 'copy_page' functions.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
---
 arch/mips/mm/tlb-funcs.S |    4 +++-
 arch/mips/mm/tlbex.c     |    7 ++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

Comments

Markos Chandras April 30, 2014, 8:34 a.m. | #1
On 04/10/2014 08:06 PM, Steven J. Hill wrote:
> From: "Steven J. Hill" <Steven.Hill@imgtec.com>
> 
> Commit f4ae17aa0f2122b52f642985b46210a1f2eceb0a broke microMIPS
> kernel builds. This patch refactors that code similar to what
> was done for the 'clear_page' and 'copy_page' functions.
> 
> Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
> ---

Hi Ralf,

If this patch is accepted, can we please consider it for the v3.14
stable kernel which is also affected?

Thanks

Patch

diff --git a/arch/mips/mm/tlb-funcs.S b/arch/mips/mm/tlb-funcs.S
index 30a494d..a5427c6 100644
--- a/arch/mips/mm/tlb-funcs.S
+++ b/arch/mips/mm/tlb-funcs.S
@@ -16,8 +16,10 @@ 
 
 #define FASTPATH_SIZE	128
 
+EXPORT(tlbmiss_handler_setup_pgd_start)
 LEAF(tlbmiss_handler_setup_pgd)
-	.space		16 * 4
+1:	j	1b		/* Dummy, will be replaced. */
+	.space	64
 END(tlbmiss_handler_setup_pgd)
 EXPORT(tlbmiss_handler_setup_pgd_end)
 
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index ee88367..f99ec587 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -1422,16 +1422,17 @@  static void build_r4000_tlb_refill_handler(void)
 extern u32 handle_tlbl[], handle_tlbl_end[];
 extern u32 handle_tlbs[], handle_tlbs_end[];
 extern u32 handle_tlbm[], handle_tlbm_end[];
-extern u32 tlbmiss_handler_setup_pgd[], tlbmiss_handler_setup_pgd_end[];
+extern u32 tlbmiss_handler_setup_pgd_start[], tlbmiss_handler_setup_pgd[];
+extern u32 tlbmiss_handler_setup_pgd_end[];
 
 static void build_setup_pgd(void)
 {
 	const int a0 = 4;
 	const int __maybe_unused a1 = 5;
 	const int __maybe_unused a2 = 6;
-	u32 *p = tlbmiss_handler_setup_pgd;
+	u32 *p = tlbmiss_handler_setup_pgd_start;
 	const int tlbmiss_handler_setup_pgd_size =
-		tlbmiss_handler_setup_pgd_end - tlbmiss_handler_setup_pgd;
+		tlbmiss_handler_setup_pgd_end - tlbmiss_handler_setup_pgd_start;
 #ifndef CONFIG_MIPS_PGD_C0_CONTEXT
 	long pgdc = (long)pgd_current;
 #endif