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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83ED0ECAAD5 for ; Tue, 6 Sep 2022 13:06:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 28DC280284; Tue, 6 Sep 2022 09:06:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 23D5C80224; Tue, 6 Sep 2022 09:06:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12C9F80284; Tue, 6 Sep 2022 09:06:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 02F5080224 for ; Tue, 6 Sep 2022 09:06:13 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C75D61A189E for ; Tue, 6 Sep 2022 13:06:12 +0000 (UTC) X-FDA: 79881683784.20.D65E01B Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 2BD051200AC for ; Tue, 6 Sep 2022 13:06:12 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6201361500 for ; Tue, 6 Sep 2022 13:06:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C513FC433C1 for ; Tue, 6 Sep 2022 13:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662469570; bh=SpJwzV1xxdG6E2zoG7fCWE2FmuhYoDXFoduBgrxJB7o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=P9Jkwttt41HrjTVur3ZqETnRMvK58FTsAzgZLcpPZ35bdKjOGFvBScTvkOWJ1Eb3k z8Hzmpt8jKHwnZGT57f204iRkETZPzKn+Qzp5hxVzwJNuXteKCXoBbx+NiPdfNXxMK Z2UvStBU1e2LEKi5/rSBSEghkyxEpRxs9HAn44ESRK4QOj7BSXbkdRZKDg0NoqXE7V d3jKY902T/Dyi+RoCalF93V8QRvjEOJK47uebGefSjC0tJ2BUmdkIsdoWMGG6ohzWy hANxH2zRtxXNRNNgs4RNvXu26c80Nnn+2BYFVaeXa15L5GdGeLBzdjOAd68R34JivP reC3sJxNLWdLg== Received: by mail-lf1-f47.google.com with SMTP id q7so17287897lfu.5 for ; Tue, 06 Sep 2022 06:06:10 -0700 (PDT) X-Gm-Message-State: ACgBeo2cFQxuwUE1RJvuiolZ8ayn5n3Vp0hd42VnRXaV6vl1a+YQD91D zjU3NbvFkuJzKrgP8rdzTmNsJvyD5s3/vi/kPqE= X-Google-Smtp-Source: AA6agR5KiKCBtGu2NBHkajuKIN42XAzBbIS0deO+9CVIZbXoRkhIM737KmO+1cMcIxjM/6nXhMP1jgMcKij1ryQ7XfE= X-Received: by 2002:a19:9113:0:b0:494:ad39:7d03 with SMTP id t19-20020a199113000000b00494ad397d03mr5907458lfd.122.1662469568765; Tue, 06 Sep 2022 06:06:08 -0700 (PDT) MIME-Version: 1.0 References: <20220828005545.94389-1-bhe@redhat.com> <20220828005545.94389-2-bhe@redhat.com> In-Reply-To: From: Ard Biesheuvel Date: Tue, 6 Sep 2022 15:05:57 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] arm64, kdump: enforce to take 4G as the crashkernel low memory end To: Baoquan He Cc: Mike Rapoport , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, guanghuifeng@linux.alibaba.com, mark.rutland@arm.com, will@kernel.org, linux-mm@kvack.org, thunder.leizhen@huawei.com, wangkefeng.wang@huawei.com, kexec@lists.infradead.org Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662469572; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DewdR6AK3VJ5lbSIb9/n8mq4K+u3x7LFPRx0vESu1fA=; b=ydGm/rBqBAIEA37nAWqj5XLyXVql4A8n4RMfFdJbunw6/YZoaw7nOZZF7hOjRhZjTXnWbK T9uE6GYJCnwu7DB1dXETyILmhj1XvBbETnY9XDCahzbjlzg6K94I0nvm+F8i/E8n1cZRI/ 4eQMXI7o0xAREdlrNAzEqd9bHED+Kds= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=P9Jkwttt; spf=pass (imf29.hostedemail.com: domain of ardb@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=ardb@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662469572; a=rsa-sha256; cv=none; b=gSdBzZ2JaXrDwbZ6gIffgO7ZKDkf36Fd2wbHCkItLwmYFvgEHJukO+pTve9XyTEUdGEoQY V/EpDdFReHgCvIClrNexsya4zFLjQvM8ck8SSNMTA9qAn50TnhJAt/Mo8rieSuLVRNlhSH 7DkN/N/WRyNrOgr0a+oQdqrLVlSxV6c= X-Stat-Signature: j6et61jd4ymwiq7crwemo1stbakhotf6 X-Rspamd-Queue-Id: 2BD051200AC X-Rspam-User: Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=P9Jkwttt; spf=pass (imf29.hostedemail.com: domain of ardb@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=ardb@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam03 X-HE-Tag: 1662469572-700520 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 5 Sept 2022 at 14:08, Baoquan He wrote: > > On 09/05/22 at 01:28pm, Mike Rapoport wrote: > > On Thu, Sep 01, 2022 at 08:25:54PM +0800, Baoquan He wrote: > > > On 09/01/22 at 10:24am, Mike Rapoport wrote: > > > > > > max_zone_phys() only handles cases when CONFIG_ZONE_DMA/DMA32 enabled, > > > the disabledCONFIG_ZONE_DMA/DMA32 case is not included. I can change > > > it like: > > > > > > static phys_addr_t __init crash_addr_low_max(void) > > > { > > > phys_addr_t low_mem_mask = U32_MAX; > > > phys_addr_t phys_start = memblock_start_of_DRAM(); > > > > > > if ((!IS_ENABLED(CONFIG_ZONE_DMA) && !IS_ENABLED(CONFIG_ZONE_DMA32)) || > > > (phys_start > U32_MAX)) > > > low_mem_mask = PHYS_ADDR_MAX; > > > > > > return low_mem_mast + 1; > > > } > > > > > > or add the disabled CONFIG_ZONE_DMA/DMA32 case into crash_addr_low_max() > > > as you suggested. Which one do you like better? > > > > > > static phys_addr_t __init crash_addr_low_max(void) > > > { > > > if (!IS_ENABLED(CONFIG_ZONE_DMA) && !IS_ENABLED(CONFIG_ZONE_DMA32)) > > > return PHYS_ADDR_MAX + 1; > > > > > > return max_zone_phys(32); > > > } > > > > I like the second variant better. > > Sure, will change to use the 2nd one . Thanks. > While I appreciate the effort that has gone into solving this problem, I don't think there is any consensus that an elaborate fix is required to ensure that the crash kernel can be unmapped from the linear map at all cost. In fact, I personally think we shouldn't bother, and IIRC, Will made a remark along the same lines back when the Huawei engineers were still driving this effort. So perhaps we could align on that before doing yet another version of this?