Subject: ibm4xx pmap: execution permission for kernel mappings
To: None <port-powerpc@netbsd.org>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: port-powerpc
Date: 07/05/2006 17:56:34
This is a multipart MIME message.

--==_Exmh_3993655944300
Content-Type: text/plain; charset=us-ascii


This _should_ work. Alpha was handling this correctly
all the time, and I've just switched amd64 to do likewise.
There was a problem with LKMs, but this should be fixed too.

I can't test myself, but if someone is adventurous he could
try the appended patch.

best regards
Matthias



--==_Exmh_3993655944300
Content-Type: text/plain ; name="ppcex.txt"; charset=us-ascii
Content-Description: ppcex.txt
Content-Disposition: attachment; filename="ppcex.txt"

--- pmap.c.~1.40.~	Tue Jul  4 12:30:34 2006
+++ pmap.c	Wed Jul  5 17:53:39 2006
@@ -912,16 +912,11 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
 
 	/*
 	 * Generate TTE.
-	 *
-	 * XXXX
-	 *
-	 * Since the kernel does not handle execution privileges properly,
-	 * we will handle read and execute permissions together.
 	 */
 	tte = 0;
 	if (prot & VM_PROT_ALL) {
 
-		tte = TTE_PA(pa) | TTE_EX | TTE_ZONE(ZONE_PRIV);
+		tte = TTE_PA(pa) | TTE_ZONE(ZONE_PRIV);
 		/* XXXX -- need to support multiple page sizes. */
 		tte |= TTE_SZ_16K;
 #ifdef DIAGNOSTIC
@@ -941,6 +936,8 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
 #endif
 		if (prot & VM_PROT_WRITE)
 			tte |= TTE_WR;
+		if (prot & VM_PROT_EXECUTE)
+			tte |= TTE_EX;
 	}
 
 	s = splvm();

--==_Exmh_3993655944300--