acrn-kernel/drivers
Guilherme G. Piccoli 1179083ff0 firmware: google: test spinlock on panic path to avoid lockups
Currently the gsmi driver registers a panic notifier as well as reboot and
die notifiers.  The callbacks registered are called in atomic and very
limited context - for instance, panic disables preemption and local IRQs,
also all secondary CPUs (not executing the panic path) are shutdown.

With that said, taking a spinlock in this scenario is a dangerous
invitation for lockup scenarios.  So, fix that by checking if the spinlock
is free to acquire in the panic notifier callback - if not, bail-out and
avoid a potential hang.

Link: https://lkml.kernel.org/r/20220909200755.189679-1-gpiccoli@igalia.com
Fixes: 74c5b31c66 ("driver: Google EFI SMI")
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Reviewed-by: Evan Green <evgreen@chromium.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: David Gow <davidgow@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Petr Mladek <pmladek@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-10-03 14:21:42 -07:00
..
accessibility
acpi Merge branch 'acpi-processor' into acpi 2022-08-27 14:43:18 +02:00
amba
android binder_alloc: add missing mmap_lock calls when using the VMA 2022-08-28 14:02:44 -07:00
ata ata: libata-eh: Add missing command name 2022-08-16 05:42:51 +09:00
atm
auxdisplay
base
bcma
block block-6.0-2022-08-26 2022-08-26 11:05:54 -07:00
bluetooth
bus
cdrom
char
clk
clocksource RISC-V: Add Sstc extension support 2022-08-11 14:41:52 -07:00
comedi
connector
counter
cpufreq cpufreq: check only freq_table in __resolve_freq() 2022-08-23 20:00:52 +02:00
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware firmware: google: test spinlock on panic path to avoid lockups 2022-10-03 14:21:42 -07:00
fpga
fsi
gnss
gpio
gpu Merge tag 'amd-drm-fixes-6.0-2022-08-25' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes 2022-08-26 09:56:53 +10:00
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c i2c: imx: Make sure to unregister adapter on remove() 2022-08-21 10:27:33 +02:00
i3c
idle
iio
infiniband RDMA: Handle the return code from dma_resv_wait_timeout() properly 2022-08-16 17:13:23 +03:00
input Input updates for 5.20 (6.0) merge window: 2022-08-11 09:23:08 -07:00
interconnect
iommu irqchip fixes for 6.0, take #1 2022-08-18 17:37:22 +02:00
ipack
irqchip irqchip fixes for 6.0, take #1 2022-08-18 17:37:22 +02:00
isdn
leds
macintosh
mailbox
mcb
md block-6.0-2022-08-26 2022-08-26 11:05:54 -07:00
media
memory
memstick
message
mfd
misc
mmc linux-kselftest-kunit-fixes-6.0-rc3 2022-08-23 13:23:07 -07:00
most
mtd
mux
net Including fixes from ipsec and netfilter (with one broken Fixes tag). 2022-08-25 14:03:58 -07:00
nfc nfc: pn533: Fix use-after-free bugs caused by pn532_cmd_timeout 2022-08-22 14:51:30 +01:00
ntb
nubus
nvdimm virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
nvme block-6.0-2022-08-12 2022-08-13 13:37:36 -07:00
nvmem
of RISC-V Patches for the 5.20 Merge Window, Part 2 2022-08-12 18:39:43 -07:00
opp
parisc parisc: ccio-dma: Handle kmalloc failure in ccio_init_resources() 2022-08-22 11:09:17 +02:00
parport
pci Fix of heap data and clang warnings, support for a new Intel NTB device, 2022-08-13 14:00:45 -07:00
pcmcia
peci
perf perf: riscv legacy: fix kerneldoc comment warning 2022-08-18 14:19:26 -07:00
phy
pinctrl
platform sound fixes for 6.0-rc2 2022-08-19 09:46:11 -07:00
pnp
power power supply and reset changes for the v6.0 series 2022-08-12 09:37:33 -07:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: Fixes for v6.0 2022-08-16 11:36:38 -07:00
remoteproc virtio: Revert "virtio: find_vqs() add arg sizes" 2022-08-16 01:40:24 -04:00
reset
rpmsg
rtc
s390 s390 updates for 6.0-rc2 2022-08-20 11:29:01 -07:00
sbus
scsi scsi: sd: Revert "Rework asynchronous resume support" 2022-08-22 22:45:25 -04:00
sh
siox
slimbus
soc
soundwire
spi spi: Fixes for v6.0 2022-08-16 11:40:15 -07:00
spmi
ssb
staging
target SCSI misc on 20220813 2022-08-13 13:41:48 -07:00
tc
tee tee: add overflow check in register_shm_helper() 2022-08-18 09:20:27 -07:00
thermal Merge branch 'thermal-core' 2022-08-27 15:07:58 +02:00
thunderbolt
tty
ufs scsi: ufs: core: Reduce the power mode change timeout 2022-08-19 21:34:36 -04:00
uio
usb
vdpa vdpa/mlx5: Fix possible uninitialized return value 2022-08-11 10:00:36 -04:00
vfio
vhost virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
video fbdev: fbcon: Properly revert changes when vc_resize() failed 2022-08-26 19:56:18 +02:00
virt
virtio virtio: kerneldocs fixes and enhancements 2022-08-16 01:40:24 -04:00
vlynq
w1
watchdog
xen xen: branch for v6.0-rc3 2022-08-27 15:38:00 -07:00
zorro
Kconfig
Makefile