Re: [PATCH v2] x86/boot/compressed: use boot_kstrtoul() for hugepages= parsing
From: Thorsten Blum
Date: Mon May 04 2026 - 06:31:32 EST
On Mon, May 04, 2026 at 12:14:39PM +0200, Borislav Petkov wrote:
> On Mon, Apr 27, 2026 at 10:17:58AM +0200, Thorsten Blum wrote:
> > Could you give this another look now that [1] is in mainline and 'val'
> > can no longer be NULL?
>
> I did but looking at arch/x86/boot/string.c - we have kstrtoull() - notice the
> two "ll" - there already because we copied it from kernel proper.
>
> So, I'm thinking you should rename it to boot_kstrtoull() in a pre-patch and
> then use it in kaslr.c.
>
> Right?
Keep in mind that max_gb_huge_pages is an unsigned long (not ull), so I
think boot_kstrtoul() is the better fit.
The last sentence in my commit message also mentions that
boot_kstrtoul() avoids casting the parsed value from ull to ul.
Thanks,
Thorsten