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,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 8DA86C433DF for ; Sat, 1 Aug 2020 10:19:14 +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 58A8F208A9 for ; Sat, 1 Aug 2020 10:19:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="BOX5CM31" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58A8F208A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 130168715D; Sat, 1 Aug 2020 10:19:14 +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 XF-XxO9HgPiY; Sat, 1 Aug 2020 10:19:13 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 798328714B; Sat, 1 Aug 2020 10:19:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 56013C0050; Sat, 1 Aug 2020 10:19:13 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id C552BC004D for ; Sat, 1 Aug 2020 10:19:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id BF73B8714D for ; Sat, 1 Aug 2020 10:19:11 +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 qeKibWQ-ulLK for ; Sat, 1 Aug 2020 10:19:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 42CA28714B for ; Sat, 1 Aug 2020 10:19:11 +0000 (UTC) Received: from kernel.org (unknown [87.70.91.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5ED692087C; Sat, 1 Aug 2020 10:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596277150; bh=jQD0i2dEJRPR8dDJK6vZOAFdpUe2Ho5YLvcSFtENhXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BOX5CM31age4ZqR8WpA9Tu6Sib3TWB8q0axiVZJ9476Af21jQMyZgnRXNsbolGSGn pWpwQlO3I1Ym/ZhVqWnuEZ70zJ8p8UgBgfsl0uitfuYMEFBB9GFeRHX0dU8VC7876G 1GC7zC28lCBEAGXT18VZfRnXSGNcrY6WFAZx7Yv0= Date: Sat, 1 Aug 2020 13:18:54 +0300 From: Mike Rapoport To: Michael Ellerman Subject: Re: [PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area() Message-ID: <20200801101854.GD534153@kernel.org> References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-7-rppt@kernel.org> <87d04d5hda.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87d04d5hda.fsf@mpe.ellerman.id.au> 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 , Andrew Morton , Christoph Hellwig 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" On Thu, Jul 30, 2020 at 10:15:13PM +1000, Michael Ellerman wrote: > 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 :) Actually, I did some digging in the git log and the traversal was added there on purpose by the commit b71a693d3db3 ("powerpc/fadump: exclude memory holes while reserving memory in second kernel") Presuming this is still reqruired I'm going to drop this patch and will simply replace for_each_memblock() with for_each_mem_range() in v2. > 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 -- Sincerely yours, Mike. _______________________________________________ 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 4EB9BC433E0 for ; Sat, 1 Aug 2020 10:19:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2255F20888 for ; Sat, 1 Aug 2020 10:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596277152; bh=jQD0i2dEJRPR8dDJK6vZOAFdpUe2Ho5YLvcSFtENhXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=iZvl2CQ163oUXiKh2t8zgEY0PkahpR8vNjgdkElGjwENMiWNmwB+PMQAFlNSZlGJh IW+kxQdPGdD2RIPjqtZTUhEcWJbd5Yr5kyOoFoKZDVsrtrWC/qrXoCcMdpJaUf/Xtg Lm7cm91aJeO5GOu30C1QESABIXQ7db9imMW6hWbk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728816AbgHAKTL (ORCPT ); Sat, 1 Aug 2020 06:19:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:43666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726888AbgHAKTL (ORCPT ); Sat, 1 Aug 2020 06:19:11 -0400 Received: from kernel.org (unknown [87.70.91.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5ED692087C; Sat, 1 Aug 2020 10:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596277150; bh=jQD0i2dEJRPR8dDJK6vZOAFdpUe2Ho5YLvcSFtENhXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BOX5CM31age4ZqR8WpA9Tu6Sib3TWB8q0axiVZJ9476Af21jQMyZgnRXNsbolGSGn pWpwQlO3I1Ym/ZhVqWnuEZ70zJ8p8UgBgfsl0uitfuYMEFBB9GFeRHX0dU8VC7876G 1GC7zC28lCBEAGXT18VZfRnXSGNcrY6WFAZx7Yv0= Date: Sat, 1 Aug 2020 13:18:54 +0300 From: Mike Rapoport To: Michael Ellerman Cc: Andrew Morton , 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 Subject: Re: [PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area() Message-ID: <20200801101854.GD534153@kernel.org> References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-7-rppt@kernel.org> <87d04d5hda.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d04d5hda.fsf@mpe.ellerman.id.au> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Thu, Jul 30, 2020 at 10:15:13PM +1000, Michael Ellerman wrote: > 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 :) Actually, I did some digging in the git log and the traversal was added there on purpose by the commit b71a693d3db3 ("powerpc/fadump: exclude memory holes while reserving memory in second kernel") Presuming this is still reqruired I'm going to drop this patch and will simply replace for_each_memblock() with for_each_mem_range() in v2. > 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 -- Sincerely yours, Mike. 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,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 8E169C433E0 for ; Sat, 1 Aug 2020 10:19:42 +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 5A8FC2087C for ; Sat, 1 Aug 2020 10:19:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dZWQ0Bzw"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="BOX5CM31" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A8FC2087C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=auP6jYx0NYlZ8rNIyuhVkWXrbD8cgD7AfHb2cIPSSok=; b=dZWQ0BzwbcCVN4deYnKkiqsi2 CXXAWgZ1aALzBlupMwLsu4kQXmzQ+LATJD1qEYiEtc/XRu4u9O5Weg0TqSKA7BZO/HTpCQz7VcCiJ WsZja3V0gdSmrJ1lQfzURHLC4JcyCnXCFO73NKI+NfPOlKeZbp5o/Y3vuvVJUAUrr27jS/I+MH6gE AI79u9uD5+i3hhm+r9YlisGSDtlIGyxZiPMX7/5V4TuqV1LzdZYC+tvi54umb1F/h7rZkVnNCm6ZW EN/3aIHFQyiAEdm1wJQPvCui3HfbZDdP4S1N42k3K+CCpJW3OKuJaZQYwoJdqp6So99OWBt0KCRv3 rEs0EmQGQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1obj-00080C-SG; Sat, 01 Aug 2020 10:19:15 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1obg-0007yV-Hl; Sat, 01 Aug 2020 10:19:13 +0000 Received: from kernel.org (unknown [87.70.91.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5ED692087C; Sat, 1 Aug 2020 10:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596277150; bh=jQD0i2dEJRPR8dDJK6vZOAFdpUe2Ho5YLvcSFtENhXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BOX5CM31age4ZqR8WpA9Tu6Sib3TWB8q0axiVZJ9476Af21jQMyZgnRXNsbolGSGn pWpwQlO3I1Ym/ZhVqWnuEZ70zJ8p8UgBgfsl0uitfuYMEFBB9GFeRHX0dU8VC7876G 1GC7zC28lCBEAGXT18VZfRnXSGNcrY6WFAZx7Yv0= Date: Sat, 1 Aug 2020 13:18:54 +0300 From: Mike Rapoport To: Michael Ellerman Subject: Re: [PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area() Message-ID: <20200801101854.GD534153@kernel.org> References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-7-rppt@kernel.org> <87d04d5hda.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87d04d5hda.fsf@mpe.ellerman.id.au> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200801_061912_709844_610286B3 X-CRM114-Status: GOOD ( 29.03 ) 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 , Andrew Morton , Christoph Hellwig 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 On Thu, Jul 30, 2020 at 10:15:13PM +1000, Michael Ellerman wrote: > 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 :) Actually, I did some digging in the git log and the traversal was added there on purpose by the commit b71a693d3db3 ("powerpc/fadump: exclude memory holes while reserving memory in second kernel") Presuming this is still reqruired I'm going to drop this patch and will simply replace for_each_memblock() with for_each_mem_range() in v2. > 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 -- Sincerely yours, Mike. _______________________________________________ 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 From: Mike Rapoport Date: Sat, 01 Aug 2020 10:18:54 +0000 Subject: Re: [PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area() Message-Id: <20200801101854.GD534153@kernel.org> List-Id: References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-7-rppt@kernel.org> <87d04d5hda.fsf@mpe.ellerman.id.au> In-Reply-To: <87d04d5hda.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michael Ellerman 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 , Andrew Morton , Christoph Hellwig On Thu, Jul 30, 2020 at 10:15:13PM +1000, Michael Ellerman wrote: > 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 :) Actually, I did some digging in the git log and the traversal was added there on purpose by the commit b71a693d3db3 ("powerpc/fadump: exclude memory holes while reserving memory in second kernel") Presuming this is still reqruired I'm going to drop this patch and will simply replace for_each_memblock() with for_each_mem_range() in v2. > 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 -- Sincerely yours, Mike. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Rapoport Date: Sat, 01 Aug 2020 10:19:13 -0000 Subject: [OpenRISC] [PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area() In-Reply-To: <87d04d5hda.fsf@mpe.ellerman.id.au> References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-7-rppt@kernel.org> <87d04d5hda.fsf@mpe.ellerman.id.au> Message-ID: <20200801101854.GD534153@kernel.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org On Thu, Jul 30, 2020 at 10:15:13PM +1000, Michael Ellerman wrote: > 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 :) Actually, I did some digging in the git log and the traversal was added there on purpose by the commit b71a693d3db3 ("powerpc/fadump: exclude memory holes while reserving memory in second kernel") Presuming this is still reqruired I'm going to drop this patch and will simply replace for_each_memblock() with for_each_mem_range() in v2. > 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 -- Sincerely yours, Mike. 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,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 CD50FC433DF for ; Sat, 1 Aug 2020 10:21:03 +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 7882020716 for ; Sat, 1 Aug 2020 10:21:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="BOX5CM31" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7882020716 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 4BJgCd3xlQzDqSr for ; Sat, 1 Aug 2020 20:21:01 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=rppt@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=BOX5CM31; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BJg9Y1jkwzDqSh for ; Sat, 1 Aug 2020 20:19:13 +1000 (AEST) Received: from kernel.org (unknown [87.70.91.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5ED692087C; Sat, 1 Aug 2020 10:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596277150; bh=jQD0i2dEJRPR8dDJK6vZOAFdpUe2Ho5YLvcSFtENhXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BOX5CM31age4ZqR8WpA9Tu6Sib3TWB8q0axiVZJ9476Af21jQMyZgnRXNsbolGSGn pWpwQlO3I1Ym/ZhVqWnuEZ70zJ8p8UgBgfsl0uitfuYMEFBB9GFeRHX0dU8VC7876G 1GC7zC28lCBEAGXT18VZfRnXSGNcrY6WFAZx7Yv0= Date: Sat, 1 Aug 2020 13:18:54 +0300 From: Mike Rapoport To: Michael Ellerman Subject: Re: [PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area() Message-ID: <20200801101854.GD534153@kernel.org> References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-7-rppt@kernel.org> <87d04d5hda.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d04d5hda.fsf@mpe.ellerman.id.au> 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 , Andrew Morton , Christoph Hellwig Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Jul 30, 2020 at 10:15:13PM +1000, Michael Ellerman wrote: > 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 :) Actually, I did some digging in the git log and the traversal was added there on purpose by the commit b71a693d3db3 ("powerpc/fadump: exclude memory holes while reserving memory in second kernel") Presuming this is still reqruired I'm going to drop this patch and will simply replace for_each_memblock() with for_each_mem_range() in v2. > 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 -- Sincerely yours, Mike. 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,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 D799DC433DF for ; Sat, 1 Aug 2020 10:21:18 +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 A3DF820716 for ; Sat, 1 Aug 2020 10:21:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FD0mtr0O"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="BOX5CM31" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A3DF820716 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HvLE/ATHS0jkwSKDMituJX6vGGZER6nMTqRTHn4+1eY=; b=FD0mtr0OO8RQkVTNXD2uQgedB z3PKF0LNFlSW6nwP2wvyUn7K7+HpgYGj4GTrOzy3z5xAE9PYR33yKrC8hBsubbhWt2Z2l24RwcSkT jrlDe61FPkoc11JVMvknN91PF3qulTke+U33M/iUbZUd6pNWF8zLf7zwLmSSG02yqvcg94ejD+1rn CFKDEP2ZoLIE9P7JjYU3yZrvvlT6e6EoNo0pqJG7dbU8H97XX8xVtixGhJPqR8G4fKX1ISjRwfUIF yivXq2KfN9kSydpM53xtYuAwEUDOlvxs46ANGR3YHyZpMd/m/7gMI+FGKVFQlz/l38LwHm0HpSRii rQVSfDozA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1obi-0007zP-Lh; Sat, 01 Aug 2020 10:19:14 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1obg-0007yV-Hl; Sat, 01 Aug 2020 10:19:13 +0000 Received: from kernel.org (unknown [87.70.91.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5ED692087C; Sat, 1 Aug 2020 10:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596277150; bh=jQD0i2dEJRPR8dDJK6vZOAFdpUe2Ho5YLvcSFtENhXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BOX5CM31age4ZqR8WpA9Tu6Sib3TWB8q0axiVZJ9476Af21jQMyZgnRXNsbolGSGn pWpwQlO3I1Ym/ZhVqWnuEZ70zJ8p8UgBgfsl0uitfuYMEFBB9GFeRHX0dU8VC7876G 1GC7zC28lCBEAGXT18VZfRnXSGNcrY6WFAZx7Yv0= Date: Sat, 1 Aug 2020 13:18:54 +0300 From: Mike Rapoport To: Michael Ellerman Subject: Re: [PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area() Message-ID: <20200801101854.GD534153@kernel.org> References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-7-rppt@kernel.org> <87d04d5hda.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87d04d5hda.fsf@mpe.ellerman.id.au> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200801_061912_709844_610286B3 X-CRM114-Status: GOOD ( 29.03 ) 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 , Andrew Morton , Christoph Hellwig 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 On Thu, Jul 30, 2020 at 10:15:13PM +1000, Michael Ellerman wrote: > 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 :) Actually, I did some digging in the git log and the traversal was added there on purpose by the commit b71a693d3db3 ("powerpc/fadump: exclude memory holes while reserving memory in second kernel") Presuming this is still reqruired I'm going to drop this patch and will simply replace for_each_memblock() with for_each_mem_range() in v2. > 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 -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel