Skip to content

Commit 95c46b5

Browse files
amlutoKAGA-KOKO
authored andcommitted
x86_64, vsyscall: Rewrite comment and clean up headers in vsyscall code
vsyscall_64.c is just vsyscall emulation. Tidy it up accordingly. [ tglx: Preserved the original copyright notices ] Signed-off-by: Andy Lutomirski <luto@amacapital.net> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Link: http://lkml.kernel.org/r/9c448d5643d0fdb618f8cde9a54c21d2bcd486ce.1414618407.git.luto@amacapital.net Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 87983c6 commit 95c46b5

File tree

1 file changed

+18
-32
lines changed

1 file changed

+18
-32
lines changed

arch/x86/kernel/vsyscall_64.c

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,38 @@
11
/*
2+
* Copyright (c) 2012-2014 Andy Lutomirski <luto@amacapital.net>
3+
*
4+
* Based on the original implementation which is:
25
* Copyright (C) 2001 Andrea Arcangeli <andrea@suse.de> SuSE
36
* Copyright 2003 Andi Kleen, SuSE Labs.
47
*
5-
* [ NOTE: this mechanism is now deprecated in favor of the vDSO. ]
8+
* Parts of the original code have been moved to arch/x86/vdso/vma.c
9+
*
10+
* This file implements vsyscall emulation. vsyscalls are a legacy ABI:
11+
* Userspace can request certain kernel services by calling fixed
12+
* addresses. This concept is problematic:
613
*
7-
* Thanks to hpa@transmeta.com for some useful hint.
8-
* Special thanks to Ingo Molnar for his early experience with
9-
* a different vsyscall implementation for Linux/IA32 and for the name.
14+
* - It interferes with ASLR.
15+
* - It's awkward to write code that lives in kernel addresses but is
16+
* callable by userspace at fixed addresses.
17+
* - The whole concept is impossible for 32-bit compat userspace.
18+
* - UML cannot easily virtualize a vsyscall.
1019
*
11-
* vsyscall 1 is located at -10Mbyte, vsyscall 2 is located
12-
* at virtual address -10Mbyte+1024bytes etc... There are at max 4
13-
* vsyscalls. One vsyscall can reserve more than 1 slot to avoid
14-
* jumping out of line if necessary. We cannot add more with this
15-
* mechanism because older kernels won't return -ENOSYS.
20+
* As of mid-2014, I believe that there is no new userspace code that
21+
* will use a vsyscall if the vDSO is present. I hope that there will
22+
* soon be no new userspace code that will ever use a vsyscall.
1623
*
17-
* Note: the concept clashes with user mode linux. UML users should
18-
* use the vDSO.
24+
* The code in this file emulates vsyscalls when notified of a page
25+
* fault to a vsyscall address.
1926
*/
2027

21-
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22-
23-
#include <linux/time.h>
24-
#include <linux/init.h>
2528
#include <linux/kernel.h>
2629
#include <linux/timer.h>
27-
#include <linux/seqlock.h>
28-
#include <linux/jiffies.h>
29-
#include <linux/sysctl.h>
30-
#include <linux/topology.h>
31-
#include <linux/timekeeper_internal.h>
32-
#include <linux/getcpu.h>
33-
#include <linux/cpu.h>
34-
#include <linux/smp.h>
35-
#include <linux/notifier.h>
3630
#include <linux/syscalls.h>
3731
#include <linux/ratelimit.h>
3832

3933
#include <asm/vsyscall.h>
40-
#include <asm/pgtable.h>
41-
#include <asm/compat.h>
42-
#include <asm/page.h>
4334
#include <asm/unistd.h>
4435
#include <asm/fixmap.h>
45-
#include <asm/errno.h>
46-
#include <asm/io.h>
47-
#include <asm/segment.h>
48-
#include <asm/desc.h>
49-
#include <asm/topology.h>
5036
#include <asm/traps.h>
5137

5238
#define CREATE_TRACE_POINTS

0 commit comments

Comments
 (0)