Linux Documentation
 help / color / mirror / Atom feed
From: "Pasha Tatashin" <pasha.tatashin@soleen.com>
To: "Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Pasha Tatashin" <pasha.tatashin@soleen.com>,
	"Pratyush Yadav" <pratyush@kernel.org>
Cc: "Alexander Graf" <graf@amazon.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Chen Pei" <cp0613@linux.alibaba.com>,
	"George Guo" <guodongtai@kylinos.cn>,
	"Kexin Liu" <liukexin@kylinos.cn>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Sourabh Jain" <sourabhjain@linux.ibm.com>,
	<kexec@lists.infradead.org>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH v3 1/5] kho: reject zero bootmem scale
Date: Thu, 12 Nov 2026 09:59:46 -0500	[thread overview]
Message-ID: <DMTBLFVSOEYG.K5WAQC5KN7IQ@soleen.com> (raw)
In-Reply-To: <20261112-kho-bootmem-sizing-v3-1-f0c8d00295d5@kernel.org>

On Thu Nov 12, 2026 at 5:38 AM EST, Mike Rapoport (Microsoft) wrote:
> kho_bootmem=0% sets bootmem_scale to 0, and then the bootmem areas are
> sized using the explicit sizes that default to 0. KHO remains enabled,
> but there is no usable bootmem to load the next kernel.
>
> Reject zero scale the same way zero explicit sizes are rejected.
>
> Fixes: 3dc92c311498 ("kexec: add Kexec HandOver (KHO) generation helpers")
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
>  kernel/liveupdate/kexec_handover.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
> index 6f1f55fe31819..b30ba686cb301 100644
> --- a/kernel/liveupdate/kexec_handover.c
> +++ b/kernel/liveupdate/kexec_handover.c
> @@ -703,16 +703,22 @@ static int __init kho_parse_bootmem_size(char *p)
>  	if (p[len - 1] == '%') {
>  		/* unsigned int max is 4,294,967,295, 10 chars */
>  		char s_scale[11] = {};
> +		unsigned int scale;
>  		int ret = 0;
>  
>  		if (len > ARRAY_SIZE(s_scale))
>  			return -EINVAL;
>  
>  		memcpy(s_scale, p, len - 1);
> -		ret = kstrtouint(s_scale, 10, &bootmem_scale);
> -		if (!ret)
> -			pr_notice("bootmem scale is %d%%\n", bootmem_scale);
> -		return ret;
> +		ret = kstrtouint(s_scale, 10, &scale);
> +		if (ret)
> +			return ret;
> +		if (!scale)
> +			return -EINVAL;
> +
> +		bootmem_scale = scale;
> +		pr_notice("bootmem scale is %d%%\n", bootmem_scale);
> +		return 0;

Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com> 

>  	}
>  
>  	/* parse ll[KMG],mm[KMG],nn[KMG] */





-- 
Pasha


  parent reply	other threads:[~2026-11-12 14:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 10:38 [PATCH v3 0/5] kho: fix bootmem sizing Mike Rapoport (Microsoft)
2026-11-12 10:38 ` [PATCH v3 1/5] kho: reject zero bootmem scale Mike Rapoport (Microsoft)
2026-11-12 13:30   ` Pratyush Yadav
2026-11-12 14:59   ` Pasha Tatashin [this message]
2026-11-12 10:38 ` [PATCH v3 2/5] kho: walk bootmem areas in address order Mike Rapoport (Microsoft)
2026-11-12 10:38 ` [PATCH v3 3/5] kho: skip zero-sized lowmem and global bootmem areas Mike Rapoport (Microsoft)
2026-11-12 10:38 ` [PATCH v3 4/5] kho: fix bootmem sizing Mike Rapoport (Microsoft)
2026-11-12 10:38 ` [PATCH v3 5/5] kho: docs: update description of bootmem regions Mike Rapoport (Microsoft)
2026-11-12 13:48   ` Pratyush Yadav
2026-11-12 15:00   ` Pasha Tatashin

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=DMTBLFVSOEYG.K5WAQC5KN7IQ@soleen.com \
    --to=pasha.tatashin@soleen.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=cp0613@linux.alibaba.com \
    --cc=graf@amazon.com \
    --cc=guodongtai@kylinos.cn \
    --cc=kexec@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liukexin@kylinos.cn \
    --cc=pratyush@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=sourabhjain@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox