summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-28 20:43:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-28 20:43:20 +0000
commita67d67c718075c9d54dbc516591f1e0dac57b670 (patch)
tree03d71fcbd3c7093505ae1d07eef207a5959fb297 /sys/arch
parent76615f8f659c198cf2a371c49611e30edd500c33 (diff)
on the '040, do not cache write+exec pages for sunos processes. SunOS ld.so
is unaware of split I/D caches, and hence messes up. patch by niklas
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme68k/include/proc.h4
-rw-r--r--sys/arch/mvme68k/mvme68k/pmap.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/sys/arch/mvme68k/include/proc.h b/sys/arch/mvme68k/include/proc.h
index 2165ed8a821..6896652c9bc 100644
--- a/sys/arch/mvme68k/include/proc.h
+++ b/sys/arch/mvme68k/include/proc.h
@@ -1,4 +1,4 @@
-/* $Id: proc.h,v 1.2 1995/11/07 08:49:58 deraadt Exp $ */
+/* $Id: proc.h,v 1.3 1995/11/28 20:43:07 deraadt Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -49,3 +49,5 @@ struct mdproc {
#define MDP_HPUXMMAP 0x0008 /* VA space is multiply mapped */
#define MDP_CCBDATA 0x0010 /* copyback caching of data (68040) */
#define MDP_CCBSTACK 0x0020 /* copyback caching of stack (68040) */
+#define MDP_UNCACHE_WX 0x0040 /* The process might modify code, so
+ don't cache writeable executable pages. */
diff --git a/sys/arch/mvme68k/mvme68k/pmap.c b/sys/arch/mvme68k/mvme68k/pmap.c
index c9cb8582760..d1bc4bf8819 100644
--- a/sys/arch/mvme68k/mvme68k/pmap.c
+++ b/sys/arch/mvme68k/mvme68k/pmap.c
@@ -1,4 +1,4 @@
-/* $Id: pmap.c,v 1.2 1995/11/07 08:50:23 deraadt Exp $ */
+/* $Id: pmap.c,v 1.3 1995/11/28 20:43:19 deraadt Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -1243,6 +1243,13 @@ validate:
npte = pa | pte_prot(pmap, prot) | (*pte & (PG_M|PG_U)) | PG_V;
if (wired)
npte |= PG_W;
+
+ /* Don't cache if process can't take it, like SunOS ones. */
+ if (mmutype == MMU_68040 && pmap != pmap_kernel() &&
+ (curproc->p_md.md_flags & MDP_UNCACHE_WX) &&
+ (prot & VM_PROT_EXECUTE) && (prot & VM_PROT_WRITE))
+ checkpv = cacheable = FALSE;
+
if (!checkpv && !cacheable)
npte |= PG_CI;
#if defined(M68040)