Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1053156rdb; Fri, 19 Jan 2024 06:58:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgTAvf2ZHC9gX4l5V+InyhGXAhaMcBrJwOc4sBiKXVH0TfSMUNuv3IZ3L04sT4r6IBkBye X-Received: by 2002:a17:90a:cb11:b0:28f:f846:4ee8 with SMTP id z17-20020a17090acb1100b0028ff8464ee8mr1626752pjt.7.1705676290099; Fri, 19 Jan 2024 06:58:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705676290; cv=pass; d=google.com; s=arc-20160816; b=RVD7Ue9Z47ZVlK1rDsGjqGYGliFWNAPBgGIvz8AKgmk+mM8Cg2JBO8VPz6sHU7SkMC g5d/pZaXijve9rV/18d7bNOQqjnG+0oRTx9uGH3QGZcsTpWs1ggdRopj5ayg98FeMRG7 okvcuKCCrnrVMDuBYjYE99NAi+kK9V9CKxDTmRctiSQrZxU+NRgbKbUAmqAUDQVyi3ku a+LXuWrh3N+q3XiRYiSpLhRjjI+bZ7UbGHq9tB1PdQTKafQR9jcOK/oWXAQrmCPn3sj/ Yc3H1cLRvTqYpgJ1lFdCkquo4IRZIa8aD7RljFWYawjOQ+uQ3iUD9340yjToeoBhcd39 VTqw== 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=jDvYJxBJvZegSwo4Kk9zAYMdDY4WlX7FhACBVJ8AwnU=; fh=zRw2lYWZmEZ+xk8Dyhrd0rqHIpogjnUXaVblO2ikfrI=; b=q2k34XLQjKJwBm0G57e3mitprRjvIsORVUz/ASCFAsQ05XzhHXbO0DQFnONxgzhbwy mNxdRDQJx8BP8EJ8affI4bA70KwQTh7RdgtqQRdDtLO7WmMdt+6EFvIhPttBXt4bnI2S YxF60Wul1a1UB9k10B8ZJhwm/9bUT+y/0rKhLk26xKaqjD+ttJOiXDPMa8mnxv/KlQbd X2pk9j+/WuFc6XHksWr1cjJMgm9s2bFzszvcXPSEQs1HCIVhv6S9PyqzdMFGFrnkbe7u 1S209aK7FLst05XSEZb5uqSdfITq03gM09vCblGGnzykZZqSxqk7AytgBn66n7P+l78F gvog== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AnmkdkQi; 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-31291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31291-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 y37-20020a634965000000b005cf8b7a0629si3552282pgk.663.2024.01.19.06.58.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 06:58:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31291-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=AnmkdkQi; 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-31291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31291-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 94301B24E53 for ; Fri, 19 Jan 2024 14:56:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9D425674D; Fri, 19 Jan 2024 14:54:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AnmkdkQi" 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 A11D854F9B for ; Fri, 19 Jan 2024 14:54:42 +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=1705676084; cv=none; b=OR+RKUa54kP/aLqdSBsZQCLFlBUZOnZWU2EyueGQczwHY04tg85qqNVnDIKbi9xyurPZVBEfHoQloS9IEDvLhGyMSYMlKxo2nGgdcY1q+ANm/+z135KhE7BH9sAfM/QJnw4MorfyMQKVn7MG1CWUd0fBcO831YSdrMUuIfOl7p0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705676084; c=relaxed/simple; bh=OUjhJFF9q7D4YR1pSHqAvZMEA4AEazo/hcoLLBgzWxI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=Ucu3HCi4bLLr2YGKs3+KpPYSR1DXIHYMqfkCmz9PF4+JKsxii6LCuznjwb9whYUWD6kk8C/CZVywRgyWg85EZhVqB0vZ7P/XQW4h7KZeOxO+OlAVju4PZKUkFHrTywGICLMVvUHEmeQGtLguD8LyCcoMpd4LO/1PpdTyN6PB7fo= 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=AnmkdkQi; 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=1705676081; 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=jDvYJxBJvZegSwo4Kk9zAYMdDY4WlX7FhACBVJ8AwnU=; b=AnmkdkQiYVCCYD+Hsc2i83b4MO211wqNi4AC/Ld0g3I68hjuNb9dKuZN5NDC9CXtNrm9YI HoXK7Ps2hPy8/r7tyDeAi3K/ib4/3EOqkalo4B7YwoSMDbopXEeU9d8AWhIkUgz51L/NaD 5upeA4dRa7UgzSe/77HHrv4s3GcnmHA= 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-648-osoDulHkOveZzpDk9NGWvg-1; Fri, 19 Jan 2024 09:54:38 -0500 X-MC-Unique: osoDulHkOveZzpDk9NGWvg-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 12C54868A02; Fri, 19 Jan 2024 14:54:37 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id DBA8251D5; Fri, 19 Jan 2024 14:54:30 +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 14/14] loongarch, crash: wrap crash dumping code into crash related ifdefs Date: Fri, 19 Jan 2024 22:52:41 +0800 Message-ID: <20240119145241.769622-15-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 loongarch with some adjustments. Here 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/loongarch/kernel/setup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c index d183a745fb85..61f88dd97947 100644 --- a/arch/loongarch/kernel/setup.c +++ b/arch/loongarch/kernel/setup.c @@ -258,11 +258,13 @@ static void __init arch_reserve_vmcore(void) static void __init arch_parse_crashkernel(void) { -#ifdef CONFIG_KEXEC int ret; unsigned long long total_mem; unsigned long long crash_base, crash_size; + 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, @@ -283,7 +285,6 @@ static void __init arch_parse_crashkernel(void) crashk_res.start = crash_base; crashk_res.end = crash_base + crash_size - 1; -#endif } static void __init fdt_setup(void) @@ -468,7 +469,7 @@ static void __init resource_init(void) request_resource(res, &bss_resource); } -#ifdef CONFIG_KEXEC +#ifdef CONFIG_CRASH_RESERVE if (crashk_res.start < crashk_res.end) { insert_resource(&iomem_resource, &crashk_res); pr_info("Reserving %ldMB of memory at %ldMB for crashkernel\n", -- 2.41.0