[PATCH 2/2] arm64/mm: Update create_kpti_ng_temp_pgd() to handle pgtable_alloc failure
Giorgi Tchankvetadze
giorgitchankvetadze1997 at gmail.com
Tue Aug 19 01:44:09 PDT 2025
Smart! BUG_ON() ends up in the generic “kernel bug” path, which on many
distros is configured to continue after printing the back-trace (e.g.
panic_on_oops=0).
Since a memory-allocation failure in early boot is unrecoverable , we
must force a halt.
On 8/19/2025 11:41 AM, David Hildenbrand wrote:
> On 13.08.25 16:56, Chaitanya S Prakash wrote:
>> create_kpti_ng_temp_pgd() was created as an alias for void returning
>> __create_pgd_mapping_locked() and relied on pgtable_alloc() to BUG_ON()
>> if an allocation failure occurred. But as __create_pgd_mapping_locked()
>> has been updated as a part of the error propagation patch to return a
>> non-void value, update create_kpti_ng_temp_pgd() to act as a wrapper
>> around __create_pgd_mapping_locked() and BUG_ON() on ret being a non
>> zero value.
>
> If my memory serves me right, panic() is preferred in such unexpected
> early-boot scenarios (BUG_ON is frowned upon), where you can actually
> print what is going wrong.
More information about the linux-arm-kernel
mailing list