Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1453834imu; Sat, 12 Jan 2019 00:18:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN7IoZGhUFsyloU5KrpypL+4Ux0gFKYieIhJhykMcWDW4sMAKBdRECsBBfsz/IgCSt94fyPK X-Received: by 2002:a63:b649:: with SMTP id v9mr16204608pgt.436.1547281084661; Sat, 12 Jan 2019 00:18:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547281084; cv=none; d=google.com; s=arc-20160816; b=bJrFbDZh32z7KwwgP+R4bvmA7+ErlEMC2SlrspMeaSrLaWHwarrfCiIY0RBTBA6UEL LlsUUIpRZxtk6Ktoq/EOSkI9Z7Gfc/tlLffOyQ+O8J//PPbwAVVAXNdyNSv6vxkOWJKF hXtoXwT5rw/kqodpG2aolyWAHHmrT/TbIav/gYT5aSzs+Pd3mCl2Ud7cfPxs2kfOIey1 c+VtdxXaAEqoNtuyE8iWuE+xFw11CnsDMcIV6KiotTydYMFwv+AlXPfedQoGtAKG9Z06 8YlCDaIy/7DqRMEXVu1pLPknB+KTSNtZhiVkBYanvhfRPyD+O3hKOIwbxCRR0PPEN+Ps DEVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=ZUaoX4XZsho0WAoEoEL4dXXYsXZw/HSWu+Bq2twuXEc=; b=pm2itz7PyhOX/YtDb1wjzB98KzposT4YpqzG0vpwCuF6YK3aggBFZFKr2bakoq19sM 7vGKU0r8+gBS0V8SQlsGeTF9GmaxWOkeC5s0LPZYjXsF3WSkYfpIPjvUm6oSNv0sGuz/ UF1BgEq8qVdaMkTj/vmg2/6/AHlGrMJy1Cc83fiaGfzlkClnw/qgFGVNrqmezUIk1yPi wVVYmYz2hIusnk/FLJlVGJmWwerrgcZj6gGMcsfopzSMdRYW/ptGwbA9saGPD+SlJ1q+ 5+mJCupmSSz8IPB/JIzyb1WUsMNAAzVhtD5paM46CrfgQ18RUtBLXhFnoApSZzbLduuX A3xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tCGRExQm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si23450753pld.249.2019.01.12.00.17.46; Sat, 12 Jan 2019 00:18:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tCGRExQm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725852AbfALIQg (ORCPT + 99 others); Sat, 12 Jan 2019 03:16:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:52530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725816AbfALIQg (ORCPT ); Sat, 12 Jan 2019 03:16:36 -0500 Received: from localhost.localdomain (unknown [115.192.188.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4D21D2086C; Sat, 12 Jan 2019 08:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547280996; bh=MRJzkrosj38Z55pRXmQuVWQuvmzgOFyBj+f0xMV3Vec=; h=From:To:Cc:Subject:Date:From; b=tCGRExQmfamGllgyCc1SAGCamRmHe22wWhdsCZt/FgWjaaUgSLdN9VHDb1ed61ORP myMLwUaKOoqBCr1oCPlbG2UOwk6uJOmoZP9/dujsQtMEVrxgBgR8qE5RgjagaqJDzI 5cmza9VaWY3/6AW5OgmtebN+wWC+7782jDLDSDAA= From: guoren@kernel.org To: palmer@sifive.com, aou@eecs.berkeley.edu Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Guo Ren , Mao Han Subject: [PATCH] riscv: fixup max_low_pfn with PFN_DOWN. Date: Sat, 12 Jan 2019 16:16:27 +0800 Message-Id: <1547280987-7630-1-git-send-email-guoren@kernel.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren max_low_pfn should be pfn_size not byte_size. Signed-off-by: Guo Ren Signed-off-by: Mao Han Cc: Palmer Dabbelt Cc: Albert Ou --- arch/riscv/kernel/setup.c | 2 +- arch/riscv/mm/init.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index fc8006a..5463e67 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -174,7 +174,7 @@ static void __init setup_bootmem(void) BUG_ON(mem_size == 0); set_max_mapnr(PFN_DOWN(mem_size)); - max_low_pfn = memblock_end_of_DRAM(); + max_low_pfn = PFN_DOWN(memblock_end_of_DRAM()); #ifdef CONFIG_BLK_DEV_INITRD setup_initrd(); diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 1d9bfaf..658ebf6 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -28,7 +28,8 @@ static void __init zone_sizes_init(void) unsigned long max_zone_pfns[MAX_NR_ZONES] = { 0, }; #ifdef CONFIG_ZONE_DMA32 - max_zone_pfns[ZONE_DMA32] = PFN_DOWN(min(4UL * SZ_1G, max_low_pfn)); + max_zone_pfns[ZONE_DMA32] = PFN_DOWN(min(4UL * SZ_1G, + (unsigned long) PFN_PHYS(max_low_pfn))); #endif max_zone_pfns[ZONE_NORMAL] = max_low_pfn; -- 2.7.4