From: sashiko-bot@kernel.org
To: "Jose A. Perez de Azpillaga" <azpijr@gmail.com>,
"Mike Rapoport" <rppt@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Kees Cook" <kees@kernel.org>,
"Changyuan Lyu" <changyuanl@google.com>,
"Alexander Graf" <graf@amazon.com>
Cc: Tony Luck <tony.luck@intel.com>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
linux-mm@kvack.org, kexec@lists.infradead.org,
Pratyush Yadav <pratyush@kernel.org>
Subject: Re: [PATCH v2] memblock: don't allocate new reserve_mem regions on a KHO boot
Date: Thu, 05 Nov 2026 20:44:06 +0000 [thread overview]
Message-ID: <sashiko-outbox-200129@kernel.org> (raw)
In-Reply-To: <20261104204235.9066-1-azpijr@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] memblock: missing is_kho_boot() stub breaks tools/testing/memblock build
--
commit 19549caf363a437d6178ec835c2f8f9d0ecc7f1d
Author: Jose A. Perez de Azpillaga <azpijr@gmail.com>
memblock: don't allocate new reserve_mem regions on a KHO boot
This patch rejects allocating new reserve_mem regions during a KHO boot
when the region cannot be revived from the previous kernel, returning
-EOPNOTSUPP instead of allocating from KHO_NOPRSRV memory.
> diff --git a/mm/memblock.c b/mm/memblock.c
> index a450092a80fb5..e325e0542c9a8 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -2827,7 +2827,16 @@ static int __init reserve_mem(char *p)
> if (reserve_mem_kho_revive(name, size, align))
> return 1;
>
> - /* TODO: Allocation must be outside of KHO_NOPRSRV region */
> + /*
> + * On a KHO boot memblock only allocates from KHO_NOPRSRV memory here,
> + * which includes the bootmem the next kernel boots out of. Only regions
> + * handed over by the previous kernel are supported.
> + */
> + if (is_kho_boot()) {
> + pr_err("reserve_mem: can't allocate \"%s\" on a KHO boot\n", name);
> + return -EOPNOTSUPP;
> + }
[Severity: Low]
Does calling is_kho_boot() in reserve_mem() break the user-space memblock
test suite build in tools/testing/memblock?
When building tools/testing/memblock, mm/memblock.c is compiled with -I.
before -I../../include and without CONFIG_KEXEC_HANDOVER defined. As a
result, #include <linux/kexec_handover.h> resolves to the empty stub header
in tools/testing/memblock/linux/kexec_handover.h rather than
include/linux/kexec_handover.h:
tools/testing/memblock/linux/kexec_handover.h:
#ifndef LINUX_KEXEC_HANDOVER_H
#define LINUX_KEXEC_HANDOVER_H
/*
* Header stub to avoid test build breakage; we don't need to actually implement
* any KHO functions as they are not used in the tests.
*/
#endif /* LINUX_KEXEC_HANDOVER_H */
Other KHO helpers called unconditionally from mm/memblock.c, such as
kho_bootmem_overlap(), have stubs in tools/testing/memblock/internal.h:
tools/testing/memblock/internal.h:
static inline bool kho_bootmem_overlap(phys_addr_t phys, size_t size)
{
return false;
}
Should a stub for is_kho_boot() be added to tools/testing/memblock as well?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261104204235.9066-1-azpijr@gmail.com?part=1
WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Jose A. Perez de Azpillaga" <azpijr@gmail.com>,
"Mike Rapoport" <rppt@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Kees Cook" <kees@kernel.org>,
"Changyuan Lyu" <changyuanl@google.com>,
"Alexander Graf" <graf@amazon.com>
Cc: "Tony Luck" <tony.luck@intel.com>,
"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
linux-mm@kvack.org, "Pratyush Yadav" <pratyush@kernel.org>,
"Pasha Tatashin" <pasha.tatashin@soleen.com>,
kexec@lists.infradead.org
Subject: Re: [PATCH v2] memblock: don't allocate new reserve_mem regions on a KHO boot
Date: Thu, 05 Nov 2026 20:44:06 +0000 [thread overview]
Message-ID: <sashiko-outbox-200129@kernel.org> (raw)
In-Reply-To: <20261104204235.9066-1-azpijr@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] memblock: missing is_kho_boot() stub breaks tools/testing/memblock build
--
commit 19549caf363a437d6178ec835c2f8f9d0ecc7f1d
Author: Jose A. Perez de Azpillaga <azpijr@gmail.com>
memblock: don't allocate new reserve_mem regions on a KHO boot
This patch rejects allocating new reserve_mem regions during a KHO boot
when the region cannot be revived from the previous kernel, returning
-EOPNOTSUPP instead of allocating from KHO_NOPRSRV memory.
> diff --git a/mm/memblock.c b/mm/memblock.c
> index a450092a80fb5..e325e0542c9a8 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -2827,7 +2827,16 @@ static int __init reserve_mem(char *p)
> if (reserve_mem_kho_revive(name, size, align))
> return 1;
>
> - /* TODO: Allocation must be outside of KHO_NOPRSRV region */
> + /*
> + * On a KHO boot memblock only allocates from KHO_NOPRSRV memory here,
> + * which includes the bootmem the next kernel boots out of. Only regions
> + * handed over by the previous kernel are supported.
> + */
> + if (is_kho_boot()) {
> + pr_err("reserve_mem: can't allocate \"%s\" on a KHO boot\n", name);
> + return -EOPNOTSUPP;
> + }
[Severity: Low]
Does calling is_kho_boot() in reserve_mem() break the user-space memblock
test suite build in tools/testing/memblock?
When building tools/testing/memblock, mm/memblock.c is compiled with -I.
before -I../../include and without CONFIG_KEXEC_HANDOVER defined. As a
result, #include <linux/kexec_handover.h> resolves to the empty stub header
in tools/testing/memblock/linux/kexec_handover.h rather than
include/linux/kexec_handover.h:
tools/testing/memblock/linux/kexec_handover.h:
#ifndef LINUX_KEXEC_HANDOVER_H
#define LINUX_KEXEC_HANDOVER_H
/*
* Header stub to avoid test build breakage; we don't need to actually implement
* any KHO functions as they are not used in the tests.
*/
#endif /* LINUX_KEXEC_HANDOVER_H */
Other KHO helpers called unconditionally from mm/memblock.c, such as
kho_bootmem_overlap(), have stubs in tools/testing/memblock/internal.h:
tools/testing/memblock/internal.h:
static inline bool kho_bootmem_overlap(phys_addr_t phys, size_t size)
{
return false;
}
Should a stub for is_kho_boot() be added to tools/testing/memblock as well?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261104204235.9066-1-azpijr@gmail.com?part=1
next prev parent reply other threads:[~2026-11-05 20:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 20:42 [PATCH v2] memblock: don't allocate new reserve_mem regions on a KHO boot Jose A. Perez de Azpillaga
2026-11-04 20:42 ` Jose A. Perez de Azpillaga
2026-11-05 2:28 ` Pasha Tatashin
2026-11-05 2:28 ` Pasha Tatashin
2026-11-05 7:59 ` Mike Rapoport
2026-11-05 7:59 ` Mike Rapoport
2026-11-05 11:56 ` Jose A. Perez de Azpillaga
2026-11-05 11:56 ` Jose A. Perez de Azpillaga
2026-11-05 20:44 ` sashiko-bot [this message]
2026-11-05 20:44 ` sashiko-bot
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=sashiko-outbox-200129@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=azpijr@gmail.com \
--cc=changyuanl@google.com \
--cc=graf@amazon.com \
--cc=kees@kernel.org \
--cc=kexec@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rppt@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tony.luck@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.