diff options
author | Will Deacon <will@kernel.org> | 2022-11-21 12:52:07 +0000 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2022-11-21 12:52:07 +0000 |
commit | 32d495b0c3305546f4773b9aafcd4e90188ddb9e (patch) | |
tree | 62c5d3d2559e19ced1f196ca522925b3c0a68790 /arch/arm64/mm | |
parent | 5b468dad6e5cf4998bdc05efbc5526c111666027 (diff) | |
download | linux-32d495b0c3305546f4773b9aafcd4e90188ddb9e.tar.gz linux-32d495b0c3305546f4773b9aafcd4e90188ddb9e.tar.bz2 linux-32d495b0c3305546f4773b9aafcd4e90188ddb9e.zip |
Revert "arm64/mm: Drop redundant BUG_ON(!pgtable_alloc)"
This reverts commit 9ed2b4616d4e846ece2a04cb5007ce1d1bd9e3f3.
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/Y3pS5fdZ3MdLZ00t@dev-arch.thelio-3990X
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r-- | arch/arm64/mm/mmu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 73a12b3abf82..d386033a074c 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -207,6 +207,7 @@ static void alloc_init_cont_pte(pmd_t *pmdp, unsigned long addr, if (flags & NO_EXEC_MAPPINGS) pmdval |= PMD_TABLE_PXN; + BUG_ON(!pgtable_alloc); pte_phys = pgtable_alloc(PAGE_SHIFT); __pmd_populate(pmdp, pte_phys, pmdval); pmd = READ_ONCE(*pmdp); @@ -284,6 +285,7 @@ static void alloc_init_cont_pmd(pud_t *pudp, unsigned long addr, if (flags & NO_EXEC_MAPPINGS) pudval |= PUD_TABLE_PXN; + BUG_ON(!pgtable_alloc); pmd_phys = pgtable_alloc(PMD_SHIFT); __pud_populate(pudp, pmd_phys, pudval); pud = READ_ONCE(*pudp); @@ -322,6 +324,7 @@ static void alloc_init_pud(pgd_t *pgdp, unsigned long addr, unsigned long end, if (flags & NO_EXEC_MAPPINGS) p4dval |= P4D_TABLE_PXN; + BUG_ON(!pgtable_alloc); pud_phys = pgtable_alloc(PUD_SHIFT); __p4d_populate(p4dp, pud_phys, p4dval); p4d = READ_ONCE(*p4dp); @@ -380,7 +383,6 @@ static void __create_pgd_mapping_locked(pgd_t *pgdir, phys_addr_t phys, phys &= PAGE_MASK; addr = virt & PAGE_MASK; end = PAGE_ALIGN(virt + size); - BUG_ON(!pgtable_alloc); do { next = pgd_addr_end(addr, end); |