linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: add BUILD_BUG_ON to check if fixmap range spans multiple pmds
@ 2021-10-20  5:49 quanyang.wang
  2021-10-24 21:44 ` Linus Walleij
  2021-10-31 18:12 ` kernel test robot
  0 siblings, 2 replies; 13+ messages in thread
From: quanyang.wang @ 2021-10-20  5:49 UTC (permalink / raw)
  To: Russell King, Linus Walleij, Thomas Gleixner, Ard Biesheuvel
  Cc: linux-arm-kernel, linux-kernel, Quanyang Wang

From: Quanyang Wang <quanyang.wang@windriver.com>

Not only the early fixmap range, but also the fixmap range should be
checked if it spans multiple pmds. When enabling CONFIG_DEBUG_HIGHMEM,
some systems which contain up to 16 CPUs will crash.

Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
---
 arch/arm/mm/mmu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index a4e0060051070..57eed92073a4a 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -369,6 +369,8 @@ void __init early_fixmap_init(void)
 	 */
 	BUILD_BUG_ON((__fix_to_virt(__end_of_early_ioremap_region) >> PMD_SHIFT)
 		     != FIXADDR_TOP >> PMD_SHIFT);
+	BUILD_BUG_ON((__fix_to_virt(__end_of_fixmap_region) >> PMD_SHIFT)
+		     != FIXADDR_TOP >> PMD_SHIFT);
 
 	pmd = fixmap_pmd(FIXADDR_TOP);
 	pmd_populate_kernel(&init_mm, pmd, bm_pte);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-10-31 18:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-20  5:49 [PATCH] ARM: add BUILD_BUG_ON to check if fixmap range spans multiple pmds quanyang.wang
2021-10-24 21:44 ` Linus Walleij
2021-10-25  6:38   ` Quanyang Wang
2021-10-26  8:59   ` Russell King (Oracle)
2021-10-26  9:53     ` Quanyang Wang
2021-10-26 10:12       ` Ard Biesheuvel
2021-10-26 10:38         ` Quanyang Wang
2021-10-26 10:54           ` Russell King (Oracle)
2021-10-26 10:56             ` Ard Biesheuvel
2021-10-26 11:15               ` Russell King (Oracle)
2021-10-26 11:26                 ` Ard Biesheuvel
2021-10-26 11:29                   ` Russell King (Oracle)
2021-10-31 18:12 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).