From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC4BCC433E0 for ; Tue, 22 Dec 2020 05:03:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8905122518 for ; Tue, 22 Dec 2020 05:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725856AbgLVFDc (ORCPT ); Tue, 22 Dec 2020 00:03:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgLVFDc (ORCPT ); Tue, 22 Dec 2020 00:03:32 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E837AC0613D6 for ; Mon, 21 Dec 2020 21:02:51 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id x12so6798182plr.10 for ; Mon, 21 Dec 2020 21:02:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=RpZ+wXfl2QotbYqPhv72PU/yTVx45uHY6nTFy9x2zvA=; b=ALTnk7siuh07+b8/NS2YbaHb6lJA8nhq8iRcs3VOa76aaRGvdEuQn6i+3bs5kNbgBe +D2voammdOWr66fe4oikCX1fCEvd9h8EUfX9HZQMv5er7CrIQN4J5ZjkkiMsUWrfk6fV VI5CQOcExxe31qVzEGqeq3hCLZFi3z6Hu9+Ro1clfFqxMQbuv15DiMoWouT7vm9lzh3J Rgqd4Y08TfXC2mphKWhoYVfi/03gtpDUDw+gkV0GNBPFTourrXsWa/rvwL/5+cxWU55O wHB74H8I22nYDY/lLqtXyKuz6YwNRz8gNx3OdDniCiDVwgsgxjSmk9q2T37ui3v8Uc96 an5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=RpZ+wXfl2QotbYqPhv72PU/yTVx45uHY6nTFy9x2zvA=; b=LfOuXGFCfgDfXq7QRrVbBvBp2dNoL3SbGVEQOUaOJqGI9YJQQhOvJx187DN7xdCoW3 UdOooRBC/97WIXAtYluwlG9d0B0GQaKE0bIIX3pM7JTUDf/aHPw8fi+bc/zMMEccdbcZ 9WuazuJ8WZL2S9H7BLPSa9ifvbmZgvAjgGEQWCUdQfXPvQEPotYMF4itDY41Zd0pZw8c cIf/a9jEdTvql+bhYEd1MR6AyT2nC1mXDITDLKwhiSq6gxgL7F1znVg+C8ufMLq09Gf+ VrMaUtdpAFu5xv77thc5NtjJr3mZjgzVq21Y2bHCWaFt08l1K8ezfdL5537uoT2Q7B3d Ne+Q== X-Gm-Message-State: AOAM5328m6Ko6g+ZnYTAOzzRDXVkBKCi/pHEqFZ7a7qEnJI+H+Xm8y+z UfTm2jNEJj18Zg2K6QLk4nH6vgzsCu0FC0wn X-Google-Smtp-Source: ABdhPJxd/u78GqOJhoWzNph+XNE99fMyFxboDZVhN/a3J6FYMOa7bgl3N+Fcj7B8erZv7k6geDrFwg== X-Received: by 2002:a17:90a:e001:: with SMTP id u1mr18321209pjy.3.1608613371225; Mon, 21 Dec 2020 21:02:51 -0800 (PST) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id l190sm18292642pfl.205.2020.12.21.21.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Dec 2020 21:02:50 -0800 (PST) Date: Mon, 21 Dec 2020 21:02:50 -0800 (PST) X-Google-Original-Date: Mon, 21 Dec 2020 21:02:48 PST (-0800) Subject: Re: [PATCH v2] RISC-V: Fix usage of memblock_enforce_memory_limit In-Reply-To: <20201219001356.2887782-1-atish.patra@wdc.com> CC: linux-kernel@vger.kernel.org, Atish Patra , stable@vger.kernel.org, bin.meng@windriver.com, rppt@linux.ibm.com, aou@eecs.berkeley.edu, akpm@linux-foundation.org, Anup Patel , linux-riscv@lists.infradead.org, rppt@kernel.org, Paul Walmsley , bmeng.cn@gmail.com From: Palmer Dabbelt To: Atish Patra Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 18 Dec 2020 16:13:56 PST (-0800), Atish Patra wrote: > memblock_enforce_memory_limit accepts the maximum memory size not the > maximum address that can be handled by kernel. Fix the function invocation > accordingly. > > Fixes: 1bd14a66ee52 ("RISC-V: Remove any memblock representing unusable memory area") > Cc: stable@vger.kernel.org > > Reported-by: Bin Meng > Tested-by: Bin Meng > Acked-by: Mike Rapoport > Signed-off-by: Atish Patra > --- > Changes from v1->v2: > 1. Added stable-kernel in cc. > 2. Added reported/tested by tag. > --- > 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 13ba533f462b..bf5379135e39 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -176,7 +176,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); Thanks, this is on fixes. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE236C433E0 for ; Tue, 22 Dec 2020 05:03:02 +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 6E3D622518 for ; Tue, 22 Dec 2020 05:03:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E3D622518 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Mime-Version:Message-ID:To:From:In-Reply-To:Subject: Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References:List-Owner; bh=DjbnbSaY07KkaHYy2E9zXAiPEvhIAx4M370bSAkbgFk=; b=VQbMLM57Ft28UobUQVvBvV9e2 c3CW6Wjn0cdW4YIlwJb7Hazxt0Fp5GrHswxd2JBWI1OsLKVtccFwy405d1EszhabziUWTYjEOymkI QfIka+Pfly5S9bnQ5F6ZsXartc4ar9djqKLS1cEUXgGD0Si3XyE6QU62q2fzQqqD42Ns8O0z84WOn a2wK+mJ3cyDx1Vq1ClMQpbcU/GSKteLMeJQZRIuRXxgkvzkJNTpg1olIFuUgQXZKgH4i3lYYop25V 0upJ0RalmVSm+z6WnlK6TOJi8SJDEhv2m9cW7zAsQRQSBAYYfjM8nKiqp7DIBf3UG4JzAb6i05adV nQKUfRQmg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krZp1-0000gj-KK; Tue, 22 Dec 2020 05:02:55 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krZoz-0000g6-J2 for linux-riscv@lists.infradead.org; Tue, 22 Dec 2020 05:02:54 +0000 Received: by mail-pl1-x635.google.com with SMTP id t6so6826994plq.1 for ; Mon, 21 Dec 2020 21:02:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=RpZ+wXfl2QotbYqPhv72PU/yTVx45uHY6nTFy9x2zvA=; b=ALTnk7siuh07+b8/NS2YbaHb6lJA8nhq8iRcs3VOa76aaRGvdEuQn6i+3bs5kNbgBe +D2voammdOWr66fe4oikCX1fCEvd9h8EUfX9HZQMv5er7CrIQN4J5ZjkkiMsUWrfk6fV VI5CQOcExxe31qVzEGqeq3hCLZFi3z6Hu9+Ro1clfFqxMQbuv15DiMoWouT7vm9lzh3J Rgqd4Y08TfXC2mphKWhoYVfi/03gtpDUDw+gkV0GNBPFTourrXsWa/rvwL/5+cxWU55O wHB74H8I22nYDY/lLqtXyKuz6YwNRz8gNx3OdDniCiDVwgsgxjSmk9q2T37ui3v8Uc96 an5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=RpZ+wXfl2QotbYqPhv72PU/yTVx45uHY6nTFy9x2zvA=; b=gg9rZ8s7HTdGTXhcdyxHjWg0Pq1w7gXFAsAVPjSpGgmSM4FS7zuaP7vmJqRT49ZDO7 q4AnE4DQpnrXXBe98H/YJAaY4t1CJLJKRH8ePxwxaWBSh0j79yc0COiKlqVRWmMnRhwx e1GdeIeqRnEm2DIHZylPLM2cdyqNS/fctaiBet1yRkM0zQjWI0zOceOvBF3ZYtU3D+L/ Mp/P3L6ICgrb51DQCQ4nP7EAPXBt4XyTF8lkP0IM6QAB9eX3LxxL/G1NWnPY7UMYuwGp 5xuHQNXMsZU4lHf50wDXSzE0uqmmVfT80i/Ku2hvZPX2MpiQwh9xqdffTfWo0uftutPr 4xmw== X-Gm-Message-State: AOAM533yFQDPhmcGq705BgO40qsiveyrzvsXObkhYQiL86VYNS1Ywrar tGu1OVrFIFaXMLAOszhZgNDukg== X-Google-Smtp-Source: ABdhPJxd/u78GqOJhoWzNph+XNE99fMyFxboDZVhN/a3J6FYMOa7bgl3N+Fcj7B8erZv7k6geDrFwg== X-Received: by 2002:a17:90a:e001:: with SMTP id u1mr18321209pjy.3.1608613371225; Mon, 21 Dec 2020 21:02:51 -0800 (PST) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id l190sm18292642pfl.205.2020.12.21.21.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Dec 2020 21:02:50 -0800 (PST) Date: Mon, 21 Dec 2020 21:02:50 -0800 (PST) X-Google-Original-Date: Mon, 21 Dec 2020 21:02:48 PST (-0800) Subject: Re: [PATCH v2] RISC-V: Fix usage of memblock_enforce_memory_limit In-Reply-To: <20201219001356.2887782-1-atish.patra@wdc.com> From: Palmer Dabbelt To: Atish Patra Message-ID: Mime-Version: 1.0 (MHng) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201222_000253_699562_760B1216 X-CRM114-Status: GOOD ( 22.51 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aou@eecs.berkeley.edu, bin.meng@windriver.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org, rppt@linux.ibm.com, Atish Patra , Anup Patel , Paul Walmsley , akpm@linux-foundation.org, bmeng.cn@gmail.com, linux-riscv@lists.infradead.org, rppt@kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, 18 Dec 2020 16:13:56 PST (-0800), Atish Patra wrote: > memblock_enforce_memory_limit accepts the maximum memory size not the > maximum address that can be handled by kernel. Fix the function invocation > accordingly. > > Fixes: 1bd14a66ee52 ("RISC-V: Remove any memblock representing unusable memory area") > Cc: stable@vger.kernel.org > > Reported-by: Bin Meng > Tested-by: Bin Meng > Acked-by: Mike Rapoport > Signed-off-by: Atish Patra > --- > Changes from v1->v2: > 1. Added stable-kernel in cc. > 2. Added reported/tested by tag. > --- > 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 13ba533f462b..bf5379135e39 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -176,7 +176,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); Thanks, this is on fixes. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv