linux-stable/drivers/hv
Guilherme G. Piccoli 3cd2e36930 video: hyperv_fb: Avoid taking busy spinlock on panic path
[ Upstream commit 1d044ca035 ]

The Hyper-V framebuffer code registers a panic notifier in order
to try updating its fbdev if the kernel crashed. The notifier
callback is straightforward, but it calls the vmbus_sendpacket()
routine eventually, and such function takes a spinlock for the
ring buffer operations.

Panic path runs in atomic context, with local interrupts and
preemption disabled, and all secondary CPUs shutdown. That said,
taking a spinlock might cause a lockup if a secondary CPU was
disabled with such lock taken. Fix it here by checking if the
ring buffer spinlock is busy on Hyper-V framebuffer panic notifier;
if so, bail-out avoiding the potential lockup scenario.

Cc: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Cc: Dexuan Cui <decui@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Michael Kelley <mikelley@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Tianyu Lan <Tianyu.Lan@microsoft.com>
Cc: Wei Liu <wei.liu@kernel.org>
Tested-by: Fabio A M Martins <fabiomirmar@gmail.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20220819221731.480795-10-gpiccoli@igalia.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:26:40 +01:00
..
Kconfig hv: utils: add PTP_1588_CLOCK to Kconfig to fix build 2021-11-28 21:22:35 +00:00
Makefile Drivers: hv: Move Hyper-V extended capability check to arch neutral code 2021-06-05 10:22:34 +00:00
channel.c Drivers: hv: vmbus: Introduce {lock,unlock}_requestor() 2022-04-25 15:51:13 +00:00
channel_mgmt.c Drivers: hv: vmbus: fix double free in the error path of vmbus_add_channel_work() 2022-12-02 17:43:05 +01:00
connection.c Drivers: hv: vm_bus: Handle vmbus rescind calls after vmbus is suspended 2022-07-11 18:53:42 +00:00
hv.c x86/hyperv: Add ghcb hvcall support for SNP VM 2021-10-28 11:22:49 +00:00
hv_balloon.c Drivers: hv: Create debugfs file with hyper-v balloon usage information 2022-07-18 11:19:02 +00:00
hv_common.c hyperv-fixes for 5.18-rc2 2022-04-07 06:35:34 -10:00
hv_debugfs.c hv_debugfs: Make hv_debug_root static 2020-04-04 17:47:43 +01:00
hv_fcopy.c Drivers: hv: remove duplicate word in a comment 2022-09-05 16:28:40 +00:00
hv_kvp.c Drivers: hv: Fix syntax errors in comments 2022-06-08 12:26:28 +00:00
hv_snapshot.c hv_utils: Add comment about max VMbus packet size in VSS driver 2022-02-18 13:08:18 +00:00
hv_trace.c
hv_trace.h Drivers: hv: vmbus: Drivers: hv: vmbus: Introduce CHANNELMSG_MODIFYCHANNEL_RESPONSE 2021-04-18 13:03:11 +00:00
hv_trace_balloon.h
hv_util.c drivers: hv: Decouple Hyper-V clock/timer code from VMbus drivers 2021-07-19 09:24:28 +00:00
hv_utils_transport.c Drivers: hv: utils: Make use of the helper macro LIST_HEAD() 2022-02-09 14:33:21 +00:00
hv_utils_transport.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 280 2019-06-05 17:36:36 +02:00
hyperv_vmbus.h Drivers: hv: vm_bus: Handle vmbus rescind calls after vmbus is suspended 2022-07-11 18:53:42 +00:00
ring_buffer.c video: hyperv_fb: Avoid taking busy spinlock on panic path 2022-12-31 13:26:40 +01:00
vmbus_drv.c Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() 2022-12-02 17:43:06 +01:00