From patchwork Thu Jun 25 23:45:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 11626989 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A7E392A for ; Fri, 26 Jun 2020 09:52:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E54F21531 for ; Fri, 26 Jun 2020 09:52:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="m/QO4nGp"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="aYrU/9rV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E54F21531 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=R/zBLKP2v4SY491xWJsmzYgtLRUy0G+uifOUnL4DL4M=; b=m/QO4nGpfSMEH4lZu3s79FU/H ID/BNtQsuDxqGmoyfOiNBGcP7dOGPOUHLwohosdtGlRLuGEfoOOu5b1M2wXkaK39bKXkKvkV7mj2R FYLrWJBO0UtlOfUvGxTgfitSZTlB+RHr8premp7Y9riYU9tGZ8ktAgy03UThIVa6RwHXTLxK/jUid 6KalAezTcgAFz+fujsW6CZwx0dtvR7hQ/Ewh3mcGL75ybAn4J8mFMIxVT84YxYusB4Ti0Bix9XfHw LKdKOk0SNt5yCS5xVEzzPOj1dg2mh1JLJA+0ZiFnIx+KhAVRZKrfF7uWEMAD2EKyqWskE3y6UVaNK w+Geu03jA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jol09-0002ih-SY; Fri, 26 Jun 2020 09:50:29 +0000 Received: from esa2.hgst.iphmx.com ([68.232.143.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jojmT-0002Se-Ct; Fri, 26 Jun 2020 08:32:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1593160339; x=1624696339; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e1f5tFToh6jF2Fr3c6Bri7MNiVrYpT85jVmyBw2a1o8=; b=aYrU/9rVZ0hMu3SpQhDlPaMyd0HDaP21YSDlQnEwjzR+Yt13uj074FEj KPy2tX8bO91EX5nu18k9vDULWZLEbA+TFoa2roe1R/OEFydNWnxIYcl6r XYlHIrC/AMuJ+S5uXmSxq773XYjigZrdcNRKjmikSHwQKsbCczQ6eg5+/ Mz+6QDrxHqj5LuZh6xC2pWIlNHU5VVba/KB5JNQYv2Wn7Bnew+KMum1Nu 3rPzTRR1DE8WLMhnAeDqP2vRQLb4wKOmiYTSs79pkpRN/UU2EqpdCpIqn Q1o9E5s/DglC2GlBdTwSdWwSbqDqY5X4zBJeEx3BQAEKl8LWbhq9KgO/A Q==; IronPort-SDR: 3C45ie6KGoNNXNnAoh5a7V/Qm+JMg4g+69iGD36qD9Hj50c4lV7LAJURzN+btR3YgZCwulh0bm H8LspNpCeNla9qLonXtAGI0O3UJ89+tiNcWjtOK8Fvp8/A3P4wMHTRuFAFDPbL4wYDkNhhU1Jk 7wBUgxAs+Czlzke7O7YCRwCA0DPdVBLRs7RxOJtNMrt9uDlGPT4LlDj83g/XdtsOK+3XpQGF4l 6DL2+oycGkPKBrHOsxEBRikzkx2MM51FiKnhsduzeQ+jystN29rS+SGrHWZOO4ezmw34gZpIl6 RzY= X-IronPort-AV: E=Sophos;i="5.75,280,1589212800"; d="scan'208";a="243966117" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Jun 2020 07:45:58 +0800 IronPort-SDR: 1+rJeBaCAD2XncIQUuMdrCpHQ4Emw1o87TeREXaFO7oEOMvzaFGmTdyKiWsm7QT2aNUfFgoiIJ fhqzuCTAo6pJstegHJWT3Koz43/tr4LC4= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2020 16:34:26 -0700 IronPort-SDR: x27YsbO1KVXuwcO1coWKuCCOUz0CEkeOSTXMxHLCyjOMlyEdoh9s5hWmoxbaG9WTGee2GcC+DR DbQR7vLieVwg== WDCIronportException: Internal Received: from 2349pbt5e4f.ad.shared (HELO jedi-01.hgst.com) ([10.86.58.78]) by uls-op-cesaip01.wdc.com with ESMTP; 25 Jun 2020 16:45:26 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 05/11] RISC-V: Set maximum number of mapped pages correctly Date: Thu, 25 Jun 2020 16:45:10 -0700 Message-Id: <20200625234516.31406-6-atish.patra@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200625234516.31406-1-atish.patra@wdc.com> References: <20200625234516.31406-1-atish.patra@wdc.com> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.143.124 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-efi@vger.kernel.org, Heinrich Schuchardt , Masahiro Yamada , Atish Patra , Palmer Dabbelt , linux-riscv@lists.infradead.org, Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Currently, maximum number of mapper pages are set to the pfn calculated from the memblock size of the memblock containing kernel. This will work until that memblock spans the entire memory. However, it will be set to a wrong value if there are multiple memblocks defined in kernel (e.g. with efi runtime services). Set the the maximum value to the pfn calculated from dram size. Signed-off-by: Atish Patra --- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index bad60686d080..4021706aef81 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -147,9 +147,9 @@ void __init setup_bootmem(void) /* Reserve from the start of the kernel to the end of the kernel */ memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start); - set_max_mapnr(PFN_DOWN(mem_size)); max_pfn = PFN_DOWN(memblock_end_of_DRAM()); max_low_pfn = max_pfn; + set_max_mapnr(max_low_pfn); #ifdef CONFIG_BLK_DEV_INITRD setup_initrd();