summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/include
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2015-04-09 16:56:53 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2015-04-09 16:56:53 +0000
commit0620b57e535158c589d1d3776993c98c7d6b873a (patch)
treead4b90d4bc5a81576bba09725e6188a2c74886e8 /sys/arch/sparc64/include
parenta1320a97a4295507345de0c691625b8589fe0e07 (diff)
Make the sparc64 pmap (more) mpsafe by protecting both the pmap itself and the
pv lists with a mutex. Some minor code adjustments to prevent holding locks too long. This should make pmap_enter(9), pmap_remove(9) and pmap_page_protect(9) safe to use without holding the kernel lock.
Diffstat (limited to 'sys/arch/sparc64/include')
-rw-r--r--sys/arch/sparc64/include/pmap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/arch/sparc64/include/pmap.h b/sys/arch/sparc64/include/pmap.h
index c22ae4a0891..646ce3aa154 100644
--- a/sys/arch/sparc64/include/pmap.h
+++ b/sys/arch/sparc64/include/pmap.h
@@ -39,6 +39,7 @@
#ifdef _KERNEL
#include <sys/queue.h>
#endif
+#include <sys/mutex.h>
#endif
/*
@@ -108,6 +109,7 @@ struct page_size_map {
extern struct page_size_map page_size_map[];
struct pmap {
+ struct mutex pm_mtx;
int pm_ctx; /* Current context */
int pm_refs; /* ref count */
/*
@@ -201,10 +203,12 @@ typedef struct pv_entry {
/* PV flags encoded in the low bits of the VA of the first pv_entry */
struct vm_page_md {
+ struct mutex pvmtx;
struct pv_entry pvent;
};
#define VM_MDPAGE_INIT(pg) do { \
+ mtx_init(&(pg)->mdpage.pvmtx, IPL_VM); \
(pg)->mdpage.pvent.pv_next = NULL; \
(pg)->mdpage.pvent.pv_pmap = NULL; \
(pg)->mdpage.pvent.pv_va = 0; \