android_kernel_oneplus_msm8998/include
Andi Kleen 685b44483f x86/speculation/l1tf: Limit swap file size to MAX_PA/2
commit 377eeaa8e11fe815b1d07c81c4a0e2843a8c15eb upstream

For the L1TF workaround its necessary to limit the swap file size to below
MAX_PA/2, so that the higher bits of the swap offset inverted never point
to valid memory.

Add a mechanism for the architecture to override the swap file size check
in swapfile.c and add a x86 specific max swapfile check function that
enforces that limit.

The check is only enabled if the CPU is vulnerable to L1TF.

In VMs with 42bit MAX_PA the typical limit is 2TB now, on a native system
with 46bit PA it is 32TB. The limit is only per individual swap file, so
it's always possible to exceed these limits with multiple swap files or
partitions.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-15 17:42:10 +02:00
..
acpi
asm-generic x86/speculation/l1tf: Disallow non privileged high MMIO PROT_NONE mappings 2018-08-15 17:42:10 +02:00
clocksource
crypto crypto: poly1305 - remove ->setkey() method 2018-02-16 20:09:43 +01:00
drm drm: Add DP PSR2 sink enable bit 2018-08-06 16:24:39 +02:00
dt-bindings ARM: dts: Fix omap3 off mode pull defines 2017-11-21 09:21:19 +01:00
keys
kvm
linux x86/speculation/l1tf: Limit swap file size to MAX_PA/2 2018-08-15 17:42:10 +02:00
math-emu
media
memory
misc
net tcp: add max_quickacks param to tcp_incr_quickack and tcp_enter_quickack_mode 2018-08-06 16:24:41 +02:00
pcmcia
ras
rdma IB/core: Make testing MR flags for writability a static inline function 2018-08-15 17:42:06 +02:00
rxrpc
scsi scsi: sg: disable SET_FORCE_LOW_DMA 2018-01-23 19:50:14 +01:00
soc memory: tegra: Apply interrupts mask per SoC 2018-08-06 16:24:38 +02:00
sound ALSA: control: Hardening for potential Spectre v1 2018-05-02 07:53:41 -07:00
target target: Avoid early CMD_T_PRE_EXECUTE failures during ABORT_TASK 2018-01-17 09:35:31 +01:00
trace tracing/hrtimer: Fix tracing bugs by taking all clock bases and modes into account 2018-05-30 07:48:52 +02:00
uapi seccomp: Add filter flag to opt-out of SSB mitigation 2018-07-25 10:18:27 +02:00
video
xen fix xen_swiotlb_dma_mmap prototype 2017-10-05 09:41:48 +02:00
Kbuild