aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/pgtable.h')
-rw-r--r--arch/s390/include/asm/pgtable.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 979fe3dc0788..dd647c919a66 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -119,13 +119,12 @@ static inline int is_zero_pfn(unsigned long pfn)
119 119
120#ifndef __ASSEMBLY__ 120#ifndef __ASSEMBLY__
121/* 121/*
122 * The vmalloc area will always be on the topmost area of the kernel 122 * The vmalloc and module area will always be on the topmost area of the kernel
123 * mapping. We reserve 96MB (31bit) / 128GB (64bit) for vmalloc, 123 * mapping. We reserve 96MB (31bit) / 128GB (64bit) for vmalloc and modules.
124 * which should be enough for any sane case. 124 * On 64 bit kernels we have a 2GB area at the top of the vmalloc area where
125 * By putting vmalloc at the top, we maximise the gap between physical 125 * modules will reside. That makes sure that inter module branches always
126 * memory and vmalloc to catch misplaced memory accesses. As a side 126 * happen without trampolines and in addition the placement within a 2GB frame
127 * effect, this also makes sure that 64 bit module code cannot be used 127 * is branch prediction unit friendly.
128 * as system call address.
129 */ 128 */
130extern unsigned long VMALLOC_START; 129extern unsigned long VMALLOC_START;
131extern unsigned long VMALLOC_END; 130extern unsigned long VMALLOC_END;
@@ -133,6 +132,14 @@ extern struct page *vmemmap;
133 132
134#define VMEM_MAX_PHYS ((unsigned long) vmemmap) 133#define VMEM_MAX_PHYS ((unsigned long) vmemmap)
135 134
135#ifdef CONFIG_64BIT
136extern unsigned long MODULES_VADDR;
137extern unsigned long MODULES_END;
138#define MODULES_VADDR MODULES_VADDR
139#define MODULES_END MODULES_END
140#define MODULES_LEN (1UL << 31)
141#endif
142
136/* 143/*
137 * A 31 bit pagetable entry of S390 has following format: 144 * A 31 bit pagetable entry of S390 has following format:
138 * | PFRA | | OS | 145 * | PFRA | | OS |
@@ -507,6 +514,15 @@ static inline int pmd_none(pmd_t pmd)
507 return (pmd_val(pmd) & _SEGMENT_ENTRY_INV) != 0UL; 514 return (pmd_val(pmd) & _SEGMENT_ENTRY_INV) != 0UL;
508} 515}
509 516
517static inline int pmd_large(pmd_t pmd)
518{
519#ifdef CONFIG_64BIT
520 return !!(pmd_val(pmd) & _SEGMENT_ENTRY_LARGE);
521#else
522 return 0;
523#endif
524}
525
510static inline int pmd_bad(pmd_t pmd) 526static inline int pmd_bad(pmd_t pmd)
511{ 527{
512 unsigned long mask = ~_SEGMENT_ENTRY_ORIGIN & ~_SEGMENT_ENTRY_INV; 528 unsigned long mask = ~_SEGMENT_ENTRY_ORIGIN & ~_SEGMENT_ENTRY_INV;