From: Pasha Tatashin <pasha.tatashin@soleen.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
kernel test robot <lkp@intel.com>
Subject: Re: [linux-next:master 4972/5926] kernel/kexec_handover_debug.c:16:18: error: use of undeclared identifier 'kho_scratch_cnt'
Date: Tue, 4 Nov 2025 12:50:49 -0500 [thread overview]
Message-ID: <CA+CK2bBnorfsTymKtv4rKvqGBHs=y=MjEMMRg_tE-RME6n-zUw@mail.gmail.com> (raw)
In-Reply-To: <CA+CK2bBYF5AndNHgqcb5zDbUOV04nE6xiZ0igcTdYf-GOU4aOQ@mail.gmail.com>
The fix looks like this:
diff --git a/kernel/kexec_handover.c b/kernel/kexec_handover.c
index de4466b47455..2a8c20c238a8 100644
--- a/kernel/kexec_handover.c
+++ b/kernel/kexec_handover.c
@@ -477,8 +477,8 @@ static void __init kho_mem_deserialize(const void *fdt)
* area for early allocations that happen before page allocator is
* initialized.
*/
-static struct kho_scratch *kho_scratch;
-static unsigned int kho_scratch_cnt;
+struct kho_scratch *kho_scratch;
+unsigned int kho_scratch_cnt;
/*
* The scratch areas are scaled by default as percent of memory allocated from
diff --git a/kernel/kexec_handover_internal.h b/kernel/kexec_handover_internal.h
index 05e9720ba7b9..3c3c7148ceed 100644
--- a/kernel/kexec_handover_internal.h
+++ b/kernel/kexec_handover_internal.h
@@ -2,8 +2,12 @@
#ifndef LINUX_KEXEC_HANDOVER_INTERNAL_H
#define LINUX_KEXEC_HANDOVER_INTERNAL_H
+#include <linux/kexec_handover.h>
#include <linux/types.h>
+extern struct kho_scratch *kho_scratch;
+extern unsigned int kho_scratch_cnt;
+
#ifdef CONFIG_KEXEC_HANDOVER_DEBUG
bool kho_scratch_overlap(phys_addr_t phys, size_t size);
#else
Andrew, Mike, do you want me to resend the "[PATCH v3 0/3] KHO: kfence
+ KHO memory corruption fix" series with the fix included?
On Tue, Nov 4, 2025 at 12:32 PM Pasha Tatashin
<pasha.tatashin@soleen.com> wrote:
>
> Eh, "kho: make debugfs interface optional" makes this variable external.
>
> Let me see how to fix this quickly.
>
> On Tue, Nov 4, 2025 at 10:38 AM Mike Rapoport <rppt@kernel.org> wrote:
> >
> > (adding Pasha)
> >
> > On Tue, Nov 04, 2025 at 10:48:31PM +0800, kernel test robot wrote:
> > > Hi Mike,
> > >
> > > First bad commit (maybe != root cause):
> > >
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > > head: 17490bd0527f59d841168457b245581f314b5fa0
> > > commit: 8c211175c3abcebb8bffce8095d78d193e482105 [4972/5926] liveupdate-kho-warn-and-fail-on-metadata-or-preserved-memory-in-scratch-area-fix
> > > config: x86_64-randconfig-071-20251104 (https://download.01.org/0day-ci/archive/20251104/202511042251.paO6f5BZ-lkp@intel.com/config)
> > > compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511042251.paO6f5BZ-lkp@intel.com/reproduce)
> > >
> > > 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>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202511042251.paO6f5BZ-lkp@intel.com/
> > >
> > > All errors (new ones prefixed by >>):
> > >
> > > >> kernel/kexec_handover_debug.c:16:18: error: use of undeclared identifier 'kho_scratch_cnt'
> > > 16 | for (i = 0; i < kho_scratch_cnt; i++) {
> > > | ^
> > > >> kernel/kexec_handover_debug.c:17:19: error: use of undeclared identifier 'kho_scratch'
> > > 17 | scratch_start = kho_scratch[i].addr;
> > > | ^
> > > kernel/kexec_handover_debug.c:18:17: error: use of undeclared identifier 'kho_scratch'
> > > 18 | scratch_end = kho_scratch[i].addr + kho_scratch[i].size;
> > > | ^
> > > kernel/kexec_handover_debug.c:18:39: error: use of undeclared identifier 'kho_scratch'
> > > 18 | scratch_end = kho_scratch[i].addr + kho_scratch[i].size;
> > > | ^
> > > 4 errors generated.
> > >
> > >
> > > vim +/kho_scratch_cnt +16 kernel/kexec_handover_debug.c
> > >
> > > 4039a00022d42a Pasha Tatashin 2025-10-20 10
> > > 4039a00022d42a Pasha Tatashin 2025-10-20 11 bool kho_scratch_overlap(phys_addr_t phys, size_t size)
> > > 4039a00022d42a Pasha Tatashin 2025-10-20 12 {
> > > 4039a00022d42a Pasha Tatashin 2025-10-20 13 phys_addr_t scratch_start, scratch_end;
> > > 4039a00022d42a Pasha Tatashin 2025-10-20 14 unsigned int i;
> > > 4039a00022d42a Pasha Tatashin 2025-10-20 15
> > > 4039a00022d42a Pasha Tatashin 2025-10-20 @16 for (i = 0; i < kho_scratch_cnt; i++) {
> > > 4039a00022d42a Pasha Tatashin 2025-10-20 @17 scratch_start = kho_scratch[i].addr;
> > >
> > > :::::: The code at line 16 was first introduced by commit
> > > :::::: 4039a00022d42ac3d68b2eea63066bc9f7ef89ce kho: warn and fail on metadata or preserved memory in scratch area
> > >
> > > :::::: TO: Pasha Tatashin <pasha.tatashin@soleen.com>
> > > :::::: CC: Andrew Morton <akpm@linux-foundation.org>
> > >
> > > --
> > > 0-DAY CI Kernel Test Service
> > > https://github.com/intel/lkp-tests/wiki
> >
> > --
> > Sincerely yours,
> > Mike.
next prev parent reply other threads:[~2025-11-04 17:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 14:48 kernel test robot
2025-11-04 15:38 ` Mike Rapoport
2025-11-04 17:32 ` Pasha Tatashin
2025-11-04 17:50 ` Pasha Tatashin [this message]
2025-11-04 22:15 ` Andrew Morton
2025-11-04 23:12 ` Pasha Tatashin
2025-11-04 23:54 ` Andrew Morton
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='CA+CK2bBnorfsTymKtv4rKvqGBHs=y=MjEMMRg_tE-RME6n-zUw@mail.gmail.com' \
--to=pasha.tatashin@soleen.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rppt@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