From 2dc97081b1982ffa5cd4234223e665efedb8af0c Mon Sep 17 00:00:00 2001 From: Zbigniew Bodek Date: Tue, 18 Apr 2017 10:25:59 +0000 Subject: [PATCH] Increase number of L2 tables required for kernel bootstrap Memory space reserved for pmap_kernel_l2dtable_kva and pmap_kernel_l2ptp_kva has not been taken into account in original code. All the memory reserved from kernel space by pmap_alloc_specials() function called in pmap_bootstrap() should be mapped initially by initarm(). To create initial mapping initarm() function reserves proper number of l2 page tables. However the number of the l2 page tables does not take into account memory for: pmap_kernel_l2ptp_kva, pmap_kernel_l2dtable_kva, crashdumpmap, etc. Submitted by: Grzegorz Bernacki Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: meloun-miracle-cz Differential revision: https://reviews.freebsd.org/D10217 --- sys/arm/arm/machdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index e1eed0a72f0a..1a90486e897e 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -814,9 +814,10 @@ initarm(struct arm_boot_params *abp) /* * Add one table for end of kernel map, one for stacks, msgbuf and - * L1 and L2 tables map and one for vectors map. + * L1 and L2 tables map, one for vectors map and two for + * l2 structures from pmap_bootstrap. */ - l2size += 3; + l2size += 5; /* Make it divisible by 4 */ l2size = (l2size + 3) & ~3;