Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp911493rdb; Tue, 23 Jan 2024 21:16:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjMUwWRt61063uflvDvtN98wBOvQdlueuLI7O+ik0YazQrq+8V6JhHnHmtDkU10M57PmKz X-Received: by 2002:a17:907:d310:b0:a30:e39e:9bd0 with SMTP id vg16-20020a170907d31000b00a30e39e9bd0mr646597ejc.134.1706073397354; Tue, 23 Jan 2024 21:16:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706073397; cv=pass; d=google.com; s=arc-20160816; b=jhNVSsXNNqAFofTccAzvKqKwd+IwC27ToIShhbrP8/qZ6tBwb1eUUXuKsEpBCzIgZP B7xB70IMeftPP5qSqfRSXpkurQoWYOaMKsklD3WSRs8IdmpMGBWWtQUN6yNODj0iW1Zx bw+WAYKrlon60+RCdNr9ResBCEG4hLeFRbtJlcM00AFKtSuu86i+4PGB6SJjogsvH2Rz eYnJt0r84X8W4IPP5t/fePe2ICeHOIBOffpOakGZoHJTIF6mM2bMoZfxEx/jQnPmzglE 3xCpO9fLkPaX9GU3Bl0QdUo5jKyApBieTL9UoiF8xojHKhANhhwZ3Z9g3yCnLbxge7UF VGbA== 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=X1mAKQotCLVkwrgDwzEKzyrz3Qjs1lczR0f5EiGuinE=; fh=zRw2lYWZmEZ+xk8Dyhrd0rqHIpogjnUXaVblO2ikfrI=; b=wAmJHiTubQSsWZcRzZSUKeyGC175sFwm39rX2mVU68aQ5WtiL97yeefS1AcO3Kb4jN 1d91QGbCXTurLLOFk5TUFJaVx2yvNn2ifXZrpgthQxTbsyj7/XergmEoE9kUxNNxjmrL SXQX2dIY167tzznCZTQpJpa53SMwrewzayC8o2JxBqzJ31UpGekIkvXVWnM1ZyprznFk SSMfoyI5LyvFmgkzHkLVWTGmodKcSjMckXH/Ke/lSGTOSkFnDKvIdYnx2YAaKPYG+Jkx 3NlZRgUBOB/00ANXZjH7GyQKqbJwPUOUtjXQlGZcygJOeRJ7o7LJkuSMimjVEDcIMX0N sF3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IQKmt5yT; 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-36459-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36459-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m7-20020a1709062b8700b00a2c7df9b8b4si11945508ejg.502.2024.01.23.21.16.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 21:16:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36459-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IQKmt5yT; 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-36459-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36459-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 87C5F1F27F38 for ; Wed, 24 Jan 2024 05:16:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B66310795; Wed, 24 Jan 2024 05:14:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IQKmt5yT" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 E35CB175AA for ; Wed, 24 Jan 2024 05:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706073265; cv=none; b=rCFBh0AoENZwsDAuLJEHEprBzfnl+V+l1sN7Kv/J6NeQ0KK9k5HLWg4qbIjhEnuO9qsCc+tz0prhuh+tOxbJ5eD7V4H4y0w3DIACLHhOikXnAOUO1F6Gn3lncuHfQidOEpGjyPtk3kIf2nw2C6/5nBJbmaRRqsCGXMkDVyA5Dr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706073265; c=relaxed/simple; bh=Z/NSssrI40cWg6UnSdAu2wVEOrslUZEI42CSL345nVs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=Pww9DCnWGFvDzcltEoEHFRk0wMzULDXIQq5jlDMkrKGFHysEfRsFB9hnu18EkI46I8wL9El7R0ucLU0JneCN+xtaYcwrFehaUol9lhn76izTZXbBEspZ3g7Za8aOwucvfaxHIq+mt7yRfN11AyBPZRVhYMXSfVC8CRuCM6AkRD4= 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=IQKmt5yT; arc=none smtp.client-ip=170.10.129.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=1706073262; 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=X1mAKQotCLVkwrgDwzEKzyrz3Qjs1lczR0f5EiGuinE=; b=IQKmt5yTqgGuVEVZtmayiP7C5yz91xCKqcNkZFmrFkPIy2R/N+a58O7xYY1bLHeaHAA/Qy fsDkQracxL4rAvmyqWfAlnsrC2CBIjL+I7o2mMiJ8V82hKdXYuIzvHPSCZNK6+s+4QDbVE R3A7qDV9XoZZfUBGXGWq+LHNWyEe0QQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-HIffDQXhPqiRKUEtAWrImg-1; Wed, 24 Jan 2024 00:14:16 -0500 X-MC-Unique: HIffDQXhPqiRKUEtAWrImg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 02A09837224; Wed, 24 Jan 2024 05:14:14 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18E661C060AF; Wed, 24 Jan 2024 05:14:07 +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 linux-next v3 10/14] sh, crash: wrap crash dumping code into crash related ifdefs Date: Wed, 24 Jan 2024 13:12:50 +0800 Message-ID: <20240124051254.67105-11-bhe@redhat.com> In-Reply-To: <20240124051254.67105-1-bhe@redhat.com> References: <20240124051254.67105-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.7 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 SuperH with some adjustments. wrap up crash dumping codes with CONFIG_CRASH_DUMP ifdeffery, and use IS_ENABLED(CONFIG_CRASH_RESERVE) check to decide if compiling in the crashkernel reservation code. Signed-off-by: Baoquan He --- arch/sh/kernel/machine_kexec.c | 3 +++ arch/sh/kernel/setup.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index fa3a7b36190a..8daa8a6e6fa6 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c @@ -153,6 +153,9 @@ void __init reserve_crashkernel(void) unsigned long long crash_size, crash_base; int ret; + if (!IS_ENABLED(CONFIG_CRASH_RESERVE)) + return; + ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(), &crash_size, &crash_base, NULL, NULL); if (ret == 0 && crash_size > 0) { diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index d3175f09b3aa..620e5cf8ae1e 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -220,7 +220,7 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn, request_resource(res, &code_resource); request_resource(res, &data_resource); request_resource(res, &bss_resource); -#ifdef CONFIG_KEXEC_CORE +#ifdef CONFIG_CRASH_RESERVE request_resource(res, &crashk_res); #endif -- 2.41.0