From 9b919e8ab9f359fe6f094b87f176398d74297f89 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 28 Nov 1995 20:43:07 +0000 Subject: [PATCH] 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 --- sys/arch/mvme68k/include/proc.h | 4 +++- sys/arch/mvme68k/mvme68k/pmap.c | 9 ++++++++- 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) -- 2.20.1