Skip to content

Commit 6373467

Browse files
Thomas Bogendoerferpaulburton
authored andcommitted
MIPS: SGI-IP27: fix exception handler replication
Commit 775b089 ("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 <[email protected]> Signed-off-by: Paul Burton <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Paul Burton <[email protected]> Cc: James Hogan <[email protected]> Cc: [email protected] Cc: [email protected]
1 parent d6d5df1 commit 6373467

File tree

3 files changed

+6
-26
lines changed

3 files changed

+6
-26
lines changed

arch/mips/sgi-ip27/Kconfig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,3 @@ config REPLICATE_KTEXT
3838
Say Y here to enable replicating the kernel text across multiple
3939
nodes in a NUMA cluster. This trades memory for speed.
4040

41-
config REPLICATE_EXHANDLERS
42-
bool "Exception handler replication support"
43-
depends on SGI_IP27
44-
help
45-
Say Y here to enable replicating the kernel exception handlers
46-
across multiple nodes in a NUMA cluster. This trades memory for
47-
speed.

arch/mips/sgi-ip27/ip27-init.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,14 @@ static void per_hub_init(cnodeid_t cnode)
6969

7070
hub_rtc_init(cnode);
7171

72-
#ifdef CONFIG_REPLICATE_EXHANDLERS
73-
/*
74-
* If this is not a headless node initialization,
75-
* copy over the caliased exception handlers.
76-
*/
77-
if (get_compact_nodeid() == cnode) {
78-
extern char except_vec2_generic, except_vec3_generic;
79-
extern void build_tlb_refill_handler(void);
80-
81-
memcpy((void *)(CKSEG0 + 0x100), &except_vec2_generic, 0x80);
82-
memcpy((void *)(CKSEG0 + 0x180), &except_vec3_generic, 0x80);
83-
build_tlb_refill_handler();
84-
memcpy((void *)(CKSEG0 + 0x100), (void *) CKSEG0, 0x80);
85-
memcpy((void *)(CKSEG0 + 0x180), &except_vec3_generic, 0x100);
72+
if (nasid) {
73+
/* copy exception handlers from first node to current node */
74+
memcpy((void *)NODE_OFFSET_TO_K0(nasid, 0),
75+
(void *)CKSEG0, 0x200);
8676
__flush_cache_all();
77+
/* switch to node local exception handlers */
78+
REMOTE_HUB_S(nasid, PI_CALIAS_SIZE, PI_CALIAS_SIZE_8K);
8779
}
88-
#endif
8980
}
9081

9182
void per_cpu_init(void)

arch/mips/sgi-ip27/ip27-memory.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,7 @@ static void __init mlreset(void)
332332
* thinks it is a node 0 address.
333333
*/
334334
REMOTE_HUB_S(nasid, PI_REGION_PRESENT, (region_mask | 1));
335-
#ifdef CONFIG_REPLICATE_EXHANDLERS
336-
REMOTE_HUB_S(nasid, PI_CALIAS_SIZE, PI_CALIAS_SIZE_8K);
337-
#else
338335
REMOTE_HUB_S(nasid, PI_CALIAS_SIZE, PI_CALIAS_SIZE_0);
339-
#endif
340336

341337
#ifdef LATER
342338
/*

0 commit comments

Comments
 (0)