|
1 | 1 | /*
|
| 2 | + * Copyright (c) 2012-2014 Andy Lutomirski <luto@amacapital.net> |
| 3 | + * |
| 4 | + * Based on the original implementation which is: |
2 | 5 | * Copyright (C) 2001 Andrea Arcangeli <andrea@suse.de> SuSE
|
3 | 6 | * Copyright 2003 Andi Kleen, SuSE Labs.
|
4 | 7 | *
|
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: |
6 | 13 | *
|
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. |
10 | 19 | *
|
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. |
16 | 23 | *
|
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. |
19 | 26 | */
|
20 | 27 |
|
21 |
| -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
22 |
| - |
23 |
| -#include <linux/time.h> |
24 |
| -#include <linux/init.h> |
25 | 28 | #include <linux/kernel.h>
|
26 | 29 | #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> |
36 | 30 | #include <linux/syscalls.h>
|
37 | 31 | #include <linux/ratelimit.h>
|
38 | 32 |
|
39 | 33 | #include <asm/vsyscall.h>
|
40 |
| -#include <asm/pgtable.h> |
41 |
| -#include <asm/compat.h> |
42 |
| -#include <asm/page.h> |
43 | 34 | #include <asm/unistd.h>
|
44 | 35 | #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> |
50 | 36 | #include <asm/traps.h>
|
51 | 37 |
|
52 | 38 | #define CREATE_TRACE_POINTS
|
|
0 commit comments