diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2017-12-27 14:13:06 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2017-12-27 14:13:06 +0000 |
commit | 947754f2e927d9ba1007173cba01173d393332d3 (patch) | |
tree | 8d33cfcba5713187be36feeba79533ab198d6d3b | |
parent | cc75069c5548aa24bb82dba6506ff7150c5d4943 (diff) |
Initialize memhook such that /dev/mem access doesn't attempt to map pages
at address zero. Spotted by Artturi Alm.
ok patrick@
-rw-r--r-- | sys/arch/arm64/arm64/pmap.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/arm64/arm64/pmap.c b/sys/arch/arm64/arm64/pmap.c index 4dd2df4a2e2..2e7b0db7976 100644 --- a/sys/arch/arm64/arm64/pmap.c +++ b/sys/arch/arm64/arm64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.39 2017/12/23 15:04:46 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.40 2017/12/27 14:13:05 kettenis Exp $ */ /* * Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com> * @@ -133,6 +133,10 @@ vaddr_t pmap_map_stolen(vaddr_t); void pmap_physload_avail(void); extern caddr_t msgbufaddr; +char *memhook; +vaddr_t zero_page; +vaddr_t copy_src_page; +vaddr_t copy_dst_page; /* XXX - panic on pool get failures? */ struct pool pmap_pmap_pool; @@ -1201,6 +1205,9 @@ pmap_bootstrap(long kvo, paddr_t lpt1, long kernelstart, long kernelend, printf("all mapped\n"); + memhook = (char *)vstart; + vstart += PAGE_SIZE; + return vstart; } @@ -1650,11 +1657,6 @@ pmap_update(pmap_t pm) { } -char *memhook; -vaddr_t zero_page; -vaddr_t copy_src_page; -vaddr_t copy_dst_page; - int pmap_is_referenced(struct vm_page *pg) { |