Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1881652ybg; Thu, 30 Jul 2020 05:18:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcHdmSkX7r2jy0XhPwMW0gpR6qtJLP3InTyLtxDlBqceP6MNF2EvrcHZHD43mSV0KIT5vM X-Received: by 2002:a05:6402:22fc:: with SMTP id dn28mr2290119edb.381.1596111479882; Thu, 30 Jul 2020 05:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596111479; cv=none; d=google.com; s=arc-20160816; b=rZ6+CCwN7GD5S35jgP343v7+pzyF8rX6slndr3ty1s/FZ0m64TkK2pyb5fSJU3eB/a QOUZC0UHibtpKofLRjdYyIPzI51jNlLTMq7EHHp21lmDVywv1pWSVbaROk2wb+LT2LLA 6dmSXFn+NPRmzy0r0sdA4RC257ogLq4S/2e8ptiOPlZ9cKtLhqT3JgCE7GnjMdRV5e43 U8Uf5T6ue8DL1iXC6chc5KoRDuxN31fOs6JWXkt7/W40o++Xl4glr0YjWCXAYHgLo22k EywVABFEiejHzY1aYnwleZAI8ojOC/HJDoDcYszopwK1zz5y9XsLxCVwXq4YptzzuXaY P8Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=rVchL7IzIWDbD81piUGoCjaHQ87L70iPhmm0TQZ3Cco=; b=vlxLggA1EqaS8p70u8iS8A1nypPZbBs2l/rXKh1+xt0qzFwGfJKwT0H7VB+O6wKtHy Yd0U1dSH10cm7EMQocOZ/tYAXjsN2LGFnSj+8Oa+hu7oFE1fKtJvXFeokmukyTQ3+SVv d9miUqzlmj9/vgcA2pHumER14J8/WktiYsvsOCMro/xxRYNYlxpEGXmMSti9PvEVL9jL Z0TwSN5fohRlqOQ5Omdc3qTu1o71r8QksyVBP426Wsp2f5PGaJC4bc/az1cbVSTp6t2l ouXSkleawe9UjOJikhSkOHMkOY4sCDlH05mqNZWIpsKxL/oDvIeWg49Wkkj3v4phwM87 KMZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=dDG2HeGv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si3282096edn.576.2020.07.30.05.17.37; Thu, 30 Jul 2020 05:17:59 -0700 (PDT) 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=@ellerman.id.au header.s=201909 header.b=dDG2HeGv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728121AbgG3MPY (ORCPT + 99 others); Thu, 30 Jul 2020 08:15:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727852AbgG3MPX (ORCPT ); Thu, 30 Jul 2020 08:15:23 -0400 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54853C061794; Thu, 30 Jul 2020 05:15:23 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4BHTrL6Fgfz9sRN; Thu, 30 Jul 2020 22:15:14 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1596111321; bh=YNSVJAmG6iTLprr4AXeykiRRbuPWau8/ePuc4CoRMGM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dDG2HeGveH8jvsO0a3nV+Tp8BcGIZDu65BOPDvIIBo9wVTyiHzeoVy9VEea0rigvp Y31hCYMQ/HUQJyt9f4Ns+ZWd4J0yauoOrKc1q24QkaP65G5RtKXvj8BnxizCtGPCIs 4Qc5Gy9BbRkYcfHS9FaL2IesmCw9kHwdS0i+jJ5INj6RLnsR8z4hMy+N03Q+rveLd0 2v5hfX/mFHnRdxjBR0pUmOS4LXqz54J4KK7TRfoGZVmsUzhhMnBhUvMn3FR8lvfRl/ Ax9t5/4az9jOznaLXvwqANu/Zl8pK6CgRrdLYmMHTgYkBan25IQFsKLy25EXJBUiYn TCPH/khAUMFFQ== From: Michael Ellerman To: Mike Rapoport , Andrew Morton Cc: Andy Lutomirski , Benjamin Herrenschmidt , Borislav Petkov , Catalin Marinas , Christoph Hellwig , Dave Hansen , Ingo Molnar , Marek Szyprowski , Max Filippov , Michal Simek , Mike Rapoport , Mike Rapoport , Palmer Dabbelt , Paul Mackerras , Paul Walmsley , Peter Zijlstra , Russell King , Stafford Horne , Thomas Gleixner , Will Deacon , Yoshinori Sato , clang-built-linux@googlegroups.com, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, x86@kernel.org, Hari Bathini Subject: Re: [PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area() In-Reply-To: <20200728051153.1590-7-rppt@kernel.org> References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-7-rppt@kernel.org> Date: Thu, 30 Jul 2020 22:15:13 +1000 Message-ID: <87d04d5hda.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mike Rapoport writes: > From: Mike Rapoport > > fadump_reserve_crash_area() reserves memory from a specified base address > till the end of the RAM. > > Replace iteration through the memblock.memory with a single call to > memblock_reserve() with appropriate that will take care of proper memory ^ parameters? > reservation. > > Signed-off-by: Mike Rapoport > --- > arch/powerpc/kernel/fadump.c | 20 +------------------- > 1 file changed, 1 insertion(+), 19 deletions(-) I think this looks OK to me, but I don't have a setup to test it easily. I've added Hari to Cc who might be able to. But I'll give you an ack in the hope that it works :) Acked-by: Michael Ellerman > diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c > index 78ab9a6ee6ac..2446a61e3c25 100644 > --- a/arch/powerpc/kernel/fadump.c > +++ b/arch/powerpc/kernel/fadump.c > @@ -1658,25 +1658,7 @@ int __init fadump_reserve_mem(void) > /* Preserve everything above the base address */ > static void __init fadump_reserve_crash_area(u64 base) > { > - struct memblock_region *reg; > - u64 mstart, msize; > - > - for_each_memblock(memory, reg) { > - mstart = reg->base; > - msize = reg->size; > - > - if ((mstart + msize) < base) > - continue; > - > - if (mstart < base) { > - msize -= (base - mstart); > - mstart = base; > - } > - > - pr_info("Reserving %lluMB of memory at %#016llx for preserving crash data", > - (msize >> 20), mstart); > - memblock_reserve(mstart, msize); > - } > + memblock_reserve(base, memblock_end_of_DRAM() - base); > } > > unsigned long __init arch_reserved_kernel_pages(void) > -- > 2.26.2