Commit e4026440 authored by Ingo Molnar's avatar Ingo Molnar

x86: map vsyscalls early enough

map vsyscalls early enough. This is important if a __vsyscall_fn
function is used by other kernel code too.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent cdc7957d
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <asm/mtrr.h> #include <asm/mtrr.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/vsyscall.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/msr.h> #include <asm/msr.h>
...@@ -453,6 +454,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -453,6 +454,7 @@ void __init setup_arch(char **cmdline_p)
#endif #endif
reserve_crashkernel(); reserve_crashkernel();
paging_init(); paging_init();
map_vsyscall();
early_quirks(); early_quirks();
......
...@@ -319,7 +319,7 @@ cpu_vsyscall_notifier(struct notifier_block *n, unsigned long action, void *arg) ...@@ -319,7 +319,7 @@ cpu_vsyscall_notifier(struct notifier_block *n, unsigned long action, void *arg)
return NOTIFY_DONE; return NOTIFY_DONE;
} }
static void __init map_vsyscall(void) void __init map_vsyscall(void)
{ {
extern char __vsyscall_0; extern char __vsyscall_0;
unsigned long physaddr_page0 = __pa_symbol(&__vsyscall_0); unsigned long physaddr_page0 = __pa_symbol(&__vsyscall_0);
...@@ -335,7 +335,6 @@ static int __init vsyscall_init(void) ...@@ -335,7 +335,6 @@ static int __init vsyscall_init(void)
BUG_ON((unsigned long) &vtime != VSYSCALL_ADDR(__NR_vtime)); BUG_ON((unsigned long) &vtime != VSYSCALL_ADDR(__NR_vtime));
BUG_ON((VSYSCALL_ADDR(0) != __fix_to_virt(VSYSCALL_FIRST_PAGE))); BUG_ON((VSYSCALL_ADDR(0) != __fix_to_virt(VSYSCALL_FIRST_PAGE)));
BUG_ON((unsigned long) &vgetcpu != VSYSCALL_ADDR(__NR_vgetcpu)); BUG_ON((unsigned long) &vgetcpu != VSYSCALL_ADDR(__NR_vgetcpu));
map_vsyscall();
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
register_sysctl_table(kernel_root_table2); register_sysctl_table(kernel_root_table2);
#endif #endif
......
...@@ -36,6 +36,8 @@ extern volatile unsigned long __jiffies; ...@@ -36,6 +36,8 @@ extern volatile unsigned long __jiffies;
extern int vgetcpu_mode; extern int vgetcpu_mode;
extern struct timezone sys_tz; extern struct timezone sys_tz;
extern void map_vsyscall(void);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _ASM_X86_64_VSYSCALL_H_ */ #endif /* _ASM_X86_64_VSYSCALL_H_ */
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