]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] x86_64: Add boot option to disable randomized mappings and cleanup
authorAndi Kleen <ak@suse.de>
Thu, 16 Feb 2006 22:41:58 +0000 (23:41 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 17 Feb 2006 16:00:40 +0000 (08:00 -0800)
AMD SimNow!'s JIT doesn't like them at all in the guest. For distribution
installation it's easiest if it's a boot time option.

Also I moved the variable to a more appropiate place and make
it independent from sysctl

And marked __read_mostly which it is.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Documentation/kernel-parameters.txt
arch/i386/kernel/cpu/transmeta.c
include/linux/kernel.h
include/linux/mm.h
kernel/sysctl.c
mm/memory.c

index ac75b57edf2e71050d4eacd1b1b91d2aaa987076..b874771385cda9df928fc651dee1e7585c6a08ff 100644 (file)
@@ -1638,6 +1638,9 @@ running once the system is up.
                        Format:
                        <irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
 
+       norandmaps      Don't use address space randomization
+                       Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space
+
 
 ______________________________________________________________________
 Changelog:
index bdbeb77f4e22fa9e7f6636cf03c03e8bb59c4dd6..7214c9b577ab91329ecdb261926e2cdde6e729fd 100644 (file)
@@ -1,4 +1,5 @@
 #include <linux/kernel.h>
+#include <linux/mm.h>
 #include <linux/init.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
index b49affa0ac5a4d4b779d2e0b9a8967fec7640bec..3b507bf05d098313503270a757175af101af6f57 100644 (file)
@@ -326,12 +326,6 @@ struct sysinfo {
 /* Force a compilation error if condition is true */
 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
 
-#ifdef CONFIG_SYSCTL
-extern int randomize_va_space;
-#else
-#define randomize_va_space 1
-#endif
-
 /* Trap pasters of __FUNCTION__ at compile-time */
 #define __FUNCTION__ (__func__)
 
index 75e9f0724997e631806ceb7dd3733dfd7b2d8cc1..26e1663a5cbe474597b6fe75f5d2b00f2c09e20a 100644 (file)
@@ -1051,5 +1051,7 @@ int shrink_slab(unsigned long scanned, gfp_t gfp_mask,
 void drop_pagecache(void);
 void drop_slab(void);
 
+extern int randomize_va_space;
+
 #endif /* __KERNEL__ */
 #endif /* _LINUX_MM_H */
index 71dd6f62efec11ce623d64ef31ec565a78084763..7654d55c47f50c8a476fcca89d6e28c709461870 100644 (file)
@@ -126,8 +126,6 @@ extern int sysctl_hz_timer;
 extern int acct_parm[];
 #endif
 
-int randomize_va_space = 1;
-
 static int parse_table(int __user *, int, void __user *, size_t __user *, void __user *, size_t,
                       ctl_table *, void **);
 static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
index 2bee1f21aa8aa92294ef481778b3c370063413fb..9abc6008544baae37d9d88a4416a4ec81e966132 100644 (file)
@@ -82,6 +82,16 @@ EXPORT_SYMBOL(num_physpages);
 EXPORT_SYMBOL(high_memory);
 EXPORT_SYMBOL(vmalloc_earlyreserve);
 
+int randomize_va_space __read_mostly = 1;
+
+static int __init disable_randmaps(char *s)
+{
+       randomize_va_space = 0;
+       return 0;
+}
+__setup("norandmaps", disable_randmaps);
+
+
 /*
  * If a p?d_bad entry is found while walking page tables, report
  * the error, before resetting entry to p?d_none.  Usually (but