Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c3652ef authored by Roland McGrath's avatar Roland McGrath Committed by Ingo Molnar
Browse files

x86 vDSO: i386 vdso32



This makes the i386 kernel use the new vDSO build in arch/x86/vdso/vdso32/
to replace the old one from arch/x86/kernel/.

Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 0249c9c1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -110,7 +110,8 @@ libs-y += arch/x86/lib/
core-y					+= arch/x86/kernel/ \
					   arch/x86/mm/ \
					   $(mcore-y)/ \
					   arch/x86/crypto/
					   arch/x86/crypto/ \
					   arch/x86/vdso/
drivers-$(CONFIG_MATH_EMULATION)	+= arch/x86/math-emu/
drivers-$(CONFIG_PCI)			+= arch/x86/pci/
# must be linked after kernel/
+1 −42
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
obj-$(CONFIG_X86_SUMMIT_NUMA)	+= summit_32.o
obj-$(CONFIG_KPROBES)		+= kprobes_32.o
obj-$(CONFIG_MODULES)		+= module_32.o
obj-y				+= sysenter_32.o vsyscall_32.o
obj-y				+= sysenter_32.o
obj-$(CONFIG_ACPI_SRAT) 	+= srat_32.o
obj-$(CONFIG_EFI) 		+= efi_32.o efi_stub_32.o
obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault_32.o
@@ -48,44 +48,3 @@ obj-$(CONFIG_PARAVIRT) += paravirt_32.o
obj-y				+= pcspeaker.o

obj-$(CONFIG_SCx200)		+= scx200_32.o

# vsyscall_32.o contains the vsyscall DSO images as __initdata.
# We must build both images before we can assemble it.
# Note: kbuild does not track this dependency due to usage of .incbin
$(obj)/vsyscall_32.o: $(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter_32.so
targets += $(foreach F,int80 sysenter,vsyscall-$F_32.o vsyscall-$F_32.so)
targets += vsyscall-note_32.o vsyscall_32.lds

$(obj)/vsyscall-%_32.o: $(src)/../vdso/vdso32/%.S
	$(call if_changed_dep,as_o_S)

# The DSO images are built using a special linker script.
quiet_cmd_syscall = SYSCALL $@
      cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
		          -Wl,-T,$(filter-out FORCE,$^) -o $@

export CPPFLAGS_vsyscall_32.lds += -P -C -Ui386

vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
		 $(call ld-option, -Wl$(comma)--hash-style=sysv)
SYSCFLAGS_vsyscall-sysenter_32.so	= $(vsyscall-flags)
SYSCFLAGS_vsyscall-int80_32.so	= $(vsyscall-flags)

$(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter_32.so: \
$(obj)/vsyscall-%.so: $(src)/vsyscall_32.lds \
		      $(obj)/vsyscall-%.o $(obj)/vsyscall-note_32.o FORCE
	$(call if_changed,syscall)

# We also create a special relocatable object that should mirror the symbol
# table and layout of the linked DSO.  With ld -R we can then refer to
# these symbols in the kernel code rather than hand-coded addresses.
extra-y += vsyscall-syms.o
$(obj)/built-in.o: $(obj)/vsyscall-syms.o
$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o

SYSCFLAGS_vsyscall-syms.o = -r
$(obj)/vsyscall-syms.o: $(src)/vsyscall_32.lds \
			$(obj)/vsyscall-sysenter_32.o $(obj)/vsyscall-note_32.o FORCE
	$(call if_changed,syscall)

+0 −2
Original line number Diff line number Diff line
@@ -111,8 +111,6 @@ void foo(void)
	DEFINE(PTRS_PER_PMD, PTRS_PER_PMD);
	DEFINE(PTRS_PER_PGD, PTRS_PER_PGD);

	DEFINE(VDSO_PRELINK_asm, VDSO_PRELINK);

	OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);

#ifdef CONFIG_PARAVIRT
+3 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <asm/ucontext.h>
#include <asm/uaccess.h>
#include <asm/i387.h>
#include <asm/vdso.h>
#include "sigframe_32.h"

#define DEBUG_SIG 0
@@ -362,7 +363,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
	}

	if (current->binfmt->hasvdso)
		restorer = (void *)VDSO_SYM(&__kernel_sigreturn);
		restorer = VDSO32_SYMBOL(current->mm->context.vdso, sigreturn);
	else
		restorer = (void *)&frame->retcode;
	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,
		goto give_sigsegv;

	/* Set up to return from userspace.  */
	restorer = (void *)VDSO_SYM(&__kernel_rt_sigreturn);
	restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn);
	if (ka->sa.sa_flags & SA_RESTORER)
		restorer = ka->sa.sa_restorer;
	err |= __put_user(restorer, &frame->pretcode);
+2 −4
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <asm/unistd.h>
#include <asm/elf.h>
#include <asm/tlbflush.h>
#include <asm/vdso.h>

enum {
	VDSO_DISABLED = 0,
@@ -259,9 +260,6 @@ int __init sysenter_setup(void)
	return 0;
}

/* Defined in vsyscall-sysenter.S */
extern void SYSENTER_RETURN;

/* Setup a VMA at program startup for the vsyscall page */
int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
{
@@ -308,7 +306,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)

	current->mm->context.vdso = (void *)addr;
	current_thread_info()->sysenter_return =
		(void *)VDSO_SYM(&SYSENTER_RETURN);
		VDSO32_SYMBOL(addr, SYSENTER_RETURN);

  up_fail:
	up_write(&mm->mmap_sem);
Loading