[PATCH 4.1 00/65] page table isolation for stable 4.1

From: Pavel Tatashin
Date: Mon Mar 05 2018 - 19:41:38 EST


The git of this backport can be found here:
git clone --branch pti_v4.1.49 https://github.com/soleen/linux

The patches were backported from stable 4.4 to Oracle UEK4.1, and from
UEK4.1 to Stable 4.1

Aaron Lu (1):
x86/irq: Do not substract irq_tlb_count from irq_call_count

Andy Lutomirski (16):
x86/mm: Add INVPCID helpers
x86/mm: Add a 'noinvpcid' boot option to turn off INVPCID
x86/mm: If INVPCID is available, use it to flush global mappings
sched/core: Add switch_mm_irqs_off() and use it in the scheduler
x86/mm: Build arch/x86/mm/tlb.c even on !SMP
x86/mm, sched/core: Turn off IRQs in switch_mm()
sched/core: Idle_task_exit() shouldn't use switch_mm_irqs_off()
x86/vm86/32: Switch to flush_tlb_mm_range() in mark_screen_rdonly()
x86/mm: Remove flush_tlb() and flush_tlb_current_task()
x86/mm: Make flush_tlb_mm_range() more predictable
x86/mm: Reimplement flush_tlb_page() using flush_tlb_mm_range()
x86/mm: Remove the UP asm/tlbflush.h code, always use the (formerly)
SMP code
x86/mm: Disable PCID on 32-bit kernels
x86/mm: Add the 'nopcid' boot option to turn off PCID
x86/mm: Enable CR4.PCIDE on supported systems
x86/mm/64: Fix reboot interaction with CR4.PCIDE

Borislav Petkov (5):
x86/mm: Fix INVPCID asm constraint
x86/kaiser: Rename and simplify X86_FEATURE_KAISER handling
x86/kaiser: Check boottime cmdline params
x86/kaiser: Reenable PARAVIRT
x86/kaiser: Move feature detection up

Dave Hansen (2):
kaiser: merged update
kaiser: enhanced by kernel and user PCIDs

Denys Vlasenko (3):
x86/entry: Stop using PER_CPU_VAR(kernel_stack)
x86/entry: Remove unused 'kernel_stack' per-cpu variable
x86/entry: Define 'cpu_current_top_of_stack' for 64-bit code

Hugh Dickins (26):
kaiser: do not set _PAGE_NX on pgd_none
kaiser: stack map PAGE_SIZE at THREAD_SIZE-PAGE_SIZE
kaiser: fix build and FIXME in alloc_ldt_struct()
kaiser: KAISER depends on SMP
kaiser: fix regs to do_nmi() ifndef CONFIG_KAISER
kaiser: fix perf crashes
kaiser: ENOMEM if kaiser_pagetable_walk() NULL
kaiser: tidied up asm/kaiser.h somewhat
kaiser: tidied up kaiser_add/remove_mapping slightly
kaiser: kaiser_remove_mapping() move along the pgd
kaiser: cleanups while trying for gold link
kaiser: name that 0x1000 KAISER_SHADOW_PGD_OFFSET
kaiser: delete KAISER_REAL_SWITCH option
kaiser: vmstat show NR_KAISERTABLE as nr_overhead
kaiser: load_new_mm_cr3() let SWITCH_USER_CR3 flush user
kaiser: PCID 0 for kernel and 128 for user
kaiser: x86_cr3_pcid_noflush and x86_cr3_pcid_user
kaiser: paranoid_entry pass cr3 need to paranoid_exit
kaiser: _pgd_alloc() without __GFP_REPEAT to avoid stalls
kaiser: fix unlikely error in alloc_ldt_struct()
kaiser: add "nokaiser" boot option, using ALTERNATIVE
kaiser: add "nokaiser" boot option, using ALTERNATIVE
kaiser: use ALTERNATIVE instead of x86_cr3_pcid_noflush
kaiser: drop is_atomic arg to kaiser_pagetable_walk()
kaiser: asm/tlbflush.h handle noPGE at lower level
kaiser: kaiser_flush_tlb_on_return_to_user() check PCID

Ingo Molnar (1):
mm/mmu_context, sched/core: Fix mmu_context.h assumption

Jamie Iles (1):
x86/ldt: fix crash in ldt freeing.

Jiri Kosina (1):
PTI: unbreak EFI old_memmap

Kees Cook (1):
KPTI: Rename to PAGE_TABLE_ISOLATION

Konrad Rzeszutek Wilk (1):
kpti: Disable when running under Xen PV

Pavel Tatashin (3):
x86/mm, sched/core: Uninline switch_mm()
pti: Rename X86_FEATURE_KAISER to X86_FEATURE_PTI
x86/pti/efi: broken conversion from efi to kernel page table

Richard Fellner (1):
KAISER: Kernel Address Isolation

Steven Rostedt (1):
ARM: Hide finish_arch_post_lock_switch() from modules

Thomas Gleixner (1):
x86/paravirt: Dont patch flush_tlb_single

Tom Lendacky (1):
x86/boot: Add early cmdline parsing for options with arguments

Documentation/kernel-parameters.txt | 12 +
arch/arm/include/asm/mmu_context.h | 2 +
arch/x86/boot/compressed/misc.h | 1 +
arch/x86/ia32/ia32entry.S | 11 +-
arch/x86/include/asm/cmdline.h | 2 +
arch/x86/include/asm/cpufeature.h | 7 +
arch/x86/include/asm/desc.h | 2 +-
arch/x86/include/asm/disabled-features.h | 4 +-
arch/x86/include/asm/hardirq.h | 6 +-
arch/x86/include/asm/hw_irq.h | 2 +-
arch/x86/include/asm/kaiser.h | 151 ++++++++++
arch/x86/include/asm/mmu.h | 6 -
arch/x86/include/asm/mmu_context.h | 101 +------
arch/x86/include/asm/pgtable.h | 28 +-
arch/x86/include/asm/pgtable_64.h | 25 +-
arch/x86/include/asm/pgtable_types.h | 29 +-
arch/x86/include/asm/processor.h | 2 +-
arch/x86/include/asm/thread_info.h | 8 +-
arch/x86/include/asm/tlbflush.h | 233 +++++++++------
arch/x86/include/uapi/asm/processor-flags.h | 3 +-
arch/x86/kernel/cpu/bugs.c | 8 +
arch/x86/kernel/cpu/common.c | 86 +++++-
arch/x86/kernel/cpu/perf_event_intel_ds.c | 57 +++-
arch/x86/kernel/entry_64.S | 170 +++++++++--
arch/x86/kernel/espfix_64.c | 10 +
arch/x86/kernel/head_64.S | 35 ++-
arch/x86/kernel/irq.c | 3 +-
arch/x86/kernel/irqinit.c | 2 +-
arch/x86/kernel/ldt.c | 25 +-
arch/x86/kernel/paravirt_patch_64.c | 2 -
arch/x86/kernel/process.c | 2 +-
arch/x86/kernel/process_32.c | 5 +-
arch/x86/kernel/process_64.c | 3 -
arch/x86/kernel/reboot.c | 4 +
arch/x86/kernel/setup.c | 7 +
arch/x86/kernel/smpboot.c | 2 -
arch/x86/kernel/tracepoint.c | 2 +
arch/x86/kernel/vm86_32.c | 2 +-
arch/x86/kvm/x86.c | 3 +-
arch/x86/lib/cmdline.c | 105 +++++++
arch/x86/mm/Makefile | 4 +-
arch/x86/mm/init.c | 4 +-
arch/x86/mm/init_64.c | 10 +
arch/x86/mm/kaiser.c | 449 ++++++++++++++++++++++++++++
arch/x86/mm/pageattr.c | 63 +++-
arch/x86/mm/pgtable.c | 16 +-
arch/x86/mm/tlb.c | 194 ++++++++----
arch/x86/platform/efi/efi_64.c | 6 +
arch/x86/realmode/init.c | 4 +-
arch/x86/realmode/rm/trampoline_64.S | 3 +-
arch/x86/xen/enlighten.c | 6 +
arch/x86/xen/xen-asm_64.S | 6 +-
include/asm-generic/vmlinux.lds.h | 7 +
include/linux/kaiser.h | 52 ++++
include/linux/mmu_context.h | 7 +
include/linux/mmzone.h | 3 +-
include/linux/percpu-defs.h | 32 +-
init/main.c | 2 +
kernel/fork.c | 6 +
kernel/sched/core.c | 4 +-
mm/mmu_context.c | 2 +-
mm/vmstat.c | 1 +
security/Kconfig | 10 +
63 files changed, 1687 insertions(+), 372 deletions(-)
create mode 100644 arch/x86/include/asm/kaiser.h
create mode 100644 arch/x86/mm/kaiser.c
create mode 100644 include/linux/kaiser.h

--
2.16.2