linux/drivers/hv
Michael Kelley 6abad2eb9a Drivers: hv: Always do Hyper-V panic notification in hv_kmsg_dump()
[ Upstream commit 49f49d47af ]

hv_kmsg_dump() currently skips the panic notification entirely if it
doesn't get any message bytes to pass to Hyper-V due to an error from
kmsg_dump_get_buffer(). Skipping the notification is undesirable because
it leaves the Hyper-V host uncertain about the state of a panic'ed guest.

Fix this by always doing the panic notification, even if bytes_written
is zero. Also ensure that bytes_written is initialized, which fixes a
kernel test robot warning. The warning is actually bogus because
kmsg_dump_get_buffer() happens to set bytes_written even if it fails, and
in the kernel test robot's CONFIG_PRINTK not set case, hv_kmsg_dump() is
never called. But do the initialization for robustness and to quiet the
static checker.

Fixes: 9c318a1d9b ("Drivers: hv: move panic report code from vmbus to hv early init code")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/202512172103.OcUspn1Z-lkp@intel.com/
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Roman Kisel <vdso@mailbox.org>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-01-30 10:32:09 +01:00
..
channel.c Drivers: hv: Simplify data structures for VMBus channel close message 2025-09-08 22:11:03 +00:00
channel_mgmt.c Drivers: hv: Fix warnings for missing export.h header inclusion 2025-07-09 23:43:52 +00:00
connection.c Drivers: hv: Use nested hypercall for post message and signal event 2025-07-15 06:24:16 +00:00
hv.c Drivers: hv: Use nested hypercall for post message and signal event 2025-07-15 06:24:16 +00:00
hv_balloon.c hv_balloon: update the NR_BALLOON_PAGES state 2025-03-21 22:03:13 -07:00
hv_common.c Drivers: hv: Always do Hyper-V panic notification in hv_kmsg_dump() 2026-01-30 10:32:09 +01:00
hv_debugfs.c hv_debugfs: Make hv_debug_root static 2020-04-04 17:47:43 +01:00
hv_kvp.c hyperv: Switch from hyperv-tlfs.h to hyperv/hvhdk.h 2025-01-10 00:54:21 +00:00
hv_proc.c Drivers: hv: Fix warnings for missing export.h header inclusion 2025-07-09 23:43:52 +00:00
hv_snapshot.c hyperv: Switch from hyperv-tlfs.h to hyperv/hvhdk.h 2025-01-10 00:54:21 +00:00
hv_trace.c hv: add SPDX license to trace 2018-03-28 13:24:56 +02:00
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_balloon: trace post_status 2018-03-06 09:57:17 -08:00
hv_util.c Drivers: hv: util: Avoid accessing a ringbuffer not initialized yet 2024-12-09 18:44:15 +00:00
hv_utils_transport.c Drivers: hv: util: Cosmetic changes for hv_utils_transport.c 2025-09-08 22:10:55 +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 uio_hv_generic: Fix sysfs creation path for ring buffer 2025-05-02 13:59:02 +02:00
Kconfig Drivers: hv: Make CONFIG_HYPERV bool 2025-10-01 00:00:45 +00:00
Makefile Drivers: hv: Make CONFIG_HYPERV bool 2025-10-01 00:00:45 +00:00
mshv.h mshv: Use common "entry virt" APIs to do work in root before running guest 2025-09-30 22:50:48 +00:00
mshv_common.c mshv: Use common "entry virt" APIs to do work in root before running guest 2025-09-30 22:50:48 +00:00
mshv_eventfd.c ARM: 2025-07-30 17:14:01 -07:00
mshv_eventfd.h Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs 2025-03-21 18:24:22 +00:00
mshv_irq.c Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs 2025-03-21 18:24:22 +00:00
mshv_portid_table.c Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs 2025-03-21 18:24:22 +00:00
mshv_root.h Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs 2025-03-21 18:24:22 +00:00
mshv_root_hv_call.c Drivers: hv: Fix warnings for missing export.h header inclusion 2025-07-09 23:43:52 +00:00
mshv_root_main.c mshv: Fix create memory region overlap check 2025-12-18 14:03:02 +01:00
mshv_synic.c Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs 2025-03-21 18:24:22 +00:00
ring_buffer.c Drivers: hv: Fix warnings for missing export.h header inclusion 2025-07-09 23:43:52 +00:00
vmbus_drv.c Drivers: hv: vmbus: Fix typos in vmbus_drv.c 2025-09-30 23:31:00 +00:00