Skip to contentSkip to conversation

x86/asm changes for v4.3

GIT PULL Ingo Molnar 1 participant 1 message Aug 31, 2015

Subsystems (25)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest x86-asm-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-asm-for-linus

# HEAD: 7e01ebffffedec22cea86ebe94802f909e4579ca x86/asm: Drop repeated macro of X86_EFLAGS_AC definition

The biggest changes in this cycle were:

- Revamp, simplify (and in some cases fix) Time Stamp Counter (TSC) primitives. (Andy Lutomirski)

- Add new, comprehensible entry and exit handlers written in C. (Andy Lutomirski)

- vm86 mode cleanups and fixes. (Brian Gerst)

- 32-bit compat code cleanups. (Brian Gerst)

The amount of simplification in low level assembly code is already palpable:

   arch/x86/entry/entry_32.S                          | 130 +----
   arch/x86/entry/entry_64.S                          | 197 ++-----

but more simplifications are planned.

There's also the usual laudry mix of low level changes - see the changelog for details.

Thanks,

Ingo

out-of-topic modifications in x86-asm-for-linus:
--------------------------------------------------
arch/um/include/shared/kern_util.h # ccaee5f85147: um: Fix do_signal() prototyp

  arch/um/kernel/process.c           # ccaee5f85147: um: Fix do_signal() prototyp
  arch/um/kernel/signal.c            # ccaee5f85147: um: Fix do_signal() prototyp
  arch/um/kernel/tlb.c               # ccaee5f85147: um: Fix do_signal() prototyp
  arch/um/kernel/trap.c              # ccaee5f85147: um: Fix do_signal() prototyp
  drivers/cpufreq/intel_pstate.c     # 4ea1636b04db: x86/asm/tsc: Rename native_r
  drivers/input/gameport/gameport.c  # 4ea1636b04db: x86/asm/tsc: Rename native_r
                                   # 732f374ba50b: x86/asm/tsc, drivers/input/g
  drivers/input/joystick/analog.c    # 4ea1636b04db: x86/asm/tsc: Rename native_r
                                   # 016bfc449a88: x86/asm/tsc, input/joystick/
  drivers/net/hamradio/baycom_epp.c  # 4ea1636b04db: x86/asm/tsc: Rename native_r
                                   # e18d1f8df176: x86/asm/tsc, drivers/net/ham
  drivers/scsi/dpt_i2o.c             # ba3e127ec105: x86/vm86: Clean up vm86.h in
  drivers/staging/media/lirc/lirc_serial.c# 3a2c16c8489d: x86/asm/tsc, staging/lirc_se
  drivers/thermal/intel_powerclamp.c # 4ea1636b04db: x86/asm/tsc: Rename native_r
                                   # 87be28aaf145: x86/asm/tsc: Replace rdtscll
  include/linux/context_tracking.h   # f9281648ecd5: context_tracking: Add ct_sta
  include/linux/context_tracking_state.h# f9281648ecd5: context_tracking: Add ct_sta
  include/linux/spinlock.h           # 3490565b633c: locking/spinlocks: Force inl
  kernel/notifier.c                  # e727c7d7a11e: notifiers, RCU: Assert that 
  kernel/sys_ni.c                    # a5b9e5a2f14f: x86/ldt: Make modify_ldt() o
  tools/power/cpupower/debug/kernel/cpufreq-test_tsc.c# 4ea1636b04db: x86/asm/tsc: Rename native_r
                                   # 87be28aaf145: x86/asm/tsc: Replace rdtscll
  tools/testing/selftests/x86/Makefile# a9c909ce8c78: selftests/x86: Add syscall_n
                                   # 33f3df41d038: selftests/x86: Disable sigre
                                   # 014dc90b66c8: selftests/x86, x86/ldt: Add 
                                   # 5e5c684a2c78: x86/entry, selftests/x86: Ad
  tools/testing/selftests/x86/entry_from_vm86.c# e800eb39e3f5: selftests/x86/vm86: Fix entr
                                   # f2a50f8b7da4: x86/selftests, x86/vm86: Imp

tools/testing/selftests/x86/ldt_gdt.c# 014dc90b66c8: selftests/x86, x86/ldt: Add tools/testing/selftests/x86/syscall_arg_fault.c# 5e5c684a2c78: x86/entry, selftests/x86: Ad tools/testing/selftests/x86/syscall_nt.c# a9c909ce8c78: selftests/x86: Add syscall_n

Thanks,

Ingo

------------------>
Andy Lutomirski (52):
x86/asm/tsc: Inline native_read_tsc() and remove __native_read_tsc()
x86/asm/tsc, kvm: Remove vget_cycles()
x86/asm/tsc, x86/paravirt: Remove read_tsc() and read_tscp() paravirt hooks x86/asm/tsc: Replace rdtscll() with native_read_tsc()
x86/asm/tsc: Remove the rdtscp() and rdtscpll() macros
x86/asm/tsc: Use the full 64-bit TSC in delay_tsc()
x86/asm/tsc, x86/cpu/amd: Use the full 64-bit TSC to detect the 2.6.2 bug x86/asm/tsc, drivers/net/hamradio/baycom_epp: Replace rdtscl() with native_read_tsc() x86/asm/tsc, staging/lirc_serial: Remove TSC-based timing
x86/asm/tsc, input/joystick/analog: Switch from rdtscl() to native_read_tsc() x86/asm/tsc, drivers/input/gameport: Replace rdtscl() with native_read_tsc() x86/asm/tsc: Remove rdtscl()
x86/asm/tsc: Rename native_read_tsc() to rdtsc()
x86/asm/tsc: Add rdtsc_ordered() and use it in trivial call sites
x86/asm/tsc/sync: Use rdtsc_ordered() in check_tsc_warp() and drop extra barriers x86/asm/tsc: Use rdtsc_ordered() in read_tsc() instead of get_cycles()
x86/asm/tsc, x86/kvm: Drop open-coded barrier and use rdtsc_ordered() in kvmclock x86/asm/tsc: Remove rdtsc_barrier()
x86/entry, selftests/x86: Add a test for 32-bit fast syscall arg faults x86/entry/64/compat: Fix bad fast syscall arg failure path
context_tracking: Add ct_state() and CT_WARN_ON()
notifiers, RCU: Assert that RCU is watching in notify_die()
x86/entry: Move C entry and exit code to arch/x86/entry/common.c
x86/traps, context_tracking: Assert that we're in CONTEXT_KERNEL in exception entries x86/entry: Add enter_from_user_mode() and use it in syscalls
x86/entry: Add new, comprehensible entry and exit handlers written in C
x86/entry/64: Really create an error-entry-from-usermode code path
x86/entry/64: Migrate 64-bit and compat syscalls to the new exit handlers and remove old assembly code x86/asm/entry/64: Save all regs on interrupt entry
x86/asm/entry/64: Simplify IRQ stack pt_regs handling
x86/asm/entry/64: Migrate error and IRQ exit work to C and remove old assembly code x86/entry: Remove exception_enter() from most trap handlers
x86/entry: Remove SCHEDULE_USER and asm/context-tracking.h
x86/irq, context_tracking: Document how IRQ context tracking works and add an RCU assertion x86/entry/64: Fix IRQ state confusion and related warning on compat syscalls with CONFIG_AUDITSYSCALL=n x86/entry: Fix _TIF_USER_RETURN_NOTIFY check in prepare_exit_to_usermode
x86/nmi: Remove the 'b2b' parameter from nmi_handle()
x86/entry/syscalls: Wire up 32-bit direct socket calls
x86/kconfig/32: Rename CONFIG_VM86 and default it to 'n'
x86/selftests, x86/vm86: Improve entry_from_vm86 selftest
x86/build: Fix detection of GCC -mpreferred-stack-boundary support
selftests/x86, x86/ldt: Add a selftest for modify_ldt()
x86/ldt: Make modify_ldt() optional
selftests/x86/vm86: Fix entry_from_vm86 test on 64-bit kernels
x86/entry/32: Remove 32-bit syscall audit optimizations
x86/entry/32: Migrate to C exit path
x86/entry: Remove do_notify_resume(), syscall_trace_leave(), and their TIF masks x86/vdso: Emit a GNU hash
selftests/x86: Disable sigreturn_64
selftests/x86: Add syscall_nt selftest
x86/traps: Weaken context tracking entry assertions
x86/asm/msr: Make wrmsrl() a function

Brian Gerst (22):
x86/compat: Move copy_siginfo_*_user32() to signal_compat.c x86/compat: Make mmap_is_ia32() common compat
x86/compat: Move ucontext_x32 to sigframe.h
x86/compat: Rename 'start_thread_ia32' to 'compat_start_thread' x86/compat: Factor out ia32 compat code from compat_arch_ptrace() x86/compat: Don't build the 32-bit VDSO if not needed x86/compat: Check for both 32-bit compat and x32 in get_gate_vma() x86/compat, x86/perf: Don't build perf_callchain_user32() on x32 x86/compat: Remove unneeded #include
x86/compat: Define ARCH_WANT_OLD_COMPAT_IPC only for 32-bit compat x86/compat: Clean up HAVE_UID16 config
x86/compat: Separate ia32 and x32 compat ABIs x86/entry/vm86: Clean up saved_fs/gs
x86/entry/vm86: Preserve 'orig_ax'
x86/entry/vm86: Move userspace accesses to do_sys_vm86() x86/vm86: Move vm86 fields out of 'thread_struct'
x86/vm86: Move fields from 'struct kernel_vm86_struct' to 'struct vm86' x86/vm86: Eliminate 'struct kernel_vm86_struct'
x86/vm86: Use the normal pt_regs area for vm86
x86/vm86: Clean up vm86.h includes
x86/vm86: Rename vm86->vm86_info to user_vm86
x86/vm86: Rename vm86->v86flags and v86mask

Denys Vlasenko (2):
x86/asm/entry/32: Replace RESTORE_RSI_RDI with open-coded 32-bit reads locking/spinlocks: Force inlining of spinlock ops

George Spelvin (1):
x86/asm/tsc: Save an instruction in DECLARE_ARGS users

Huang Rui (3):
x86/asm: Add MONITORX/MWAITX instruction support x86/asm/delay: Introduce an MWAITX-based delay with a configurable timer x86/asm: Drop repeated macro of X86_EFLAGS_AC definition

Ingo Molnar (3):
um: Fix do_signal() prototype
x86/vm86: Move the vm86 IRQ definitions to vm86.h x86/asm/tsc: Add rdtscll() merge helper

 arch/um/include/shared/kern_util.h                 |   3 +-
 arch/um/kernel/process.c                           |   6 +-
 arch/um/kernel/signal.c                            |   8 +-
 arch/um/kernel/tlb.c                               |   2 +-
 arch/um/kernel/trap.c                              |   2 +-
 arch/x86/Kconfig                                   |  60 ++-
 arch/x86/Makefile                                  |  13 +-
 arch/x86/boot/compressed/aslr.c                    |   2 +-
 arch/x86/entry/Makefile                            |   1 +
 arch/x86/entry/calling.h                           |   9 -
 arch/x86/entry/common.c                            | 318 ++++++++++++
 arch/x86/entry/entry_32.S                          | 130 +----
 arch/x86/entry/entry_64.S                          | 197 ++-----
 arch/x86/entry/entry_64_compat.S                   |  61 ++-
 arch/x86/entry/syscalls/syscall_32.tbl             |  15 +
 arch/x86/entry/vdso/Makefile                       |   8 +-
 arch/x86/entry/vdso/vclock_gettime.c               |  16 +-
 arch/x86/entry/vdso/vma.c                          |   7 +-
 arch/x86/entry/vsyscall/vsyscall_64.c              |   2 +-
 arch/x86/ia32/ia32_signal.c                        |  93 ----
 arch/x86/include/asm/barrier.h                     |  11 -
 arch/x86/include/asm/context_tracking.h            |  10 -
 arch/x86/include/asm/cpufeature.h                  |   1 +
 arch/x86/include/asm/delay.h                       |   1 +
 arch/x86/include/asm/elf.h                         |  17 +-
 arch/x86/include/asm/ia32.h                        |   9 -
 arch/x86/include/asm/irq_vectors.h                 |  10 -
 arch/x86/include/asm/math_emu.h                    |   6 +-
 arch/x86/include/asm/mmu.h                         |   2 +
 arch/x86/include/asm/mmu_context.h                 |  28 +-
 arch/x86/include/asm/msr.h                         |  70 ++-
 arch/x86/include/asm/mwait.h                       |  45 ++
 arch/x86/include/asm/paravirt.h                    |  40 +-
 arch/x86/include/asm/paravirt_types.h              |   2 -
 arch/x86/include/asm/processor.h                   |  13 +-
 arch/x86/include/asm/ptrace.h                      |   1 -
 arch/x86/include/asm/pvclock.h                     |  10 +-
 arch/x86/include/asm/sigframe.h                    |  10 +
 arch/x86/include/asm/signal.h                      |   2 +-
 arch/x86/include/asm/stackprotector.h              |   2 +-
 arch/x86/include/asm/syscalls.h                    |   1 +
 arch/x86/include/asm/thread_info.h                 |  27 +-
 arch/x86/include/asm/traps.h                       |   4 +-
 arch/x86/include/asm/tsc.h                         |  18 +-
 arch/x86/include/asm/vm86.h                        |  57 +-
 arch/x86/include/uapi/asm/processor-flags.h        |   2 -
 arch/x86/kernel/Makefile                           |   4 +-
 arch/x86/kernel/apb_timer.c                        |   8 +-
 arch/x86/kernel/apic/apic.c                        |   8 +-
 arch/x86/kernel/cpu/amd.c                          |  10 +-
 arch/x86/kernel/cpu/common.c                       |   6 +-
 arch/x86/kernel/cpu/mcheck/mce.c                   |   9 +-
 arch/x86/kernel/cpu/mcheck/p5.c                    |   5 +-
 arch/x86/kernel/cpu/mcheck/winchip.c               |   4 +-
 arch/x86/kernel/cpu/perf_event.c                   |   6 +-
 arch/x86/kernel/espfix_64.c                        |   2 +-
 arch/x86/kernel/hpet.c                             |   4 +-
 arch/x86/kernel/irq.c                              |  15 +
 arch/x86/kernel/nmi.c                              |  10 +-
 arch/x86/kernel/paravirt.c                         |   2 -
 arch/x86/kernel/paravirt_patch_32.c                |   2 -
 arch/x86/kernel/process.c                          |   3 +
 arch/x86/kernel/process_32.c                       |   1 +
 arch/x86/kernel/process_64.c                       |   6 +-
 arch/x86/kernel/ptrace.c                           | 340 +++---------
 arch/x86/kernel/signal.c                           |  33 +-
 arch/x86/kernel/signal_compat.c                    |  95 ++++
 arch/x86/kernel/step.c                             |   2 +
 arch/x86/kernel/trace_clock.c                      |   7 +-
 arch/x86/kernel/traps.c                            |  88 ++--
 arch/x86/kernel/tsc.c                              |  12 +-
 arch/x86/kernel/tsc_sync.c                         |  14 +-
 arch/x86/kernel/vm86_32.c                          | 373 +++++++------
 arch/x86/kvm/lapic.c                               |   4 +-
 arch/x86/kvm/svm.c                                 |   4 +-
 arch/x86/kvm/vmx.c                                 |   4 +-
 arch/x86/kvm/x86.c                                 |  26 +-
 arch/x86/lib/delay.c                               |  60 ++-
 arch/x86/math-emu/get_address.c                    |   1 +
 arch/x86/mm/fault.c                                |   7 +-
 arch/x86/um/asm/barrier.h                          |  13 -
 arch/x86/xen/enlighten.c                           |   3 -
 drivers/cpufreq/intel_pstate.c                     |   2 +-
 drivers/input/gameport/gameport.c                  |   4 +-
 drivers/input/joystick/analog.c                    |   4 +-
 drivers/net/hamradio/baycom_epp.c                  |   2 +-
 drivers/scsi/dpt_i2o.c                             |   3 +
 drivers/staging/media/lirc/lirc_serial.c           |  63 +--
 drivers/thermal/intel_powerclamp.c                 |   4 +-
 include/linux/context_tracking.h                   |  15 +
 include/linux/context_tracking_state.h             |   1 +
 include/linux/spinlock.h                           |  30 +-
 kernel/notifier.c                                  |   2 +
 kernel/sys_ni.c                                    |   1 +
 .../power/cpupower/debug/kernel/cpufreq-test_tsc.c |   4 +-
 tools/testing/selftests/x86/Makefile               |   4 +-
 tools/testing/selftests/x86/entry_from_vm86.c      | 139 ++++-
 tools/testing/selftests/x86/ldt_gdt.c              | 576 +++++++++++++++++++++
 tools/testing/selftests/x86/syscall_arg_fault.c    | 130 +++++
 tools/testing/selftests/x86/syscall_nt.c           |  54 ++
 100 files changed, 2197 insertions(+), 1384 deletions(-)
 create mode 100644 arch/x86/entry/common.c
 delete mode 100644 arch/x86/include/asm/context_tracking.h
 create mode 100644 arch/x86/kernel/signal_compat.c
 create mode 100644 tools/testing/selftests/x86/ldt_gdt.c
 create mode 100644 tools/testing/selftests/x86/syscall_arg_fault.c
 create mode 100644 tools/testing/selftests/x86/syscall_nt.c
arch/um/include/shared/kern_util.h +2 -1
index 83a91f976330..35ab97e4bb9b 100644
@@ -22,7 +22,8 @@ extern int kmalloc_ok;
 extern unsigned long alloc_stack(int order, int atomic);
 extern void free_stack(unsigned long stack, int order);
 
-extern int do_signal(void);
+struct pt_regs;
+extern void do_signal(struct pt_regs *regs);
 extern void interrupt_end(void);
 extern void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs);
 
arch/um/kernel/process.c +4 -2
index 68b9119841cd..a6d922672b9f 100644
@@ -90,12 +90,14 @@ void *__switch_to(struct task_struct *from, struct task_struct *to)
 
 void interrupt_end(void)
 {
+	struct pt_regs *regs = &current->thread.regs;
+
 	if (need_resched())
 		schedule();
 	if (test_thread_flag(TIF_SIGPENDING))
-		do_signal();
+		do_signal(regs);
 	if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME))
-		tracehook_notify_resume(&current->thread.regs);
+		tracehook_notify_resume(regs);
 }
 
 void exit_thread(void)
arch/um/kernel/signal.c +1 -7
index 4f60e4aad790..57acbd67d85d 100644
@@ -64,7 +64,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
 	signal_setup_done(err, ksig, singlestep);
 }
 
-static int kern_do_signal(struct pt_regs *regs)
+void do_signal(struct pt_regs *regs)
 {
 	struct ksignal ksig;
 	int handled_sig = 0;
@@ -110,10 +110,4 @@ static int kern_do_signal(struct pt_regs *regs)
 	 */
 	if (!handled_sig)
 		restore_saved_sigmask();
-	return handled_sig;
-}
-
-int do_signal(void)
-{
-	return kern_do_signal(&current->thread.regs);
 }
arch/um/kernel/tlb.c +1 -1
index f1b3eb14b855..2077248e8a72 100644
@@ -291,7 +291,7 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
 		/* We are under mmap_sem, release it such that current can terminate */
 		up_write(&current->mm->mmap_sem);
 		force_sig(SIGKILL, current);
-		do_signal();
+		do_signal(&current->thread.regs);
 	}
 }
 
arch/um/kernel/trap.c +1 -1
index 557232f758b6..d8a9fce6ee2e 100644
@@ -173,7 +173,7 @@ static void bad_segv(struct faultinfo fi, unsigned long ip)
 void fatal_sigsegv(void)
 {
 	force_sigsegv(SIGSEGV, current);
-	do_signal();
+	do_signal(&current->thread.regs);
 	/*
 	 * This is to tell gcc that we're not returning - do_signal
 	 * can, in general, return, but in this case, it's not, since
arch/x86/Kconfig +49 -11

108 lines not on this page · raw message

arch/x86/Makefile +10 -3
index 118e6debc483..054ff969fcdb 100644
@@ -39,6 +39,16 @@ ifdef CONFIG_X86_NEED_RELOCS
         LDFLAGS_vmlinux := --emit-relocs
 endif
 
+#
+# Prevent GCC from generating any FP code by mistake.
+#
+# This must happen before we try the -mpreferred-stack-boundary, see:
+#
+#    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
+#
+KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
+KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
+
 ifeq ($(CONFIG_X86_32),y)
         BITS := 32
         UTS_MACHINE := i386
@@ -167,9 +177,6 @@ KBUILD_CFLAGS += -pipe
 KBUILD_CFLAGS += -Wno-sign-compare
 #
 KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
-# prevent gcc from generating any FP code by mistake
-KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
-KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
 
 KBUILD_CFLAGS += $(mflags-y)
 KBUILD_AFLAGS += $(mflags-y)
arch/x86/boot/compressed/aslr.c +1 -1
index d7b1f655b3ef..6a9b96b4624d 100644
@@ -82,7 +82,7 @@ static unsigned long get_random_long(void)
 
 	if (has_cpuflag(X86_FEATURE_TSC)) {
 		debug_putstr(" RDTSC");
-		rdtscll(raw);
+		raw = rdtsc();
 
 		random ^= raw;
 		use_i8254 = false;
arch/x86/entry/Makefile +1 -0
index 7a144971db79..bd55dedd7614 100644
@@ -2,6 +2,7 @@
 # Makefile for the x86 low level entry code
 #
 obj-y				:= entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
+obj-y				+= common.o
 
 obj-y				+= vdso/
 obj-y				+= vsyscall/
arch/x86/entry/calling.h +0 -9
index f4e6308c4200..3c71dd947c7b 100644
@@ -135,9 +135,6 @@ For 32-bit we have the following conventions - kernel is built with
 	movq %rbp, 4*8+\offset(%rsp)
 	movq %rbx, 5*8+\offset(%rsp)
 	.endm
-	.macro SAVE_EXTRA_REGS_RBP offset=0
-	movq %rbp, 4*8+\offset(%rsp)
-	.endm
 
 	.macro RESTORE_EXTRA_REGS offset=0
 	movq 0*8+\offset(%rsp), %r15
@@ -193,12 +190,6 @@ For 32-bit we have the following conventions - kernel is built with
 	.macro RESTORE_C_REGS_EXCEPT_RCX_R11
 	RESTORE_C_REGS_HELPER 1,0,0,1,1
 	.endm
-	.macro RESTORE_RSI_RDI
-	RESTORE_C_REGS_HELPER 0,0,0,0,0
-	.endm
-	.macro RESTORE_RSI_RDI_RDX
-	RESTORE_C_REGS_HELPER 0,0,0,0,1
-	.endm
 
 	.macro REMOVE_PT_GPREGS_FROM_STACK addskip=0
 	subq $-(15*8+\addskip), %rsp
arch/x86/entry/common.c new file +318 -0

318 lines not on this page · raw message

arch/x86/entry/entry_32.S +12 -118

181 lines not on this page · raw message

arch/x86/entry/entry_64.S +53 -144

306 lines not on this page · raw message

arch/x86/entry/entry_64_compat.S +52 -9

99 lines not on this page · raw message

arch/x86/entry/syscalls/syscall_32.tbl +15 -0
index ef8187f9d28d..25e3cf1cd8fd 100644
@@ -365,3 +365,18 @@
 356	i386	memfd_create		sys_memfd_create
 357	i386	bpf			sys_bpf
 358	i386	execveat		sys_execveat			stub32_execveat
+359	i386	socket			sys_socket
+360	i386	socketpair		sys_socketpair
+361	i386	bind			sys_bind
+362	i386	connect			sys_connect
+363	i386	listen			sys_listen
+364	i386	accept4			sys_accept4
+365	i386	getsockopt		sys_getsockopt			compat_sys_getsockopt
+366	i386	setsockopt		sys_setsockopt			compat_sys_setsockopt
+367	i386	getsockname		sys_getsockname
+368	i386	getpeername		sys_getpeername
+369	i386	sendto			sys_sendto
+370	i386	sendmsg			sys_sendmsg			compat_sys_sendmsg
+371	i386	recvfrom		sys_recvfrom			compat_sys_recvfrom
+372	i386	recvmsg			sys_recvmsg			compat_sys_recvmsg
+373	i386	shutdown		sys_shutdown
arch/x86/entry/vdso/Makefile +4 -4
index e97032069f88..a3d0767a6b29 100644
@@ -8,7 +8,7 @@ KASAN_SANITIZE := n
 VDSO64-$(CONFIG_X86_64)		:= y
 VDSOX32-$(CONFIG_X86_X32_ABI)	:= y
 VDSO32-$(CONFIG_X86_32)		:= y
-VDSO32-$(CONFIG_COMPAT)		:= y
+VDSO32-$(CONFIG_IA32_EMULATION)	:= y
 
 # files to link into the vdso
 vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o
@@ -20,7 +20,7 @@ obj-y				+= vma.o
 vdso_img-$(VDSO64-y)		+= 64
 vdso_img-$(VDSOX32-y)		+= x32
 vdso_img-$(VDSO32-y)		+= 32-int80
-vdso_img-$(CONFIG_COMPAT)	+= 32-syscall
+vdso_img-$(CONFIG_IA32_EMULATION)	+= 32-syscall
 vdso_img-$(VDSO32-y)		+= 32-sysenter
 
 obj-$(VDSO32-y)			+= vdso32-setup.o
@@ -126,7 +126,7 @@ $(obj)/vdsox32.so.dbg: $(src)/vdsox32.lds $(vobjx32s) FORCE
 # Build multiple 32-bit vDSO images to choose from at boot time.
 #
 vdso32.so-$(VDSO32-y)		+= int80
-vdso32.so-$(CONFIG_COMPAT)	+= syscall
+vdso32.so-$(CONFIG_IA32_EMULATION)	+= syscall
 vdso32.so-$(VDSO32-y)		+= sysenter
 
 vdso32-images			= $(vdso32.so-y:%=vdso32-%.so)
@@ -175,7 +175,7 @@ quiet_cmd_vdso = VDSO    $@
 		       -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
 		 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
 
-VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
+VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=both) \
 	$(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS)
 GCOV_PROFILE := n
 
arch/x86/entry/vdso/vclock_gettime.c +2 -14
index 9793322751e0..ca94fa649251 100644
@@ -175,20 +175,8 @@ static notrace cycle_t vread_pvclock(int *mode)
 
 notrace static cycle_t vread_tsc(void)
 {
-	cycle_t ret;
-	u64 last;
-
-	/*
-	 * Empirically, a fence (of type that depends on the CPU)
-	 * before rdtsc is enough to ensure that rdtsc is ordered
-	 * with respect to loads.  The various CPU manuals are unclear
-	 * as to whether rdtsc can be reordered with later loads,
-	 * but no one has ever seen it happen.
-	 */
-	rdtsc_barrier();
-	ret = (cycle_t)__native_read_tsc();
-
-	last = gtod->cycle_last;
+	cycle_t ret = (cycle_t)rdtsc_ordered();
+	u64 last = gtod->cycle_last;
 
 	if (likely(ret >= last))
 		return ret;
arch/x86/entry/vdso/vma.c +5 -2
index 1c9f750c3859..434543145d78 100644
@@ -177,7 +177,7 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
 	return ret;
 }
 
-#if defined(CONFIG_X86_32) || defined(CONFIG_COMPAT)
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
 static int load_vdso32(void)
 {
 	int ret;
@@ -219,8 +219,11 @@ int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
 		return map_vdso(&vdso_image_x32, true);
 	}
 #endif
-
+#ifdef CONFIG_IA32_EMULATION
 	return load_vdso32();
+#else
+	return 0;
+#endif
 }
 #endif
 #else
arch/x86/entry/vsyscall/vsyscall_64.c +1 -1
index 2dcc6ff6fdcc..26a46f44e298 100644
@@ -290,7 +290,7 @@ static struct vm_area_struct gate_vma = {
 
 struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
 {
-#ifdef CONFIG_IA32_EMULATION
+#ifdef CONFIG_COMPAT
 	if (!mm || mm->context.ia32_compat)
 		return NULL;
 #endif
arch/x86/ia32/ia32_signal.c +0 -93

99 lines not on this page · raw message

arch/x86/include/asm/barrier.h +0 -11
index e51a8f803f55..818cb8788225 100644
@@ -91,15 +91,4 @@ do {									\
 #define smp_mb__before_atomic()	barrier()
 #define smp_mb__after_atomic()	barrier()
 
-/*
- * Stop RDTSC speculation. This is needed when you need to use RDTSC
- * (or get_cycles or vread that possibly accesses the TSC) in a defined
- * code region.
- */
-static __always_inline void rdtsc_barrier(void)
-{
-	alternative_2("", "mfence", X86_FEATURE_MFENCE_RDTSC,
-			  "lfence", X86_FEATURE_LFENCE_RDTSC);
-}
-
 #endif /* _ASM_X86_BARRIER_H */
arch/x86/include/asm/context_tracking.h deleted +0 -10
deleted file mode 100644
index 1fe49704b146..000000000000
@@ -1,10 +0,0 @@
-#ifndef _ASM_X86_CONTEXT_TRACKING_H
-#define _ASM_X86_CONTEXT_TRACKING_H
-
-#ifdef CONFIG_CONTEXT_TRACKING
-# define SCHEDULE_USER call schedule_user
-#else
-# define SCHEDULE_USER call schedule
-#endif
-
-#endif
arch/x86/include/asm/cpufeature.h +1 -0
index 3d6606fb97d0..a39e5708209b 100644
@@ -176,6 +176,7 @@
 #define X86_FEATURE_PERFCTR_NB  ( 6*32+24) /* NB performance counter extensions */
 #define X86_FEATURE_BPEXT	(6*32+26) /* data breakpoint extension */
 #define X86_FEATURE_PERFCTR_L2	( 6*32+28) /* L2 performance counter extensions */
+#define X86_FEATURE_MWAITX	( 6*32+29) /* MWAIT extension (MONITORX/MWAITX) */
 
 /*
  * Auxiliary flags: Linux defined - For features scattered in various
arch/x86/include/asm/delay.h +1 -0
index 9b3b4f2754c7..36a760bda462 100644
@@ -4,5 +4,6 @@
 #include <asm-generic/delay.h>
 
 void use_tsc_delay(void);
+void use_mwaitx_delay(void);
 
 #endif /* _ASM_X86_DELAY_H */
arch/x86/include/asm/elf.h +6 -11
index f161c189c27b..141c561f4664 100644
@@ -78,7 +78,7 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
 #ifdef CONFIG_X86_64
 extern unsigned int vdso64_enabled;
 #endif
-#if defined(CONFIG_X86_32) || defined(CONFIG_COMPAT)
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
 extern unsigned int vdso32_enabled;
 #endif
 
@@ -187,8 +187,8 @@ static inline void elf_common_init(struct thread_struct *t,
 #define	COMPAT_ELF_PLAT_INIT(regs, load_addr)		\
 	elf_common_init(&current->thread, regs, __USER_DS)
 
-void start_thread_ia32(struct pt_regs *regs, u32 new_ip, u32 new_sp);
-#define compat_start_thread start_thread_ia32
+void compat_start_thread(struct pt_regs *regs, u32 new_ip, u32 new_sp);
+#define compat_start_thread compat_start_thread
 
 void set_personality_ia32(bool);
 #define COMPAT_SET_PERSONALITY(ex)			\
@@ -344,14 +344,9 @@ extern int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
  */
 static inline int mmap_is_ia32(void)
 {
-#ifdef CONFIG_X86_32
-	return 1;
-#endif
-#ifdef CONFIG_IA32_EMULATION
-	if (test_thread_flag(TIF_ADDR32))
-		return 1;
-#endif
-	return 0;
+	return config_enabled(CONFIG_X86_32) ||
+	       (config_enabled(CONFIG_COMPAT) &&
+		test_thread_flag(TIF_ADDR32));
 }
 
 /* Do not change the values. See get_align_mask() */
arch/x86/include/asm/ia32.h +0 -9
index d0e8e0141041..28019765442e 100644
@@ -22,15 +22,6 @@ struct ucontext_ia32 {
 	compat_sigset_t	  uc_sigmask;	/* mask last for extensibility */
 };
 
-struct ucontext_x32 {
-	unsigned int	  uc_flags;
-	unsigned int 	  uc_link;
-	compat_stack_t	  uc_stack;
-	unsigned int	  uc__pad0;     /* needed for alignment */
-	struct sigcontext uc_mcontext;  /* the 64-bit sigcontext type */
-	compat_sigset_t	  uc_sigmask;	/* mask last for extensibility */
-};
-
 /* This matches struct stat64 in glibc2.2, hence the absolutely
  * insane amounts of padding around dev_t's.
  */
arch/x86/include/asm/irq_vectors.h +0 -10
index 4c2d2eb2060a..6ca9fd6234e1 100644
@@ -117,16 +117,6 @@
 
 #define FPU_IRQ				  13
 
-#define	FIRST_VM86_IRQ			   3
-#define LAST_VM86_IRQ			  15
-
-#ifndef __ASSEMBLY__
-static inline int invalid_vm86_irq(int irq)
-{
-	return irq < FIRST_VM86_IRQ || irq > LAST_VM86_IRQ;
-}
-#endif
-
 /*
  * Size the maximum number of interrupts.
  *
arch/x86/include/asm/math_emu.h +1 -5
index 031f6266f425..0d9b14f60d2c 100644
@@ -2,7 +2,6 @@
 #define _ASM_X86_MATH_EMU_H
 
 #include <asm/ptrace.h>
-#include <asm/vm86.h>
 
 /* This structure matches the layout of the data saved to the stack
    following a device-not-present interrupt, part of it saved
@@ -10,9 +9,6 @@
    */
 struct math_emu_info {
 	long ___orig_eip;
-	union {
-		struct pt_regs *regs;
-		struct kernel_vm86_regs *vm86;
-	};
+	struct pt_regs *regs;
 };
 #endif /* _ASM_X86_MATH_EMU_H */
arch/x86/include/asm/mmu.h +2 -0
index 364d27481a52..55234d5e7160 100644
@@ -9,7 +9,9 @@
  * we put the segment information here.
  */
 typedef struct {
+#ifdef CONFIG_MODIFY_LDT_SYSCALL
 	struct ldt_struct *ldt;
+#endif
 
 #ifdef CONFIG_X86_64
 	/* True if mm supports a task running in 32 bit compatibility mode. */
arch/x86/include/asm/mmu_context.h +21 -7
index 984abfe47edc..379cd3658799 100644
@@ -33,6 +33,7 @@ static inline void load_mm_cr4(struct mm_struct *mm)
 static inline void load_mm_cr4(struct mm_struct *mm) {}
 #endif
 
+#ifdef CONFIG_MODIFY_LDT_SYSCALL
 /*
  * ldt_structs can be allocated, used, and freed, but they are never
  * modified while live.
@@ -48,8 +49,23 @@ struct ldt_struct {
 	int size;
 };
 
+/*
+ * Used for LDT copy/destruction.
+ */
+int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
+void destroy_context(struct mm_struct *mm);
+#else	/* CONFIG_MODIFY_LDT_SYSCALL */
+static inline int init_new_context(struct task_struct *tsk,
+				   struct mm_struct *mm)
+{
+	return 0;
+}
+static inline void destroy_context(struct mm_struct *mm) {}
+#endif
+
 static inline void load_mm_ldt(struct mm_struct *mm)
 {
+#ifdef CONFIG_MODIFY_LDT_SYSCALL
 	struct ldt_struct *ldt;
 
 	/* lockless_dereference synchronizes with smp_store_release */
@@ -73,17 +89,13 @@ static inline void load_mm_ldt(struct mm_struct *mm)
 		set_ldt(ldt->entries, ldt->size);
 	else
 		clear_LDT();
+#else
+	clear_LDT();
+#endif
 
 	DEBUG_LOCKS_WARN_ON(preemptible());
 }
 
-/*
- * Used for LDT copy/destruction.
- */
-int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
-void destroy_context(struct mm_struct *mm);
-
-
 static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
 {
 #ifdef CONFIG_SMP
@@ -114,6 +126,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 		/* Load per-mm CR4 state */
 		load_mm_cr4(next);
 
+#ifdef CONFIG_MODIFY_LDT_SYSCALL
 		/*
 		 * Load the LDT, if the LDT is different.
 		 *
@@ -128,6 +141,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 		 */
 		if (unlikely(prev->context.ldt != next->context.ldt))
 			load_mm_ldt(next);
+#endif
 	}
 #ifdef CONFIG_SMP
 	  else {
arch/x86/include/asm/msr.h +46 -24

113 lines not on this page · raw message

arch/x86/include/asm/mwait.h +45 -0

63 lines not on this page · raw message

arch/x86/include/asm/paravirt.h +5 -35
index d143bfad45d7..10d0596433f8 100644
@@ -153,7 +153,11 @@ do {						\
 	val = paravirt_read_msr(msr, &_err);	\
 } while (0)
 
-#define wrmsrl(msr, val)	wrmsr(msr, (u32)((u64)(val)), ((u64)(val))>>32)
+static inline void wrmsrl(unsigned msr, u64 val)
+{
+	wrmsr(msr, (u32)val, (u32)(val>>32));
+}
+
 #define wrmsr_safe(msr, a, b)	paravirt_write_msr(msr, a, b)
 
 /* rdmsr with exception handling */
@@ -174,19 +178,6 @@ static inline int rdmsrl_safe(unsigned msr, unsigned long long *p)
 	return err;
 }
 
-static inline u64 paravirt_read_tsc(void)
-{
-	return PVOP_CALL0(u64, pv_cpu_ops.read_tsc);
-}
-
-#define rdtscl(low)				\
-do {						\
-	u64 _l = paravirt_read_tsc();		\
-	low = (int)_l;				\
-} while (0)
-
-#define rdtscll(val) (val = paravirt_read_tsc())
-
 static inline unsigned long long paravirt_sched_clock(void)
 {
 	return PVOP_CALL0(unsigned long long, pv_time_ops.sched_clock);
@@ -215,27 +206,6 @@ do {						\
 
 #define rdpmcl(counter, val) ((val) = paravirt_read_pmc(counter))
 
-static inline unsigned long long paravirt_rdtscp(unsigned int *aux)
-{
-	return PVOP_CALL1(u64, pv_cpu_ops.read_tscp, aux);
-}
-
-#define rdtscp(low, high, aux)				\
-do {							\
-	int __aux;					\
-	unsigned long __val = paravirt_rdtscp(&__aux);	\
-	(low) = (u32)__val;				\
-	(high) = (u32)(__val >> 32);			\
-	(aux) = __aux;					\
-} while (0)
-
-#define rdtscpll(val, aux)				\
-do {							\
-	unsigned long __aux; 				\
-	val = paravirt_rdtscp(&__aux);			\
-	(aux) = __aux;					\
-} while (0)
-
 static inline void paravirt_alloc_ldt(struct desc_struct *ldt, unsigned entries)
 {
 	PVOP_VCALL2(pv_cpu_ops.alloc_ldt, ldt, entries);
arch/x86/include/asm/paravirt_types.h +0 -2
index a6b8f9fadb06..ce029e4fa7c6 100644
@@ -156,9 +156,7 @@ struct pv_cpu_ops {
 	u64 (*read_msr)(unsigned int msr, int *err);
 	int (*write_msr)(unsigned int msr, unsigned low, unsigned high);
 
-	u64 (*read_tsc)(void);
 	u64 (*read_pmc)(int counter);
-	unsigned long long (*read_tscp)(unsigned int *aux);
 
 #ifdef CONFIG_X86_32
 	/*
arch/x86/include/asm/processor.h +3 -10
index 944f1785ed0d..9615a4e2645e 100644
@@ -6,8 +6,8 @@
 /* Forward declaration, a strange C thing */
 struct task_struct;
 struct mm_struct;
+struct vm86;
 
-#include <asm/vm86.h>
 #include <asm/math_emu.h>
 #include <asm/segment.h>
 #include <asm/types.h>
@@ -400,15 +400,9 @@ struct thread_struct {
 	unsigned long		cr2;
 	unsigned long		trap_nr;
 	unsigned long		error_code;
-#ifdef CONFIG_X86_32
+#ifdef CONFIG_VM86
 	/* Virtual 86 mode info */
-	struct vm86_struct __user *vm86_info;
-	unsigned long		screen_bitmap;
-	unsigned long		v86flags;
-	unsigned long		v86mask;
-	unsigned long		saved_sp0;
-	unsigned int		saved_fs;
-	unsigned int		saved_gs;
+	struct vm86		*vm86;
 #endif
 	/* IO permissions: */
 	unsigned long		*io_bitmap_ptr;
@@ -720,7 +714,6 @@ static inline void spin_lock_prefetch(const void *x)
 
 #define INIT_THREAD  {							  \
 	.sp0			= TOP_OF_INIT_STACK,			  \
-	.vm86_info		= NULL,					  \
 	.sysenter_cs		= __KERNEL_CS,				  \
 	.io_bitmap_ptr		= NULL,					  \
 }
arch/x86/include/asm/ptrace.h +0 -1
index 5fabf1362942..6271281f947d 100644
@@ -88,7 +88,6 @@ extern long syscall_trace_enter_phase2(struct pt_regs *, u32 arch,
 				       unsigned long phase1_result);
 
 extern long syscall_trace_enter(struct pt_regs *);
-extern void syscall_trace_leave(struct pt_regs *);
 
 static inline unsigned long regs_return_value(struct pt_regs *regs)
 {
arch/x86/include/asm/pvclock.h +2 -8
index 628954ceede1..7a6bed5c08bc 100644
@@ -62,7 +62,7 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
 static __always_inline
 u64 pvclock_get_nsec_offset(const struct pvclock_vcpu_time_info *src)
 {
-	u64 delta = __native_read_tsc() - src->tsc_timestamp;
+	u64 delta = rdtsc_ordered() - src->tsc_timestamp;
 	return pvclock_scale_delta(delta, src->tsc_to_system_mul,
 				   src->tsc_shift);
 }
@@ -76,13 +76,7 @@ unsigned __pvclock_read_cycles(const struct pvclock_vcpu_time_info *src,
 	u8 ret_flags;
 
 	version = src->version;
-	/* Note: emulated platforms which do not advertise SSE2 support
-	 * result in kvmclock not using the necessary RDTSC barriers.
-	 * Without barriers, it is possible that RDTSC instruction reads from
-	 * the time stamp counter outside rdtsc_barrier protected section
-	 * below, resulting in violation of monotonicity.
-	 */
-	rdtsc_barrier();
+
 	offset = pvclock_get_nsec_offset(src);
 	ret = src->system_time + offset;
 	ret_flags = src->flags;
arch/x86/include/asm/sigframe.h +10 -0
index 7c7c27c97daa..1f3175bb994e 100644
@@ -4,6 +4,7 @@
 #include <asm/sigcontext.h>
 #include <asm/siginfo.h>
 #include <asm/ucontext.h>
+#include <linux/compat.h>
 
 #ifdef CONFIG_X86_32
 #define sigframe_ia32		sigframe
@@ -69,6 +70,15 @@ struct rt_sigframe {
 
 #ifdef CONFIG_X86_X32_ABI
 
+struct ucontext_x32 {
+	unsigned int	  uc_flags;
+	unsigned int 	  uc_link;
+	compat_stack_t	  uc_stack;
+	unsigned int	  uc__pad0;     /* needed for alignment */
+	struct sigcontext uc_mcontext;  /* the 64-bit sigcontext type */
+	compat_sigset_t	  uc_sigmask;	/* mask last for extensibility */
+};
+
 struct rt_sigframe_x32 {
 	u64 pretcode;
 	struct ucontext_x32 uc;
arch/x86/include/asm/signal.h +1 -1
index 31eab867e6d3..c481be78fcf1 100644
@@ -30,7 +30,7 @@ typedef sigset_t compat_sigset_t;
 #endif /* __ASSEMBLY__ */
 #include <uapi/asm/signal.h>
 #ifndef __ASSEMBLY__
-extern void do_notify_resume(struct pt_regs *, void *, __u32);
+extern void do_signal(struct pt_regs *regs);
 
 #define __ARCH_HAS_SA_RESTORER
 
arch/x86/include/asm/stackprotector.h +1 -1
index c2e00bb2a136..58505f01962f 100644
@@ -72,7 +72,7 @@ static __always_inline void boot_init_stack_canary(void)
 	 * on during the bootup the random pool has true entropy too.
 	 */
 	get_random_bytes(&canary, sizeof(canary));
-	tsc = __native_read_tsc();
+	tsc = rdtsc();
 	canary += tsc + (tsc << 32UL);
 
 	current->stack_canary = canary;
arch/x86/include/asm/syscalls.h +1 -0
index 592a6a672e07..91dfcafe27a6 100644
@@ -37,6 +37,7 @@ asmlinkage long sys_get_thread_area(struct user_desc __user *);
 asmlinkage unsigned long sys_sigreturn(void);
 
 /* kernel/vm86_32.c */
+struct vm86_struct;
 asmlinkage long sys_vm86old(struct vm86_struct __user *);
 asmlinkage long sys_vm86(unsigned long, unsigned long);
 
arch/x86/include/asm/thread_info.h +7 -20
index 225ee545e1a0..8afdc3e44247 100644
@@ -27,14 +27,17 @@
  * Without this offset, that can result in a page fault.  (We are
  * careful that, in this case, the value we read doesn't matter.)
  *
- * In vm86 mode, the hardware frame is much longer still, but we neither
- * access the extra members from NMI context, nor do we write such a
- * frame at sp0 at all.
+ * In vm86 mode, the hardware frame is much longer still, so add 16
+ * bytes to make room for the real-mode segments.
  *
  * x86_64 has a fixed-length stack frame.
  */
 #ifdef CONFIG_X86_32
-# define TOP_OF_KERNEL_STACK_PADDING 8
+# ifdef CONFIG_VM86
+#  define TOP_OF_KERNEL_STACK_PADDING 16
+# else
+#  define TOP_OF_KERNEL_STACK_PADDING 8
+# endif
 #else
 # define TOP_OF_KERNEL_STACK_PADDING 0
 #endif
@@ -140,27 +143,11 @@ struct thread_info {
 	 _TIF_SECCOMP | _TIF_SINGLESTEP | _TIF_SYSCALL_TRACEPOINT |	\
 	 _TIF_NOHZ)
 
-/* work to do in syscall_trace_leave() */
-#define _TIF_WORK_SYSCALL_EXIT	\
-	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP |	\
-	 _TIF_SYSCALL_TRACEPOINT | _TIF_NOHZ)
-
-/* work to do on interrupt/exception return */
-#define _TIF_WORK_MASK							\
-	(0x0000FFFF &							\
-	 ~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|			\
-	   _TIF_SINGLESTEP|_TIF_SECCOMP|_TIF_SYSCALL_EMU))
-
 /* work to do on any return to user space */
 #define _TIF_ALLWORK_MASK						\
 	((0x0000FFFF & ~_TIF_SECCOMP) | _TIF_SYSCALL_TRACEPOINT |	\
 	_TIF_NOHZ)
 
-/* Only used for 64 bit */
-#define _TIF_DO_NOTIFY_MASK						\
-	(_TIF_SIGPENDING | _TIF_NOTIFY_RESUME |				\
-	 _TIF_USER_RETURN_NOTIFY | _TIF_UPROBE)
-
 /* flags to check in __switch_to() */
 #define _TIF_WORK_CTXSW							\
 	(_TIF_IO_BITMAP|_TIF_NOTSC|_TIF_BLOCKSTEP)
arch/x86/include/asm/traps.h +2 -2
index c5380bea2a36..c3496619740a 100644
@@ -112,8 +112,8 @@ asmlinkage void smp_threshold_interrupt(void);
 asmlinkage void smp_deferred_error_interrupt(void);
 #endif
 
-extern enum ctx_state ist_enter(struct pt_regs *regs);
-extern void ist_exit(struct pt_regs *regs, enum ctx_state prev_state);
+extern void ist_enter(struct pt_regs *regs);
+extern void ist_exit(struct pt_regs *regs);
 extern void ist_begin_non_atomic(struct pt_regs *regs);
 extern void ist_end_non_atomic(void);
 
arch/x86/include/asm/tsc.h +1 -17
index 94605c0e9cee..3df7675debcf 100644
@@ -21,28 +21,12 @@ extern void disable_TSC(void);
 
 static inline cycles_t get_cycles(void)
 {
-	unsigned long long ret = 0;
-
 #ifndef CONFIG_X86_TSC
 	if (!cpu_has_tsc)
 		return 0;
 #endif
-	rdtscll(ret);
-
-	return ret;
-}
 
-static __always_inline cycles_t vget_cycles(void)
-{
-	/*
-	 * We only do VDSOs on TSC capable CPUs, so this shouldn't
-	 * access boot_cpu_data (which is not VDSO-safe):
-	 */
-#ifndef CONFIG_X86_TSC
-	if (!cpu_has_tsc)
-		return 0;
-#endif
-	return (cycles_t)__native_read_tsc();
+	return rdtsc();
 }
 
 extern void tsc_init(void);
arch/x86/include/asm/vm86.h +33 -24

89 lines not on this page · raw message

arch/x86/include/uapi/asm/processor-flags.h +0 -2
index 180a0c3c224d..79887abcb5e1 100644
@@ -37,8 +37,6 @@
 #define X86_EFLAGS_VM		_BITUL(X86_EFLAGS_VM_BIT)
 #define X86_EFLAGS_AC_BIT	18 /* Alignment Check/Access Control */
 #define X86_EFLAGS_AC		_BITUL(X86_EFLAGS_AC_BIT)
-#define X86_EFLAGS_AC_BIT	18 /* Alignment Check/Access Control */
-#define X86_EFLAGS_AC		_BITUL(X86_EFLAGS_AC_BIT)
 #define X86_EFLAGS_VIF_BIT	19 /* Virtual Interrupt Flag */
 #define X86_EFLAGS_VIF		_BITUL(X86_EFLAGS_VIF_BIT)
 #define X86_EFLAGS_VIP_BIT	20 /* Virtual Interrupt Pending */
arch/x86/kernel/Makefile +3 -1
index 0f15af41bd80..514064897d55 100644
@@ -23,8 +23,10 @@ KASAN_SANITIZE_dumpstack_$(BITS).o := n
 CFLAGS_irq.o := -I$(src)/../include/asm/trace
 
 obj-y			:= process_$(BITS).o signal.o
+obj-$(CONFIG_COMPAT)	+= signal_compat.o
 obj-y			+= traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
-obj-y			+= time.o ioport.o ldt.o dumpstack.o nmi.o
+obj-y			+= time.o ioport.o dumpstack.o nmi.o
+obj-$(CONFIG_MODIFY_LDT_SYSCALL)	+= ldt.o
 obj-y			+= setup.o x86_init.o i8259.o irqinit.o jump_label.o
 obj-$(CONFIG_IRQ_WORK)  += irq_work.o
 obj-y			+= probe_roms.o
arch/x86/kernel/apb_timer.c +4 -4
index ede92c3364d3..222a57076039 100644
@@ -263,7 +263,7 @@ static int apbt_clocksource_register(void)
 
 	/* Verify whether apbt counter works */
 	t1 = dw_apb_clocksource_read(clocksource_apbt);
-	rdtscll(start);
+	start = rdtsc();
 
 	/*
 	 * We don't know the TSC frequency yet, but waiting for
@@ -273,7 +273,7 @@ static int apbt_clocksource_register(void)
 	 */
 	do {
 		rep_nop();
-		rdtscll(now);
+		now = rdtsc();
 	} while ((now - start) < 200000UL);
 
 	/* APBT is the only always on clocksource, it has to work! */
@@ -390,13 +390,13 @@ unsigned long apbt_quick_calibrate(void)
 	old = dw_apb_clocksource_read(clocksource_apbt);
 	old += loop;
 
-	t1 = __native_read_tsc();
+	t1 = rdtsc();
 
 	do {
 		new = dw_apb_clocksource_read(clocksource_apbt);
 	} while (new < old);
 
-	t2 = __native_read_tsc();
+	t2 = rdtsc();
 
 	shift = 5;
 	if (unlikely(loop >> shift == 0)) {
arch/x86/kernel/apic/apic.c +4 -4
index dcb52850a28f..0d71cd9b4a50 100644
@@ -457,7 +457,7 @@ static int lapic_next_deadline(unsigned long delta,
 {
 	u64 tsc;
 
-	rdtscll(tsc);
+	tsc = rdtsc();
 	wrmsrl(MSR_IA32_TSC_DEADLINE, tsc + (((u64) delta) * TSC_DIVISOR));
 	return 0;
 }
@@ -592,7 +592,7 @@ static void __init lapic_cal_handler(struct clock_event_device *dev)
 	unsigned long pm = acpi_pm_read_early();
 
 	if (cpu_has_tsc)
-		rdtscll(tsc);
+		tsc = rdtsc();
 
 	switch (lapic_cal_loops++) {
 	case 0:
@@ -1209,7 +1209,7 @@ void setup_local_APIC(void)
 	long long max_loops = cpu_khz ? cpu_khz : 1000000;
 
 	if (cpu_has_tsc)
-		rdtscll(tsc);
+		tsc = rdtsc();
 
 	if (disable_apic) {
 		disable_ioapic_support();
@@ -1293,7 +1293,7 @@ void setup_local_APIC(void)
 		}
 		if (queued) {
 			if (cpu_has_tsc && cpu_khz) {
-				rdtscll(ntsc);
+				ntsc = rdtsc();
 				max_loops = (cpu_khz << 10) - (ntsc - tsc);
 			} else
 				max_loops--;
arch/x86/kernel/cpu/amd.c +7 -3
index dd3a4baffe50..4a70fc6d400a 100644
@@ -11,6 +11,7 @@
 #include <asm/cpu.h>
 #include <asm/smp.h>
 #include <asm/pci-direct.h>
+#include <asm/delay.h>
 
 #ifdef CONFIG_X86_64
 # include <asm/mmconfig.h>
@@ -114,7 +115,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
 		const int K6_BUG_LOOP = 1000000;
 		int n;
 		void (*f_vide)(void);
-		unsigned long d, d2;
+		u64 d, d2;
 
 		printk(KERN_INFO "AMD K6 stepping B detected - ");
 
@@ -125,10 +126,10 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
 
 		n = K6_BUG_LOOP;
 		f_vide = vide;
-		rdtscl(d);
+		d = rdtsc();
 		while (n--)
 			f_vide();
-		rdtscl(d2);
+		d2 = rdtsc();
 		d = d2-d;
 
 		if (d > 20*K6_BUG_LOOP)
@@ -506,6 +507,9 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)
 		/* A random value per boot for bit slice [12:upper_bit) */
 		va_align.bits = get_random_int() & va_align.mask;
 	}
+
+	if (cpu_has(c, X86_FEATURE_MWAITX))
+		use_mwaitx_delay();
 }
 
 static void early_init_amd(struct cpuinfo_x86 *c)
arch/x86/kernel/cpu/common.c +3 -3
index cb9e5df42dd2..b128808853a2 100644
@@ -1185,10 +1185,10 @@ void syscall_init(void)
 	 * set CS/DS but only a 32bit target. LSTAR sets the 64bit rip.
 	 */
 	wrmsrl(MSR_STAR,  ((u64)__USER32_CS)<<48  | ((u64)__KERNEL_CS)<<32);
-	wrmsrl(MSR_LSTAR, entry_SYSCALL_64);
+	wrmsrl(MSR_LSTAR, (unsigned long)entry_SYSCALL_64);
 
 #ifdef CONFIG_IA32_EMULATION
-	wrmsrl(MSR_CSTAR, entry_SYSCALL_compat);
+	wrmsrl(MSR_CSTAR, (unsigned long)entry_SYSCALL_compat);
 	/*
 	 * This only works on Intel CPUs.
 	 * On AMD CPUs these MSRs are 32-bit, CPU truncates MSR_IA32_SYSENTER_EIP.
@@ -1199,7 +1199,7 @@ void syscall_init(void)
 	wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL);
 	wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (u64)entry_SYSENTER_compat);
 #else
-	wrmsrl(MSR_CSTAR, ignore_sysret);
+	wrmsrl(MSR_CSTAR, (unsigned long)ignore_sysret);
 	wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)GDT_ENTRY_INVALID_SEG);
 	wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL);
 	wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL);
arch/x86/kernel/cpu/mcheck/mce.c +4 -5
index df919ff103c3..99940d151e7d 100644
@@ -125,7 +125,7 @@ void mce_setup(struct mce *m)
 {
 	memset(m, 0, sizeof(struct mce));
 	m->cpu = m->extcpu = smp_processor_id();
-	rdtscll(m->tsc);
+	m->tsc = rdtsc();
 	/* We hope get_seconds stays lockless */
 	m->time = get_seconds();
 	m->cpuvendor = boot_cpu_data.x86_vendor;
@@ -1029,7 +1029,6 @@ void do_machine_check(struct pt_regs *regs, long error_code)
 {
 	struct mca_config *cfg = &mca_cfg;
 	struct mce m, *final;
-	enum ctx_state prev_state;
 	int i;
 	int worst = 0;
 	int severity;
@@ -1055,7 +1054,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
 	int flags = MF_ACTION_REQUIRED;
 	int lmce = 0;
 
-	prev_state = ist_enter(regs);
+	ist_enter(regs);
 
 	this_cpu_inc(mce_exception_count);
 
@@ -1227,7 +1226,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
 	local_irq_disable();
 	ist_end_non_atomic();
 done:
-	ist_exit(regs, prev_state);
+	ist_exit(regs);
 }
 EXPORT_SYMBOL_GPL(do_machine_check);
 
@@ -1784,7 +1783,7 @@ static void collect_tscs(void *data)
 {
 	unsigned long *cpu_tsc = (unsigned long *)data;
 
-	rdtscll(cpu_tsc[smp_processor_id()]);
+	cpu_tsc[smp_processor_id()] = rdtsc();
 }
 
 static int mce_apei_read_done;
arch/x86/kernel/cpu/mcheck/p5.c +2 -3
index 737b0ad4e61a..12402e10aeff 100644
@@ -19,10 +19,9 @@ int mce_p5_enabled __read_mostly;
 /* Machine check handler for Pentium class Intel CPUs: */
 static void pentium_machine_check(struct pt_regs *regs, long error_code)
 {
-	enum ctx_state prev_state;
 	u32 loaddr, hi, lotype;
 
-	prev_state = ist_enter(regs);
+	ist_enter(regs);
 
 	rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi);
 	rdmsr(MSR_IA32_P5_MC_TYPE, lotype, hi);
@@ -39,7 +38,7 @@ static void pentium_machine_check(struct pt_regs *regs, long error_code)
 
 	add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
 
-	ist_exit(regs, prev_state);
+	ist_exit(regs);
 }
 
 /* Set up machine check reporting for processors with Intel style MCE: */
arch/x86/kernel/cpu/mcheck/winchip.c +2 -2
index 44f138296fbe..01dd8702880b 100644
@@ -15,12 +15,12 @@
 /* Machine check handler for WinChip C6: */
 static void winchip_machine_check(struct pt_regs *regs, long error_code)
 {
-	enum ctx_state prev_state = ist_enter(regs);
+	ist_enter(regs);
 
 	printk(KERN_EMERG "CPU0: Machine Check Exception.\n");
 	add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
 
-	ist_exit(regs, prev_state);
+	ist_exit(regs);
 }
 
 /* Set up machine check reporting on the Winchip C6 series */
arch/x86/kernel/cpu/perf_event.c +5 -1
index 9469dfa55607..cc25c8f3512d 100644
@@ -2179,6 +2179,7 @@ static unsigned long get_segment_base(unsigned int segment)
 	int idx = segment >> 3;
 
 	if ((segment & SEGMENT_TI_MASK) == SEGMENT_LDT) {
+#ifdef CONFIG_MODIFY_LDT_SYSCALL
 		struct ldt_struct *ldt;
 
 		if (idx > LDT_ENTRIES)
@@ -2190,6 +2191,9 @@ static unsigned long get_segment_base(unsigned int segment)
 			return 0;
 
 		desc = &ldt->entries[idx];
+#else
+		return 0;
+#endif
 	} else {
 		if (idx > GDT_ENTRIES)
 			return 0;
@@ -2200,7 +2204,7 @@ static unsigned long get_segment_base(unsigned int segment)
 	return get_desc_base(desc);
 }
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_IA32_EMULATION
 
 #include <asm/compat.h>
 
arch/x86/kernel/espfix_64.c +1 -1
index ce95676abd60..4d38416e2a7f 100644
@@ -110,7 +110,7 @@ static void init_espfix_random(void)
 	 */
 	if (!arch_get_random_long(&rand)) {
 		/* The constant is an arbitrary large prime */
-		rdtscll(rand);
+		rand = rdtsc();
 		rand *= 0xc345c6b72fd16123UL;
 	}
 
arch/x86/kernel/hpet.c +2 -2
index 10757d0a3fcf..f75c5908c7a6 100644
@@ -735,7 +735,7 @@ static int hpet_clocksource_register(void)
 
 	/* Verify whether hpet counter works */
 	t1 = hpet_readl(HPET_COUNTER);
-	rdtscll(start);
+	start = rdtsc();
 
 	/*
 	 * We don't know the TSC frequency yet, but waiting for
@@ -745,7 +745,7 @@ static int hpet_clocksource_register(void)
 	 */
 	do {
 		rep_nop();
-		rdtscll(now);
+		now = rdtsc();
 	} while ((now - start) < 200000UL);
 
 	if (t1 == hpet_readl(HPET_COUNTER)) {
arch/x86/kernel/irq.c +15 -0
index c7dfe1be784e..d596eba9586e 100644
@@ -216,8 +216,23 @@ __visible unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
 	unsigned vector = ~regs->orig_ax;
 	unsigned irq;
 
+	/*
+	 * NB: Unlike exception entries, IRQ entries do not reliably
+	 * handle context tracking in the low-level entry code.  This is
+	 * because syscall entries execute briefly with IRQs on before
+	 * updating context tracking state, so we can take an IRQ from
+	 * kernel mode with CONTEXT_USER.  The low-level entry code only
+	 * updates the context if we came from user mode, so we won't
+	 * switch to CONTEXT_KERNEL.  We'll fix that once the syscall
+	 * code is cleaned up enough that we can cleanly defer enabling
+	 * IRQs.
+	 */
+
 	entering_irq();
 
+	/* entering_irq() tells RCU that we're not quiescent.  Check it. */
+	rcu_lockdep_assert(rcu_is_watching(), "IRQ failed to wake up RCU");
+
 	irq = __this_cpu_read(vector_irq[vector]);
 
 	if (!handle_irq(irq, regs)) {
arch/x86/kernel/nmi.c +5 -5
index d05bd2e2ee91..697f90db0e37 100644
@@ -110,7 +110,7 @@ static void nmi_max_handler(struct irq_work *w)
 		a->handler, whole_msecs, decimal_msecs);
 }
 
-static int nmi_handle(unsigned int type, struct pt_regs *regs, bool b2b)
+static int nmi_handle(unsigned int type, struct pt_regs *regs)
 {
 	struct nmi_desc *desc = nmi_to_desc(type);
 	struct nmiaction *a;
@@ -213,7 +213,7 @@ static void
 pci_serr_error(unsigned char reason, struct pt_regs *regs)
 {
 	/* check to see if anyone registered against these types of errors */
-	if (nmi_handle(NMI_SERR, regs, false))
+	if (nmi_handle(NMI_SERR, regs))
 		return;
 
 	pr_emerg("NMI: PCI system error (SERR) for reason %02x on CPU %d.\n",
@@ -247,7 +247,7 @@ io_check_error(unsigned char reason, struct pt_regs *regs)
 	unsigned long i;
 
 	/* check to see if anyone registered against these types of errors */
-	if (nmi_handle(NMI_IO_CHECK, regs, false))
+	if (nmi_handle(NMI_IO_CHECK, regs))
 		return;
 
 	pr_emerg(
@@ -284,7 +284,7 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
 	 * as only the first one is ever run (unless it can actually determine
 	 * if it caused the NMI)
 	 */
-	handled = nmi_handle(NMI_UNKNOWN, regs, false);
+	handled = nmi_handle(NMI_UNKNOWN, regs);
 	if (handled) {
 		__this_cpu_add(nmi_stats.unknown, handled);
 		return;
@@ -332,7 +332,7 @@ static void default_do_nmi(struct pt_regs *regs)
 
 	__this_cpu_write(last_nmi_rip, regs->ip);
 
-	handled = nmi_handle(NMI_LOCAL, regs, b2b);
+	handled = nmi_handle(NMI_LOCAL, regs);
 	__this_cpu_add(nmi_stats.normal, handled);
 	if (handled) {
 		/*
arch/x86/kernel/paravirt.c +0 -2
index 58bcfb67c01f..f68e48f5f6c2 100644
@@ -351,9 +351,7 @@ __visible struct pv_cpu_ops pv_cpu_ops = {
 	.wbinvd = native_wbinvd,
 	.read_msr = native_read_msr_safe,
 	.write_msr = native_write_msr_safe,
-	.read_tsc = native_read_tsc,
 	.read_pmc = native_read_pmc,
-	.read_tscp = native_read_tscp,
 	.load_tr_desc = native_load_tr_desc,
 	.set_ldt = native_set_ldt,
 	.load_gdt = native_load_gdt,
arch/x86/kernel/paravirt_patch_32.c +0 -2
index e1b013696dde..c89f50a76e97 100644
@@ -10,7 +10,6 @@ DEF_NATIVE(pv_mmu_ops, read_cr2, "mov %cr2, %eax");
 DEF_NATIVE(pv_mmu_ops, write_cr3, "mov %eax, %cr3");
 DEF_NATIVE(pv_mmu_ops, read_cr3, "mov %cr3, %eax");
 DEF_NATIVE(pv_cpu_ops, clts, "clts");
-DEF_NATIVE(pv_cpu_ops, read_tsc, "rdtsc");
 
 #if defined(CONFIG_PARAVIRT_SPINLOCKS) && defined(CONFIG_QUEUED_SPINLOCKS)
 DEF_NATIVE(pv_lock_ops, queued_spin_unlock, "movb $0, (%eax)");
@@ -52,7 +51,6 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
 		PATCH_SITE(pv_mmu_ops, read_cr3);
 		PATCH_SITE(pv_mmu_ops, write_cr3);
 		PATCH_SITE(pv_cpu_ops, clts);
-		PATCH_SITE(pv_cpu_ops, read_tsc);
 #if defined(CONFIG_PARAVIRT_SPINLOCKS) && defined(CONFIG_QUEUED_SPINLOCKS)
 		case PARAVIRT_PATCH(pv_lock_ops.queued_spin_unlock):
 			if (pv_is_native_spin_unlock()) {
arch/x86/kernel/process.c +3 -0
index 397688beed4b..2199d9b774c8 100644
@@ -29,6 +29,7 @@
 #include <asm/debugreg.h>
 #include <asm/nmi.h>
 #include <asm/tlbflush.h>
+#include <asm/vm86.h>
 
 /*
  * per-CPU TSS segments. Threads are completely 'soft' on Linux,
@@ -110,6 +111,8 @@ void exit_thread(void)
 		kfree(bp);
 	}
 
+	free_vm86(t);
+
 	fpu__drop(fpu);
 }
 
arch/x86/kernel/process_32.c +1 -0
index f73c962fe636..c13df2c735f8 100644
@@ -53,6 +53,7 @@
 #include <asm/syscalls.h>
 #include <asm/debugreg.h>
 #include <asm/switch_to.h>
+#include <asm/vm86.h>
 
 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
 asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread");
arch/x86/kernel/process_64.c +4 -2
index f6b916387590..3c1bbcf12924 100644
@@ -121,6 +121,7 @@ void __show_regs(struct pt_regs *regs, int all)
 void release_thread(struct task_struct *dead_task)
 {
 	if (dead_task->mm) {
+#ifdef CONFIG_MODIFY_LDT_SYSCALL
 		if (dead_task->mm->context.ldt) {
 			pr_warn("WARNING: dead process %s still has LDT? <%p/%d>\n",
 				dead_task->comm,
@@ -128,6 +129,7 @@ void release_thread(struct task_struct *dead_task)
 				dead_task->mm->context.ldt->size);
 			BUG();
 		}
+#endif
 	}
 }
 
@@ -248,8 +250,8 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
 			    __USER_CS, __USER_DS, 0);
 }
 
-#ifdef CONFIG_IA32_EMULATION
-void start_thread_ia32(struct pt_regs *regs, u32 new_ip, u32 new_sp)
+#ifdef CONFIG_COMPAT
+void compat_start_thread(struct pt_regs *regs, u32 new_ip, u32 new_sp)
 {
 	start_thread_common(regs, new_ip, new_sp,
 			    test_thread_flag(TIF_X32)
arch/x86/kernel/ptrace.c +75 -265

372 lines not on this page · raw message

arch/x86/kernel/signal.c +5 -28
index 71820c42b6ce..da52e6bb5c7f 100644
@@ -31,11 +31,11 @@
 #include <asm/vdso.h>
 #include <asm/mce.h>
 #include <asm/sighandling.h>
+#include <asm/vm86.h>
 
 #ifdef CONFIG_X86_64
 #include <asm/proto.h>
 #include <asm/ia32_unistd.h>
-#include <asm/sys_ia32.h>
 #endif /* CONFIG_X86_64 */
 
 #include <asm/syscall.h>
@@ -632,6 +632,9 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)
 	bool stepping, failed;
 	struct fpu *fpu = &current->thread.fpu;
 
+	if (v8086_mode(regs))
+		save_v86_state((struct kernel_vm86_regs *) regs, VM86_SIGNAL);
+
 	/* Are we from a system call? */
 	if (syscall_get_nr(current, regs) >= 0) {
 		/* If so, check system call restarting.. */
@@ -697,7 +700,7 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)
  * want to handle. Thus you cannot kill init even with a SIGKILL even by
  * mistake.
  */
-static void do_signal(struct pt_regs *regs)
+void do_signal(struct pt_regs *regs)
 {
 	struct ksignal ksig;
 
@@ -732,32 +735,6 @@ static void do_signal(struct pt_regs *regs)
 	restore_saved_sigmask();
 }
 
-/*
- * notification of userspace execution resumption
- * - triggered by the TIF_WORK_MASK flags
- */
-__visible void
-do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
-{
-	user_exit();
-
-	if (thread_info_flags & _TIF_UPROBE)
-		uprobe_notify_resume(regs);
-
-	/* deal with pending signal delivery */
-	if (thread_info_flags & _TIF_SIGPENDING)
-		do_signal(regs);
-
-	if (thread_info_flags & _TIF_NOTIFY_RESUME) {
-		clear_thread_flag(TIF_NOTIFY_RESUME);
-		tracehook_notify_resume(regs);
-	}
-	if (thread_info_flags & _TIF_USER_RETURN_NOTIFY)
-		fire_user_return_notifiers();
-
-	user_enter();
-}
-
 void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
 {
 	struct task_struct *me = current;
arch/x86/kernel/signal_compat.c new file +95 -0

95 lines not on this page · raw message

arch/x86/kernel/step.c +2 -0
index 0ccb53a9fcd9..c9a073866ca7 100644
@@ -18,6 +18,7 @@ unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *re
 		return addr;
 	}
 
+#ifdef CONFIG_MODIFY_LDT_SYSCALL
 	/*
 	 * We'll assume that the code segments in the GDT
 	 * are all zero-based. That is largely true: the
@@ -45,6 +46,7 @@ unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *re
 		}
 		mutex_unlock(&child->mm->context.lock);
 	}
+#endif
 
 	return addr;
 }
arch/x86/kernel/trace_clock.c +1 -6
index 25b993729f9b..80bb24d9b880 100644
@@ -12,10 +12,5 @@
  */
 u64 notrace trace_clock_x86_tsc(void)
 {
-	u64 ret;
-
-	rdtsc_barrier();
-	rdtscll(ret);
-
-	return ret;
+	return rdtsc_ordered();
 }
arch/x86/kernel/traps.c +29 -59

6 lines not on this page · raw message

arch/x86/kernel/tsc.c +3 -9
index 7437b41f6a47..1bb8bab1b3cb 100644

Lines of this file are not shown. View the raw message.

arch/x86/kernel/tsc_sync.c +6 -8
index dd8d0791dfb5..78083bf23ed1 100644

Lines of this file are not shown. View the raw message.

arch/x86/kernel/vm86_32.c +183 -190

373 lines not on this page · raw message

arch/x86/kvm/lapic.c +2 -2
index 2a5ca97c263b..946f52c43b8f 100644

Lines of this file are not shown. View the raw message.

arch/x86/kvm/svm.c +2 -2
index 8e0c0844c6b9..a4b8c8d57b96 100644

Lines of this file are not shown. View the raw message.

arch/x86/kvm/vmx.c +2 -2
index 83b7b5cd75d5..af30c265412c 100644

Lines of this file are not shown. View the raw message.

arch/x86/kvm/x86.c +7 -19
index 8f0f6eca69da..3a2b02906486 100644

Lines of this file are not shown. View the raw message.

arch/x86/lib/delay.c +51 -9

60 lines not on this page · raw message

arch/x86/math-emu/get_address.c +1 -0
index 8300db71c2a6..8db26591d91a 100644

Lines of this file are not shown. View the raw message.

arch/x86/mm/fault.c +5 -2
index 9dc909841739..eef44d9a3f77 100644

Lines of this file are not shown. View the raw message.

arch/x86/um/asm/barrier.h +0 -13
index b9531d343134..755481f14d90 100644

Lines of this file are not shown. View the raw message.

arch/x86/xen/enlighten.c +0 -3
index 11d6fb4e8483..d9cfa452da9d 100644

Lines of this file are not shown. View the raw message.

drivers/cpufreq/intel_pstate.c +1 -1
index fcb929ec5304..7898de054f4e 100644

Lines of this file are not shown. View the raw message.

drivers/input/gameport/gameport.c +2 -2
index e853a2134680..4a2a9e370be7 100644

Lines of this file are not shown. View the raw message.

drivers/input/joystick/analog.c +2 -2
index 4284080e481d..6f8b084e13d0 100644

Lines of this file are not shown. View the raw message.

drivers/net/hamradio/baycom_epp.c +1 -1
index 83c7cce0d172..72c9f1f352b4 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/dpt_i2o.c +3 -0
index f35ed53adaac..d4cda5e9600e 100644

Lines of this file are not shown. View the raw message.

drivers/staging/media/lirc/lirc_serial.c +4 -59

63 lines not on this page · raw message

drivers/thermal/intel_powerclamp.c +2 -2
index 5820e8513927..2ac0c704bcb8 100644

Lines of this file are not shown. View the raw message.

include/linux/context_tracking.h +15 -0
index b96bd299966f..008fc67d0d96 100644

Lines of this file are not shown. View the raw message.

include/linux/context_tracking_state.h +1 -0
index 678ecdf90cf6..ee956c528fab 100644

Lines of this file are not shown. View the raw message.

include/linux/spinlock.h +15 -15
index 0063b24b4f36..ffcd053ca89a 100644

Lines of this file are not shown. View the raw message.

kernel/notifier.c +2 -0
index ae9fc7cc360e..980e4330fb59 100644

Lines of this file are not shown. View the raw message.

kernel/sys_ni.c +1 -0
index 7995ef5868d8..ca7d84f438f1 100644

Lines of this file are not shown. View the raw message.

tools/power/cpupower/debug/kernel/cpufreq-test_tsc.c +2 -2
index 5224ee5b392d..6ff8383f2941 100644

Lines of this file are not shown. View the raw message.

tools/testing/selftests/x86/Makefile +2 -2
index caa60d56d7d1..29089b24d18b 100644

Lines of this file are not shown. View the raw message.

tools/testing/selftests/x86/entry_from_vm86.c +129 -10

139 lines not on this page · raw message

tools/testing/selftests/x86/ldt_gdt.c new file +576 -0

576 lines not on this page · raw message

tools/testing/selftests/x86/syscall_arg_fault.c new file +130 -0

130 lines not on this page · raw message

tools/testing/selftests/x86/syscall_nt.c new file +54 -0

54 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.