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

Commit 02fc87b1 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 misc x86 fixes from Ingo Molnar:
 - topology enumeration fixes
 - KASAN fix
 - two entry fixes (not yet the big series related to KASLR)
 - remove obsolete code
 - instruction decoder fix
 - better /dev/mem sanity checks, hopefully working better this time
 - pkeys fixes
 - two ACPI fixes
 - 5-level paging related fixes
 - UMIP fixes that should make application visible faults more debuggable
 - boot fix for weird virtualization environment

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
  x86/decoder: Add new TEST instruction pattern
  x86/PCI: Remove unused HyperTransport interrupt support
  x86/umip: Fix insn_get_code_seg_params()'s return value
  x86/boot/KASLR: Remove unused variable
  x86/entry/64: Add missing irqflags tracing to native_load_gs_index()
  x86/mm/kasan: Don't use vmemmap_populate() to initialize shadow
  x86/entry/64: Fix entry_SYSCALL_64_after_hwframe() IRQ tracing
  x86/pkeys/selftests: Fix protection keys write() warning
  x86/pkeys/selftests: Rename 'si_pkey' to 'siginfo_pkey'
  x86/mpx/selftests: Fix up weird arrays
  x86/pkeys: Update documentation about availability
  x86/umip: Print a warning into the syslog if UMIP-protected instructions are used
  x86/smpboot: Fix __max_logical_packages estimate
  x86/topology: Avoid wasting 128k for package id array
  perf/x86/intel/uncore: Cache logical pkg id in uncore driver
  x86/acpi: Reduce code duplication in mp_override_legacy_irq()
  x86/acpi: Handle SCI interrupts above legacy space gracefully
  x86/boot: Fix boot failure when SMP MP-table is based at 0
  x86/mm: Limit mmap() of /dev/mem to valid physical addresses
  x86/selftests: Add test for mapping placement for 5-level paging
  ...
parents 6830c8db 12a78d43
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
Memory Protection Keys for Userspace (PKU aka PKEYs) is a CPU feature
which will be found on future Intel CPUs.
Memory Protection Keys for Userspace (PKU aka PKEYs) is a feature
which is found on Intel's Skylake "Scalable Processor" Server CPUs.
It will be avalable in future non-server parts.

For anyone wishing to test or use this feature, it is available in
Amazon's EC2 C5 instances and is known to work there using an Ubuntu
17.04 image.

Memory Protection Keys provides a mechanism for enforcing page-based
protections, but without requiring modification of the page tables
+9 −3
Original line number Diff line number Diff line
@@ -1804,14 +1804,20 @@ config X86_SMAP
	  If unsure, say Y.

config X86_INTEL_UMIP
	def_bool n
	def_bool y
	depends on CPU_SUP_INTEL
	prompt "Intel User Mode Instruction Prevention" if EXPERT
	---help---
	  The User Mode Instruction Prevention (UMIP) is a security
	  feature in newer Intel processors. If enabled, a general
	  protection fault is issued if the instructions SGDT, SLDT,
	  SIDT, SMSW and STR are executed in user mode.
	  protection fault is issued if the SGDT, SLDT, SIDT, SMSW
	  or STR instructions are executed in user mode. These instructions
	  unnecessarily expose information about the hardware state.

	  The vast majority of applications do not use these instructions.
	  For the very few that do, software emulation is provided in
	  specific cases in protected and virtual-8086 modes. Emulated
	  results are dummy.

config X86_INTEL_MPX
	prompt "Intel MPX (Memory Protection Extensions)"
+2 −3
Original line number Diff line number Diff line
@@ -171,7 +171,6 @@ parse_memmap(char *p, unsigned long long *start, unsigned long long *size)
static void mem_avoid_memmap(char *str)
{
	static int i;
	int rc;

	if (i >= MAX_MEMMAP_REGIONS)
		return;
+10 −4
Original line number Diff line number Diff line
@@ -51,15 +51,19 @@ ENTRY(native_usergs_sysret64)
END(native_usergs_sysret64)
#endif /* CONFIG_PARAVIRT */

.macro TRACE_IRQS_IRETQ
.macro TRACE_IRQS_FLAGS flags:req
#ifdef CONFIG_TRACE_IRQFLAGS
	bt	$9, EFLAGS(%rsp)		/* interrupts off? */
	bt	$9, \flags		/* interrupts off? */
	jnc	1f
	TRACE_IRQS_ON
1:
#endif
.endm

.macro TRACE_IRQS_IRETQ
	TRACE_IRQS_FLAGS EFLAGS(%rsp)
.endm

/*
 * When dynamic function tracer is enabled it will add a breakpoint
 * to all locations that it is about to modify, sync CPUs, update
@@ -148,8 +152,6 @@ ENTRY(entry_SYSCALL_64)
	movq	%rsp, PER_CPU_VAR(rsp_scratch)
	movq	PER_CPU_VAR(cpu_current_top_of_stack), %rsp

	TRACE_IRQS_OFF

	/* Construct struct pt_regs on stack */
	pushq	$__USER_DS			/* pt_regs->ss */
	pushq	PER_CPU_VAR(rsp_scratch)	/* pt_regs->sp */
@@ -170,6 +172,8 @@ GLOBAL(entry_SYSCALL_64_after_hwframe)
	sub	$(6*8), %rsp			/* pt_regs->bp, bx, r12-15 not saved */
	UNWIND_HINT_REGS extra=0

	TRACE_IRQS_OFF

	/*
	 * If we need to do entry work or if we guess we'll need to do
	 * exit work, go straight to the slow path.
@@ -943,11 +947,13 @@ ENTRY(native_load_gs_index)
	FRAME_BEGIN
	pushfq
	DISABLE_INTERRUPTS(CLBR_ANY & ~CLBR_RDI)
	TRACE_IRQS_OFF
	SWAPGS
.Lgs_change:
	movl	%edi, %gs
2:	ALTERNATIVE "", "mfence", X86_BUG_SWAPGS_FENCE
	SWAPGS
	TRACE_IRQS_FLAGS (%rsp)
	popfq
	FRAME_END
	ret
+2 −2
Original line number Diff line number Diff line
@@ -975,10 +975,10 @@ static void uncore_pci_remove(struct pci_dev *pdev)
	int i, phys_id, pkg;

	phys_id = uncore_pcibus_to_physid(pdev->bus);
	pkg = topology_phys_to_logical_pkg(phys_id);

	box = pci_get_drvdata(pdev);
	if (!box) {
		pkg = topology_phys_to_logical_pkg(phys_id);
		for (i = 0; i < UNCORE_EXTRA_PCI_DEV_MAX; i++) {
			if (uncore_extra_pci_dev[pkg].dev[i] == pdev) {
				uncore_extra_pci_dev[pkg].dev[i] = NULL;
@@ -994,7 +994,7 @@ static void uncore_pci_remove(struct pci_dev *pdev)
		return;

	pci_set_drvdata(pdev, NULL);
	pmu->boxes[pkg] = NULL;
	pmu->boxes[box->pkgid] = NULL;
	if (atomic_dec_return(&pmu->activeboxes) == 0)
		uncore_pmu_unregister(pmu);
	uncore_box_exit(box);
Loading