Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2179761iof; Tue, 7 Jun 2022 22:21:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL+B3EHGikAUKRRwKLwbxcyAoDtiZPep8uMp3XNRmHr1fxxTHkHhzIqc+6rFgYMA4vUKuG X-Received: by 2002:a17:902:8602:b0:161:b911:8ba8 with SMTP id f2-20020a170902860200b00161b9118ba8mr32125167plo.38.1654665695544; Tue, 07 Jun 2022 22:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654665695; cv=none; d=google.com; s=arc-20160816; b=Efj8eWi11PZFcWGntRvLF+ukVMpbc57SEi0aBfb2+LY6Or3RCve5AVd3QUOl27zGpj p/jcKjryAG1+aEtCc68+rG6ReHQvKzpVIvfLzDVxYRNaPXGKacQ+SyYDXnwnMwI0yqyt bHRrGR1hgXdYK7/vEI3CeFA1SzXKbkjE1EAJgiJgD3N3e5IlsTsACtBOkhIUdX/vrvwL //p8Vvi718OphwnmUsnmYMWYqBpFArZzWlDLHOnO8DIC5iG5nI76GQU5fQTBeInYcZ6j 833Ah9VS1Hhiq2ako8sc5AspByp56JBAA+igQRB6O+IW7KLiFILLx/oPc5zR7Scdg/+j L21w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0ajewOvcmgnriY2+XpHG0KOc7wrrGoGUB3fjZ1uRvt8=; b=HJYqn9DjwciEYQP52G0iP6Slq1GI+cWJwOJJQ81S7sBhZVG9D5qEXCexwsfljslrUe Y638ERUDJDUzjkpjN4I6BRujnzOR0zuej1O3o73pyPVqCIg6WMeodaHUe1hZOjfL4Dfk 366M3R39y5xwDVsQk2LMIM/7NcKSMS+yK2Tw8b0KTNJ9sQBz78gQ322pWxbR/t+XaM4A Xc5+OxjhbCmpapO0fYOgsMh2u8M5/3iaFnbzTeK+AwMc8mh8vu77kW5jRjD7KqwLZ39E cJB6MB+B6bpPvOz1+XbvAmooOVXyQTZa90wEWn1x3ttB2OlfgaxMgE43+vXswNBAOhyy gWmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=koQnRJnn; 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=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n7-20020a17090ac68700b001df53d6dbc7si29277799pjt.117.2022.06.07.22.21.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:21:35 -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=@linuxfoundation.org header.s=korg header.b=koQnRJnn; 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=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9F94A7E1FA; Tue, 7 Jun 2022 21:56:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384464AbiFGWM7 (ORCPT + 99 others); Tue, 7 Jun 2022 18:12:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379682AbiFGVKt (ORCPT ); Tue, 7 Jun 2022 17:10:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F47721565D; Tue, 7 Jun 2022 11:51:56 -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 C4888617A4; Tue, 7 Jun 2022 18:51:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1F74C341C7; Tue, 7 Jun 2022 18:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627915; bh=31HpYQaWeWqtZN+AGWXO2osKlfGZ7/fW6vbdG5g5fus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=koQnRJnnVWWo5kDwuDW4MZxhZl4XbuCBe0t7hyQC5PUhRhXmyQlVZt2b+hnOKJ139 TpWKa4T1nullHKoMKS2XK/3e6nrP8mikClaqf/4CI55K5+Xx9vjDC+rpgwWWulvvmK NFBff4JPPO1D5efzdRW5V0uZ2NytP7ZrcFgjVmNk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhen Lei , Rob Herring , Baoquan He , Catalin Marinas , Sasha Levin Subject: [PATCH 5.18 138/879] of: Support more than one crash kernel regions for kexec -s Date: Tue, 7 Jun 2022 18:54:16 +0200 Message-Id: <20220607165006.711247089@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 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 From: Zhen Lei [ Upstream commit 8af6b91f58341325bf74ecb0389ddc0039091d84 ] When "crashkernel=X,high" is used, there may be two crash regions: high=crashk_res and low=crashk_low_res. But now the syscall kexec_file_load() only add crashk_res into "linux,usable-memory-range", this may cause the second kernel to have no available dma memory. Fix it like kexec-tools does for option -c, add both 'high' and 'low' regions into the dtb. Signed-off-by: Zhen Lei Acked-by: Rob Herring Acked-by: Baoquan He Link: https://lore.kernel.org/r/20220506114402.365-6-thunder.leizhen@huawei.com Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- drivers/of/kexec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c index b9bd1cff1793..8d374cc552be 100644 --- a/drivers/of/kexec.c +++ b/drivers/of/kexec.c @@ -386,6 +386,15 @@ void *of_kexec_alloc_and_setup_fdt(const struct kimage *image, crashk_res.end - crashk_res.start + 1); if (ret) goto out; + + if (crashk_low_res.end) { + ret = fdt_appendprop_addrrange(fdt, 0, chosen_node, + "linux,usable-memory-range", + crashk_low_res.start, + crashk_low_res.end - crashk_low_res.start + 1); + if (ret) + goto out; + } } /* add bootargs */ -- 2.35.1