From mboxrd@z Thu Jan 1 00:00:00 1970 From: hdegoede@redhat.com (Hans de Goede) Date: Sat, 09 May 2015 15:38:16 +0200 Subject: Memory size unaligned to section boundary In-Reply-To: <20150506113503.GT2067@n2100.arm.linux.org.uk> References: <20150506101104.GD2067@n2100.arm.linux.org.uk> <20150506105102.GB5382@e104818-lin.cambridge.arm.com> <20150506113503.GT2067@n2100.arm.linux.org.uk> Message-ID: <554E0DC8.4060401@redhat.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, On 06-05-15 13:35, Russell King - ARM Linux wrote: > On Wed, May 06, 2015 at 11:51:03AM +0100, Catalin Marinas wrote: >> On Wed, May 06, 2015 at 11:11:05AM +0100, Russell King - ARM Linux wrote: >>> @@ -1142,7 +1142,7 @@ void __init sanity_check_meminfo(void) >>> * last full section, which should be mapped. >>> */ >>> if (memblock_limit) >>> - memblock_limit = round_down(memblock_limit, SECTION_SIZE); >>> + memblock_limit = round_down(memblock_limit, 2 * SECTION_SIZE); >> >> Why not PMD_SIZE? We don't need 4MB round down with LPAE. > > No reason - PMD_SIZE would be good there. Ok, so does that mean that Mark's original patch: ---->8---- diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 4e6ef89..2ea13f0 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1125,9 +1125,9 @@ void __init sanity_check_meminfo(void) * occurs before any free memory is mapped. */ if (!memblock_limit) { - if (!IS_ALIGNED(block_start, SECTION_SIZE)) + if (!IS_ALIGNED(block_start, PMD_SIZE)) memblock_limit = block_start; - else if (!IS_ALIGNED(block_end, SECTION_SIZE)) + else if (!IS_ALIGNED(block_end, PMD_SIZE)) memblock_limit = arm_lowmem_limit; } @@ -1142,7 +1142,7 @@ void __init sanity_check_meminfo(void) * last full section, which should be mapped. */ if (memblock_limit) - memblock_limit = round_down(memblock_limit, SECTION_SIZE); + memblock_limit = round_down(memblock_limit, PMD_SIZE); if (!memblock_limit) memblock_limit = arm_lowmem_limit; Is good, or do we only need to have the last chunk of this patch ? Once I know what the final patch should look like I can give this a try on one of the systems which sparked this whole discussion. Regards, Hans