summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/page.h
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-09-27 12:45:06 +0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-10-09 16:16:55 +0400
commit85e9d0e5ffabfede5facbac5b0d9b90768bc6e90 (patch)
treeb158c8bde347cd8cabd24265dfe65884a08db701 /arch/s390/include/asm/page.h
parent3c7ef08bba65d1fef0b7486b30b5bbcdb42c5d9c (diff)
downloadlinux-85e9d0e5ffabfede5facbac5b0d9b90768bc6e90.tar.xz
s390/mm: use pfmf instruction to initialize storage keys
Make use of the pfmf instruction, if available, to initialize storage keys of whole 1MB or 2GB frames instead of initializing every single page with the sske instruction. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/page.h')
-rw-r--r--arch/s390/include/asm/page.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 27ab3c7c1e8b..6d5367060a56 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -30,12 +30,20 @@
#include <asm/setup.h>
#ifndef __ASSEMBLY__
+static unsigned long pfmf(unsigned long function, unsigned long address)
+{
+ asm volatile(
+ " .insn rre,0xb9af0000,%[function],%[address]"
+ : [address] "+a" (address)
+ : [function] "d" (function)
+ : "memory");
+ return address;
+}
+
static inline void clear_page(void *page)
{
if (MACHINE_HAS_PFMF) {
- asm volatile(
- " .insn rre,0xb9af0000,%0,%1"
- : : "d" (0x10000), "a" (page) : "memory", "cc");
+ pfmf(0x10000, (unsigned long)page);
} else {
register unsigned long reg1 asm ("1") = 0;
register void *reg2 asm ("2") = page;