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=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 39EA0C433DF for ; Thu, 30 Jul 2020 12:15:30 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 05A5C2074B for ; Thu, 30 Jul 2020 12:15:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="dDG2HeGv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05A5C2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C9B5B86D04; Thu, 30 Jul 2020 12:15:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id idw_VlntchO7; Thu, 30 Jul 2020 12:15:29 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 173A186CFF; Thu, 30 Jul 2020 12:15:29 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id ECD41C0050; Thu, 30 Jul 2020 12:15:28 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 274B8C004D for ; Thu, 30 Jul 2020 12:15:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0C8DC86CEF for ; Thu, 30 Jul 2020 12:15:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x6MfWAn_INqP for ; Thu, 30 Jul 2020 12:15:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ozlabs.org (ozlabs.org [203.11.71.1]) by fraxinus.osuosl.org (Postfix) with ESMTPS id D43A186AA5 for ; Thu, 30 Jul 2020 12:15:25 +0000 (UTC) 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 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 Cc: linux-sh@vger.kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Dave Hansen , Hari Bathini , linux-mips@vger.kernel.org, Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Stafford Horne , linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , x86@kernel.org, Russell King , Mike Rapoport , clang-built-linux@googlegroups.com, Ingo Molnar , Catalin Marinas , uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, Borislav Petkov , Andy Lutomirski , Paul Walmsley , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Michal Simek , linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Palmer Dabbelt , Christoph Hellwig , Mike Rapoport X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" 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 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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=-10.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 EE2B8C433DF for ; Thu, 30 Jul 2020 12:15:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDB322067D for ; Thu, 30 Jul 2020 12:15:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="dDG2HeGv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727889AbgG3MPY (ORCPT ); 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-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@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 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=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 EAD50C433E0 for ; Thu, 30 Jul 2020 12:15:47 +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 B6E0F2067D for ; Thu, 30 Jul 2020 12:15:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Qe80vIGA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="dDG2HeGv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6E0F2067D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au 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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References:In-Reply-To: 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=SXc4gYIyN1ivxYlgOtjf8NosYUxFmTBeidzdFFI7XEY=; b=Qe80vIGASOVstpo2ltrZlAsaN 7j2BjOAhndK9+9/QbdZPhMoT/HhUOKcyugNN1u/eS/K2kBqZ79Kp9N0B1GDkegF7gtExSPNkG9duO FJ9BUx8dXkNU0LGqgNu7UwuY+67h05LTweiEgsvHzgieQBgKnKPN2yGbTYau+1MOg+6QO0bBH41iY WdBVQ869WISBccrOlPAS6/trRclme3S+OXPhPvSTxjKqJSWhtkNMEClPQw4r3HsWUBH2BgRI27fuj FChPY6w0BL2xjjDxtn/L9hlY6hkt/g7qy2i7j/O8rI3uvgbFV2tuXTQlYcmD173l/j6xTG/b96N9q 7qg8XF8VQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k17TB-0001v1-OT; Thu, 30 Jul 2020 12:15:33 +0000 Received: from ozlabs.org ([203.11.71.1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k17T5-0001rG-BH; Thu, 30 Jul 2020 12:15:28 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200730_081527_629301_FA411002 X-CRM114-Status: GOOD ( 21.31 ) 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: linux-sh@vger.kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Dave Hansen , Hari Bathini , linux-mips@vger.kernel.org, Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Stafford Horne , Marek Szyprowski , linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , x86@kernel.org, Russell King , Mike Rapoport , clang-built-linux@googlegroups.com, Ingo Molnar , Catalin Marinas , uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, Borislav Petkov , Andy Lutomirski , Paul Walmsley , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Michal Simek , linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Palmer Dabbelt , Christoph Hellwig , Mike Rapoport Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Michael Ellerman 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-s390-owner@vger.kernel.org List-ID: 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 , 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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Date: Thu, 30 Jul 2020 12:15:13 +0000 Subject: Re: [PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area() Message-Id: <87d04d5hda.fsf@mpe.ellerman.id.au> List-Id: References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-7-rppt@kernel.org> In-Reply-To: <20200728051153.1590-7-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mike Rapoport , Andrew Morton Cc: linux-sh@vger.kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Dave Hansen , Hari Bathini , linux-mips@vger.kernel.org, Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Stafford Horne , Marek Szyprowski , linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , x86@kernel.org, Russell King , Mike Rapoport , clang-built-linux@googlegroups.com, Ingo Molnar , Catalin Marinas , uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, Borislav Petkov , Andy Lutomirski , Paul Walmsley , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Michal Simek , linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Palmer Dabbelt , Christoph Hellwig 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Date: Thu, 30 Jul 2020 12:15:31 -0000 Subject: [OpenRISC] [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> Message-ID: <87d04d5hda.fsf@mpe.ellerman.id.au> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.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 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=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 735DAC433DF for ; Thu, 30 Jul 2020 12:24:20 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 DAFFD2082E for ; Thu, 30 Jul 2020 12:24:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="dDG2HeGv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAFFD2082E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BHV2p0jSRzDr0f for ; Thu, 30 Jul 2020 22:24:18 +1000 (AEST) Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BHTrb0vkFzDqfs for ; Thu, 30 Jul 2020 22:15:27 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=dDG2HeGv; dkim-atps=neutral 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 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 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-sh@vger.kernel.org, Peter Zijlstra , Dave Hansen , Hari Bathini , linux-mips@vger.kernel.org, Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Stafford Horne , Marek Szyprowski , linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , x86@kernel.org, Russell King , Mike Rapoport , clang-built-linux@googlegroups.com, Ingo Molnar , Catalin Marinas , uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, Borislav Petkov , Andy Lutomirski , Paul Walmsley , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Michal Simek , linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Palmer Dabbelt , Christoph Hellwig , Mike Rapoport Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 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=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 6B943C433E0 for ; Thu, 30 Jul 2020 12:17:05 +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 399E120838 for ; Thu, 30 Jul 2020 12:17:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uPUAOFSf"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="dDG2HeGv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 399E120838 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References:In-Reply-To: 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=cHAt3Xd79IldzLgYXKXVl6NQTvM9pFYZExFsbXfTV0k=; b=uPUAOFSfTNO+6EhsGaYlLpNl5 fZF47vEAnOqAlCRn9//Ggz+j+8U/NPWU/8xN+B46nfOTRYSVSqONtvwkzXCDRidvFmi6kddCwN23/ HSG/x5sNAH8gwqpj0PYTP7ADxLgwW1Pvk6Jl8n1lzXJ1HU6tjTCLi3G1i4O+pDnsPHGmNheB9+lVE YVzNiLSBTYR8QyE99VKAKYooYYwcMp9kKCygXsI1wMISYPB37GD+xQPl9PUu8DOyIrkOB/WMZyvja qY4sQXKsfSZnEK1gVBaGoz8FrvAYZYo0h2e2e7tr0kc/5eUsrWyFjr3rkxkkEvBNdXYlyZh1Z+D7L gySzZ0DPQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k17T8-0001th-4S; Thu, 30 Jul 2020 12:15:30 +0000 Received: from ozlabs.org ([203.11.71.1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k17T5-0001rG-BH; Thu, 30 Jul 2020 12:15:28 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200730_081527_629301_FA411002 X-CRM114-Status: GOOD ( 21.31 ) 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-sh@vger.kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Dave Hansen , Hari Bathini , linux-mips@vger.kernel.org, Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Stafford Horne , Marek Szyprowski , linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , x86@kernel.org, Russell King , Mike Rapoport , clang-built-linux@googlegroups.com, Ingo Molnar , Catalin Marinas , uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, Borislav Petkov , Andy Lutomirski , Paul Walmsley , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Michal Simek , linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Palmer Dabbelt , Christoph Hellwig , Mike Rapoport Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel