aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/page.h
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-09-27 04:45:06 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-10-09 08:16:55 -0400
commit85e9d0e5ffabfede5facbac5b0d9b90768bc6e90 (patch)
treeb158c8bde347cd8cabd24265dfe65884a08db701 /arch/s390/include/asm/page.h
parent3c7ef08bba65d1fef0b7486b30b5bbcdb42c5d9c (diff)
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 @@
30#include <asm/setup.h> 30#include <asm/setup.h>
31#ifndef __ASSEMBLY__ 31#ifndef __ASSEMBLY__
32 32
33static unsigned long pfmf(unsigned long function, unsigned long address)
34{
35 asm volatile(
36 " .insn rre,0xb9af0000,%[function],%[address]"
37 : [address] "+a" (address)
38 : [function] "d" (function)
39 : "memory");
40 return address;
41}
42
33static inline void clear_page(void *page) 43static inline void clear_page(void *page)
34{ 44{
35 if (MACHINE_HAS_PFMF) { 45 if (MACHINE_HAS_PFMF) {
36 asm volatile( 46 pfmf(0x10000, (unsigned long)page);
37 " .insn rre,0xb9af0000,%0,%1"
38 : : "d" (0x10000), "a" (page) : "memory", "cc");
39 } else { 47 } else {
40 register unsigned long reg1 asm ("1") = 0; 48 register unsigned long reg1 asm ("1") = 0;
41 register void *reg2 asm ("2") = page; 49 register void *reg2 asm ("2") = page;