> Extract the elfcorehdr extra space calculation from powerpc into a
> generic helper crash_extra_elfcorehdr_size() for use by other
> architectures like arm64.
> 
> Strengthen the original powerpc check: instead of only checking
> the loose CONFIG_CRASH_MAX_MEMORY_RANGES, the new helper enforces
> a strict compile-time BUILD_BUG_ON() to guarantee that the absolute
> maximum theoretical number of ELF Program Headers will never exceed
> the ELF physical limit of PN_XNUM. This ensures absolute safety across
> all architectures with zero runtime overhead.
> 
> The helper also provides a zero-size stub when crash memory hotplug
> is disabled.
> 
> Cc: Madhavan Srinivasan <[email protected]>
> Cc: Michael Ellerman <[email protected]>
> Cc: Nicholas Piggin <[email protected]>
> Cc: "Christophe Leroy (CS GROUP)" <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Cc: Baoquan He <[email protected]>
> Cc: Mike Rapoport <[email protected]>
> Cc: Pasha Tatashin <[email protected]>
> Cc: Pratyush Yadav <[email protected]>
> Cc: Dave Young <[email protected]>
> Cc: Sourabh Jain <[email protected]>
> Signed-off-by: Jinjie Ruan <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=15


Reply via email to