Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1052265rdb; Fri, 19 Jan 2024 06:56:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFypEp9Wkqi9PUNtjX+9IJQ6dja4cRBxd0AH1AIZ6YCRoR8q3ZI3vFKEuW+SbXaaECdAooR X-Received: by 2002:a05:6808:f0e:b0:3bd:a80d:f5c3 with SMTP id m14-20020a0568080f0e00b003bda80df5c3mr496061oiw.49.1705676185651; Fri, 19 Jan 2024 06:56:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705676185; cv=pass; d=google.com; s=arc-20160816; b=L05I4K4Oi/d4ojqCekMH5rmHTP3FC64hq1LInG3Z+C7SGZIYpWAQD+BBQdeZkFrBLE V0P973n8jkVtSYXOsCs0FTRUWG/rfLUvEHmom8LEK7aic3evwr5PGhCD0pSJ9VoQoJ/q E35x4P8+dsQBGrnjmlCenpZ9wn6gt397EZCXO9lIdCv5WtG+sQV+vVXvODWuh3WiK2b7 TKA3EUtS+uroIAFHTjjLEqCZeSmRec227i4MZRBrfEvm3/y3ZOOHhmb0zImPD6ENqOM0 goihmaH0i/O1RppAMab+jE0Hl9XZsV8IVQUmq+jmhaFpT0vEWY5t65Q90Ql8Bq9KWduq 5Uww== 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=PNOeu1HbpskBZbW25MWU6cZYUz3N/w+rWXoFdZjNr5M=; fh=zRw2lYWZmEZ+xk8Dyhrd0rqHIpogjnUXaVblO2ikfrI=; b=iRbE4F3yj4KN/6DslfiD9nix5a76nglcn3aMXyOnyHAiCdWtCxkANx0hWf85AzOqlN ZHAu3RZZcbAZkwbgjO5IcsVYC5kYq+3nB+U8A45tyrcrph24SOCtUS8XNanI8whO06ji quHp7L8+UZjmbyaY4vpqCzAnwppOX8+/Qf4/3qjUKXyI0ZN65/1FAJOdvH5pO6cToceg LaNgmgO5rO2UJkVC4J7oI6xz3eC2SJRZe42TsdyHN7VQ/Bceq9U/8DB3M4Fbpoqg8ykv hnzBdPmq+aiQepyOZ+mYFAIsQw7OW5tuS4MjHVD2H+SIaVpKiwF2HN/ZMuxfzufb+ctj 0Z/A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VsAuQgls; 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-31288-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31288-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t33-20020a05622a182100b00429bccbd83esi16576974qtc.192.2024.01.19.06.56.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 06:56:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31288-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VsAuQgls; 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-31288-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31288-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3156E1C249E9 for ; Fri, 19 Jan 2024 14:56:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD57A56448; Fri, 19 Jan 2024 14:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VsAuQgls" 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 9BF0E5472A for ; Fri, 19 Jan 2024 14:54:28 +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=1705676069; cv=none; b=puLf5wkhSf86C/ONroohOquK64929aX/tkTiHTwRWYte17wLNcfRRONK2+eDTjNxo3Rv1r/2bUcxYUKoMGBlq3622Rt8Rdmjo9IE/7dFsTtnqWJ0U3Sa3neSHxEf1Vbcm839+G+5V8LY3ZNFPk7wvX4Jn307o8sJ/4okpoTnYoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705676069; c=relaxed/simple; bh=oQxkSQ4O/ud5VcJBDiA8+ft0EzjaxWOJ7uOdw3yUGIk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=nmCZDMNZ293MdFiDOWhQ2zN2e5ehO9QUG0cCvBaiYYBMu1W01HML7G5NJw/GP2U+6jQ1Q6wOlg7YNKQgMQGQNppVs0lLV3+04MnbGaXLy1kGe9P2bRpgFd9ZwpZdoxqJLzFWy2UifNF+ANfs5MkGZcYhU/5Wc1FxPscB/1IUmT4= 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=VsAuQgls; 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=1705676067; 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=VsAuQglsbaetpoSH/asBihypGS1D0Lw/1Hfixu7SvUzNEBtDpzbPGLJg3/3S5MYotmstRH Ov1A/bLDAig87eBKm7ho4iqKSsXAsqGLWpX4IyciMAXAqhuyvxjT0mMd2rH6CrkcHyAQZt uz+uZctH4RMPgdteFvaBwiTwnA7sRKs= 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-609-VfYFFUBHNdin9KkcEv-clA-1; Fri, 19 Jan 2024 09:54:24 -0500 X-MC-Unique: VfYFFUBHNdin9KkcEv-clA-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 1734E106D107; Fri, 19 Jan 2024 14:54:23 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB5F351D5; Fri, 19 Jan 2024 14:54:16 +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 12/14] mips, crash: wrap crash dumping code into crash related ifdefs Date: Fri, 19 Jan 2024 22:52:39 +0800 Message-ID: <20240119145241.769622-13-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 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) { -- 2.41.0