summaryrefslogtreecommitdiff
path: root/sys/src/9/pc64/memory.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-06-01 03:13:58 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2014-06-01 03:13:58 +0200
commitc9f91d50154015ef31b6e63131847742893ffc91 (patch)
tree8a94dce9adbe9ca224c6112d9080296ef57ba7e6 /sys/src/9/pc64/memory.c
parent8061f30e559569943324a666ee2fcc74048785cd (diff)
pc64: allocate palloc.pages from upages
the palloc.pages array takes arround 5% of the upages which gives us: 16GB = ~0.8GB 32GB = ~1.6GB 64GB = ~3.2GB we only have 2GB of address space above KZERO so this will not work for long. instead, pageinit() was altered to accept a preallocated memory in palloc.pages. and preallocpages() in pc64/main.c allocates the in upages memory, mapping it in the VMAP area (which has 512GB). the drawback is that we cannot poke at Page structures now from /proc/n/mem as the VMAP area is not accessible from it.
Diffstat (limited to 'sys/src/9/pc64/memory.c')
-rw-r--r--sys/src/9/pc64/memory.c39
1 files changed, 2 insertions, 37 deletions
diff --git a/sys/src/9/pc64/memory.c b/sys/src/9/pc64/memory.c
index 37c611e00..1c7759dad 100644
--- a/sys/src/9/pc64/memory.c
+++ b/sys/src/9/pc64/memory.c
@@ -371,25 +371,6 @@ sigsearch(char* signature)
return sigscan(KADDR(0xe0000), 0x20000, signature);
}
-static void
-lowraminit(void)
-{
- uintptr pa, x;
-
- /*
- * Initialise the memory bank information for conventional memory
- * (i.e. less than 640KB). The base is the first location after the
- * bootstrap processor MMU information and the limit is obtained from
- * the BIOS data area.
- */
- x = PADDR(PGROUND((uintptr)end));
- pa = MemMin;
- if(x > pa)
- panic("kernel too big");
- mapfree(&rmapram, x, pa-x);
- memset(KADDR(x), 0, pa-x); /* keep us honest */
-}
-
typedef struct Emap Emap;
struct Emap
{
@@ -421,7 +402,7 @@ emapcmp(const void *va, const void *vb)
static void
map(uintptr base, uintptr len, int type)
{
- uintptr e, n, *pte, flags, maxkpa;
+ uintptr n, flags, maxkpa;
/*
* Split any call crossing MemMin to make below simpler.
@@ -433,7 +414,7 @@ map(uintptr base, uintptr len, int type)
}
/*
- * Let lowraminit and umbscan hash out the low MemMin.
+ * Let umbscan hash out the low MemMin.
*/
if(base < MemMin)
return;
@@ -497,21 +478,6 @@ map(uintptr base, uintptr len, int type)
break;
}
- /*
- * bottom MemMin is already mapped - just twiddle flags.
- * (not currently used - see above)
- */
- if(base < MemMin){
- e = base+len;
- base &= ~((uintptr)PGLSZ(1)-1);
- for(; base<e; base+=PGLSZ(1)){
- pte = mmuwalk(m->pml4, base+KZERO, 1, 0);
- if(pte != 0 && *pte & PTEVALID)
- *pte |= flags;
- }
- return;
- }
-
if(flags){
maxkpa = -KZERO;
if(base >= maxkpa)
@@ -595,7 +561,6 @@ meminit(void)
uintptr lost;
umbscan();
- // lowraminit();
e820scan();
/*