Skip to content

x86/pti: Final XMAS release

Thomas Gleixner linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v181 Latest54 patches 11 repliesIn review

Changes since V163 from the cover letter

- Moved the cpu entry area out of the fixmap because that caused failures due to fixmap size and cleanup_highmap() zapping fixmap PTEs.

- Moved all cpu entry area related code into separate files. The hodgepodge in cpu/common.c was really not appropriate.

- Folded Juergens XEN PV fix for vsyscall

- Folded Peters ACCESS bit simplification

- Cleaned up and fixed dump_pagetables

- Added Vlastimils PTI/NOPTI marker for dumpstack

- Addressed various minor review comments

Patches in v181 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/54x86/Kconfig: Limit NR_CPUS on 32bit to a sane amountarch/x86/Kconfig+2 -10 replies
2/54x86/mm/dump_pagetables: Check PAGE_PRESENT for realarch/x86/mm/dump_pagetables.c+1 -10 replies
3/54x86/mm/dump_pagetables: Make the address hints correct and readablearch/x86/mm/dump_pagetables.c+53 -370 replies
4/54x86/vsyscall/64: Explicitly set _PAGE_USER in the pagetable hierarchyarch/x86/entry/vsyscall/vsyscall_64.c+33 -10 replies
5/54x86/vsyscall/64: Warn and fail vsyscall emulation in NATIVE modearch/x86/entry/vsyscall/vsyscall_64.c+4 -00 replies
6/54arch: Allow arch_dup_mmap() to failarch/powerpc/include/asm/mmu_context.h arch/um/include/asm/mmu_context.h arch/unicore32/include/asm/mmu_context.h +3 more+14 -110 replies
7/54x86/ldt: Rework lockingarch/x86/include/asm/mmu.h arch/x86/include/asm/mmu_context.h arch/x86/kernel/ldt.c+26 -130 replies
8/54x86/ldt: Prevent ldt inheritance on execarch/x86/include/asm/mmu_context.h arch/x86/kernel/ldt.c tools/testing/selftests/x86/ldt_gdt.c+22 -260 replies
9/54x86/mm/64: Improve the memory map documentationDocumentation/x86/x86_64/mm.txt+6 -40 replies
10/54x86/doc: Remove obvious weirdnessDocumentation/x86/x86_64/mm.txt+3 -90 replies
11/54x86/entry: Remove SYSENTER_stack namingarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/fixmap.h +8 more+44 -380 replies
12/54x86/uv: Use the right tlbflush APIarch/x86/platform/uv/tlb_uv.c+1 -10 replies
13/54x86/microcode: Dont abuse the tlbflush interfacearch/x86/include/asm/tlbflush.h arch/x86/kernel/cpu/microcode/intel.c+6 -260 replies
14/54x86/mm: Use __flush_tlb_one() for kernel memoryarch/x86/mm/tlb.c+1 -10 replies
15/54x86/mm: Remove superfluous barriersarch/x86/include/asm/tlbflush.h+1 -70 replies
16/54x86/mm: Clarify which functions are supposed to flush whatarch/x86/include/asm/tlbflush.h+21 -20 replies
17/54x86/mm: Move the CR3 construction functions to tlbflush.harch/x86/include/asm/mmu_context.h arch/x86/include/asm/tlbflush.h arch/x86/mm/tlb.c+31 -320 replies
18/54x86/mm: Remove hard-coded ASID limit checksarch/x86/include/asm/tlbflush.h+18 -20 replies
19/54x86/mm: Put MMU to hardware ASID translation in one placearch/x86/include/asm/tlbflush.h+18 -110 replies
20/54x86/mm: Create asm/invpcid.harch/x86/include/asm/invpcid.h arch/x86/include/asm/tlbflush.h+54 -480 replies
21/54x86/cpu_entry_area: Move it to a separate unitarch/x86/include/asm/cpu_entry_area.h arch/x86/include/asm/fixmap.h arch/x86/kernel/cpu/common.c +3 more+157 -1351 reply
22/54x86/cpu_entry_area: Move it out of fixmapDocumentation/x86/x86_64/mm.txt arch/x86/include/asm/cpu_entry_area.h arch/x86/include/asm/desc.h +11 more+128 -772 replies
23/54init: Invoke init_espfix_bsp() from mm_init()arch/x86/include/asm/espfix.h arch/x86/kernel/smpboot.c include/asm-generic/pgtable.h +1 more+12 -120 replies
24/54x86/cpufeatures: Add X86_BUG_CPU_INSECUREarch/x86/include/asm/cpufeatures.h arch/x86/include/asm/disabled-features.h arch/x86/kernel/cpu/common.c+13 -20 replies
25/54x86/mm/pti: Disable global pages if PAGE_TABLE_ISOLATION=yarch/x86/mm/init.c+9 -30 replies
26/54x86/mm/pti: Prepare the x86/entry assembly code for entry/exit CR3 switchingarch/x86/entry/calling.h arch/x86/entry/entry_64.S arch/x86/entry/entry_64_compat.S+128 -70 replies
27/54x86/mm/pti: Add infrastructure for page table isolationDocumentation/admin-guide/kernel-parameters.txt arch/x86/boot/compressed/pagetable.c arch/x86/entry/calling.h +6 more+122 -30 replies
28/54x86/mm/pti: Add mapping helper functionsarch/x86/include/asm/pgtable.h arch/x86/include/asm/pgtable_64.h arch/x86/mm/pti.c+138 -10 replies
29/54x86/mm/pti: Allow NX poison to be set in p4d/pgdarch/x86/include/asm/pgtable.h+12 -20 replies
30/54x86/mm/pti: Allocate a separate user PGDarch/x86/kernel/head_64.S arch/x86/mm/pgtable.c+41 -50 replies
31/54x86/mm/pti: Populate user PGDarch/x86/include/asm/pgtable.h+8 -10 replies
32/54x86/mm/pti: Add functions to clone kernel PMDsarch/x86/mm/pti.c+127 -00 replies
33/54x86/mm/pti: Force entry through trampoline when PTI activearch/x86/kernel/cpu/common.c+4 -10 replies
34/54x86/mm/pti: Share cpu_entry_area with user space page tablesarch/x86/mm/pti.c+25 -00 replies
35/54x86/entry: Align entry text section to PMD boundaryarch/x86/kernel/vmlinux.lds.S+8 -02 replies
36/54x86/mm/pti: Share entry text PMDarch/x86/mm/pti.c+10 -00 replies
37/54x86/mm/pti: Map ESPFIX into user spacearch/x86/mm/pti.c+11 -00 replies
38/54x86/cpu_entry_area: Add debugstore entries to cpu_entry_areaarch/x86/events/intel/ds.c arch/x86/events/perf_event.h arch/x86/include/asm/cpu_entry_area.h +2 more+86 -210 replies
39/54x86/events/intel/ds: Map debug buffers in cpu_entry_areaarch/x86/events/intel/ds.c arch/x86/events/perf_event.h+82 -450 replies
40/54x86/mm/64: Make a full PGD-entry size hole in the memory mapDocumentation/x86/x86_64/mm.txt arch/x86/include/asm/pgtable_64_types.h+4 -40 replies
41/54x86/pti: Put the LDT in its own PGD if PTI is onDocumentation/x86/x86_64/mm.txt arch/x86/include/asm/mmu_context.h arch/x86/include/asm/pgtable_64_types.h +3 more+220 -170 replies
42/54x86/pti: Map the vsyscall page if neededarch/x86/entry/vsyscall/vsyscall_64.c arch/x86/include/asm/vsyscall.h arch/x86/mm/pti.c+67 -30 replies
43/54x86/mm: Allow flushing for future ASID switchesarch/x86/include/asm/tlbflush.h arch/x86/mm/tlb.c+64 -80 replies
44/54x86/mm: Abstract switching CR3arch/x86/mm/tlb.c+20 -20 replies
45/54x86/mm: Use/Fix PCID to optimize user/kernel switchesarch/x86/entry/calling.h arch/x86/entry/entry_64.S arch/x86/entry/entry_64_compat.S +6 more+162 -330 replies
46/54x86/mm: Optimize RESTORE_CR3arch/x86/entry/calling.h arch/x86/entry/entry_64.S+30 -40 replies
47/54x86/mm: Use INVPCID for __native_flush_tlb_single()arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/tlbflush.h arch/x86/mm/init.c+60 -280 replies
48/54x86/mm: Clarify the whole ASID/kernel PCID/user PCID namingarch/x86/include/asm/tlbflush.h+43 -120 replies
49/54x86/dumpstack: Indicate in Oops whether pti is configured and enabledarch/x86/kernel/dumpstack.c+4 -21 reply
50/54x86/mm/pti: Add Kconfigsecurity/Kconfig+10 -00 replies
51/54x86/mm/dump_pagetables: Add page table directoryarch/x86/mm/debug_pagetables.c+10 -50 replies
52/54x86/mm/dump_pagetables: Check user space page table for WX pagesarch/x86/include/asm/pgtable.h arch/x86/mm/debug_pagetables.c arch/x86/mm/dump_pagetables.c+27 -60 replies
53/54x86/mm/dump_pagetables: Allow dumping current pagetablesarch/x86/include/asm/pgtable.h arch/x86/mm/debug_pagetables.c arch/x86/mm/dump_pagetables.c+73 -60 replies
54/54x86/ldt: Make the LDT mapping ROarch/x86/include/asm/desc.h arch/x86/kernel/ldt.c arch/x86/kernel/tls.c +1 more+11 -120 replies

Reviews trailers per patch

9 of 54 patches have a Reviewed-by or Acked-by.

PatchAndrew BanmanBorislav PetkovThomas GleixnerEduardo ValentinDave HansenJiri KosinaKirill A. Shutemov
SeriesT-b
1/54
2/54
3/54
4/54
5/54
6/54
7/54
8/54
9/54
10/54
11/54
12/54A-b
13/54
14/54
15/54
16/54
17/54
18/54
19/54
20/54
21/54
22/54
23/54
24/54
25/54R-b
26/54R-b R-b
27/54R-b
28/54
29/54R-b
30/54R-b
31/54R-b
32/54Originally-by
33/54R-b
34/54
35/54
36/54
37/54
38/54
39/54
40/54
41/54
42/54
43/54
44/54
45/54
46/54
47/54
48/54
49/54R-b A-b A-b
50/54
51/54
52/54
53/54
54/54

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.

Read the v181 thread

Cover letter [patch V181 00/54] x86/pti: Final XMAS release

Changes since V163:

- Moved the cpu entry area out of the fixmap because that caused failures due to fixmap size and cleanup_highmap() zapping fixmap PTEs.

- Moved all cpu entry area related code into separate files. The hodgepodge in cpu/common.c was really not appropriate.

- Folded Juergens XEN PV fix for vsyscall

- Folded Peters ACCESS bit simplification

- Cleaned up and fixed dump_pagetables

- Added Vlastimils PTI/NOPTI marker for dumpstack

- Addressed various minor review comments

Diffstat against V163 appended.

Thanks to everyone who looked and cared!

It's perfect now because I'm going to have quiet holidays no matter what.

Nevertheless, please review and test the hell out of it.

The lot is based on:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/pti.entry

The series is also available from git:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/pti

The patch tarball is at:

https://tglx.de/~tglx/patches-pti-181.tar.bz2

sha1sum of decompressed tarball: 3b9c1729efe58e793a40031f54e82cac8aba3884

Thanks,

tglx

---

 Documentation/x86/x86_64/mm.txt         |    4 
 arch/x86/Kconfig                        |    3 
 arch/x86/entry/vsyscall/vsyscall_64.c   |    7 -
 arch/x86/events/intel/ds.c              |   53 ++++++----
 arch/x86/include/asm/cpu_entry_area.h   |   87 +++++++++++++++++
 arch/x86/include/asm/desc.h             |    1 
 arch/x86/include/asm/fixmap.h           |   96 -------------------
 arch/x86/include/asm/pgtable.h          |    4 
 arch/x86/include/asm/pgtable_32_types.h |   15 ++-
 arch/x86/include/asm/pgtable_64_types.h |   55 ++++++-----
 arch/x86/kernel/cpu/common.c            |  126 -------------------------
 arch/x86/kernel/dumpstack.c             |    7 +
 arch/x86/kernel/tls.c                   |   11 --
 arch/x86/kernel/traps.c                 |    6 -
 arch/x86/mm/Makefile                    |    8 -
 arch/x86/mm/cpu_entry_area.c            |  159 ++++++++++++++++++++++++++++++++
 arch/x86/mm/dump_pagetables.c           |  105 ++++++++++++---------
 arch/x86/mm/init_32.c                   |    6 +
 arch/x86/mm/kasan_init_64.c             |    6 -
 arch/x86/mm/pgtable_32.c                |    1 
 arch/x86/mm/pti.c                       |   52 +++++-----
 arch/x86/xen/mmu_pv.c                   |    2 
 22 files changed, 449 insertions(+), 365 deletions(-)