patch-2.4.21 linux-2.4.21/include/asm-s390x/pgtable.h

Next file: linux-2.4.21/include/asm-s390x/processor.h
Previous file: linux-2.4.21/include/asm-s390x/pgalloc.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/include/asm-s390x/pgtable.h linux-2.4.21/include/asm-s390x/pgtable.h
@@ -233,12 +233,22 @@
 		pte_val(pteval) &= ~_PAGE_MKCLEAN;
                
 		asm volatile ("sske %0,%1" 
-				: : "d" (0), "a" (pte_val(pteval)));
+				: : "d" (STORAGE_ACC_KEY_MASK),
+				"a" (pte_val(pteval)));
 	}
 
 	*pteptr = pteval;
 }
 
+extern inline void set_access_key(pte_t pteval)
+{
+	asm volatile ("    iske 0,%1\n"
+		      "    or   0,%0\n"
+		      "    sske 0,%1\n"
+			: : "d" (STORAGE_ACC_KEY_MASK),
+			"a" (pte_val(pteval)) : "0", "cc");
+}
+
 #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
 
 /*
@@ -391,7 +401,7 @@
 
 extern inline pte_t pte_mkwrite(pte_t pte)
 {
-	pte_val(pte) &= ~_PAGE_RO;
+	pte_val(pte) &= ~(_PAGE_RO | _PAGE_ISCLEAN);
 	return pte;
 }
 
@@ -452,7 +462,7 @@
 	/* We can't clear the changed bit atomically. For now we
          * clear (!) the page referenced bit. */
 	asm volatile ("sske %0,%1" 
-	              : : "d" (0), "a" (*ptep));
+	              : : "d" (STORAGE_ACC_KEY_MASK), "a" (*ptep));
 	return 1;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)