aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/Makefile_3243
-rw-r--r--arch/x86/kernel/asm-offsets_32.c2
-rw-r--r--arch/x86/kernel/signal_32.c5
-rw-r--r--arch/x86/kernel/sysenter_32.c6
-rw-r--r--arch/x86/kernel/vsyscall_32.S15
-rw-r--r--arch/x86/kernel/vsyscall_32.lds.S67
6 files changed, 6 insertions, 132 deletions
diff --git a/arch/x86/kernel/Makefile_32 b/arch/x86/kernel/Makefile_32
index f7c1c1c88dda..0eef8226753b 100644
--- a/arch/x86/kernel/Makefile_32
+++ b/arch/x86/kernel/Makefile_32
@@ -33,7 +33,7 @@ obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
33obj-$(CONFIG_X86_SUMMIT_NUMA) += summit_32.o 33obj-$(CONFIG_X86_SUMMIT_NUMA) += summit_32.o
34obj-$(CONFIG_KPROBES) += kprobes_32.o 34obj-$(CONFIG_KPROBES) += kprobes_32.o
35obj-$(CONFIG_MODULES) += module_32.o 35obj-$(CONFIG_MODULES) += module_32.o
36obj-y += sysenter_32.o vsyscall_32.o 36obj-y += sysenter_32.o
37obj-$(CONFIG_ACPI_SRAT) += srat_32.o 37obj-$(CONFIG_ACPI_SRAT) += srat_32.o
38obj-$(CONFIG_EFI) += efi_32.o efi_stub_32.o 38obj-$(CONFIG_EFI) += efi_32.o efi_stub_32.o
39obj-$(CONFIG_DOUBLEFAULT) += doublefault_32.o 39obj-$(CONFIG_DOUBLEFAULT) += doublefault_32.o
@@ -48,44 +48,3 @@ obj-$(CONFIG_PARAVIRT) += paravirt_32.o
48obj-y += pcspeaker.o 48obj-y += pcspeaker.o
49 49
50obj-$(CONFIG_SCx200) += scx200_32.o 50obj-$(CONFIG_SCx200) += scx200_32.o
51
52# vsyscall_32.o contains the vsyscall DSO images as __initdata.
53# We must build both images before we can assemble it.
54# Note: kbuild does not track this dependency due to usage of .incbin
55$(obj)/vsyscall_32.o: $(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter_32.so
56targets += $(foreach F,int80 sysenter,vsyscall-$F_32.o vsyscall-$F_32.so)
57targets += vsyscall-note_32.o vsyscall_32.lds
58
59$(obj)/vsyscall-%_32.o: $(src)/../vdso/vdso32/%.S
60 $(call if_changed_dep,as_o_S)
61
62# The DSO images are built using a special linker script.
63quiet_cmd_syscall = SYSCALL $@
64 cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
65 -Wl,-T,$(filter-out FORCE,$^) -o $@
66
67export CPPFLAGS_vsyscall_32.lds += -P -C -Ui386
68
69vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
70 $(call ld-option, -Wl$(comma)--hash-style=sysv)
71SYSCFLAGS_vsyscall-sysenter_32.so = $(vsyscall-flags)
72SYSCFLAGS_vsyscall-int80_32.so = $(vsyscall-flags)
73
74$(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter_32.so: \
75$(obj)/vsyscall-%.so: $(src)/vsyscall_32.lds \
76 $(obj)/vsyscall-%.o $(obj)/vsyscall-note_32.o FORCE
77 $(call if_changed,syscall)
78
79# We also create a special relocatable object that should mirror the symbol
80# table and layout of the linked DSO. With ld -R we can then refer to
81# these symbols in the kernel code rather than hand-coded addresses.
82extra-y += vsyscall-syms.o
83$(obj)/built-in.o: $(obj)/vsyscall-syms.o
84$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
85
86SYSCFLAGS_vsyscall-syms.o = -r
87$(obj)/vsyscall-syms.o: $(src)/vsyscall_32.lds \
88 $(obj)/vsyscall-sysenter_32.o $(obj)/vsyscall-note_32.o FORCE
89 $(call if_changed,syscall)
90
91
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index 4f750ec810f6..fd7464d23339 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -111,8 +111,6 @@ void foo(void)
111 DEFINE(PTRS_PER_PMD, PTRS_PER_PMD); 111 DEFINE(PTRS_PER_PMD, PTRS_PER_PMD);
112 DEFINE(PTRS_PER_PGD, PTRS_PER_PGD); 112 DEFINE(PTRS_PER_PGD, PTRS_PER_PGD);
113 113
114 DEFINE(VDSO_PRELINK_asm, VDSO_PRELINK);
115
116 OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); 114 OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
117 115
118#ifdef CONFIG_PARAVIRT 116#ifdef CONFIG_PARAVIRT
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index 5c6170c44b00..1ac53e9a0859 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -23,6 +23,7 @@
23#include <asm/ucontext.h> 23#include <asm/ucontext.h>
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include <asm/i387.h> 25#include <asm/i387.h>
26#include <asm/vdso.h>
26#include "sigframe_32.h" 27#include "sigframe_32.h"
27 28
28#define DEBUG_SIG 0 29#define DEBUG_SIG 0
@@ -362,7 +363,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
362 } 363 }
363 364
364 if (current->binfmt->hasvdso) 365 if (current->binfmt->hasvdso)
365 restorer = (void *)VDSO_SYM(&__kernel_sigreturn); 366 restorer = VDSO32_SYMBOL(current->mm->context.vdso, sigreturn);
366 else 367 else
367 restorer = (void *)&frame->retcode; 368 restorer = (void *)&frame->retcode;
368 if (ka->sa.sa_flags & SA_RESTORER) 369 if (ka->sa.sa_flags & SA_RESTORER)
@@ -459,7 +460,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
459 goto give_sigsegv; 460 goto give_sigsegv;
460 461
461 /* Set up to return from userspace. */ 462 /* Set up to return from userspace. */
462 restorer = (void *)VDSO_SYM(&__kernel_rt_sigreturn); 463 restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn);
463 if (ka->sa.sa_flags & SA_RESTORER) 464 if (ka->sa.sa_flags & SA_RESTORER)
464 restorer = ka->sa.sa_restorer; 465 restorer = ka->sa.sa_restorer;
465 err |= __put_user(restorer, &frame->pretcode); 466 err |= __put_user(restorer, &frame->pretcode);
diff --git a/arch/x86/kernel/sysenter_32.c b/arch/x86/kernel/sysenter_32.c
index 5a2d951e2608..85c52d23ee40 100644
--- a/arch/x86/kernel/sysenter_32.c
+++ b/arch/x86/kernel/sysenter_32.c
@@ -23,6 +23,7 @@
23#include <asm/unistd.h> 23#include <asm/unistd.h>
24#include <asm/elf.h> 24#include <asm/elf.h>
25#include <asm/tlbflush.h> 25#include <asm/tlbflush.h>
26#include <asm/vdso.h>
26 27
27enum { 28enum {
28 VDSO_DISABLED = 0, 29 VDSO_DISABLED = 0,
@@ -259,9 +260,6 @@ int __init sysenter_setup(void)
259 return 0; 260 return 0;
260} 261}
261 262
262/* Defined in vsyscall-sysenter.S */
263extern void SYSENTER_RETURN;
264
265/* Setup a VMA at program startup for the vsyscall page */ 263/* Setup a VMA at program startup for the vsyscall page */
266int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack) 264int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
267{ 265{
@@ -308,7 +306,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
308 306
309 current->mm->context.vdso = (void *)addr; 307 current->mm->context.vdso = (void *)addr;
310 current_thread_info()->sysenter_return = 308 current_thread_info()->sysenter_return =
311 (void *)VDSO_SYM(&SYSENTER_RETURN); 309 VDSO32_SYMBOL(addr, SYSENTER_RETURN);
312 310
313 up_fail: 311 up_fail:
314 up_write(&mm->mmap_sem); 312 up_write(&mm->mmap_sem);
diff --git a/arch/x86/kernel/vsyscall_32.S b/arch/x86/kernel/vsyscall_32.S
deleted file mode 100644
index a5ab3dc4fd25..000000000000
--- a/arch/x86/kernel/vsyscall_32.S
+++ /dev/null
@@ -1,15 +0,0 @@
1#include <linux/init.h>
2
3__INITDATA
4
5 .globl vsyscall_int80_start, vsyscall_int80_end
6vsyscall_int80_start:
7 .incbin "arch/x86/kernel/vsyscall-int80_32.so"
8vsyscall_int80_end:
9
10 .globl vsyscall_sysenter_start, vsyscall_sysenter_end
11vsyscall_sysenter_start:
12 .incbin "arch/x86/kernel/vsyscall-sysenter_32.so"
13vsyscall_sysenter_end:
14
15__FINIT
diff --git a/arch/x86/kernel/vsyscall_32.lds.S b/arch/x86/kernel/vsyscall_32.lds.S
deleted file mode 100644
index 4a8b0ed9b8fb..000000000000
--- a/arch/x86/kernel/vsyscall_32.lds.S
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * Linker script for vsyscall DSO. The vsyscall page is an ELF shared
3 * object prelinked to its virtual address, and with only one read-only
4 * segment (that fits in one page). This script controls its layout.
5 */
6#include <asm/asm-offsets.h>
7
8SECTIONS
9{
10 . = VDSO_PRELINK_asm + SIZEOF_HEADERS;
11
12 .hash : { *(.hash) } :text
13 .gnu.hash : { *(.gnu.hash) }
14 .dynsym : { *(.dynsym) }
15 .dynstr : { *(.dynstr) }
16 .gnu.version : { *(.gnu.version) }
17 .gnu.version_d : { *(.gnu.version_d) }
18 .gnu.version_r : { *(.gnu.version_r) }
19
20 /* This linker script is used both with -r and with -shared.
21 For the layouts to match, we need to skip more than enough
22 space for the dynamic symbol table et al. If this amount
23 is insufficient, ld -shared will barf. Just increase it here. */
24 . = VDSO_PRELINK_asm + 0x400;
25
26 .text : { *(.text) } :text =0x90909090
27 .note : { *(.note.*) } :text :note
28 .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
29 .eh_frame : { KEEP (*(.eh_frame)) } :text
30 .dynamic : { *(.dynamic) } :text :dynamic
31 .useless : {
32 *(.got.plt) *(.got)
33 *(.data .data.* .gnu.linkonce.d.*)
34 *(.dynbss)
35 *(.bss .bss.* .gnu.linkonce.b.*)
36 } :text
37}
38
39/*
40 * We must supply the ELF program headers explicitly to get just one
41 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
42 */
43PHDRS
44{
45 text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
46 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
47 note PT_NOTE FLAGS(4); /* PF_R */
48 eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */
49}
50
51/*
52 * This controls what symbols we export from the DSO.
53 */
54VERSION
55{
56 LINUX_2.5 {
57 global:
58 __kernel_vsyscall;
59 __kernel_sigreturn;
60 __kernel_rt_sigreturn;
61
62 local: *;
63 };
64}
65
66/* The ELF entry point can be used to set the AT_SYSINFO value. */
67ENTRY(__kernel_vsyscall);