From patchwork Wed Jan 24 05:12:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 191356 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp785196dyi; Tue, 23 Jan 2024 21:14:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPmLHPf6tTj8dxccb5tXhMgxBeFvAk+ZwHPgF0g41sCnFsjQ7ssx7wqAIZQrq3z2AQBtfq X-Received: by 2002:ac8:5805:0:b0:42a:3b39:5e with SMTP id g5-20020ac85805000000b0042a3b39005emr2243255qtg.94.1706073285676; Tue, 23 Jan 2024 21:14:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706073285; cv=pass; d=google.com; s=arc-20160816; b=vHBuui9k77NY4In0qcxMUI8z+4M07eFAoN77Nx7al4qKTs3NxiUeaAGrGV9+/yl8Uo 4YaHhmaaI+atpJssS1YMqscKvx+pmrpsf9QWS29FPjQGh91gP8MS79Sexh9qHus4w6xm k943rB2nfqVfV9GidS9wMiVrhbAhJGqLkVDE3JdIvR0P+rJOWv1tLk9ucqGST+H8e8UV cGBeTfp/ZhOh/yV03GVj4bDB+aAnhexJq3NaHPYdu6NY9ijkFvxhCOIdxWMwEFJbHYg5 2RaHfdZmogbdvchkSn28R98+RDIX7G5F84wK72irfpaUAaKLZoUXrjsS1TZvo+E4lctK e4IQ== 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=idAf8C8vEaEPhamo8i8Q+7QtJLmbWmmoc+K4mQqU0s4=; fh=zRw2lYWZmEZ+xk8Dyhrd0rqHIpogjnUXaVblO2ikfrI=; b=zeCVXtTv7PdJ8B2pcMWmbLFUlsrhO+4Ah6Ggve2OhlZmqSfCl5iZ44hR52cKO78AWJ 5OcLcQwD0AOfR0nSJeGCnUwGJ5Jb3J5F2XzLfc1CFRBN2tlw/OWrTgvngJGME/92pQxw Rh7FlmJTMmkRFhUMeez9qOC58MJJVxk4GgyrTS4sac2ZEBXIpQ302FPI6LaXIGei9+75 QqmpdLlP4RL/ZLroWScgwc2LTRTPf1Ifb40r59eorg88bmOOTSksfQDyH4A38R6bMUBk 9L9o3P0+NNNBobPKIK4xYTbKICeBxogWfHdWI/4q0aMz0JE4XjWpto1gyslMugTYFqBS vimQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cmDB7FFl; 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-36453-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36453-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u9-20020a05622a14c900b00429992c4d68si9376602qtx.526.2024.01.23.21.14.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 21:14:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36453-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cmDB7FFl; 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-36453-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36453-ouuuleilei=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 5F8DC1C274B6 for ; Wed, 24 Jan 2024 05:14:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5B57168C7; Wed, 24 Jan 2024 05:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cmDB7FFl" 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 89FE9F50A for ; Wed, 24 Jan 2024 05:13:47 +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=1706073229; cv=none; b=WfCZXFa/gr+yBNZ/i+2CrQS3VpIGyvh8zsxiWKLy/amQhFm0CUz1d2oFYlVuoPM1L5X6K7tnr+sfa9M7ZcWCYUVyScgDnPkpb1/6Q9OPamGtGkT2NKfZE4q2tR8/bgg31KaxSzDhJ6gXzFL0XaS8ejGxJz1zzkJDwQMD7j4GSqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706073229; c=relaxed/simple; bh=hFskVw87Sdr8raPjNAxR5rfjJTmG9iVV6lVF91D6qJA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=m8KkL6Uc5UtoNX8PjFTZyFVtMtm0crJr+EsOuUJuQzTs7kp1wR9pbbtq4Me61cA2IRGMWsPZO3hFGz8SnRmFyNyIBiY4ij58S2+HXUcXt7Up9AuQ92VzAhOKN9q9SeQc/NzyN1dXl5pzTIshzAjksV/ANMyNxbTMPGhqzLZQDf0= 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=cmDB7FFl; 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=1706073226; 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=idAf8C8vEaEPhamo8i8Q+7QtJLmbWmmoc+K4mQqU0s4=; b=cmDB7FFlTDfyJ21q/mM4jIlxLB27dLRgVefWN1YZ1BebTtnO1Jp04x/MUHucku5rdjss1w vOjkYEkTewFl0W6Yajge2O+Qi1CvzqhwVW8eGT6u5FrdDWdJ8m8iyRf6c/G0o6z82JGqo4 I2nqOvooi7b8kcmSBaD7coB0uSio+WU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-101-ttLakTbNM3uB_a-svY1mPA-1; Wed, 24 Jan 2024 00:13:41 -0500 X-MC-Unique: ttLakTbNM3uB_a-svY1mPA-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 A8E4738212D7; Wed, 24 Jan 2024 05:13:40 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18A5F1C060AF; Wed, 24 Jan 2024 05:13:34 +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 05/14] crash: clean up kdump related config items Date: Wed, 24 Jan 2024 13:12:45 +0800 Message-ID: <20240124051254.67105-6-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 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788947501804437061 X-GMAIL-MSGID: 1788947501804437061 By splitting CRASH_RESERVE and VMCORE_INFO out from CRASH_CORE, cleaning up the dependency of FA_DMUMP on CRASH_DUMP, and moving crash codes from kexec_core.c to crash_core.c, now we can rearrange CRASH_DUMP to depend on KEXEC_CORE, and make CRASH_DUMP select CRASH_RESERVE and VMCORE_INFO. KEXEC_CORE won't select CRASH_RESERVE and VMCORE_INFO any more because KEXEC_CORE enables codes which allocate control pages, copy kexec/kdump segments, and prepare for switching. These codes are shared by both kexec reboot and crash dumping. Doing this makes codes and the corresponding config items more logical (the right item depends on or is selected by the left item). PROC_KCORE -----------> VMCORE_INFO |----------> VMCORE_INFO FA_DUMP----| |----------> CRASH_RESERVE ---->VMCORE_INFO / |---->CRASH_RESERVE KEXEC --| /| |--> KEXEC_CORE--> CRASH_DUMP-->/-|---->PROC_VMCORE KEXEC_FILE --| \ | \---->CRASH_HOTPLUG KEXEC --| |--> KEXEC_CORE--> kexec reboot KEXEC_FILE --| Signed-off-by: Baoquan He --- kernel/Kconfig.kexec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec index 8faf27043432..6c34e63c88ff 100644 --- a/kernel/Kconfig.kexec +++ b/kernel/Kconfig.kexec @@ -9,8 +9,6 @@ config VMCORE_INFO bool config KEXEC_CORE - select VMCORE_INFO - select CRASH_RESERVE bool config KEXEC_ELF @@ -99,8 +97,11 @@ config KEXEC_JUMP config CRASH_DUMP bool "kernel crash dumps" + default y depends on ARCH_SUPPORTS_CRASH_DUMP - select KEXEC_CORE + depends on KEXEC_CORE + select VMCORE_INFO + select CRASH_RESERVE help Generate crash dump after being started by kexec. This should be normally only set in special crash dump kernels