Commit a9815a4f 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 set of x86 fixes and functional updates:

   - Prevent stale huge I/O TLB mappings on 32bit. A long standing bug
     which got exposed by KPTI support for 32bit

   - Prevent bogus access_ok() warnings in arch_stack_walk_user()

   - Add display quirks for Lenovo devices which have height and width
     swapped

   - Add the missing CR2 fixup for 32 bit async pagefaults. Fallout of
     the CR2 bug fix series.

   - Unbreak handling of force enabled HPET by moving the 'is HPET
     counting' check back to the original place.

   - A more accurate check for running on a hypervisor platform in the
     MDS mitigation code. Not perfect, but more accurate than the
     previous one.

   - Update a stale and confusing comment vs. IRQ stacks"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/speculation/mds: Apply more accurate check on hypervisor platform
  x86/hpet: Undo the early counter is counting check
  x86/entry/32: Pass cr2 to do_async_page_fault()
  x86/irq/64: Update stale comment
  x86/sysfb_efi: Add quirks for some devices with swapped width and height
  x86/stacktrace: Prevent access_ok() warnings in arch_stack_walk_user()
  mm/vmalloc: Sync unmappings in __purge_vmap_area_lazy()
  x86/mm: Sync also unmappings in vmalloc_sync_all()
  x86/mm: Check for pfn instead of page in vmalloc_sync_one()
parents e24ce84e 517c3ba0
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1443,8 +1443,12 @@ BUILD_INTERRUPT3(hv_stimer0_callback_vector, HYPERV_STIMER0_VECTOR,

ENTRY(page_fault)
	ASM_CLAC
	pushl	$0; /* %gs's slot on the stack */
	pushl	$do_page_fault
	jmp	common_exception_read_cr2
END(page_fault)

common_exception_read_cr2:
	/* the function address is in %gs's slot on the stack */
	SAVE_ALL switch_stacks=1 skip_gs=1

	ENCODE_FRAME_POINTER
@@ -1452,6 +1456,7 @@ ENTRY(page_fault)

	/* fixup %gs */
	GS_TO_REG %ecx
	movl	PT_GS(%esp), %edi
	REG_TO_PTGS %ecx
	SET_KERNEL_GS %ecx

@@ -1463,9 +1468,9 @@ ENTRY(page_fault)

	TRACE_IRQS_OFF
	movl	%esp, %eax			# pt_regs pointer
	call	do_page_fault
	CALL_NOSPEC %edi
	jmp	ret_from_exception
END(page_fault)
END(common_exception_read_cr2)

common_exception:
	/* the function address is in %gs's slot on the stack */
@@ -1595,7 +1600,7 @@ END(general_protection)
ENTRY(async_page_fault)
	ASM_CLAC
	pushl	$do_async_page_fault
	jmp	common_exception
	jmp	common_exception_read_cr2
END(async_page_fault)
#endif

+1 −1
Original line number Diff line number Diff line
@@ -1226,7 +1226,7 @@ static ssize_t l1tf_show_state(char *buf)

static ssize_t mds_show_state(char *buf)
{
	if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
		return sprintf(buf, "%s; SMT Host state unknown\n",
			       mds_strings[mds_mitigation]);
	}
+4 −4
Original line number Diff line number Diff line
@@ -193,10 +193,10 @@ ENTRY(secondary_startup_64)

	/* Set up %gs.
	 *
	 * The base of %gs always points to the bottom of the irqstack
	 * union.  If the stack protector canary is enabled, it is
	 * located at %gs:40.  Note that, on SMP, the boot cpu uses
	 * init data section till per cpu areas are set up.
	 * The base of %gs always points to fixed_percpu_data. If the
	 * stack protector canary is enabled, it is located at %gs:40.
	 * Note that, on SMP, the boot cpu uses init data section until
	 * the per cpu areas are set up.
	 */
	movl	$MSR_GS_BASE,%ecx
	movl	initial_gs(%rip),%eax
+8 −4
Original line number Diff line number Diff line
@@ -827,10 +827,6 @@ int __init hpet_enable(void)
	if (!hpet_cfg_working())
		goto out_nohpet;

	/* Validate that the counter is counting */
	if (!hpet_counting())
		goto out_nohpet;

	/*
	 * Read the period and check for a sane value:
	 */
@@ -896,6 +892,14 @@ int __init hpet_enable(void)
	}
	hpet_print_config();

	/*
	 * Validate that the counter is counting. This needs to be done
	 * after sanitizing the config registers to properly deal with
	 * force enabled HPETs.
	 */
	if (!hpet_counting())
		goto out_nohpet;

	clocksource_register_hz(&clocksource_hpet, (u32)hpet_freq);

	if (id & HPET_ID_LEGSUP) {
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ copy_stack_frame(const void __user *fp, struct stack_frame_user *frame)
{
	int ret;

	if (!access_ok(fp, sizeof(*frame)))
	if (__range_not_ok(fp, sizeof(*frame), TASK_SIZE))
		return 0;

	ret = 1;
Loading