From: kettenis Date: Wed, 27 Dec 2017 14:13:05 +0000 (+0000) Subject: Initialize memhook such that /dev/mem access doesn't attempt to map pages X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=944f7f4eeb83f5f7503acf61c28797c7bf666095;p=openbsd Initialize memhook such that /dev/mem access doesn't attempt to map pages at address zero. Spotted by Artturi Alm. ok patrick@ --- 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 * @@ -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) {