Commit a62eaf15 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Add boot option to disable randomized mappings and cleanup

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: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 99019e91
...@@ -1638,6 +1638,9 @@ running once the system is up. ...@@ -1638,6 +1638,9 @@ running once the system is up.
Format: Format:
<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]] <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: Changelog:
......
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/msr.h> #include <asm/msr.h>
......
...@@ -326,12 +326,6 @@ struct sysinfo { ...@@ -326,12 +326,6 @@ struct sysinfo {
/* Force a compilation error if condition is true */ /* Force a compilation error if condition is true */
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) #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 */ /* Trap pasters of __FUNCTION__ at compile-time */
#define __FUNCTION__ (__func__) #define __FUNCTION__ (__func__)
......
...@@ -1051,5 +1051,7 @@ int shrink_slab(unsigned long scanned, gfp_t gfp_mask, ...@@ -1051,5 +1051,7 @@ int shrink_slab(unsigned long scanned, gfp_t gfp_mask,
void drop_pagecache(void); void drop_pagecache(void);
void drop_slab(void); void drop_slab(void);
extern int randomize_va_space;
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */ #endif /* _LINUX_MM_H */
...@@ -126,8 +126,6 @@ extern int sysctl_hz_timer; ...@@ -126,8 +126,6 @@ extern int sysctl_hz_timer;
extern int acct_parm[]; extern int acct_parm[];
#endif #endif
int randomize_va_space = 1;
static int parse_table(int __user *, int, void __user *, size_t __user *, void __user *, size_t, static int parse_table(int __user *, int, void __user *, size_t __user *, void __user *, size_t,
ctl_table *, void **); ctl_table *, void **);
static int proc_doutsstring(ctl_table *table, int write, struct file *filp, static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
......
...@@ -82,6 +82,16 @@ EXPORT_SYMBOL(num_physpages); ...@@ -82,6 +82,16 @@ EXPORT_SYMBOL(num_physpages);
EXPORT_SYMBOL(high_memory); EXPORT_SYMBOL(high_memory);
EXPORT_SYMBOL(vmalloc_earlyreserve); 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 * If a p?d_bad entry is found while walking page tables, report
* the error, before resetting entry to p?d_none. Usually (but * the error, before resetting entry to p?d_none. Usually (but
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment