Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4828791iob; Mon, 9 May 2022 02:35:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx07bdTllTw44ihaxExTjKYnI+9b3dCZCBc76hu6Y+cPn+Cpl2SSEsvaDjtR+4jjFxqVCR3 X-Received: by 2002:a63:d04a:0:b0:3c1:65f2:5d09 with SMTP id s10-20020a63d04a000000b003c165f25d09mr12620460pgi.201.1652088937838; Mon, 09 May 2022 02:35:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652088937; cv=none; d=google.com; s=arc-20160816; b=WgnF4pKrnEb9KhFnZJFbYGcvDI9h0tJebbK5wJcFjd7M6Xbj7+F2yeI0j4x2QjHmyf J4MusOu69IYDPvu7Sqv/PYBmsmafttcXbW2f8fyE2c9ozGUeW/oEXYkRliWUk+Nlpc7I s0Z47XqIC1cSyBNQeoVAxRkjHKYgoq6MhV/9IfQSw9gu3Qxi9544QVQPHAHnA/AP8xD8 UmpGQ+c/0gV8NRI0T97lnsHSSuRw3u/jrf3QE+XsZKVLR+ehGEBcfaf0lTYlYkaPHlmC BrvqqVZ+jfS5peiKBSal8S6at4cmzFrt0cS3O/x/vZdAmTSax8ymYG+zA0oDgUazZW4X An3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QDEUBZQi2gkd5vGN65bG0cDs8TDhy97WSz0PhVlgRoE=; b=ReXEkt7rd+4FjIA4nMRQ0DlC8+JIPRV60nMVOWd0nJwVBK+6h1y4Z/OA9Sy410Vvkz udLsmhTuVoPIqsxQoa3qLsslsfYNkPX/vZUUzn7TZ6W+GmBgD73KDVoTgPhMC7Z9dcJe GkA5NzpWyCOVGOdgQxAoikSsdYYUZS5VNzcdm5opNp3mBQwnpscIHUlTuW8q1GCE5GnZ mmvRK8NgDHXoqXdC+xsxkbo4wOoMV7wtjfbDUMmSE2ZmLS7+tkTveD7xgdp5OHTvDCY8 3asuzzLKOqo4Q0Ib+9ss24dTCRQBTuATuCxTWNOauc84zCK+UpCY+xfLrIkV2mXh2cJQ nrZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QehyvxK9; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q22-20020a056a00151600b005107cf64e1dsi11548258pfu.212.2022.05.09.02.35.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:35:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QehyvxK9; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0AD4116688A; Mon, 9 May 2022 02:21:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444905AbiEFXO1 (ORCPT + 99 others); Fri, 6 May 2022 19:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444892AbiEFXO0 (ORCPT ); Fri, 6 May 2022 19:14:26 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 20A125F25D for ; Fri, 6 May 2022 16:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651878641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QDEUBZQi2gkd5vGN65bG0cDs8TDhy97WSz0PhVlgRoE=; b=QehyvxK9vxssxcAaeIMW4ZqUmBjfWfq2Avxxo0n4VXqexANly7NPcqWmhrym3YmpoiMCOi u72ukTxVDj0Pap1JVmP/D1bvz0UoZPNmkrFuYCP3v4WUAhJ54cJuf9H5geYrdO2wWk2/eq YxaCku6uESjbMcvmavgWAOnfc1mZuco= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-TAhXEYwDNG2uu1lmYE4cTA-1; Fri, 06 May 2022 19:10:38 -0400 X-MC-Unique: TAhXEYwDNG2uu1lmYE4cTA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0110F3C01C00; Fri, 6 May 2022 23:10:37 +0000 (UTC) Received: from localhost (ovpn-12-33.pek2.redhat.com [10.72.12.33]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3ABC40CF8E8; Fri, 6 May 2022 23:10:35 +0000 (UTC) Date: Sat, 7 May 2022 07:10:32 +0800 From: Baoquan He To: Zhen Lei , Catalin Marinas Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org, Dave Young , Vivek Goyal , Eric Biederman , kexec@lists.infradead.org, Will Deacon , linux-arm-kernel@lists.infradead.org, Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Randy Dunlap , Feng Zhou , Kefeng Wang , Chen Zhou , John Donnelly , Dave Kleikamp Subject: Re: [PATCH v24 3/6] arm64: kdump: Reimplement crashkernel=X Message-ID: <20220506231032.GA122876@MiWiFi-R3L-srv> References: <20220506114402.365-1-thunder.leizhen@huawei.com> <20220506114402.365-4-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220506114402.365-4-thunder.leizhen@huawei.com> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/06/22 at 07:43pm, Zhen Lei wrote: ...... > @@ -118,8 +162,7 @@ static void __init reserve_crashkernel(void) > if (crash_base) > crash_max = crash_base + crash_size; > > - /* Current arm64 boot protocol requires 2MB alignment */ > - crash_base = memblock_phys_alloc_range(crash_size, SZ_2M, > + crash_base = memblock_phys_alloc_range(crash_size, CRASH_ALIGN, > crash_base, crash_max); > if (!crash_base) { > pr_warn("cannot allocate crashkernel (size:0x%llx)\n", > @@ -127,6 +170,11 @@ static void __init reserve_crashkernel(void) > return; > } > There's corner case missed, e.g 1) ,high and ,low are specified, CONFIG_ZONE_DMA|DMA32 is not enabled; 2) ,high and ,low are specified, the whole system memory is under 4G. Below judgement can filter them away: if (crash_base > arm64_dma_phys_limit && crash_low_size && reserve_crashkernel_low(crash_low_size)) { What's your opinion? Leave it and add document to notice user, or fix it with code change? I would suggest merging this series, Lei can add this corner case handling on top. Since this is a newly added support, we don't have to make it one step. Doing step by step can make reviewing easier. > + if (crash_low_size && reserve_crashkernel_low(crash_low_size)) { > + memblock_phys_free(crash_base, crash_size); > + return; > + } > + > pr_info("crashkernel reserved: 0x%016llx - 0x%016llx (%lld MB)\n", > crash_base, crash_base + crash_size, crash_size >> 20); > > @@ -135,6 +183,9 @@ static void __init reserve_crashkernel(void) > * map. Inform kmemleak so that it won't try to access it. > */ > kmemleak_ignore_phys(crash_base); > + if (crashk_low_res.end) > + kmemleak_ignore_phys(crashk_low_res.start); > + > crashk_res.start = crash_base; > crashk_res.end = crash_base + crash_size - 1; > insert_resource(&iomem_resource, &crashk_res); > -- > 2.25.1 >