Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kho: allow scratch areas with zero size

Patch series "kho: fixes and cleanups", v3.

These are small KHO and KHO test fixes and cleanups.


This patch (of 3):

Parsing of kho_scratch parameter treats zero size as an invalid value,
although it should be fine for user to request zero sized scratch area for
some types if scratch memory, when for example there is no need to create
scratch area in the low memory.

Treat zero as a valid value for a scratch area size but reject kho_scratch
parameter that defines no scratch memory at all.

Link: https://lkml.kernel.org/r/20250811082510.4154080-1-rppt@kernel.org
Link: https://lkml.kernel.org/r/20250811082510.4154080-2-rppt@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Changyuan Lyu <changyuanl@google.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Mike Rapoport (Microsoft) and committed by
Andrew Morton
be564840 ea5e101f

+6 -1
+6 -1
kernel/kexec_handover.c
··· 405 405 { 406 406 size_t len; 407 407 unsigned long sizes[3]; 408 + size_t total_size = 0; 408 409 int i; 409 410 410 411 if (!p) ··· 442 441 } 443 442 444 443 sizes[i] = memparse(p, &endp); 445 - if (!sizes[i] || endp == p) 444 + if (endp == p) 446 445 return -EINVAL; 447 446 p = endp; 447 + total_size += sizes[i]; 448 448 } 449 + 450 + if (!total_size) 451 + return -EINVAL; 449 452 450 453 scratch_size_lowmem = sizes[0]; 451 454 scratch_size_global = sizes[1];