Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp626297rwe; Fri, 14 Apr 2023 07:43:40 -0700 (PDT) X-Google-Smtp-Source: AKy350Z8DbbOD8ybcDakgUz6JnKtGV1gOiDLn6atfc2oDMElF4Siwt+mppiOVqTwXQgQ6xd0iTYS X-Received: by 2002:a05:6a20:4c89:b0:d8:f312:b3b with SMTP id fq9-20020a056a204c8900b000d8f3120b3bmr5931737pzb.3.1681483420517; Fri, 14 Apr 2023 07:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681483420; cv=none; d=google.com; s=arc-20160816; b=rSSvd1IxMx183rp7qCFdY/wNT5YQb2bIzL/XJpa/aCd+3AUlw7EKw0i+AeueIqYJzU rRDuBq3b6BGCUTUpoNa7F2FKH5cscigRRZ7P4tWlT5tT/gK/MdyHBCsdC+InEnopGdgs AYmHpQpDgBzbH6cjdlK9KXJp1GLhgB96EV9wW1uoVkCFHM63mdBpXgqBxJCVtDCRzDMq DDZLW5GkRQyzc8V9d8y1FUWe5satI6Hb/ow34pq0rwJS7vzPCLJG3EGX7Dn11e0h26dz aaw2T5d7g2QcOtsaU6qnWW0zF1sqJy4o4dqkPoyM/JTy01zWMdVh6QBb1KOheSBzzZAx BYpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lGx4JwhZW1jHzmBR16Td2kjw9313z7FoaTq7itxJCMI=; b=DtC437ip55sku13XgJYUqvj9GF7FuiiTfXYdjzQxlrXcXwbdOrTKTo5V3qgDT2RO6I FgWVjI9oZwlxZBjElKa4EU70UB5Um2mMTUu+9ryvdsYT3lJRcrBh26qsvYeAz+CwHaBx 1Hx0MlSnSnfqXFlxv8b6T3Y2ExGviQsZvE4E5ztvIVLuVHBqxjmLC2k7dpHT6KuXzBYr 3YPSROBqqS/mqgAnXJEI9XjUtkKbBbsGe7BSQpWiz69GKKvm094oGwZ2lwagyZHUxE1l 99elq5ZyHsO7LTH4/Delab44INIVr6KLthc2BWR2nz7iee9bEa0Yvvfhhp0AJrrI6rtE +H4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tDqpVX6r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020aa78ed1000000b00625106cebedsi4548464pfr.187.2023.04.14.07.43.23; Fri, 14 Apr 2023 07:43:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tDqpVX6r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230177AbjDNOe2 (ORCPT + 99 others); Fri, 14 Apr 2023 10:34:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbjDNOe1 (ORCPT ); Fri, 14 Apr 2023 10:34:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A766BC for ; Fri, 14 Apr 2023 07:34:23 -0700 (PDT) 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 7D2DC6420C for ; Fri, 14 Apr 2023 14:34:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E683C433D2; Fri, 14 Apr 2023 14:34:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681482861; bh=d0iC7roleDI04oHJIwtWDATxuxnM5ASBnX6PRX+duzY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tDqpVX6rIICqZGNhn3rMgK3VZbfqOkWwStqI7SukeZhca0g7UEY0KBY4pkYHechq+ D4VVpG047EwsF4tUVcVo9NUQdyqoYI1Ft63c+ZFqRuR1XMavgFb0HTsc1R6N+P6zvk TW4AIUVfYed7fR8bHyNinoFWhx0SWUx21OiyhJyQSVLQHW+6kzP9p43EN5D46hUhcc /F74Ht+k1pGaOBciSviM0+TEYWnBsn/C2q2lSWc3H3fHeq/25xfbfUDCTYhXh0BEbW C4QrLEmYK1ZTzswpX4N9Wo11cHOH4WL2/6ezPivGm4qzJCH1ZezSnM0//LKdEzGFsc mPYrJlfbHE/9g== Date: Fri, 14 Apr 2023 15:34:16 +0100 From: Will Deacon To: Baoquan He 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: <20230414143413.GA27911@willie-the-truck> References: <20230407022419.19412-1-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230407022419.19412-1-bhe@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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. Cheers, Will