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

Commit 38e6bf23 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
 "A series of fixes for X86:

   - The final fix for the end-of-stack issue in the unwinder
   - Handle non PAT systems gracefully
   - Prevent access to uninitiliazed memory
   - Move early delay calaibration after basic init
   - Fix Kconfig help text
   - Fix a cross compile issue
   - Unbreak older make versions"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/timers: Move simple_udelay_calibration past init_hypervisor_platform
  x86/alternatives: Prevent uninitialized stack byte read in apply_alternatives()
  x86/PAT: Fix Xorg regression on CPUs that don't support PAT
  x86/watchdog: Fix Kconfig help text file path reference to lockup watchdog documentation
  x86/build: Permit building with old make versions
  x86/unwind: Add end-of-stack check for ftrace handlers
  Revert "x86/entry: Fix the end of the stack for newly forked tasks"
  x86/boot: Use CROSS_COMPILE prefix for readelf
parents 39b8ab31 702644ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -360,7 +360,7 @@ config SMP
	  Management" code will be disabled if you say Y here.

	  See also <file:Documentation/x86/i386/IO-APIC.txt>,
	  <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
	  <file:Documentation/lockup-watchdogs.txt> and the SMP-HOWTO available at
	  <http://www.tldp.org/docs.html#howto>.

	  If you don't know what to do here, say N.
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o
quiet_cmd_check_data_rel = DATAREL $@
define cmd_check_data_rel
	for obj in $(filter %.o,$^); do \
		readelf -S $$obj | grep -qF .rel.local && { \
		${CROSS_COMPILE}readelf -S $$obj | grep -qF .rel.local && { \
			echo "error: $$obj has data relocations!" >&2; \
			exit 1; \
		} || true; \
+19 −11
Original line number Diff line number Diff line
@@ -251,6 +251,23 @@ ENTRY(__switch_to_asm)
	jmp	__switch_to
END(__switch_to_asm)

/*
 * The unwinder expects the last frame on the stack to always be at the same
 * offset from the end of the page, which allows it to validate the stack.
 * Calling schedule_tail() directly would break that convention because its an
 * asmlinkage function so its argument has to be pushed on the stack.  This
 * wrapper creates a proper "end of stack" frame header before the call.
 */
ENTRY(schedule_tail_wrapper)
	FRAME_BEGIN

	pushl	%eax
	call	schedule_tail
	popl	%eax

	FRAME_END
	ret
ENDPROC(schedule_tail_wrapper)
/*
 * A newly forked process directly context switches into this address.
 *
@@ -259,24 +276,15 @@ END(__switch_to_asm)
 * edi: kernel thread arg
 */
ENTRY(ret_from_fork)
	FRAME_BEGIN		/* help unwinder find end of stack */

	/*
	 * schedule_tail() is asmlinkage so we have to put its 'prev' argument
	 * on the stack.
	 */
	pushl	%eax
	call	schedule_tail
	popl	%eax
	call	schedule_tail_wrapper

	testl	%ebx, %ebx
	jnz	1f		/* kernel threads are uncommon */

2:
	/* When we fork, we trace the syscall return in the child, too. */
	leal	FRAME_OFFSET(%esp), %eax
	movl    %esp, %eax
	call    syscall_return_slowpath
	FRAME_END
	jmp     restore_all

	/* kernel thread */
+4 −7
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
#include <asm/smap.h>
#include <asm/pgtable_types.h>
#include <asm/export.h>
#include <asm/frame.h>
#include <linux/err.h>

.code64
@@ -406,7 +405,6 @@ END(__switch_to_asm)
 * r12: kernel thread arg
 */
ENTRY(ret_from_fork)
	FRAME_BEGIN			/* help unwinder find end of stack */
	movq	%rax, %rdi
	call	schedule_tail			/* rdi: 'prev' task parameter */

@@ -414,11 +412,10 @@ ENTRY(ret_from_fork)
	jnz	1f				/* kernel threads are uncommon */

2:
	leaq	FRAME_OFFSET(%rsp),%rdi	/* pt_regs pointer */
	movq	%rsp, %rdi
	call	syscall_return_slowpath	/* returns with IRQs disabled */
	TRACE_IRQS_ON			/* user mode is traced as IRQS on */
	SWAPGS
	FRAME_END
	jmp	restore_regs_and_iret

1:
+7 −2
Original line number Diff line number Diff line
@@ -409,8 +409,13 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start,
		memcpy(insnbuf, replacement, a->replacementlen);
		insnbuf_sz = a->replacementlen;

		/* 0xe8 is a relative jump; fix the offset. */
		if (*insnbuf == 0xe8 && a->replacementlen == 5) {
		/*
		 * 0xe8 is a relative jump; fix the offset.
		 *
		 * Instruction length is checked before the opcode to avoid
		 * accessing uninitialized bytes for zero-length replacements.
		 */
		if (a->replacementlen == 5 && *insnbuf == 0xe8) {
			*(s32 *)(insnbuf + 1) += replacement - instr;
			DPRINTK("Fix CALL offset: 0x%x, CALL 0x%lx",
				*(s32 *)(insnbuf + 1),
Loading