From patchwork Wed Jan 24 05:12:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13528633 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 A0642C47422 for ; Wed, 24 Jan 2024 06:16:03 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0tfFIen2GbNJMnpR8xkSTyWoQY84+IdwBkbKmbwdasc=; b=we8RctSxSmgJ+e uQFsK4Zl1uGqcXD48Lyc57KRmEVAgkcJkLH62ARuB13X4zBSZ8S4w/duraUBd5znSYAHTHB0jyudh 9d0shGeaweUxIMRtJg1tzIjjUtQ5zbJ3hI1EXRWPrKAMySNt1KeguaE79EhVThHtaKyUhRPzlOhML v836hsuI3d9FK3VOdfJEcsCwwakTROwrvbvoF2ysZCsGVo1n7Z0lKCF1+U6V2LcgQBhMuQscDtDS/ 5wt18XZ6oEW2/eVtCk4Y48R74JkpGOVKPUQSDamJT1UyyNC4ZSNy4dLwYyJLCI4i1HwQOYa9lDH1J b0TYtbM4bk40NncvRVsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSWXz-001hf3-0B; Wed, 24 Jan 2024 06:15:39 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSVap-001XHz-2e for linux-arm-kernel@bombadil.infradead.org; Wed, 24 Jan 2024 05:14:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-type :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=X1mAKQotCLVkwrgDwzEKzyrz3Qjs1lczR0f5EiGuinE=; b=PlQvJ0m2v/pRHd3Ng6dqlK2k0p knwfRf5CyO5TyaSPRzg8CJaCBa0nYG9XpuAvXyrNzknieClyN0EYNuM+8cHQhSytAfwNstF/48LEm ugY8xxGXoQQVe8GSjM24hnK4bKRTILBlm7RcJamDDjFLQLctLuXAdl7nM852LM1eKzgaRySeG2Qc3 c2dym+jT0qy8Qq54tABAZy+wAWlN4ePDU3LJKqyPMd2fMygOdpr9jSvUTBq3EehBVwosk0qDvNDlU QAIsqYu+1DE+mFkkQ1smOML/CtMmqFDfIPKGwnNnpRMKoXIhwA4x+b0adTOE6XMUFP5cLPGehctDM YUg4cvuQ==; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rSVaj-00000004FNh-13Cu for linux-arm-kernel@lists.infradead.org; Wed, 24 Jan 2024 05:14:30 +0000 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= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706073263; 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=Yolz43JVPS1fsct2F9I1udl7ub7+4dYsm3Pl//VQIPO8pPqTycu5wPr/pNNmMnhyl1gEhi GcQfEkx87HwcrEz4pF8CkCAdyP5NO6iSfRN/De+QIVVA5Ls0jLov8FPz9iXqWP6wwld+FX Rnyb1aIJjNWR3g4ukWnbiXH7ua/+bxY= 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> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240124_051428_298938_08575274 X-CRM114-Status: GOOD ( 11.03 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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