From 25215e6d12f1133465f4b0dd54a1ebbadbdb58d1 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Tue, 20 Feb 2018 23:45:25 +0000 Subject: Make arm64 pmap (somewhat) mpsafe. --- sys/arch/arm64/include/pmap.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sys/arch/arm64/include') diff --git a/sys/arch/arm64/include/pmap.h b/sys/arch/arm64/include/pmap.h index 62dc6bfd246..921d80fcb87 100644 --- a/sys/arch/arm64/include/pmap.h +++ b/sys/arch/arm64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.9 2018/01/12 14:52:55 kettenis Exp $ */ +/* $OpenBSD: pmap.h,v 1.10 2018/02/20 23:45:24 kettenis Exp $ */ /* * Copyright (c) 2008,2009,2014 Dale Rahn * @@ -17,7 +17,9 @@ #ifndef _ARM64_PMAP_H_ #define _ARM64_PMAP_H_ -#include +#include + +#include #define PMAP_PA_MASK ~((paddr_t)PAGE_MASK) /* to remove the flags */ #define PMAP_NOCACHE 0x1 /* non-cacheable memory */ @@ -66,6 +68,7 @@ void pagezero_cache(vaddr_t); * Pmap stuff */ struct pmap { + struct mutex pm_mtx; union { struct pmapvp0 *l0; /* virtual to physical table 4 lvl */ struct pmapvp1 *l1; /* virtual to physical table 3 lvl */ @@ -104,12 +107,14 @@ void pmap_map_early(paddr_t, psize_t); #define __HAVE_VM_PAGE_MD struct vm_page_md { + struct mutex pv_mtx; LIST_HEAD(,pte_desc) pv_list; int pvh_attrs; /* page attributes */ }; #define VM_MDPAGE_INIT(pg) do { \ - LIST_INIT(&((pg)->mdpage.pv_list)); \ + mtx_init(&(pg)->mdpage.pv_mtx, IPL_VM); \ + LIST_INIT(&((pg)->mdpage.pv_list)); \ (pg)->mdpage.pvh_attrs = 0; \ } while (0) -- cgit v1.2.3