aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390/pgtable.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-26 22:52:53 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-26 22:52:53 -0800
commit0444fa78751260b38f0db3418e001bf86593f05f (patch)
treeffd3bd72c7078d705216ef156cae63d990125113 /include/asm-s390/pgtable.h
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6 (diff)
parent[S390] replace lock_cpu_hotplug with get_online_cpus (diff)
downloadlinux-dev-0444fa78751260b38f0db3418e001bf86593f05f.tar.xz
linux-dev-0444fa78751260b38f0db3418e001bf86593f05f.zip
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: (56 commits) [S390] replace lock_cpu_hotplug with get_online_cpus [S390] usage of s390dbf: shrink number of debug areas to use. [S390] constify function pointer tables. [S390] do local_irq_restore while spinning in spin_lock_irqsave. [S390] add smp_call_function_mask [S390] dasd: fix loop in request expiration handling [S390] Unused field / extern declaration in processor.h [S390] Remove TOPDIR from Makefile [S390] dasd: add hyper PAV support to DASD device driver, part 1 [S390] single-step cleanup [S390] Move NOTES and BUG_TABLE. [S390] drivers/s390/: Spelling fixes [S390] include/asm-s390/: Spelling fixes [S390] arch/s390/: Spelling fixes [S390] Use diag308 subcodes 3 and 6 for reboot and dump when possible. [S390] vmemmap: allocate struct pages before 1:1 mapping [S390] Initialize sclp_ipl_info [S390] Allocate and free cpu lowcores and stacks when needed/possible. [S390] use LIST_HEAD instead of LIST_HEAD_INIT [S390] Load disabled wait psw instead of stopping cpu on halt. ...
Diffstat (limited to 'include/asm-s390/pgtable.h')
-rw-r--r--include/asm-s390/pgtable.h46
1 files changed, 16 insertions, 30 deletions
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 1f530f8a6280..79b9eab1a0c7 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -104,41 +104,27 @@ extern char empty_zero_page[PAGE_SIZE];
#ifndef __ASSEMBLY__
/*
- * Just any arbitrary offset to the start of the vmalloc VM area: the
- * current 8MB value just means that there will be a 8MB "hole" after the
- * physical memory until the kernel virtual memory starts. That means that
- * any out-of-bounds memory accesses will hopefully be caught.
- * The vmalloc() routines leaves a hole of 4kB between each vmalloced
- * area for the same reason. ;)
- * vmalloc area starts at 4GB to prevent syscall table entry exchanging
- * from modules.
- */
-extern unsigned long vmalloc_end;
-
-#ifdef CONFIG_64BIT
-#define VMALLOC_ADDR (max(0x100000000UL, (unsigned long) high_memory))
-#else
-#define VMALLOC_ADDR ((unsigned long) high_memory)
-#endif
-#define VMALLOC_OFFSET (8*1024*1024)
-#define VMALLOC_START ((VMALLOC_ADDR + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
-#define VMALLOC_END vmalloc_end
-
-/*
- * We need some free virtual space to be able to do vmalloc.
- * VMALLOC_MIN_SIZE defines the minimum size of the vmalloc
- * area. On a machine with 2GB memory we make sure that we
- * have at least 128MB free space for vmalloc. On a machine
- * with 4TB we make sure we have at least 128GB.
+ * The vmalloc area will always be on the topmost area of the kernel
+ * mapping. We reserve 96MB (31bit) / 1GB (64bit) for vmalloc,
+ * which should be enough for any sane case.
+ * By putting vmalloc at the top, we maximise the gap between physical
+ * memory and vmalloc to catch misplaced memory accesses. As a side
+ * effect, this also makes sure that 64 bit module code cannot be used
+ * as system call address.
*/
#ifndef __s390x__
-#define VMALLOC_MIN_SIZE 0x8000000UL
-#define VMALLOC_END_INIT 0x80000000UL
+#define VMALLOC_START 0x78000000UL
+#define VMALLOC_END 0x7e000000UL
+#define VMEM_MAP_MAX 0x80000000UL
#else /* __s390x__ */
-#define VMALLOC_MIN_SIZE 0x2000000000UL
-#define VMALLOC_END_INIT 0x40000000000UL
+#define VMALLOC_START 0x3e000000000UL
+#define VMALLOC_END 0x3e040000000UL
+#define VMEM_MAP_MAX 0x40000000000UL
#endif /* __s390x__ */
+#define VMEM_MAP ((struct page *) VMALLOC_END)
+#define VMEM_MAP_SIZE ((VMALLOC_START / PAGE_SIZE) * sizeof(struct page))
+
/*
* A 31 bit pagetable entry of S390 has following format:
* | PFRA | | OS |