Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1050992pxu; Thu, 17 Dec 2020 00:30:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzFroJUVPBkQQ0Zzhkqdw1DjQ8zy963zQE/xpxtiuVe4LQOSdvYgZyeEJEEKylNkBIS+sb X-Received: by 2002:a17:907:20b5:: with SMTP id pw21mr1019519ejb.494.1608193816312; Thu, 17 Dec 2020 00:30:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608193816; cv=none; d=google.com; s=arc-20160816; b=kBJWIrmnhqslTMmgx6INFAHsF9fRpS3YGZk8R83V9fN/p8Bx76J5+vIq1UoM62y134 JfD+NkgREUOOAROEYmClE1lGz/Fj8Wxl5KJKZ0UepoeYxaH2/M8AQBKaW/IkwbX0ptxE k/9X8FAKrpc389t9snqPPUV85YHPiP6C6nVKn5XhOTA5Q7FFQnhtTLIcREIH3iyfYb7Q mpE/U0DdonGh1AxJn6ZbCvx73jxmt2gWB0iUM9VXREO6WvrVFE/xGL88jZSoZGJ3T5gY GXF4mRvpVuvIrzNMVdtFXu8aj1SDrcct9Lql75kv0VFdRk8iyXdj/bXhMuOaP5HZ40gE yXew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=/57bg0kKSKY7VpkWB3deSz3AUEJ6KL80o2rdlarcNdc=; b=JCUMEjXCJwM4X1eN15hvfAqG4Uz6vlqOOsUtIqJ63zttCIYVoax8mJItzkypjsyRoG Bl+DoCGqgbNlLCYxGSVMWF/8gHPpd39AC1YnMIYDx9OuOx6GlN57JDx/VbNEPQWiZi8l CmCC+ATKn07LbYb1Hjrd9LJ6vgmbyCtMOdT/aSVCstrG1n3wn5pGL/w+D5zbrU6bPn+Y Q1dsjLZm9PQCSZb3DBD8eMB4dZ2Rb1/VduSeTyXscovMt8F1UmnkK+YDtSuz1JPoxdPI EQlHZVlJ4jqigBd7T+EK/v7NcmzcWY32l6wNmpFiqD06GIduvk9tvKCbgWEMJkLZ+WVc t87w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I+KHhrtB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ho39si2292689ejc.745.2020.12.17.00.29.53; Thu, 17 Dec 2020 00:30:16 -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=pass header.i=@kernel.org header.s=k20201202 header.b=I+KHhrtB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727354AbgLQI2D (ORCPT + 99 others); Thu, 17 Dec 2020 03:28:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:44584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbgLQI2D (ORCPT ); Thu, 17 Dec 2020 03:28:03 -0500 Date: Thu, 17 Dec 2020 10:27:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608193642; bh=frpXPBgDVHFosWMul7jo1G7mud658hMgY0gDjD8FzmM=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=I+KHhrtBFQ9uN0v4rQDUWJEj9kiScJue0SpkR9fQkMH9UKQGlUABKYKefZtQ+bPjv 3V5k70FQljpXOTht4ob7nI6+AV3BBE6XgBpe73zONGlsqUNtyww7a9gqPGsgoX9Tw7 i2sYigy713Xw4EIQfA1Em1mwBHoXD3mAOQ8CfgB9soeWQgHE9mPQbe4wNzAGSm1q3c lr06/CQWkYksKnHiOfUZQhUJ87VdxY8WAg6A7w/AzrjdDUJJem8luZ+HP39EjE3u0f k32RgbCJz4SdDdXtFEHDmj0+krI96a+9D+wEVlOXoQqWnBEBbFxtnXtIwu41eJezH8 /HlnIE7BBm1Tg== From: Mike Rapoport To: Atish Patra Cc: linux-kernel@vger.kernel.org, Albert Ou , Andrew Morton , Anup Patel , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Bin Meng Subject: Re: [PATCH] RISC-V: Fix usage of memblock_enforce_memory_limit Message-ID: <20201217082714.GA366777@kernel.org> References: <20201217074855.1948743-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201217074855.1948743-1-atish.patra@wdc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 16, 2020 at 11:48:55PM -0800, Atish Patra wrote: > 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 Acked-by: Mike Rapoport > --- > 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 > -- Sincerely yours, Mike.