Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1032091pxu; Wed, 16 Dec 2020 23:51:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFrqRB2noZEQ7E4ig5j2KFbBKJ0fvTg6+8oDfbbVL16XmFb1nnxw4yKsyDe+P+rctCr+uO X-Received: by 2002:a17:906:59a:: with SMTP id 26mr9235451ejn.309.1608191459980; Wed, 16 Dec 2020 23:50:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608191459; cv=none; d=google.com; s=arc-20160816; b=nQgEucIPTTQvKOpc44sEnx3W8QBzlI+8wSnPVtn8fAdcKBSeHJJ/e17o4ZsT4Qt69x tDzc+lFNOryF8B0a1rf/L8c9hnL7FabbCR1x5UIHNkS1RHEESyBHKUT7Yvhy08OiB/GJ axpLP9kHZWR6eVpMazLuM/3cG9So1WLLXa44XUMYbp+oZ6qbr7V2r6iQZ0sGOsDY1gcM pGx+TWA78GQOE9NPRguIIfe0NF4NoC/TKmkKTo/MOKckw715ATBoh7hJVWSh5cptGgXV fepsvrbFoVcM9bP5AUUA2Oe4DC0S6tNTp2VnSFnV/64BlCF9IO6v8AFNz/VaIGQbO9cG LRkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:wdcironportexception :ironport-sdr:ironport-sdr:ironport-sdr:dkim-signature; bh=WHm4raP/Eu3PjH4gUEDAFOhTzYa3w15/+VBiksXtI30=; b=IFbx3Jyq2HWgMuBAccldAOJai/Ib25TK9iG2pBgBBTjUybuQdhdzAH56qgqRTMqTLL DCk3uVo/Ez8e887uqLdHKG0+Fs8qsUpa2FaqAhco2RId2athVxhJUmdSVtqdvuiOwI3O BSnvo+IgObYCFnPQZq5RWV15w+6IKpQDGz7+Arc8Cm69Me0NfuFXZgSSI9yX4YF5wuTJ uxPuWN7kH2ic1ALkDu8sSgHM5hCMuQxOsiex0MYohN7pQCt3o3HRt4DDW6dYPEzmiutX zLU/+GPPhWclSE9yUHYSpwgSO1iQ2lyIS0lOio0GYEVXXB6xQH/HSXszGWyfcTm6yHvh gYIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=R8dV6WAe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si3901130edq.488.2020.12.16.23.50.38; Wed, 16 Dec 2020 23:50:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=R8dV6WAe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727064AbgLQHuO (ORCPT + 99 others); Thu, 17 Dec 2020 02:50:14 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:36707 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726580AbgLQHuN (ORCPT ); Thu, 17 Dec 2020 02:50:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1608192296; x=1639728296; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=NTgNlYcb4X8fG4aPZr+pa6LHmqpavF30sDdmLy52hbs=; b=R8dV6WAen7xRJOi6SCV6vQjrfc4746XfKpvXvfEPSQA/p0P9yd1QW16L hHAlUug2WpYC0pdwfqAFk5GwWArvDOU9FEBCvOHs45c7BOD22sLlXmfaE NVqMFNt6g9zgNZsfpR/SpyYgef/JGoUuOLF2p4tpyIZAaF5wV5rVuZyDK wagLZywkhgdcc6AdN/JjMsCTGAdGH9sdoyDDbMmVPwgpqTqXrcWb7VXNd cgAM6J9rAi5sCra98bj/JPgdZXg41+QxeLh8omVPUFBPWEqWZpDz2u7eg agFRmWyw3EZmGoEzP9Bg+mUKWJRh/SyfZLTxf+8UZPA8TL2Je8IicNTxl w==; IronPort-SDR: 1WUCqLYQVxAg8m70SqWWbbh9jz6JUHEJaaHGFZ6tPlsaK+y6cUgpF7ZqFD59fGFDXSxvfxT7Q2 uS9w6wTcWTfl0adKTxwUp58NfE/qHOnTSQmkb8sjIrJkik78F0vbAO/oQCmgiHkFo4mh0hXIk0 UjBfYB/+XqgTytZ1LYAJk3umxPlDoUe8xSiIjnawErZzyDQDPgHEDwWa4snlrmfJyb0xcB5Ljj cyI60+VZ1SgpilneO4fCtH5Che8Poqt0a4C6IEr+vZyNHu1FCihcECxFCMVbBGRuSYE/CbYJLY S0Y= X-IronPort-AV: E=Sophos;i="5.78,426,1599494400"; d="scan'208";a="259133053" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 17 Dec 2020 16:03:17 +0800 IronPort-SDR: KusFkVtUrBeOkbQCfGsuK65tNZZq9PYt8qjy5/1g7bJkYDdcuYvwqe/OZEgD0Bg+/GnGwdLtey Tp/nbrcvPTf5c7YgqlbIH7hcMulBKObA2I1dAwTTroqVMvsjkBKMItv3H6NRVO0rife8KQ1nfN E/vkgvHP43myN2Dw8loM9efu38htFr/6WhvQ87TN8O2RMbFTgPodWssdwMeej7c7XYVZUwC4xC J8WQpTwZTBTcA+A2iQFBTQLoFoMaC/4f7qayPk4sWiPD9qTdrQG5UWT6MmXRzYrshch7ZgmfcZ ZpUUbYbNzpFFqf2agw//sZj9 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; 16 Dec 2020 23:34:24 -0800 IronPort-SDR: h8HJiAirRgl6kkJenUcBB/tbrwZLlJ5vg/aqhDFN15CCUoqRbnRFkm9gi5bzLwQWTJ/qpRSNUF KZer3wH1ESeR6r986rC/fTXlCT7pxY3xd8zvwoNpEF9py0y74YyBkS9i9Q3RVgnwOq9lcek1mv OGIe/2QaA/xYqQtxCw+ZrKcd7hSjthbiEiICCznwS84SAFnfwCFK3vamSD1hZsaFD+ZRUnVdAI nDaJElXmFxgD1DEj+s8ki4h7w0Hnh+p6UT0A4dc2p6tenQmdZB0IM3EwhIkrGBKUQeKH4TP0HT tnY= WDCIronportException: Internal Received: from kelly-s-lt.ad.shared (HELO jedi-01.hgst.com) ([10.86.62.43]) by uls-op-cesaip01.wdc.com with ESMTP; 16 Dec 2020 23:49:07 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Albert Ou , Andrew Morton , Anup Patel , linux-riscv@lists.infradead.org, Mike Rapoport , Palmer Dabbelt , Paul Walmsley , Bin Meng Subject: [PATCH] RISC-V: Fix usage of memblock_enforce_memory_limit Date: Wed, 16 Dec 2020 23:48:55 -0800 Message-Id: <20201217074855.1948743-1-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org memblock_enforce_memory_limit accepts the maximum memory size not the last address. Fix the function invocation correctly. Fixes: 1bd14a66ee52 ("RISC-V: Remove any memblock representing unusable memory area") 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 8e577f14f120..e4133c20744c 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -174,7 +174,7 @@ void __init setup_bootmem(void) * Make sure that any memory beyond mem_start + (-PAGE_OFFSET) is removed * as it is unusable by kernel. */ - memblock_enforce_memory_limit(mem_start - PAGE_OFFSET); + memblock_enforce_memory_limit(-PAGE_OFFSET); /* Reserve from the start of the kernel to the end of the kernel */ memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start); -- 2.25.1