diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-05-13 19:27:25 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-05-13 19:27:25 +0000 |
commit | c79277c383444cb55f516c3d1b67169b242c7358 (patch) | |
tree | ed076225d08c2cbe0bceb62061bfc642c03cb12a /sys/arch/amd64 | |
parent | 98a4219c399741d89d082bb03f4c3c71f35cee2b (diff) |
Synchronise amd64 more with other PMAP_DIRECT architectures. (step 1,
more to come later)
Specfically, there is no reason to reserve a special virtual address just so we
can do boot dump, we have a direct map of every page anyway.
since pmap_map is deprecated and MD only anyway, this means we can remove that
interface too. If anything this should increase reliability since pmap_enter
won't fail under memory pressure during dump (unlikely but possible). It is also
simpler and smaller ;)
Tested by myself and ckuethe, no regressions.
ok miod@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 17 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/pmap.c | 33 | ||||
-rw-r--r-- | sys/arch/amd64/include/pmap.h | 4 |
3 files changed, 5 insertions, 49 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 7289cea0d5f..8fc28481dcb 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.106 2010/03/24 00:36:04 oga Exp $ */ +/* $OpenBSD: machdep.c,v 1.107 2010/05/13 19:27:24 oga Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -860,15 +860,6 @@ dumpconf(void) * the auto-restart code. */ #define BYTES_PER_DUMP PAGE_SIZE /* must be a multiple of pagesize XXX small */ -static vaddr_t dumpspace; - -vaddr_t -reserve_dumppages(vaddr_t p) -{ - - dumpspace = p; - return (p + BYTES_PER_DUMP); -} void dumpsys(void) @@ -932,10 +923,8 @@ dumpsys(void) if (n > BYTES_PER_DUMP) n = BYTES_PER_DUMP; - (void) pmap_map(dumpspace, maddr, maddr + n, - VM_PROT_READ); - - error = (*dump)(dumpdev, blkno, (caddr_t)dumpspace, n); + error = (*dump)(dumpdev, blkno, + (caddr_t)PMAP_DIRECT_MAP(maddr), n); if (error) goto err; maddr += n; diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c index 7143ccc497c..4c262196d89 100644 --- a/sys/arch/amd64/amd64/pmap.c +++ b/sys/arch/amd64/amd64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.54 2010/05/08 16:54:07 oga Exp $ */ +/* $OpenBSD: pmap.c,v 1.55 2010/05/13 19:27:24 oga Exp $ */ /* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */ /* @@ -205,10 +205,6 @@ * If we fail, we simply let pmap_enter() tell UVM about it. */ -/* - * XXX: would be nice to have per-CPU VAs for the above 4 - */ - vaddr_t ptp_masks[] = PTP_MASK_INITIALIZER; int ptp_shifts[] = PTP_SHIFT_INITIALIZER; long nkptp[] = NKPTP_INITIALIZER; @@ -671,13 +667,6 @@ pmap_bootstrap(paddr_t first_avail, paddr_t max_pa) lo32_paddr = first_avail; first_avail += PAGE_SIZE; #endif - - /* - * now we reserve some VM for mapping pages when doing a crash dump - */ - - virtual_avail = reserve_dumppages(virtual_avail); - /* * init the global lists. */ @@ -1234,26 +1223,6 @@ pmap_extract(struct pmap *pmap, vaddr_t va, paddr_t *pap) } /* - * pmap_map: map a range of PAs into kvm - * - * => used during crash dump - * => XXX: pmap_map() should be phased out? - */ - -vaddr_t -pmap_map(vaddr_t va, paddr_t spa, paddr_t epa, vm_prot_t prot) -{ - while (spa < epa) { - pmap_enter(pmap_kernel(), va, spa, prot, 0); - va += PAGE_SIZE; - spa += PAGE_SIZE; - } - pmap_update(pmap_kernel()); - return va; -} - - -/* * pmap_zero_page: zero a page */ diff --git a/sys/arch/amd64/include/pmap.h b/sys/arch/amd64/include/pmap.h index 6eacd435fa7..04929cb9072 100644 --- a/sys/arch/amd64/include/pmap.h +++ b/sys/arch/amd64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.32 2010/05/08 16:54:07 oga Exp $ */ +/* $OpenBSD: pmap.h,v 1.33 2010/05/13 19:27:24 oga Exp $ */ /* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ /* @@ -568,8 +568,6 @@ kvtopte(vaddr_t va) #define pmap_cpu_has_pg_n() (1) #define pmap_cpu_has_invlpg (1) -vaddr_t pmap_map(vaddr_t, paddr_t, paddr_t, vm_prot_t); - #define PMAP_DIRECT_MAP(pa) ((vaddr_t)PMAP_DIRECT_BASE + pa) #define PMAP_DIRECT_UNMAP(va) ((paddr_t)va - PMAP_DIRECT_BASE) #define pmap_map_direct(pg) PMAP_DIRECT_MAP(VM_PAGE_TO_PHYS(pg)) |