summaryrefslogtreecommitdiff
path: root/sys/src/9/pc64/mmu.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-02-15 06:17:05 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-02-15 06:17:05 +0100
commit32604cd830a03c1237cf992b86e9b00499ca7b38 (patch)
tree5ca583bc9b65914bec42fd88216131134a84aa8c /sys/src/9/pc64/mmu.c
parent1d64be19849086dc1152ef952b1ab32612e2e94c (diff)
pc64: move VMAP into its own PDP (for vmware)
modifying the kernel pdp (CPU0PDP) hangs vmware. so we initialize the pdp with KZERO and KZERO+1GB map in l.s and never change it. (except when removing the zero double map which seems to work). VMAP has its own pdp now allowing to map 512GB of physical address space. this simplifies the code a bit and gives nice virtual addresses.
Diffstat (limited to 'sys/src/9/pc64/mmu.c')
-rw-r--r--sys/src/9/pc64/mmu.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/src/9/pc64/mmu.c b/sys/src/9/pc64/mmu.c
index 8f1d45d71..74857b90f 100644
--- a/sys/src/9/pc64/mmu.c
+++ b/sys/src/9/pc64/mmu.c
@@ -82,8 +82,8 @@ mmuinit(void)
didmmuinit = 1;
/* zap double map done by l.s */
- m->pml4[0] = 0;
m->pml4[512] = 0;
+ m->pml4[0] = 0;
m->tss = mallocz(sizeof(Tss), 1);
if(m->tss == nil)
@@ -157,7 +157,7 @@ paddr(void *v)
if(va >= KZERO)
return va-KZERO;
if(va >= VMAP)
- return va-(VMAP-(-KZERO));
+ return va-VMAP;
panic("paddr: va=%#p pc=%#p", va, getcallerpc(&v));
return 0;
}
@@ -505,12 +505,7 @@ vmap(uintptr pa, int size)
uintptr va;
int o;
- if(size <= 0 || pa >= -VMAP)
- panic("vmap: pa=%#p size=%d pc=%#p", pa, size, getcallerpc(&pa));
- if(cankaddr(pa) >= size)
- va = pa+KZERO;
- else
- va = pa+(VMAP-(-KZERO));
+ va = pa+VMAP;
/*
* might be asking for less than a page.
*/