From 775b089aeffa98d5f69045d9dc4fe3aaba1bc9e1 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Sat, 31 Aug 2019 15:40:46 +0000 Subject: MIPS: tlbex: Remove cpu_has_local_ebase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cpu_has_local_ebase macro is, confusingly, not used to indicate whether the EBase register is local to a CPU or not. Instead it indicates whether we want to generate the TLB refill exception vector each time a CPU is brought online. Doing this makes little sense on any system, since we always use the same value for EBase & thus we cannot have different TLB refill exception handlers per CPU. Regenerating the code is not only pointless but also can be actively harmful, as commit 8759934e2b6b ("MIPS: Build uasm-generated code only once to avoid CPU Hotplug problem") described. That commit introduced cpu_has_local_ebase to disable the handler regeneration for Loongson machines, but this is by no means a Loongson-specific problem. Remove cpu_has_local_ebase & simply generate the TLB refill handler once during boot, just like the rest of the TLB exception handlers. Signed-off-by: Paul Burton Reviewed-by: Philippe Mathieu-Daudé Cc: linux-mips@vger.kernel.org --- arch/mips/mm/tlbex.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'arch/mips/mm/tlbex.c') diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 6e3ca9cc5249..e01cb33bfa1a 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c @@ -2609,12 +2609,9 @@ void build_tlb_refill_handler(void) if (cpu_has_3kex) { #ifndef CONFIG_MIPS_PGD_C0_CONTEXT - if (cpu_has_local_ebase) - build_r3000_tlb_refill_handler(); if (!run_once) { - if (!cpu_has_local_ebase) - build_r3000_tlb_refill_handler(); build_setup_pgd(); + build_r3000_tlb_refill_handler(); build_r3000_tlb_load_handler(); build_r3000_tlb_store_handler(); build_r3000_tlb_modify_handler(); @@ -2638,13 +2635,11 @@ void build_tlb_refill_handler(void) build_r4000_tlb_modify_handler(); if (cpu_has_ldpte) build_loongson3_tlb_refill_handler(); - else if (!cpu_has_local_ebase) + else build_r4000_tlb_refill_handler(); flush_tlb_handlers(); run_once++; } - if (cpu_has_local_ebase) - build_r4000_tlb_refill_handler(); if (cpu_has_xpa) config_xpa_params(); if (cpu_has_htw) -- cgit v1.2.3