From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Roman Kisel <romank@linux.microsoft.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org, Wei Liu <wei.liu@kernel.org>,
Michael Kelley <mhklinux@outlook.com>
Subject: drivers/hv/hv_common.c:242 hv_kmsg_dump() error: uninitialized symbol 'bytes_written'.
Date: Wed, 17 Dec 2025 16:23:38 +0300 [thread overview]
Message-ID: <202512172102.OcUspn1Z-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ea1013c1539270e372fc99854bc6e4d94eaeff66
commit: f41ceff1748612b9e1538becc13dc2f1617d9d14 Drivers: hv: Enable VTL mode for arm64
date: 7 months ago
config: arm64-randconfig-r072-20251216 (https://download.01.org/0day-ci/archive/20251217/202512172102.OcUspn1Z-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202512172102.OcUspn1Z-lkp@intel.com/
smatch warnings:
drivers/hv/hv_common.c:242 hv_kmsg_dump() error: uninitialized symbol 'bytes_written'.
vim +/bytes_written +242 drivers/hv/hv_common.c
9c318a1d9b5000 Long Li 2023-04-20 225 static void hv_kmsg_dump(struct kmsg_dumper *dumper,
e1a261ba599eec Jocelyn Falempe 2024-07-02 226 struct kmsg_dump_detail *detail)
9c318a1d9b5000 Long Li 2023-04-20 227 {
9c318a1d9b5000 Long Li 2023-04-20 228 struct kmsg_dump_iter iter;
9c318a1d9b5000 Long Li 2023-04-20 229 size_t bytes_written;
9c318a1d9b5000 Long Li 2023-04-20 230
9c318a1d9b5000 Long Li 2023-04-20 231 /* We are only interested in panics. */
e1a261ba599eec Jocelyn Falempe 2024-07-02 232 if (detail->reason != KMSG_DUMP_PANIC || !sysctl_record_panic_msg)
9c318a1d9b5000 Long Li 2023-04-20 233 return;
9c318a1d9b5000 Long Li 2023-04-20 234
9c318a1d9b5000 Long Li 2023-04-20 235 /*
9c318a1d9b5000 Long Li 2023-04-20 236 * Write dump contents to the page. No need to synchronize; panic should
9c318a1d9b5000 Long Li 2023-04-20 237 * be single-threaded.
9c318a1d9b5000 Long Li 2023-04-20 238 */
9c318a1d9b5000 Long Li 2023-04-20 239 kmsg_dump_rewind(&iter);
9c318a1d9b5000 Long Li 2023-04-20 240 kmsg_dump_get_buffer(&iter, false, hv_panic_page, HV_HYP_PAGE_SIZE,
9c318a1d9b5000 Long Li 2023-04-20 241 &bytes_written);
kmsg_dump_get_buffer() is a no-op if CONFIG_PRINTK is disabled.
9c318a1d9b5000 Long Li 2023-04-20 @242 if (!bytes_written)
^^^^^^^^^^^^^^
uninitialized.
9c318a1d9b5000 Long Li 2023-04-20 243 return;
9c318a1d9b5000 Long Li 2023-04-20 244 /*
9c318a1d9b5000 Long Li 2023-04-20 245 * P3 to contain the physical address of the panic page & P4 to
9c318a1d9b5000 Long Li 2023-04-20 246 * contain the size of the panic data in that page. Rest of the
9c318a1d9b5000 Long Li 2023-04-20 247 * registers are no-op when the NOTIFY_MSG flag is set.
9c318a1d9b5000 Long Li 2023-04-20 248 */
0e3f7d120086c8 Nuno Das Neves 2024-02-20 249 hv_set_msr(HV_MSR_CRASH_P0, 0);
0e3f7d120086c8 Nuno Das Neves 2024-02-20 250 hv_set_msr(HV_MSR_CRASH_P1, 0);
0e3f7d120086c8 Nuno Das Neves 2024-02-20 251 hv_set_msr(HV_MSR_CRASH_P2, 0);
0e3f7d120086c8 Nuno Das Neves 2024-02-20 252 hv_set_msr(HV_MSR_CRASH_P3, virt_to_phys(hv_panic_page));
0e3f7d120086c8 Nuno Das Neves 2024-02-20 253 hv_set_msr(HV_MSR_CRASH_P4, bytes_written);
9c318a1d9b5000 Long Li 2023-04-20 254
9c318a1d9b5000 Long Li 2023-04-20 255 /*
9c318a1d9b5000 Long Li 2023-04-20 256 * Let Hyper-V know there is crash data available along with
9c318a1d9b5000 Long Li 2023-04-20 257 * the panic message.
9c318a1d9b5000 Long Li 2023-04-20 258 */
0e3f7d120086c8 Nuno Das Neves 2024-02-20 259 hv_set_msr(HV_MSR_CRASH_CTL,
9c318a1d9b5000 Long Li 2023-04-20 260 (HV_CRASH_CTL_CRASH_NOTIFY |
9c318a1d9b5000 Long Li 2023-04-20 261 HV_CRASH_CTL_CRASH_NOTIFY_MSG));
9c318a1d9b5000 Long Li 2023-04-20 262 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-12-17 13:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-17 13:23 Dan Carpenter [this message]
2025-12-19 5:01 ` Michael Kelley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202512172102.OcUspn1Z-lkp@intel.com \
--to=dan.carpenter@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mhklinux@outlook.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=romank@linux.microsoft.com \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®