linux/drivers
Andi Kleen 299147ddcb x86/speculation/l1tf: Add sysfs reporting for l1tf
commit 17dbca1193 upstream.

L1TF core kernel workarounds are cheap and normally always enabled, However
they still should be reported in sysfs if the system is vulnerable or
mitigated. Add the necessary CPU feature/bug bits.

- Extend the existing checks for Meltdowns to determine if the system is
  vulnerable. All CPUs which are not vulnerable to Meltdown are also not
  vulnerable to L1TF

- Check for 32bit non PAE and emit a warning as there is no practical way
  for mitigation due to the limited physical address bits

- If the system has more than MAX_PA/2 physical memory the invert page
  workarounds don't protect the system against the L1TF attack anymore,
  because an inverted physical address will also point to valid
  memory. Print a warning in this case and report that the system is
  vulnerable.

Add a function which returns the PFN limit for the L1TF mitigation, which
will be used in follow up patches for sanity and range checks.

[ tglx: Renamed the CPU feature bit to L1TF_PTEINV ]
[ dwmw2: Backport to 4.9 (cpufeatures.h, E820) ]

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: 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>
[bwh: Backported to 3.16:
 - Assign the next available bits from feature word 7 and bug word 0
 - CONFIG_PGTABLE_LEVELS is not defined; use other config symbols in the
   condition
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-10-03 04:10:01 +01:00
..
accessibility printk: move braille console support into separate braille.[ch] files 2013-07-31 14:41:03 -07:00
acpi ACPI: sbshc: remove raw pointer from printk() message 2018-03-03 15:52:34 +00:00
amba ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
ata libata: Modify quirks for MX100 to limit NCQ_TRIM quirk to MU01 version 2018-06-16 22:22:44 +01:00
atm atm: iphase: fix misleading indention 2017-04-04 22:21:54 +01:00
auxdisplay auxdisplay: ks0108: fix refcount 2015-09-28 10:21:35 +01:00
base x86/speculation/l1tf: Add sysfs reporting for l1tf 2018-10-03 04:10:01 +01:00
bcma bcma: use (get|put)_device when probing/removing device driver 2017-06-05 21:17:01 +01:00
block rbd: whitelist RBD_FEATURE_OPERATIONS feature bit 2018-06-16 22:22:02 +01:00
bluetooth Bluetooth: Add another AR3012 04ca:3018 device 2017-06-05 21:17:09 +01:00
bus bus: mbus: fix window size calculation for 4GB windows 2018-01-01 20:51:52 +00:00
cdrom cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status 2018-09-25 23:47:31 +01:00
char tpm: fix potential buffer overruns caused by bit glitches on the bus 2018-06-16 22:22:27 +01:00
clk clk: ti: dra7-atl-clock: fix child-node lookups 2018-02-13 18:42:22 +00:00
clocksource clocksource/drivers/fsl_ftm_timer: Fix error return checking 2018-06-16 22:22:25 +01:00
connector connector: bump skb->users before callback invocation 2016-01-28 10:14:29 +00:00
cpufreq cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() 2018-06-16 22:22:28 +01:00
cpuidle cpuidle: Fix cpuidle_state_is_coupled() argument in cpuidle_enter() 2016-08-22 22:38:01 +01:00
crypto crypto: s5p-sss - Fix kernel Oops in AES-ECB mode 2018-06-16 22:22:15 +01:00
dca dca: convert to idr_alloc() 2013-02-27 19:10:15 -08:00
devfreq PM / devfreq: Propagate error from devfreq_add_device() 2018-06-16 22:21:45 +01:00
dio m68k: don't export static inline functions 2009-12-06 11:18:28 +01:00
dma dmaengine: dmatest: fix container_of member in dmatest_callback 2018-03-03 15:52:35 +00:00
edac EDAC, octeon: Fix an uninitialized variable warning 2018-06-16 22:21:40 +01:00
eisa Revert "EISA: Initialize device before its resources" 2014-01-17 14:57:29 -07:00
extcon extcon: palmas: Use devm_extcon_dev_allocate for extcon_dev 2014-04-29 09:52:12 +09:00
firewire firewire: net: fix fragmented datagram_size off-by-one 2017-02-23 03:54:28 +00:00
firmware firmware: dmi_scan: Fix handling of empty DMI strings 2018-06-16 22:22:06 +01:00
fmc Merge 3.14-rc5 into char-misc-next 2014-03-02 19:53:09 -08:00
gpio gpio: acpi: work around false-positive -Wstring-overflow warning 2018-01-01 20:51:33 +00:00
gpu mm: remove rest usage of VM_NONLINEAR and pte_file() 2018-10-03 04:09:52 +01:00
hid usb: ldusb: add PIDs for new CASSY devices supported by this driver 2018-06-16 22:22:16 +01:00
hsi HSI: ssi_protocol: double free in ssip_pn_xmit() 2017-08-26 02:14:37 +01:00
hv x86/retpoline/hyperv: Convert assembler indirect jumps 2018-03-19 18:59:07 +00:00
hwmon hwmon: (pmbus) Use 64bit math for DIRECT format values 2018-03-03 15:51:34 +00:00
hwspinlock A single patch from Vincent extending OMAP's hwspinlock support to OMAP5. 2013-05-07 14:01:27 -07:00
i2c i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA 2018-03-03 15:52:25 +00:00
ide Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide 2014-07-21 22:44:24 -07:00
idle intel_idle: fix IVT idle state table setting 2014-04-21 23:36:07 +02:00
iio iio: buffer: check if a buffer has been set up when poll is called 2018-06-16 22:22:19 +01:00
infiniband infiniband: fix a possible use-after-free bug 2018-09-25 23:47:30 +01:00
input Input: matrix_keypad - fix race when disabling interrupts 2018-06-16 22:22:12 +01:00
iommu iommu/vt-d: Fix scatterlist offset handling 2018-03-03 15:51:31 +00:00
ipack ipack: convert bus code to use dev_groups 2013-10-16 18:40:57 -07:00
irqchip irqchip: brcmstb-l2: Define an irq_pm_shutdown function 2017-11-11 13:33:16 +00:00
isdn mISDN: avoid arch specific __builtin_return_address call 2017-11-11 13:33:52 +00:00
leds leds / PM: fix hibernation on arm when gpio-led used with CPU led trigger 2015-07-09 14:36:01 +01:00
lguest x86: Clean up cr4 manipulation 2018-01-09 00:35:07 +00:00
macintosh macintosh/therm_windtunnel: Export I2C module alias information 2017-10-12 15:28:18 +01:00
mailbox drivers/mailbox/omap: make mbox->irq signed for error handling 2014-01-23 16:36:53 -08:00
mcb mcb: Fixed bar number assignment for the gdd 2016-08-22 22:37:53 +01:00
md bcache: don't attach backing with duplicate UUID 2018-06-16 22:22:32 +01:00
media media: cxusb, dib0700: ignore XC2028_I2C_FLUSH 2018-06-16 22:22:02 +01:00
memory memory: mvebu-devbus: add a devbus, keep-config property 2014-04-29 13:17:10 +00:00
memstick memstick: rtsx_usb_ms: Manage runtime PM when accessing the device 2017-02-23 03:54:16 +00:00
message i2o: hide unsafe ioctl on 64-bit 2017-11-11 13:33:48 +00:00
mfd mfd: twl6040: Fix child-node lookup 2018-03-03 15:51:40 +00:00
misc lkdtm: fix handle_irq_event symbol for INT_HW_IRQ_EN 2018-06-16 22:22:00 +01:00
mmc mmc: block: fix updating ext_csd caches on ioctl call 2018-06-16 22:22:41 +01:00
mtd mtd: jedec_probe: Fix crash in jedec_read_mfr() 2018-06-16 22:22:51 +01:00
net net/mlx4_en: Fix mixed PFC and Global pause user control requests 2018-06-16 22:22:50 +01:00
nfc NFC: microread: Potential overflows in microread_target_discovered() 2014-10-05 13:41:05 -07:00
ntb ntb: Use pci_enable_msix_range() instead of pci_enable_msix() 2014-04-07 10:59:20 -07:00
nubus kernel/printk: use symbolic defines for console loglevels 2014-06-04 16:54:17 -07:00
of of: fdt: Fix return with value in void function 2018-03-03 15:52:29 +00:00
oprofile oprofile, nmi-timer: Fix CPU hotplug callback registration 2014-03-20 13:43:46 +01:00
parisc parisc: Hide Diva-built-in serial aux and graphics card 2018-03-03 15:52:00 +00:00
parport parport: fix menu breakage 2014-07-25 18:00:23 -07:00
pci PCI: Add function 1 DMA alias quirk for Highpoint RocketRAID 644L 2018-06-16 22:22:32 +01:00
pcmcia Disable write buffering on Toshiba ToPIC95 2015-07-15 10:00:33 +01:00
phy phy: sun4i-usb: Use spinlock to guard phyctl register access 2017-02-23 03:53:59 +00:00
pinctrl pinctrl: Really force states during suspend/resume 2018-06-16 22:21:45 +01:00
platform Revert "apple-gmux: lock iGP IO to protect from vgaarb changes" 2018-06-16 22:22:03 +01:00
pnp ACPI / PNP: Reserve ACPI resources at the fs_initcall_sync stage 2015-07-15 10:01:34 +01:00
power power: supply: ab8500_charger: Bail out in case of error in 'ab8500_charger_init_hw_registers()' 2018-06-16 22:21:41 +01:00
powercap PowerCap: Fix an error code in powercap_register_zone() 2017-09-15 18:29:35 +01:00
pps pps: do not crash when failed to register 2016-11-20 01:16:57 +00:00
ps3 ps3-vuart: don't use PREPARE_WORK 2014-03-07 10:24:48 -05:00
ptp ptp: ptp_pch depends on x86_32 2014-06-17 15:43:48 -07:00
pwm pwm: tiehrpwm: fix clock imbalance in probe error path 2017-11-26 13:50:22 +00:00
rapidio rapidio/tsi721_dma: fix failure to obtain transaction descriptor 2014-07-30 17:16:13 -07:00
regulator regulator: da9063: Return an error code on probe failure 2017-11-26 13:50:27 +00:00
remoteproc remoteproc: avoid stack overflow in debugfs file 2016-01-05 12:08:23 +00:00
reset reset: sunxi: fix spinlock initialization 2015-01-22 16:33:34 +00:00
rpmsg A small pull request consisting of: 2013-05-07 14:02:00 -07:00
rtc rtc: set the alarm to the next expiring timer 2018-02-13 18:42:03 +00:00
s390 s390/qeth: free netdevice when removing a card 2018-06-16 22:22:47 +01:00
sbus bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000 2014-08-14 10:09:44 +08:00
scsi scsi: libsas: defer ata device eh commands to libata 2018-09-25 23:47:26 +01:00
sfi SFI / ACPI: Fix warnings reported during builds with W=1 2013-12-07 01:24:33 +01:00
sh SH Driver Update for v3.16 2014-06-06 11:44:09 -07:00
sn Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
soc soc: qcom: fix of_device_id table 2014-05-26 21:27:09 +02:00
spi spi: imx: do not access registers while clocks disabled 2018-06-16 22:21:46 +01:00
spmi spmi: Include OF based modalias in device uevent 2017-11-11 13:32:58 +00:00
ssb ssb: Fix error routine when fallback SPROM fails 2017-03-16 02:26:23 +00:00
staging usbip: usbip_host: fix bad unlock balance during stub_probe() 2018-09-25 23:47:23 +01:00
target iscsi-target: Fix non-immediate TMR reference leak 2018-02-13 18:42:18 +00:00
tc TC: Handle device_register() errors. 2014-06-26 10:48:23 +01:00
thermal thermal: hwmon: Properly report critical temperature in sysfs 2017-03-16 02:26:26 +00:00
tty tty: vt: fix up tabstops properly 2018-06-16 22:22:48 +01:00
uio uio: fix incorrect memory leak cleanup 2017-09-15 18:29:40 +01:00
usb uas: replace WARN_ON_ONCE() with lockdep_assert_held() 2018-09-25 23:47:32 +01:00
uwb uwb: properly check kthread_run return value 2018-01-01 20:51:31 +00:00
vfio vfio: New external user group/file match 2017-10-12 15:27:55 +01:00
vhost vhost_net: stop device during reset owner 2018-06-16 22:22:02 +01:00
video video: uvesafb: Fix integer overflow in allocation 2018-09-25 23:47:32 +01:00
virt drivers: clean-up prom.h implicit includes 2013-10-09 20:04:04 -05:00
virtio virtio: release virtio index when fail to device_register 2018-03-03 15:51:42 +00:00
vlynq drivers/vlynq/vlynq.c: fix another resource size off by 1 error 2014-01-23 16:36:55 -08:00
vme vme: Fix wrong pointer utilization in ca91cx42_slave_get 2017-03-16 02:26:56 +00:00
w1 w1: don't leak refcount on slave attach failure in w1_attach_slave_device() 2017-06-05 21:16:58 +01:00
watchdog watchdog: bcm281xx: Fix use of uninitialized spinlock. 2017-09-15 18:29:46 +01:00
xen xen/pirq: fix error path cleanup when binding MSIs 2018-06-16 22:22:30 +01:00
zorro zorro/UAPI: Use proper types (endianness/size) in <linux/zorro.h> 2013-11-26 11:09:09 +01:00
Kconfig soc: Introduce drivers/soc place-holder for SOC specific drivers 2014-05-23 11:37:46 -05:00
Makefile usb: Make sure usb/phy/of gets built-in 2017-08-26 02:14:39 +01:00