diff options
Diffstat (limited to 'arch/x86/entry/vsyscall/vsyscall_64.c')
-rw-r--r-- | arch/x86/entry/vsyscall/vsyscall_64.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c index 174c2549939d..2d359991a273 100644 --- a/arch/x86/entry/vsyscall/vsyscall_64.c +++ b/arch/x86/entry/vsyscall/vsyscall_64.c | |||
@@ -46,6 +46,7 @@ static enum { EMULATE, NATIVE, NONE } vsyscall_mode = | |||
46 | #else | 46 | #else |
47 | EMULATE; | 47 | EMULATE; |
48 | #endif | 48 | #endif |
49 | unsigned long vsyscall_pgprot = __PAGE_KERNEL_VSYSCALL; | ||
49 | 50 | ||
50 | static int __init vsyscall_setup(char *str) | 51 | static int __init vsyscall_setup(char *str) |
51 | { | 52 | { |
@@ -66,6 +67,11 @@ static int __init vsyscall_setup(char *str) | |||
66 | } | 67 | } |
67 | early_param("vsyscall", vsyscall_setup); | 68 | early_param("vsyscall", vsyscall_setup); |
68 | 69 | ||
70 | bool vsyscall_enabled(void) | ||
71 | { | ||
72 | return vsyscall_mode != NONE; | ||
73 | } | ||
74 | |||
69 | static void warn_bad_vsyscall(const char *level, struct pt_regs *regs, | 75 | static void warn_bad_vsyscall(const char *level, struct pt_regs *regs, |
70 | const char *message) | 76 | const char *message) |
71 | { | 77 | { |
@@ -331,11 +337,11 @@ void __init map_vsyscall(void) | |||
331 | extern char __vsyscall_page; | 337 | extern char __vsyscall_page; |
332 | unsigned long physaddr_vsyscall = __pa_symbol(&__vsyscall_page); | 338 | unsigned long physaddr_vsyscall = __pa_symbol(&__vsyscall_page); |
333 | 339 | ||
340 | if (vsyscall_mode != NATIVE) | ||
341 | vsyscall_pgprot = __PAGE_KERNEL_VVAR; | ||
334 | if (vsyscall_mode != NONE) | 342 | if (vsyscall_mode != NONE) |
335 | __set_fixmap(VSYSCALL_PAGE, physaddr_vsyscall, | 343 | __set_fixmap(VSYSCALL_PAGE, physaddr_vsyscall, |
336 | vsyscall_mode == NATIVE | 344 | __pgprot(vsyscall_pgprot)); |
337 | ? PAGE_KERNEL_VSYSCALL | ||
338 | : PAGE_KERNEL_VVAR); | ||
339 | 345 | ||
340 | BUILD_BUG_ON((unsigned long)__fix_to_virt(VSYSCALL_PAGE) != | 346 | BUILD_BUG_ON((unsigned long)__fix_to_virt(VSYSCALL_PAGE) != |
341 | (unsigned long)VSYSCALL_ADDR); | 347 | (unsigned long)VSYSCALL_ADDR); |