Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1052858rdb; Fri, 19 Jan 2024 06:57:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7o1fOBJjM3Cmm/mHUTH2P9rS+Un5jq9FPU+bQG9gqnvMK5bOQ5yqLm/mt96kAqJyGVyX6 X-Received: by 2002:a05:6a00:3d4d:b0:6da:4d94:8838 with SMTP id lp13-20020a056a003d4d00b006da4d948838mr2970060pfb.42.1705676252957; Fri, 19 Jan 2024 06:57:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705676252; cv=pass; d=google.com; s=arc-20160816; b=YVpgBWqyzOfEX8+sj5pTVaHQMU5Km6OX/NoaDFT8ylleAfL4Mf50UiEZI06VWQ/Lgd 8NlQR+l+Q5d/j9MrI3DUEikmTdH7oDojJSygRR+kXZdJL8XdSHPLlF2KvaRbE+tgUX1J BFFdHAg/o5PhWJJcCLZ4DWf1vhRcC20tqg4+oY6CHzyn/o4247cGPa2HFTUIrQZPX3uH fiGOj2d2MivzO5zfVT0VdsSrcVscHo05NJOOrEu5KNL4u+mQ2ScabkH0GCWRiPbWkr+/ SPq9nSsPURGxHBgouf8LvvK0AFq8ezB8rkjz8uKWYeH2zVRI6SGE3/PvHP6o5IBUlCHL 4aAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rvI+qIRXvnkRa99jMtk0WlMp94Xm6ORI7SgED7Qv6WY=; fh=zRw2lYWZmEZ+xk8Dyhrd0rqHIpogjnUXaVblO2ikfrI=; b=keWbZ2JkEx11a7jKkguEvtHcQI7QQQQw9KwDx6tSu0KeyBN7bzx/Ttz28E7pwCKg1X AujBXRN2XACsxK4bKZSv2bfEw3HtsscBA+In7Bz9lz7c4z0lDxI6VqFfF7S04FXgerQG P2CErDg6LKlNkeSATxjG0S+jUfgiqKZV9Tn+VkPQzcBMYZgHF/pvALS+m1S84wnyl0u1 4YLenMIjDj72ryHlXBb2WB9MfoWo39muD8Xc04gj2agigIvKuYvQ2zd0OFeSoFeqOwIe 3+lLFHa+Q48XtaKNaIqWEWRvWCCKAlbHRmSztrRtiWc3OeNdKNBF8tp9j6+k9Ol2YiGQ pF+A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W2ZVV+fk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-31287-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31287-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fn25-20020a056a002fd900b006db7980ae0csi5609685pfb.104.2024.01.19.06.57.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 06:57:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31287-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W2ZVV+fk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-31287-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31287-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 48F61B2533E for ; Fri, 19 Jan 2024 14:56:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C233F54F85; Fri, 19 Jan 2024 14:54:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="W2ZVV+fk" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB75B5478B for ; Fri, 19 Jan 2024 14:54:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705676063; cv=none; b=j36FpzZtB+KLX36+sdhsqYryhTdWYiCNWKiG8934bCRQnJNdhD0JNfkmFnxZwywaVhm7+aubTuP6Shqhw48qAheFT92h2uhA8BgHxm8CUsoiRX2wBVUvFbf59GtafxqrweHF24c4ZCwZwc9/hFUWhEn+eX3vBlVgt9RcwHkpHpw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705676063; c=relaxed/simple; bh=+kOO43E85ahYtBRdDODzuq4Xc6WUCJmQ0tsIgZHp7Tg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=pl5OcJEN2hdUXm0HEmfz62IFN7u1HCYow9fGtWCba/FF+ZZY5mWgTjmoKxgH12wSylVeDzbRn3CLxphhG6RQ7OV/LQievEcT5vKXdb9HmvbqHD5VVC3r8PPhK5Ibhp9y/c/yYw26neA8QRrqic5Vhdmm/X34mV27MqHpECkao90= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=W2ZVV+fk; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705676060; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rvI+qIRXvnkRa99jMtk0WlMp94Xm6ORI7SgED7Qv6WY=; b=W2ZVV+fk2UGS5k/xzsT0hmxEYxzczBJB1cnJGTuU//94rOkcBQODhBH630QcfYgCtdoPlb IfgwYjmaB7fDj3m5Gz7xcylblBDYOK2dxti2ZjNWaCDZoZwv6ihPIJTUa4I1Ov+E0GBCKc gFQQCWEGwkav0RBe6OMonsijfPnYkkg= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-5WFyMg4UNWmcGndjb4K8hw-1; Fri, 19 Jan 2024 09:54:16 -0500 X-MC-Unique: 5WFyMg4UNWmcGndjb4K8hw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 159183C025B8; Fri, 19 Jan 2024 14:54:16 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA96351D5; Fri, 19 Jan 2024 14:54:09 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, loongarch@lists.linux.dev, akpm@linux-foundation.org, ebiederm@xmission.com, hbathini@linux.ibm.com, piliu@redhat.com, viro@zeniv.linux.org.uk, Baoquan He Subject: [PATCH v2 11/14] arm, crash: wrap crash dumping code into crash related ifdefs Date: Fri, 19 Jan 2024 22:52:38 +0800 Message-ID: <20240119145241.769622-12-bhe@redhat.com> In-Reply-To: <20240119145241.769622-1-bhe@redhat.com> References: <20240119145241.769622-1-bhe@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Now crash codes under kernel/ folder has been split out from kexec code, crash dumping can be separated from kexec reboot in config items on arm with some adjustments. Here use IS_ENABLED(CONFIG_CRASH_RESERVE) check to decide if compiling in the crashkernel reservation code. Signed-off-by: Baoquan He --- arch/arm/kernel/setup.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index ff2299ce1ad7..cf0b3798179f 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -979,7 +979,6 @@ static int __init init_machine_late(void) } late_initcall(init_machine_late); -#ifdef CONFIG_KEXEC /* * The crash region must be aligned to 128MB to avoid * zImage relocating below the reserved region. @@ -1007,6 +1006,9 @@ static void __init reserve_crashkernel(void) unsigned long long total_mem; int ret; + if (!IS_ENABLED(CONFIG_CRASH_RESERVE)) + return; + total_mem = get_total_mem(); ret = parse_crashkernel(boot_command_line, total_mem, &crash_size, &crash_base, @@ -1064,9 +1066,6 @@ static void __init reserve_crashkernel(void) insert_resource(&iomem_resource, &crashk_boot_res); } } -#else -static inline void reserve_crashkernel(void) {} -#endif /* CONFIG_KEXEC */ void __init hyp_mode_check(void) { -- 2.41.0