diff options
author | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-06-13 01:13:50 +0000 |
---|---|---|
committer | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-06-13 01:13:50 +0000 |
commit | 42b952be1de697c355819bf2679291eeb49a0755 (patch) | |
tree | de175df48330b1e18b091fcb0c96cd5265d02847 | |
parent | 4925c5662482c19b880fe231e216090a074dd190 (diff) |
When doing kernel text replication, make sure we do not scribble on
top of the replicated kernel text thinking it is unused memory. This
lets us get to multiuser on a replicated kernel text system.
-rw-r--r-- | arch/mips64/sgi-ip27/ip27-klnuma.c | 27 | ||||
-rw-r--r-- | arch/mips64/sgi-ip27/ip27-memory.c | 21 | ||||
-rw-r--r-- | include/asm-mips64/sn/sn_private.h | 1 |
3 files changed, 28 insertions, 21 deletions
diff --git a/arch/mips64/sgi-ip27/ip27-klnuma.c b/arch/mips64/sgi-ip27/ip27-klnuma.c index 8e2a6e566..1b36208eb 100644 --- a/arch/mips64/sgi-ip27/ip27-klnuma.c +++ b/arch/mips64/sgi-ip27/ip27-klnuma.c @@ -7,6 +7,7 @@ #include <linux/mmzone.h> #include <linux/kernel.h> +#include <asm/page.h> #include <asm/sn/types.h> #include <asm/sn/arch.h> #include <asm/sn/gda.h> @@ -19,6 +20,7 @@ #define CPUMASK_SETB(p, bit) (p) |= 1 << (bit) #define CPUMASK_TSTB(p, bit) ((p) & (1ULL << (bit))) +extern char _end; static cpumask_t ktext_repmask; /* @@ -117,3 +119,28 @@ void __init replicate_kernel_text(int maxnodes) set_ktext_source(client_nasid, server_nasid); } } + +/* + * Return pfn of first free page of memory on a node. PROM may allocate + * data structures on the first couple of pages of the first slot of each + * node. If this is the case, getfirstfree(node) > getslotstart(node, 0). + */ +pfn_t node_getfirstfree(cnodeid_t cnode) +{ + unsigned long loadbase = CKSEG0; + nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); + unsigned long offset; + +#ifdef CONFIG_MAPPED_KERNEL + loadbase = CKSSEG + 16777216; +#endif + offset = PAGE_ALIGN((unsigned long)(&_end)) - loadbase; + if (cnode == 0) + return (offset >> PAGE_SHIFT); + else if (CPUMASK_TSTB(ktext_repmask, cnode)) + return (TO_NODE(nasid, offset) >> PAGE_SHIFT); + else + return (KDM_TO_PHYS(PAGE_ALIGN(SYMMON_STK_ADDR(nasid, 0))) >> + PAGE_SHIFT); +} + diff --git a/arch/mips64/sgi-ip27/ip27-memory.c b/arch/mips64/sgi-ip27/ip27-memory.c index 67ca9ab09..ff218d1d2 100644 --- a/arch/mips64/sgi-ip27/ip27-memory.c +++ b/arch/mips64/sgi-ip27/ip27-memory.c @@ -27,8 +27,6 @@ #include <asm/sn/arch.h> #include <asm/mmzone.h> -extern char _end; - #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) #define SLOT_IGNORED 0xffff @@ -48,25 +46,6 @@ int numa_debug(void) } /* - * Return pfn of first free page of memory on a node. PROM may allocate - * data structures on the first couple of pages of the first slot of each - * node. If this is the case, getfirstfree(node) > getslotstart(node, 0). - */ -pfn_t node_getfirstfree(cnodeid_t cnode) -{ - unsigned long loadbase = CKSEG0; - nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); - -#ifdef CONFIG_MAPPED_KERNEL - loadbase = CKSSEG + 16777216; -#endif - if (cnode == 0) - return (KDM_TO_PHYS(PAGE_ALIGN((unsigned long)(&_end)) - - (loadbase - K0BASE)) >> PAGE_SHIFT); - return (KDM_TO_PHYS(PAGE_ALIGN(SYMMON_STK_ADDR(nasid, 0))) >> PAGE_SHIFT); -} - -/* * Return the number of pages of memory provided by the given slot * on the specified node. */ diff --git a/include/asm-mips64/sn/sn_private.h b/include/asm-mips64/sn/sn_private.h index f4867e796..2715ce5db 100644 --- a/include/asm-mips64/sn/sn_private.h +++ b/include/asm-mips64/sn/sn_private.h @@ -8,3 +8,4 @@ extern void install_cpuintr(int cpu); extern void install_tlbintr(int cpu); extern void setup_replication_mask(int); extern void replicate_kernel_text(int); +extern pfn_t node_getfirstfree(cnodeid_t); |