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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5502C77B75 for ; Tue, 16 May 2023 03:00:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=/BWoVd8I5xm7WrUiwylUMNKpvXPxp3EOWE6CDIMbaoM=; b=2v7Dj/A7ZDsTUi 0LrKPBZHTvWSNJzLOce0/CwCtOnfnoB0vzAbv2o4KbOGDzYyLxVic1iJfUSdvpI+hQ6iVAQHXZ40r xW4JXsph1ZF2vTaBVGXtqELDjaEnlTzMrFoV6mx+r8fCid9K8pG30B1IUKOKK45AxO7h5hYHFYQqN axR367TTV42uVXcaHsZ+JXfxp5ocXG+gGP73a3MXsM9UOFjjtQvUeUgL26mkNSKK6siCq5fP1aWyT mqPR26In1zwlOEwoxKnrPaYEWDvl/iTwHkWv+FIv/Ajreo24s/Gr6EM3ZqMi/yAOe2HwcqfQlfkhF U7fkxHMprOqLYBYz4zxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pykvQ-004CbM-0g; Tue, 16 May 2023 03:00:32 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pykvN-004CaB-1m for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2023 03:00:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684206019; 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=AEAd3D4zy/iD7bH1Yo/MWqtNt/Zaten+LoJ4wRMWN0U=; b=MqQ1OTnylg3GuZ0xDmYxkUc7TmEHYEeJ7tLmnkuS0CVdxN0qXv936/FMVM1aiT+Lfbtp91 TJRPMLCTWZKNcrxKOdsut6N4Wu9bVdXp5yvURyzOZn5/JvPu2OxdT1Ym0WNXLom5tFZFbn 1Nwm8O5CVJb9KWOYuchIyq1If/3Inxk= 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-331-4FWlob5xMauTLOaaeX6gTA-1; Mon, 15 May 2023 23:00:15 -0400 X-MC-Unique: 4FWlob5xMauTLOaaeX6gTA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 968591C09500; Tue, 16 May 2023 03:00:14 +0000 (UTC) Received: from localhost (ovpn-12-32.pek2.redhat.com [10.72.12.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B316714171B6; Tue, 16 May 2023 03:00:13 +0000 (UTC) Date: Tue, 16 May 2023 11:00:10 +0800 From: Baoquan He To: Will Deacon Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, horms@kernel.org, thunder.leizhen@huawei.com, John.p.donnelly@oracle.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5] arm64: kdump: simplify the reservation behaviour of crashkernel=,high Message-ID: References: <20230407022419.19412-1-bhe@redhat.com> <20230414143413.GA27911@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230414143413.GA27911@willie-the-truck> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_200029_706144_4245A347 X-CRM114-Status: GOOD ( 22.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Hi Will, On 04/14/23 at 03:34pm, Will Deacon wrote: > Hi, > > On Fri, Apr 07, 2023 at 10:24:19AM +0800, Baoquan He wrote: > > On arm64, reservation for 'crashkernel=xM,high' is taken by searching for > > suitable memory region top down. If the 'xM' of crashkernel high memory > > is reserved from high memory successfully, it will try to reserve > > crashkernel low memory later accoringly. Otherwise, it will try to search > > low memory area for the 'xM' suitable region. Please see the details in > > Documentation/admin-guide/kernel-parameters.txt. > > [...] > > > arch/arm64/mm/init.c | 44 ++++++++++++++++++++++++++++++++++---------- > > 1 file changed, 34 insertions(+), 10 deletions(-) > > I tried to apply this, but smatch is unhappy with the result: > > | arch/arm64/mm/init.c:153 reserve_crashkernel() error: uninitialized symbol 'search_base'. > > I _think_ this is a false positive, but I must say that the control flow > in reserve_crashkernel() is extremely hard to follow so I couldn't be > sure. If the static checker is struggling, then so will humans! > > Ideally, this would all be restructured to make it easier to follow, > but in the short term we need something to squash the warning. I tried to refactor the code as you suggested, while it seems not easy to do. The complexity comes from several cases which need be handled. I try my best to write a document with the things I think important to help understand the code. Please help check if it helps or we just having the current code is fine. Thanks Baoquan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel