linux-imx/mm
Hugh Dickins a4f588df14 KAISER: Kernel Address Isolation
This patch introduces our implementation of KAISER (Kernel Address
Isolation to have Side-channels Efficiently Removed), a kernel isolation
technique to close hardware side channels on kernel address information.

More information about the original patch can be found at:
https://github.com/IAIK/KAISER
http://marc.info/?l=linux-kernel&m=149390087310405&w=2

Daniel Gruss <daniel.gruss@iaik.tugraz.at>
Richard Fellner <richard.fellner@student.tugraz.at>
Michael Schwarz <michael.schwarz@iaik.tugraz.at>
<clementine.maurice@iaik.tugraz.at>
<moritz.lipp@iaik.tugraz.at>

That original was then developed further by
Dave Hansen <dave.hansen@intel.com>
Hugh Dickins <hughd@google.com>
then others after this snapshot.

This combined patch for 3.2.96 was derived from hughd's patches below
for 3.18.72, in 2017-12-04's kaiser-3.18.72.tar; except for the last,
which was sent in 2017-12-09's nokaiser-3.18.72.tar.  They have been
combined in order to minimize the effort of rebasing: most of the
patches in the 3.18.72 series were small fixes and cleanups and
enhancements to three large patches.  About the only new work in this
backport is a simple reimplementation of kaiser_remove_mapping():
since mm/pageattr.c changed a lot between 3.2 and 3.18, and the
mods there for Kaiser never seemed necessary.

KAISER: Kernel Address Isolation
kaiser: merged update
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: align addition to x86/mm/Makefile
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: enhanced by kernel and user PCIDs
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: drop is_atomic arg to kaiser_pagetable_walk()

Signed-off-by: Hugh Dickins <hughd@google.com>
[bwh:
 - Fixed the #undef in arch/x86/boot/compressed/misc.h
 - Add missing #include in arch/x86/mm/kaiser.c]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-01-07 01:46:49 +00:00
..
backing-dev.c mm, vmstat: fix wrong WQ sleep when memory reclaim doesn't make any progress 2016-02-27 14:28:47 +00:00
bootmem.c bootmem/sparsemem: remove limit constraint in alloc_bootmem_section 2012-04-02 09:52:37 -07:00
bounce.c block: Add bio_for_each_segment_all() 2013-09-10 01:57:27 +01:00
cleancache.c mm: cleancache core ops functions and config 2011-05-26 10:01:36 -06:00
compaction.c mm: compaction: fix echo 1 > compact_memory return error issue 2013-02-06 04:33:31 +00:00
debug-pagealloc.c debug-pagealloc: add support for highmem pages 2011-10-31 17:30:48 -07:00
dmapool.c mm: dmapool: use provided gfp flags for all dma_alloc_coherent() calls 2013-01-03 03:33:36 +00:00
fadvise.c mm/fadvise.c: drain all pagevecs if POSIX_FADV_DONTNEED fails to discard all pages 2013-03-06 03:24:12 +00:00
failslab.c fault-injection: add ability to export fault_attr in arbitrary directory 2011-08-03 14:25:20 -10:00
filemap_xip.c mm/filemap_xip.c: fix race condition in xip_file_fault() 2012-02-13 11:16:54 -08:00
filemap.c mm, fs: check for fatal signals in do_generic_file_read() 2017-03-16 02:18:47 +00:00
fremap.c mm: delete various needless include <linux/module.h> 2011-10-31 09:20:11 -04:00
highmem.c mm: highmem: don't treat PKMAP_ADDR(LAST_PKMAP) as a highmem address 2014-07-11 13:33:33 +01:00
huge_memory.c mm/huge_memory: Fix unused label warning 2017-11-11 13:34:41 +00:00
hugetlb.c mm/hugetlb: avoid soft lockup in set_max_huge_pages() 2016-11-20 01:01:30 +00:00
hwpoison-inject.c Fix common misspellings 2011-03-31 11:26:23 -03:00
init-mm.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
internal.h mm: setup pageblock_order before it's used by sparsemem 2012-08-10 00:25:09 +01:00
Kconfig memblock: add NO_BOOTMEM config symbol 2011-10-31 17:30:47 -07:00
Kconfig.debug mm: debug-pagealloc: fix kconfig dependency warning 2011-03-22 17:44:02 -07:00
kmemcheck.c kmemcheck: Fix build errors due to missing slab.h 2010-03-30 22:02:32 +09:00
kmemleak-test.c kmemleak: remove memset by using kzalloc 2011-01-27 18:31:51 +00:00
kmemleak.c mm: kmemleak: allow safe memory scanning during kmemleak disabling 2015-08-12 16:33:17 +02:00
ksm.c mm,ksm: fix endless looping in allocating memory when ksm enable 2016-11-20 01:01:43 +00:00
maccess.c mm: Map most files to use export.h instead of module.h 2011-10-31 09:20:12 -04:00
madvise.c mm: Hold a file reference in madvise_remove 2012-07-12 04:32:19 +01:00
Makefile Cross Memory Attach 2011-10-31 17:30:44 -07:00
memblock.c mm/memblock.c: quiet sparse noise 2011-10-31 17:30:50 -07:00
memcontrol.c memcg: only free spare array when readers are done 2016-02-13 10:34:10 +00:00
memory_hotplug.c mm/memory_hotplug.c: check for missing sections in test_pages_in_a_zone() 2016-01-22 21:40:08 +00:00
memory-failure.c mm/memory-failure.c: fix memory leak by race between poison and unpoison 2014-06-09 13:29:15 +01:00
memory.c mm: larger stack guard gap, between vmas 2017-07-02 17:12:47 +01:00
mempolicy.c mm/mempolicy: fix use after free when calling get_mempolicy 2017-11-11 13:34:30 +00:00
mempool.c mm: Map most files to use export.h instead of module.h 2011-10-31 09:20:12 -04:00
migrate.c Sanitize 'move_pages()' permission checks 2017-09-15 18:30:57 +01:00
mincore.c mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode 2012-04-02 09:52:37 -07:00
mlock.c mm: try_to_unmap_cluster() should lock_page() before mlocking 2014-04-30 16:23:26 +01:00
mm_init.c mm: Map most files to use export.h instead of module.h 2011-10-31 09:20:12 -04:00
mmap.c mm: fix overflow check in expand_upwards() 2017-10-12 15:27:17 +01:00
mmu_context.c mm/mmu_context, sched/core: Fix mmu_context.h assumption 2018-01-07 01:46:47 +00:00
mmu_notifier.c mm: mmu_notifier: re-fix freed page still mapped in secondary MMU 2013-05-30 14:35:06 +01:00
mmzone.c mm: delete various needless include <linux/module.h> 2011-10-31 09:20:11 -04:00
mprotect.c thp: mprotect: transparent huge page support 2011-01-13 17:32:44 -08:00
mremap.c thp: mremap support and TLB optimization 2011-10-31 17:30:48 -07:00
msync.c sanitize vfs_fsync calling conventions 2010-05-21 18:31:21 -04:00
nobootmem.c mm: nobootmem: fix sign extend problem in __free_pages_memory() 2012-05-20 22:56:33 +01:00
nommu.c mm/nommu.c: fix arithmetic overflow in __vm_enough_memory() 2015-05-09 23:16:16 +01:00
oom_kill.c mm, oom: base root bonus on current usage 2014-04-02 00:58:46 +01:00
page_alloc.c PM/hibernate: touch NMI watchdog when creating snapshot 2017-11-11 13:34:32 +00:00
page_cgroup.c swap: cond_resched in swap_cgroup_prepare() 2017-09-15 18:30:54 +01:00
page_io.c block: kill off REQ_UNPLUG 2011-03-10 08:52:27 +01:00
page_isolation.c mm: page_isolation: codeclean fix comment and rm unneeded val init 2010-10-26 16:52:11 -07:00
page-writeback.c writeback: use |1 instead of +1 to protect against div by zero 2015-08-07 00:32:06 +01:00
pagewalk.c mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range 2015-03-06 00:39:18 +00:00
percpu-km.c percpu: clear memory allocated with the km allocator 2010-10-02 10:28:42 +03:00
percpu-vm.c percpu: perform tlb flush after pcpu_map_pages() failure 2014-11-05 20:27:38 +00:00
percpu.c percpu: free percpu allocation info for uniprocessor system 2014-11-05 20:27:38 +00:00
pgtable-generic.c mm/pgtable-generic.c: fix CONFIG_SWAP=n build 2011-01-26 10:49:58 +10:00
prio_tree.c sanitize <linux/prefetch.h> usage 2011-05-20 12:50:29 -07:00
process_vm_access.c ptrace: use fsuid, fsgid, effective creds for fs access checks 2017-09-15 18:30:57 +01:00
quicklist.c mm: delete various needless include <linux/module.h> 2011-10-31 09:20:11 -04:00
readahead.c mm: Map most files to use export.h instead of module.h 2011-10-31 09:20:12 -04:00
rmap.c mm: fix anon_vma->degree underflow in anon_vma endless growing prevention 2015-05-09 23:16:33 +01:00
shmem.c fs: Give dentry to inode_change_ok() instead of inode 2016-11-20 01:01:43 +00:00
slab.c cpuset: PF_SPREAD_PAGE and PF_SPREAD_SLAB should be atomic flags 2017-10-12 15:27:22 +01:00
slob.c mm: Map most files to use export.h instead of module.h 2011-10-31 09:20:12 -04:00
slub.c slub: refactoring unfreeze_partials() 2015-08-07 00:32:17 +01:00
sparse-vmemmap.c mm: delete various needless include <linux/module.h> 2011-10-31 09:20:11 -04:00
sparse.c mm/vmemmap: fix wrong use of virt_to_page 2012-12-06 11:20:36 +00:00
swap_state.c swap: avoid read_swap_cache_async() race to deadlock while waiting on discard I/O completion 2013-06-19 02:17:01 +01:00
swap.c mm: hugetlbfs: fix hugetlbfs optimization 2014-02-15 19:20:17 +00:00
swapfile.c swapfile: fix memory corruption via malformed swapfile 2017-02-23 03:50:59 +00:00
thrash.c mm/thrash.c: quiet sparse noise 2011-10-31 17:30:50 -07:00
truncate.c mm: Remove false WARN_ON from pagecache_isize_extended() 2014-12-14 16:24:01 +00:00
util.c mm: Map most files to use export.h instead of module.h 2011-10-31 09:20:12 -04:00
vmalloc.c mm: kmemleak: avoid false negatives on vmalloc'ed objects 2014-08-06 18:07:42 +01:00
vmscan.c mm: vmscan: clear kswapd's special reclaim powers before exiting 2014-07-11 13:33:47 +01:00
vmstat.c KAISER: Kernel Address Isolation 2018-01-07 01:46:49 +00:00