Skip to content

Commit 32d495b

Browse files
committed
Revert "arm64/mm: Drop redundant BUG_ON(!pgtable_alloc)"
This reverts commit 9ed2b46. Nathan reports early boot failures bisected to this change which look related to the kPTI nG repainting. In any case, consolidating the BUG_ON()s to a single location needs more thought, so revert the change until this is figured out properly. Link: https://lore.kernel.org/r/[email protected] Reported-by: Nathan Chancellor <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 5b468da commit 32d495b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/arm64/mm/mmu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ static void alloc_init_cont_pte(pmd_t *pmdp, unsigned long addr,
207207

208208
if (flags & NO_EXEC_MAPPINGS)
209209
pmdval |= PMD_TABLE_PXN;
210+
BUG_ON(!pgtable_alloc);
210211
pte_phys = pgtable_alloc(PAGE_SHIFT);
211212
__pmd_populate(pmdp, pte_phys, pmdval);
212213
pmd = READ_ONCE(*pmdp);
@@ -284,6 +285,7 @@ static void alloc_init_cont_pmd(pud_t *pudp, unsigned long addr,
284285

285286
if (flags & NO_EXEC_MAPPINGS)
286287
pudval |= PUD_TABLE_PXN;
288+
BUG_ON(!pgtable_alloc);
287289
pmd_phys = pgtable_alloc(PMD_SHIFT);
288290
__pud_populate(pudp, pmd_phys, pudval);
289291
pud = READ_ONCE(*pudp);
@@ -322,6 +324,7 @@ static void alloc_init_pud(pgd_t *pgdp, unsigned long addr, unsigned long end,
322324

323325
if (flags & NO_EXEC_MAPPINGS)
324326
p4dval |= P4D_TABLE_PXN;
327+
BUG_ON(!pgtable_alloc);
325328
pud_phys = pgtable_alloc(PUD_SHIFT);
326329
__p4d_populate(p4dp, pud_phys, p4dval);
327330
p4d = READ_ONCE(*p4dp);
@@ -380,7 +383,6 @@ static void __create_pgd_mapping_locked(pgd_t *pgdir, phys_addr_t phys,
380383
phys &= PAGE_MASK;
381384
addr = virt & PAGE_MASK;
382385
end = PAGE_ALIGN(virt + size);
383-
BUG_ON(!pgtable_alloc);
384386

385387
do {
386388
next = pgd_addr_end(addr, end);

0 commit comments

Comments
 (0)