Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1557222

[PATCH] powerpc/mm: fix a hardcode on memory boundary checking

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Rui Teng <rui.teng@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH] powerpc/mm: fix a hardcode on memory boundary checking
Date Thu, 12 Jan 2017 10:20:01 +0100
Message-ID <sYJI5-2bd-3@gated-at.bofh.it> (permalink)
X-Original-To Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
X-Mailer git-send-email 2.9.0
X-Tm-As-Gconf 00
X-Content-Scanned Fidelis XPS MAILER
X-Cbid 17011209-0012-0000-0000-000012EE51FD
X-Ibm-Spammodules-Versions BY=3.00006419; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000199; SDB=6.00806540; UDB=6.00392504; IPR=6.00583872; BA=6.00005049; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013901; XFM=3.00000011; UTC=2017-01-12 09:09:52
X-Ibm-Av-Detection SAVI=unused REMOTE=unused XFE=unused
X-Cbparentid 17011209-0013-0000-0000-00004A0CFC26
X-Proofpoint-Virus-Version vendor=fsecure engine=2.50.10432:,, definitions=2017-01-12_06:,, signatures=0
X-Proofpoint-Spam-Details rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701120124
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 24
Organization linux.* mail to news gateway
X-Original-Cc "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>, Boqun Feng <boqun.feng@gmail.com>, jia he <hejianet@linux.vnet.ibm.com>, Rui Teng <rui.teng@linux.vnet.ibm.com>
X-Original-Date Thu, 12 Jan 2017 17:09:06 +0800
X-Original-Message-ID <20170112090906.17864-1-rui.teng@linux.vnet.ibm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1557222

Show key headers only | View raw


The offset of hugepage block will not be 16G, if the expected
page is more than one. Calculate the totol size instead of the
hardcode value.

Signed-off-by: Rui Teng <rui.teng@linux.vnet.ibm.com>
---
 arch/powerpc/mm/hash_utils_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 8033493..b829f8e 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -506,7 +506,7 @@ static int __init htab_dt_scan_hugepage_blocks(unsigned long node,
 	printk(KERN_INFO "Huge page(16GB) memory: "
 			"addr = 0x%lX size = 0x%lX pages = %d\n",
 			phys_addr, block_size, expected_pages);
-	if (phys_addr + (16 * GB) <= memblock_end_of_DRAM()) {
+	if (phys_addr + block_size * expected_pages <= memblock_end_of_DRAM()) {
 		memblock_reserve(phys_addr, block_size * expected_pages);
 		add_gpage(phys_addr, block_size, expected_pages);
 	}
-- 
2.9.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] powerpc/mm: fix a hardcode on memory boundary checking Rui Teng <rui.teng@linux.vnet.ibm.com> - 2017-01-12 10:20 +0100

csiph-web