diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-11-26 20:51:45 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-11-26 20:51:45 +0000 |
commit | 20ea113790c22e5fc8dd0051baa359e4fa083425 (patch) | |
tree | a64dbfef9f4e41db253a1d8f240bf6b060639b27 /sys/src/9/pc64/squidboy.c | |
parent | add3a0a4da2f46f69a87782699e77c794a8b2cb9 (diff) |
kernel: support large 64-bit pci membars, increase pc64 VMAPSIZE to 1TB
This makes vmap()/vunmap() take a vlong size argument,
and change the type of Pci.mem[].size to vlong as well.
Even if vmap() wont support large mappings, it is nice to
get the original unruncated value for error checking.
pc64 needs a bigger VMAP window, as system76 pangolin
puts the framebuffer at a physical address > 512GB.
Diffstat (limited to 'sys/src/9/pc64/squidboy.c')
-rw-r--r-- | sys/src/9/pc64/squidboy.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/src/9/pc64/squidboy.c b/sys/src/9/pc64/squidboy.c index f7882820b..ea0f9a10a 100644 --- a/sys/src/9/pc64/squidboy.c +++ b/sys/src/9/pc64/squidboy.c @@ -32,7 +32,7 @@ squidboy(Apic* apic) void mpstartap(Apic* apic) { - uintptr *apbootp, *pml4, *pdp0; + uintptr *apbootp, *pml4, *pdp0, v; Segdesc *gdt; Mach *mach; uchar *p; @@ -65,8 +65,11 @@ mpstartap(Apic* apic) * map KZERO (note that we share the KZERO (and VMAP) * PDP between processors. */ - pml4[PTLX(KZERO, 3)] = MACHP(0)->pml4[PTLX(KZERO, 3)]; - pml4[PTLX(VMAP, 3)] = MACHP(0)->pml4[PTLX(VMAP, 3)]; + *mmuwalk(pml4, KZERO, 3, 0) = *mmuwalk(m->pml4, KZERO, 3, 0); + for(v = VMAP; v < VMAP+VMAPSIZE; v += PGLSZ(3)){ + mmuwalk(m->pml4, v, 2, 1); /* force create */ + *mmuwalk(pml4, v, 3, 0) = *mmuwalk(m->pml4, v, 3, 0); + } /* double map */ pml4[0] = PADDR(pdp0) | PTEWRITE|PTEVALID; |