From patchwork Wed Jan 24 05:12:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13528631 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 53283C46CD2 for ; Wed, 24 Jan 2024 06:16:01 +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=2rPmMGy3Q4/5vOg5tG1xtFOA14K61p5812hH/O0Fen0=; b=si1vjZLh6NIerF 0vsczVYTToa2DjxYZXRwb/gz02UAYKCJBnlnkPIFAoWVbH7N2YOKQymNglTUFOK0eN0G2jUo6AH9C nATHPG6tvu+mPp+f1ug+difVma3WmK41q8bPwCzff0RFrxub+ByPDmPkXQc7wrO0o/DGQ4uar9wDI MQ3zVn42Ha8jedguE9ntEpyBRoaPAjXhokR4XEZCy/MPLa+azRt8hPS79wxFpRsY12Ed6ubWuaaCW 3DudqVgUg6/X7+Rc4LP5AIpDLAUtlPWCoMdvXi7FsGn8u/zkL7B/sp8wtlhnp48u7l5KtySOLlzxV jn/vhnwr4ypX2T/sk3sA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSWXy-001heF-1B; Wed, 24 Jan 2024 06:15:38 +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 1rSVao-001XFs-0I for linux-arm-kernel@bombadil.infradead.org; Wed, 24 Jan 2024 05:14:30 +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=PNOeu1HbpskBZbW25MWU6cZYUz3N/w+rWXoFdZjNr5M=; b=fuS8OYpu6ebc4SNBJkcQYkjzxn bbt34slgyGDIL19RvqY9PvJeGfz0pc7X84fLjM68CT9RdbDJhxLTl0heAdTQ7Yh5zBncLRnTHD9vQ U7I9LWqq/HBolI0fU3pmFyrsb3Oc+7YKze+Nlsobz64quDlr/2O+uOa+uPiDlsiICIQFhLZbQNdhZ hHMYiNNkRiGH8XcXenuWM/2kgi8qEZHr6d/itGPsbOJ55b6n/S4jggwkUeIHOKaUEDpkmd/CPcAt5 fjHpnkNchchQhhbdn3L4Fh48wpFhPQohh3ChLQArvVRsJSS/+gOviwDad4BJAx8cPkFgugcw3u9WU oSLe87PQ==; Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rSVak-00000004FNz-3QxO for linux-arm-kernel@lists.infradead.org; Wed, 24 Jan 2024 05:14:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706073265; 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=PNOeu1HbpskBZbW25MWU6cZYUz3N/w+rWXoFdZjNr5M=; b=WuXxTyy1CSfhYtcoQLcAEKkdzIPQk+BNjKTnwSp84V/vDFyh0Q0mFvzOWPy9J0Xutrn6pz mqWAQOnh2SMvQGQQ4seqwsSXQdUwEZRa+MXMb7NGAahi9jz5yr3g3h8fuwTfcKp0zNe4mN 7GoPeayePnWqziRv40WA71lovLxNQjc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706073265; 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=PNOeu1HbpskBZbW25MWU6cZYUz3N/w+rWXoFdZjNr5M=; b=WuXxTyy1CSfhYtcoQLcAEKkdzIPQk+BNjKTnwSp84V/vDFyh0Q0mFvzOWPy9J0Xutrn6pz mqWAQOnh2SMvQGQQ4seqwsSXQdUwEZRa+MXMb7NGAahi9jz5yr3g3h8fuwTfcKp0zNe4mN 7GoPeayePnWqziRv40WA71lovLxNQjc= 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-124-xwsoB4tCPl2PN_DmUSobQw-1; Wed, 24 Jan 2024 00:14:21 -0500 X-MC-Unique: xwsoB4tCPl2PN_DmUSobQw-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 3761085A589; Wed, 24 Jan 2024 05:14:20 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 966E31C060AF; Wed, 24 Jan 2024 05:14:14 +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 11/14] mips, crash: wrap crash dumping code into crash related ifdefs Date: Wed, 24 Jan 2024 13:12:51 +0800 Message-ID: <20240124051254.67105-12-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_051427_034319_3F23BCF4 X-CRM114-Status: GOOD ( 10.96 ) 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 mips 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/mips/kernel/setup.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 9c30de151597..12a1a4ffb602 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -442,8 +442,6 @@ static void __init mips_reserve_vmcore(void) #endif } -#ifdef CONFIG_KEXEC - /* 64M alignment for crash kernel regions */ #define CRASH_ALIGN SZ_64M #define CRASH_ADDR_MAX SZ_512M @@ -454,6 +452,9 @@ static void __init mips_parse_crashkernel(void) unsigned long long crash_size, crash_base; int ret; + if (!IS_ENABLED(CONFIG_CRASH_RESERVE)) + return; + total_mem = memblock_phys_mem_size(); ret = parse_crashkernel(boot_command_line, total_mem, &crash_size, &crash_base, @@ -489,6 +490,9 @@ static void __init request_crashkernel(struct resource *res) { int ret; + if (!IS_ENABLED(CONFIG_CRASH_RESERVE)) + return; + if (crashk_res.start == crashk_res.end) return; @@ -498,15 +502,6 @@ static void __init request_crashkernel(struct resource *res) (unsigned long)(resource_size(&crashk_res) >> 20), (unsigned long)(crashk_res.start >> 20)); } -#else /* !defined(CONFIG_KEXEC) */ -static void __init mips_parse_crashkernel(void) -{ -} - -static void __init request_crashkernel(struct resource *res) -{ -} -#endif /* !defined(CONFIG_KEXEC) */ static void __init check_kernel_sections_mem(void) {