]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
MIPS: SGI-IP27: fix exception handler replication
authorThomas Bogendoerfer <tbogendoerfer@suse.de>
Thu, 31 Oct 2019 09:46:04 +0000 (10:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:48:26 +0000 (08:48 +0100)
[ Upstream commit 637346748245e94c877aa746e6fe0d7079b7736a ]

Commit 775b089aeffa ("MIPS: tlbex: Remove cpu_has_local_ebase") removed
generating tlb refill handlers for every CPU, which was needed for
generating per node exception handlers on IP27. Instead of resurrecting
(and fixing) refill handler generation, we simply copy all exception
vectors from the boot node to the other nodes. Also remove the config
option since the memory tradeoff for expection handler replication
is just 8k per node.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/sgi-ip27/Kconfig
arch/mips/sgi-ip27/ip27-init.c
arch/mips/sgi-ip27/ip27-memory.c

index ef3847e7aee02dbd7b8db59d2b258c727a47d606..e5b6cadbec857a2660babccb228a26035f63597e 100644 (file)
@@ -38,10 +38,3 @@ config REPLICATE_KTEXT
          Say Y here to enable replicating the kernel text across multiple
          nodes in a NUMA cluster.  This trades memory for speed.
 
-config REPLICATE_EXHANDLERS
-       bool "Exception handler replication support"
-       depends on SGI_IP27
-       help
-         Say Y here to enable replicating the kernel exception handlers
-         across multiple nodes in a NUMA cluster. This trades memory for
-         speed.
index 066b33f50bcc4da9649360d2654c80e7a0da5e72..db58ebf02870ff642b1774b66ea690b11474ae4e 100644 (file)
@@ -69,23 +69,14 @@ static void per_hub_init(cnodeid_t cnode)
 
        hub_rtc_init(cnode);
 
-#ifdef CONFIG_REPLICATE_EXHANDLERS
-       /*
-        * If this is not a headless node initialization,
-        * copy over the caliased exception handlers.
-        */
-       if (get_compact_nodeid() == cnode) {
-               extern char except_vec2_generic, except_vec3_generic;
-               extern void build_tlb_refill_handler(void);
-
-               memcpy((void *)(CKSEG0 + 0x100), &except_vec2_generic, 0x80);
-               memcpy((void *)(CKSEG0 + 0x180), &except_vec3_generic, 0x80);
-               build_tlb_refill_handler();
-               memcpy((void *)(CKSEG0 + 0x100), (void *) CKSEG0, 0x80);
-               memcpy((void *)(CKSEG0 + 0x180), &except_vec3_generic, 0x100);
+       if (nasid) {
+               /* copy exception handlers from first node to current node */
+               memcpy((void *)NODE_OFFSET_TO_K0(nasid, 0),
+                      (void *)CKSEG0, 0x200);
                __flush_cache_all();
+               /* switch to node local exception handlers */
+               REMOTE_HUB_S(nasid, PI_CALIAS_SIZE, PI_CALIAS_SIZE_8K);
        }
-#endif
 }
 
 void per_cpu_init(void)
index fb077a947575674f0b156abc5ac38c9d76859fb3..8624a885d95bf4d0f5c5a640a19a56ac89cd5236 100644 (file)
@@ -332,11 +332,7 @@ static void __init mlreset(void)
                 * thinks it is a node 0 address.
                 */
                REMOTE_HUB_S(nasid, PI_REGION_PRESENT, (region_mask | 1));
-#ifdef CONFIG_REPLICATE_EXHANDLERS
-               REMOTE_HUB_S(nasid, PI_CALIAS_SIZE, PI_CALIAS_SIZE_8K);
-#else
                REMOTE_HUB_S(nasid, PI_CALIAS_SIZE, PI_CALIAS_SIZE_0);
-#endif
 
 #ifdef LATER
                /*