diff options
author | Gerald Schaefer <geraldsc@de.ibm.com> | 2008-04-30 07:38:46 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-04-30 07:38:47 -0400 |
commit | 53492b1de46a7576170e865062ffcfc93bb5650b (patch) | |
tree | bee94e5b2e8c19c1a094a25023cb82572707feb4 /include/asm-s390/page.h | |
parent | 2e5061e40af88070984e3769eafb5a06022375fd (diff) |
[S390] System z large page support.
This adds hugetlbfs support on System z, using both hardware large page
support if available and software large page emulation on older hardware.
Shared (large) page tables are implemented in software emulation mode,
by using page->index of the first tail page from a compound large page
to store page table information.
Signed-off-by: Gerald Schaefer <geraldsc@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'include/asm-s390/page.h')
-rw-r--r-- | include/asm-s390/page.h | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h index fe7f92b6ae6d..b01e6fc9a295 100644 --- a/include/asm-s390/page.h +++ b/include/asm-s390/page.h | |||
@@ -19,17 +19,34 @@ | |||
19 | #define PAGE_DEFAULT_ACC 0 | 19 | #define PAGE_DEFAULT_ACC 0 |
20 | #define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4) | 20 | #define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4) |
21 | 21 | ||
22 | #define HPAGE_SHIFT 20 | ||
23 | #define HPAGE_SIZE (1UL << HPAGE_SHIFT) | ||
24 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) | ||
25 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | ||
26 | |||
27 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | ||
28 | #define ARCH_HAS_HUGE_PTE_TYPE | ||
29 | #define ARCH_HAS_PREPARE_HUGEPAGE | ||
30 | #define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH | ||
31 | |||
22 | #include <asm/setup.h> | 32 | #include <asm/setup.h> |
23 | #ifndef __ASSEMBLY__ | 33 | #ifndef __ASSEMBLY__ |
24 | 34 | ||
25 | static inline void clear_page(void *page) | 35 | static inline void clear_page(void *page) |
26 | { | 36 | { |
27 | register unsigned long reg1 asm ("1") = 0; | 37 | if (MACHINE_HAS_PFMF) { |
28 | register void *reg2 asm ("2") = page; | 38 | asm volatile( |
29 | register unsigned long reg3 asm ("3") = 4096; | 39 | " .insn rre,0xb9af0000,%0,%1" |
30 | asm volatile( | 40 | : : "d" (0x10000), "a" (page) : "memory", "cc"); |
31 | " mvcl 2,0" | 41 | } else { |
32 | : "+d" (reg2), "+d" (reg3) : "d" (reg1) : "memory", "cc"); | 42 | register unsigned long reg1 asm ("1") = 0; |
43 | register void *reg2 asm ("2") = page; | ||
44 | register unsigned long reg3 asm ("3") = 4096; | ||
45 | asm volatile( | ||
46 | " mvcl 2,0" | ||
47 | : "+d" (reg2), "+d" (reg3) : "d" (reg1) | ||
48 | : "memory", "cc"); | ||
49 | } | ||
33 | } | 50 | } |
34 | 51 | ||
35 | static inline void copy_page(void *to, void *from) | 52 | static inline void copy_page(void *to, void *from) |