Re: [PATCH 2/2] arm64/mm: Update create_kpti_ng_temp_pgd() to handle pgtable_alloc failure
From: Giorgi Tchankvetadze
Date: Tue Aug 19 2025 - 04:44:48 EST
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.