lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1459844572-53069-2-git-send-email-puck.chen@hisilicon.com>
Date:	Tue, 5 Apr 2016 16:22:52 +0800
From:	Chen Feng <puck.chen@...ilicon.com>
To:	<catalin.marinas@....com>, <will.deacon@....com>,
	<ard.biesheuvel@...aro.org>, <mark.rutland@....com>,
	<akpm@...ux-foundation.org>, <robin.murphy@....com>,
	<linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <mhocko@...e.com>,
	<kirill.shutemov@...ux.intel.com>, <rientjes@...gle.com>,
	<linux-mm@...ck.org>
CC:	<puck.chen@...ilicon.com>, <puck.chen@...mail.com>,
	<oliver.fu@...ilicon.com>, <linuxarm@...wei.com>,
	<dan.zhao@...ilicon.com>, <suzhuangluan@...ilicon.com>,
	<yudongbin@...licon.com>, <albert.lubing@...ilicon.com>,
	<xuyiping@...ilicon.com>, <saberlily.xia@...ilicon.com>
Subject: [PATCH 2/2] arm64: mm: make pfn always valid with flat memory

Make the pfn always valid when using flat memory.
If the reserved memory is not align to memblock-size,
there will be holes in zone.

This patch makes the memory in buddy always in the
array of mem-map.

Signed-off-by: Chen Feng <puck.chen@...ilicon.com>
Signed-off-by: Fu Jun <oliver.fu@...ilicon.com>
---
 arch/arm64/mm/init.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index ea989d8..0e1d5b7 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -306,7 +306,8 @@ static void __init free_unused_memmap(void)
 	struct memblock_region *reg;
 
 	for_each_memblock(memory, reg) {
-		start = __phys_to_pfn(reg->base);
+		start = round_down(__phys_to_pfn(reg->base),
+				   MAX_ORDER_NR_PAGES);
 
 #ifdef CONFIG_SPARSEMEM
 		/*
@@ -327,8 +328,8 @@ static void __init free_unused_memmap(void)
 		 * memmap entries are valid from the bank end aligned to
 		 * MAX_ORDER_NR_PAGES.
 		 */
-		prev_end = ALIGN(__phys_to_pfn(reg->base + reg->size),
-				 MAX_ORDER_NR_PAGES);
+		prev_end = round_up(__phys_to_pfn(reg->base + reg->size),
+				    MAX_ORDER_NR_PAGES);
 	}
 
 #ifdef CONFIG_SPARSEMEM
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ