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=-12.4 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 91954C433E0 for ; Sat, 1 Aug 2020 15:54:42 +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 440B0207BC for ; Sat, 1 Aug 2020 15:54:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 440B0207BC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com 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 F2E1985A22; Sat, 1 Aug 2020 15:54:41 +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 cPgfMTPxnjUJ; Sat, 1 Aug 2020 15:54:40 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0E636858B3; Sat, 1 Aug 2020 15:54:40 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DDDC9C004F; Sat, 1 Aug 2020 15:54:39 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 788E5C004D for ; Sat, 1 Aug 2020 10:54:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6F513203C3 for ; Sat, 1 Aug 2020 10:54:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2xRMH+cf1Mhb for ; Sat, 1 Aug 2020 10:54:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by silver.osuosl.org (Postfix) with ESMTPS id 58BC92034A for ; Sat, 1 Aug 2020 10:54:24 +0000 (UTC) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 071AWipj009926; Sat, 1 Aug 2020 06:53:31 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32n4j1tj4p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Aug 2020 06:53:31 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 071AineF032275; Sat, 1 Aug 2020 06:53:30 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 32n4j1tj43-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Aug 2020 06:53:30 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 071AoAw0031317; Sat, 1 Aug 2020 10:53:27 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03ams.nl.ibm.com with ESMTP id 32n01809gg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Aug 2020 10:53:27 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 071ArONv53215310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 1 Aug 2020 10:53:24 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E75411C04A; Sat, 1 Aug 2020 10:53:24 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5269A11C04C; Sat, 1 Aug 2020 10:53:16 +0000 (GMT) Received: from [9.102.1.22] (unknown [9.102.1.22]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 1 Aug 2020 10:53:16 +0000 (GMT) Subject: Re: [PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area() To: Mike Rapoport , Michael Ellerman References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-7-rppt@kernel.org> <87d04d5hda.fsf@mpe.ellerman.id.au> <20200801101854.GD534153@kernel.org> From: Hari Bathini Message-ID: Date: Sat, 1 Aug 2020 16:23:15 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200801101854.GD534153@kernel.org> Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-01_07:2020-07-31, 2020-08-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 phishscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 clxscore=1011 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008010079 X-Mailman-Approved-At: Sat, 01 Aug 2020 15:54:38 +0000 Cc: linux-sh@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Dave Hansen , Hari Bathini , linux-kernel@vger.kernel.org, Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Thomas Gleixner , 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 , Christoph Hellwig , uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, Borislav Petkov , Andy Lutomirski , Paul Walmsley , Stafford Horne , linux-arm-kernel@lists.infradead.org, Michal Simek , linux-mm@kvack.org, linux-mips@vger.kernel.org, iommu@lists.linux-foundation.org, Palmer Dabbelt , Andrew Morton , linuxppc-dev@lists.ozlabs.org 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 01/08/20 3:48 pm, Mike Rapoport wrote: > 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") I was about to comment on the same :) memblock_reserve() was being used until we ran into the issue talked about in the above commit... > Presuming this is still reqruired I'm going to drop this patch and will Yeah, it is still required.. > simply replace for_each_memblock() with for_each_mem_range() in v2. Sounds right. > >> 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 > Thanks Hari _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu