From mboxrd@z Thu Jan 1 00:00:00 1970 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 F3847C3DA4A for ; Fri, 9 Aug 2024 01:48:25 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P/Wez1Pf0cweH1hOpi3MXS76ERaxhhAwR2zJFLYKPQY=; b=XyOUI1BCiMU4MU BeunqGjBFFnpihbkwUTSQZqn5maRgPE6QLtnxbJ6L7RrrI0cMARYOfJhPytY9Mlvf8T2M8TZ7Pm/u xjdeoCMFcNwwNdSlURNdLoKL0IUZsf24QbJWyKASL+GEaUpam/7quC23t1G6cGfntzpIUAMFE46dW GZAXK0zt+txAld6o+rUhF2DtkTs7qgwNbEzRzxlod7YD6v2VUBPCMYYHpQ07anjrXgGc/z7xqdIA/ C6GU5KO4hc0cbYPeOCnrBj0+HHaAlFvGoQxlYRIDj6aC4Pu2Nl35RCcaLmR4uqAfvBaCNsd+epADF e2bbQjKla3iz6oI23neg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scEjw-00000009yGP-1MMh; Fri, 09 Aug 2024 01:48:24 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scEjt-00000009yFw-0RXs for kexec@lists.infradead.org; Fri, 09 Aug 2024 01:48:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723168099; 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: in-reply-to:in-reply-to:references:references; bh=hJ/62GROS7IbAy6zzGYGjfT+wmu/PxDh0548wPz6kXc=; b=SChRvP12VwRoQVJhNUiw6ood19TmUOMCIBvDDZeCexyYYnLUgow2BK6E6FR+pZC2aygplH eV7gDscdklElnvgTmmV3dOMUXWPljQFbIvOowoUrMBAA4wqWo80s31JBq1cpdZgsQ1zCDT aUL04/GzrlGjJor7heEuTl+9XtFHUQM= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-njZg67iROPSgfEfh6geabA-1; Thu, 08 Aug 2024 21:48:16 -0400 X-MC-Unique: njZg67iROPSgfEfh6geabA-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E26F91944D30; Fri, 9 Aug 2024 01:48:13 +0000 (UTC) Received: from localhost (unknown [10.72.112.129]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8AB7A19560AA; Fri, 9 Aug 2024 01:48:10 +0000 (UTC) Date: Fri, 9 Aug 2024 09:48:07 +0800 From: Baoquan He To: Sourabh Jain Cc: Petr Tesarik , Hari Bathini , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: Re: [PATCH] Document/kexec: Generalize crash hotplug description Message-ID: References: <20240805050829.297171-1-sourabhjain@linux.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240805050829.297171-1-sourabhjain@linux.ibm.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_184821_251350_C5A7293A X-CRM114-Status: GOOD ( 34.85 ) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org On 08/05/24 at 10:38am, Sourabh Jain wrote: > Commit 79365026f869 ("crash: add a new kexec flag for hotplug support") > generalizes the crash hotplug support to allow architectures to update > multiple kexec segments on CPU/Memory hotplug and not just elfcorehdr. > Therefore, update the relevant kernel documentation to reflect the same. > > No functional change. > > Cc: Petr Tesarik > Cc: Hari Bathini > Cc: kexec@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: x86@kernel.org > Signed-off-by: Sourabh Jain > --- > > Discussion about the documentation update: > https://lore.kernel.org/all/68d0328d-531a-4a2b-ab26-c97fd8a12e8b@linux.ibm.com/ > > --- > .../ABI/testing/sysfs-devices-memory | 6 ++-- > .../ABI/testing/sysfs-devices-system-cpu | 6 ++-- > .../admin-guide/mm/memory-hotplug.rst | 5 ++-- > Documentation/core-api/cpu_hotplug.rst | 10 ++++--- > kernel/crash_core.c | 29 ++++++++++++------- > 5 files changed, 33 insertions(+), 23 deletions(-) The overall looks good to me, except of concern from Petr. Thanks. > > diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory > index a95e0f17c35a..421acc8e2c6b 100644 > --- a/Documentation/ABI/testing/sysfs-devices-memory > +++ b/Documentation/ABI/testing/sysfs-devices-memory > @@ -115,6 +115,6 @@ What: /sys/devices/system/memory/crash_hotplug > Date: Aug 2023 > Contact: Linux kernel mailing list > Description: > - (RO) indicates whether or not the kernel directly supports > - modifying the crash elfcorehdr for memory hot un/plug and/or > - on/offline changes. > + (RO) indicates whether or not the kernel update of kexec > + segments on memory hot un/plug and/or on/offline events, > + avoiding the need to reload kdump kernel. > diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu > index 325873385b71..f4ada1cd2f96 100644 > --- a/Documentation/ABI/testing/sysfs-devices-system-cpu > +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu > @@ -703,9 +703,9 @@ What: /sys/devices/system/cpu/crash_hotplug > Date: Aug 2023 > Contact: Linux kernel mailing list > Description: > - (RO) indicates whether or not the kernel directly supports > - modifying the crash elfcorehdr for CPU hot un/plug and/or > - on/offline changes. > + (RO) indicates whether or not the kernel update of kexec > + segments on CPU hot un/plug and/or on/offline events, > + avoiding the need to reload kdump kernel. > > What: /sys/devices/system/cpu/enabled > Date: Nov 2022 > diff --git a/Documentation/admin-guide/mm/memory-hotplug.rst b/Documentation/admin-guide/mm/memory-hotplug.rst > index 098f14d83e99..cb2c080f400c 100644 > --- a/Documentation/admin-guide/mm/memory-hotplug.rst > +++ b/Documentation/admin-guide/mm/memory-hotplug.rst > @@ -294,8 +294,9 @@ The following files are currently defined: > ``crash_hotplug`` read-only: when changes to the system memory map > occur due to hot un/plug of memory, this file contains > '1' if the kernel updates the kdump capture kernel memory > - map itself (via elfcorehdr), or '0' if userspace must update > - the kdump capture kernel memory map. > + map itself (via elfcorehdr and other relevant kexec > + segments), or '0' if userspace must update the kdump > + capture kernel memory map. > > Availability depends on the CONFIG_MEMORY_HOTPLUG kernel > configuration option. > diff --git a/Documentation/core-api/cpu_hotplug.rst b/Documentation/core-api/cpu_hotplug.rst > index dcb0e379e5e8..a21dbf261be7 100644 > --- a/Documentation/core-api/cpu_hotplug.rst > +++ b/Documentation/core-api/cpu_hotplug.rst > @@ -737,8 +737,9 @@ can process the event further. > > When changes to the CPUs in the system occur, the sysfs file > /sys/devices/system/cpu/crash_hotplug contains '1' if the kernel > -updates the kdump capture kernel list of CPUs itself (via elfcorehdr), > -or '0' if userspace must update the kdump capture kernel list of CPUs. > +updates the kdump capture kernel list of CPUs itself (via elfcorehdr and > +other relevant kexec segment), or '0' if userspace must update the kdump > +capture kernel list of CPUs. > > The availability depends on the CONFIG_HOTPLUG_CPU kernel configuration > option. > @@ -750,8 +751,9 @@ file can be used in a udev rule as follows: > SUBSYSTEM=="cpu", ATTRS{crash_hotplug}=="1", GOTO="kdump_reload_end" > > For a CPU hot un/plug event, if the architecture supports kernel updates > -of the elfcorehdr (which contains the list of CPUs), then the rule skips > -the unload-then-reload of the kdump capture kernel. > +of the elfcorehdr (which contains the list of CPUs) and other relevant > +kexec segments, then the rule skips the unload-then-reload of the kdump > +capture kernel. > > Kernel Inline Documentations Reference > ====================================== > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index 63cf89393c6e..64dad01e260b 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -520,18 +520,25 @@ int crash_check_hotplug_support(void) > } > > /* > - * To accurately reflect hot un/plug changes of cpu and memory resources > - * (including onling and offlining of those resources), the elfcorehdr > - * (which is passed to the crash kernel via the elfcorehdr= parameter) > - * must be updated with the new list of CPUs and memories. > + * To accurately reflect hot un/plug changes of CPU and Memory resources > + * (including onling and offlining of those resources), the relevant > + * kexec segments must be updated with latest CPU and Memory resources. > * > - * In order to make changes to elfcorehdr, two conditions are needed: > - * First, the segment containing the elfcorehdr must be large enough > - * to permit a growing number of resources; the elfcorehdr memory size > - * is based on NR_CPUS_DEFAULT and CRASH_MAX_MEMORY_RANGES. > - * Second, purgatory must explicitly exclude the elfcorehdr from the > - * list of segments it checks (since the elfcorehdr changes and thus > - * would require an update to purgatory itself to update the digest). > + * Architectures must ensure two things for all segments that need > + * updating during hotplug events: > + * > + * 1. Segments must be large enough to accommodate a growing number of > + * resources. > + * 2. Exclude the segments from SHA verification. > + * > + * For example, on most architectures, the elfcorehdr (which is passed > + * to the crash kernel via the elfcorehdr= parameter) must include the > + * new list of CPUs and memory. To make changes to the elfcorehdr, it > + * should be large enough to permit a growing number of CPU and Memory > + * resources. One can estimate the elfcorehdr memory size based on > + * NR_CPUS_DEFAULT and CRASH_MAX_MEMORY_RANGES. The elfcorehdr is > + * excluded from SHA verification by default if the architecture > + * supports crash hotplug. > */ > static void crash_handle_hotplug_event(unsigned int hp_action, unsigned int cpu, void *arg) > { > -- > 2.45.2 > _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 05961C3DA4A for ; Fri, 9 Aug 2024 01:49:09 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TILRPx6a; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KU2XTSvr; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Wg6K04ZC3z2ypm for ; Fri, 9 Aug 2024 11:49:08 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TILRPx6a; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KU2XTSvr; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=bhe@redhat.com; receiver=lists.ozlabs.org) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4Wg6JB6mBgz2xnW for ; Fri, 9 Aug 2024 11:48:24 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723168101; 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: in-reply-to:in-reply-to:references:references; bh=hJ/62GROS7IbAy6zzGYGjfT+wmu/PxDh0548wPz6kXc=; b=TILRPx6aZaRVJSaxiIG3lcHEQZ/QYGilqXqDkgXKZlVMKcepjY3fsuTuOIQpMvLyD8TBRG LbJmHHktRHNG/6YQGxKoYXQaZB5kc97n238mBQXj3FNG/T4+1jY6oTBxPcYOCEktCSVPf0 4scjRM/jya2CJwtSgI0nv3LXcBnxu+Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723168102; 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: in-reply-to:in-reply-to:references:references; bh=hJ/62GROS7IbAy6zzGYGjfT+wmu/PxDh0548wPz6kXc=; b=KU2XTSvrCJjsK/deHPdRcYY1OaRKoDBYKRDZ3UuT3rZBOpnISBeOGVZV3IT4840loxuJ6A OTFkRMbhpK0iR9MWwF68qau0pqLJAvjk/7bYrBd89Lq8oL7VqUmkpuY2GOnA+8OC28U8ik xgvmIQNMhUXttK9CWJuei8Xfb045rj0= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-njZg67iROPSgfEfh6geabA-1; Thu, 08 Aug 2024 21:48:16 -0400 X-MC-Unique: njZg67iROPSgfEfh6geabA-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E26F91944D30; Fri, 9 Aug 2024 01:48:13 +0000 (UTC) Received: from localhost (unknown [10.72.112.129]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8AB7A19560AA; Fri, 9 Aug 2024 01:48:10 +0000 (UTC) Date: Fri, 9 Aug 2024 09:48:07 +0800 From: Baoquan He To: Sourabh Jain Subject: Re: [PATCH] Document/kexec: Generalize crash hotplug description Message-ID: References: <20240805050829.297171-1-sourabhjain@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240805050829.297171-1-sourabhjain@linux.ibm.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Petr Tesarik , x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Hari Bathini Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 08/05/24 at 10:38am, Sourabh Jain wrote: > Commit 79365026f869 ("crash: add a new kexec flag for hotplug support") > generalizes the crash hotplug support to allow architectures to update > multiple kexec segments on CPU/Memory hotplug and not just elfcorehdr. > Therefore, update the relevant kernel documentation to reflect the same. > > No functional change. > > Cc: Petr Tesarik > Cc: Hari Bathini > Cc: kexec@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: x86@kernel.org > Signed-off-by: Sourabh Jain > --- > > Discussion about the documentation update: > https://lore.kernel.org/all/68d0328d-531a-4a2b-ab26-c97fd8a12e8b@linux.ibm.com/ > > --- > .../ABI/testing/sysfs-devices-memory | 6 ++-- > .../ABI/testing/sysfs-devices-system-cpu | 6 ++-- > .../admin-guide/mm/memory-hotplug.rst | 5 ++-- > Documentation/core-api/cpu_hotplug.rst | 10 ++++--- > kernel/crash_core.c | 29 ++++++++++++------- > 5 files changed, 33 insertions(+), 23 deletions(-) The overall looks good to me, except of concern from Petr. Thanks. > > diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory > index a95e0f17c35a..421acc8e2c6b 100644 > --- a/Documentation/ABI/testing/sysfs-devices-memory > +++ b/Documentation/ABI/testing/sysfs-devices-memory > @@ -115,6 +115,6 @@ What: /sys/devices/system/memory/crash_hotplug > Date: Aug 2023 > Contact: Linux kernel mailing list > Description: > - (RO) indicates whether or not the kernel directly supports > - modifying the crash elfcorehdr for memory hot un/plug and/or > - on/offline changes. > + (RO) indicates whether or not the kernel update of kexec > + segments on memory hot un/plug and/or on/offline events, > + avoiding the need to reload kdump kernel. > diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu > index 325873385b71..f4ada1cd2f96 100644 > --- a/Documentation/ABI/testing/sysfs-devices-system-cpu > +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu > @@ -703,9 +703,9 @@ What: /sys/devices/system/cpu/crash_hotplug > Date: Aug 2023 > Contact: Linux kernel mailing list > Description: > - (RO) indicates whether or not the kernel directly supports > - modifying the crash elfcorehdr for CPU hot un/plug and/or > - on/offline changes. > + (RO) indicates whether or not the kernel update of kexec > + segments on CPU hot un/plug and/or on/offline events, > + avoiding the need to reload kdump kernel. > > What: /sys/devices/system/cpu/enabled > Date: Nov 2022 > diff --git a/Documentation/admin-guide/mm/memory-hotplug.rst b/Documentation/admin-guide/mm/memory-hotplug.rst > index 098f14d83e99..cb2c080f400c 100644 > --- a/Documentation/admin-guide/mm/memory-hotplug.rst > +++ b/Documentation/admin-guide/mm/memory-hotplug.rst > @@ -294,8 +294,9 @@ The following files are currently defined: > ``crash_hotplug`` read-only: when changes to the system memory map > occur due to hot un/plug of memory, this file contains > '1' if the kernel updates the kdump capture kernel memory > - map itself (via elfcorehdr), or '0' if userspace must update > - the kdump capture kernel memory map. > + map itself (via elfcorehdr and other relevant kexec > + segments), or '0' if userspace must update the kdump > + capture kernel memory map. > > Availability depends on the CONFIG_MEMORY_HOTPLUG kernel > configuration option. > diff --git a/Documentation/core-api/cpu_hotplug.rst b/Documentation/core-api/cpu_hotplug.rst > index dcb0e379e5e8..a21dbf261be7 100644 > --- a/Documentation/core-api/cpu_hotplug.rst > +++ b/Documentation/core-api/cpu_hotplug.rst > @@ -737,8 +737,9 @@ can process the event further. > > When changes to the CPUs in the system occur, the sysfs file > /sys/devices/system/cpu/crash_hotplug contains '1' if the kernel > -updates the kdump capture kernel list of CPUs itself (via elfcorehdr), > -or '0' if userspace must update the kdump capture kernel list of CPUs. > +updates the kdump capture kernel list of CPUs itself (via elfcorehdr and > +other relevant kexec segment), or '0' if userspace must update the kdump > +capture kernel list of CPUs. > > The availability depends on the CONFIG_HOTPLUG_CPU kernel configuration > option. > @@ -750,8 +751,9 @@ file can be used in a udev rule as follows: > SUBSYSTEM=="cpu", ATTRS{crash_hotplug}=="1", GOTO="kdump_reload_end" > > For a CPU hot un/plug event, if the architecture supports kernel updates > -of the elfcorehdr (which contains the list of CPUs), then the rule skips > -the unload-then-reload of the kdump capture kernel. > +of the elfcorehdr (which contains the list of CPUs) and other relevant > +kexec segments, then the rule skips the unload-then-reload of the kdump > +capture kernel. > > Kernel Inline Documentations Reference > ====================================== > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index 63cf89393c6e..64dad01e260b 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -520,18 +520,25 @@ int crash_check_hotplug_support(void) > } > > /* > - * To accurately reflect hot un/plug changes of cpu and memory resources > - * (including onling and offlining of those resources), the elfcorehdr > - * (which is passed to the crash kernel via the elfcorehdr= parameter) > - * must be updated with the new list of CPUs and memories. > + * To accurately reflect hot un/plug changes of CPU and Memory resources > + * (including onling and offlining of those resources), the relevant > + * kexec segments must be updated with latest CPU and Memory resources. > * > - * In order to make changes to elfcorehdr, two conditions are needed: > - * First, the segment containing the elfcorehdr must be large enough > - * to permit a growing number of resources; the elfcorehdr memory size > - * is based on NR_CPUS_DEFAULT and CRASH_MAX_MEMORY_RANGES. > - * Second, purgatory must explicitly exclude the elfcorehdr from the > - * list of segments it checks (since the elfcorehdr changes and thus > - * would require an update to purgatory itself to update the digest). > + * Architectures must ensure two things for all segments that need > + * updating during hotplug events: > + * > + * 1. Segments must be large enough to accommodate a growing number of > + * resources. > + * 2. Exclude the segments from SHA verification. > + * > + * For example, on most architectures, the elfcorehdr (which is passed > + * to the crash kernel via the elfcorehdr= parameter) must include the > + * new list of CPUs and memory. To make changes to the elfcorehdr, it > + * should be large enough to permit a growing number of CPU and Memory > + * resources. One can estimate the elfcorehdr memory size based on > + * NR_CPUS_DEFAULT and CRASH_MAX_MEMORY_RANGES. The elfcorehdr is > + * excluded from SHA verification by default if the architecture > + * supports crash hotplug. > */ > static void crash_handle_hotplug_event(unsigned int hp_action, unsigned int cpu, void *arg) > { > -- > 2.45.2 > From mboxrd@z Thu Jan 1 00:00:00 1970 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 D34D54437 for ; Fri, 9 Aug 2024 01:48:18 +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=1723168101; cv=none; b=lLupXeg5c/G5AHD1Xmx2kkgRzmDXvql9uVKQnvW2Y936jGL2YUuEALmW8OOH/B71vMSXJMJpEEao0HoIwZS9Lm+QLbFz3NWJ6IAlbw/twHxN6gdhYpb56xkoQnlzdvOJmtbRY/A2g0PEFUGCvG2c6eJ7e/ONjpnbz2yh9kh2/I8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723168101; c=relaxed/simple; bh=hIorfh9aullSsfAHSU375FiXojloEqMDbiJr4DoJSc0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H1BxFhiN+mWCibQ68OIFe6tB3XSFtgSmQ3TeJcOjNmfYsibNhOMtgRNF7a9+tLED8qac5aqP8GdUU60qmMXcu4A+DdCu5/ohdV8RWyND3HPSCDUgmMIo5YFGzqnVamd7xjNJlaBUe+09VJpenUyTotjIdXKcyt3pUsyYoMwBpWk= 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=Eg7+zRV/; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Eg7+zRV/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723168097; 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: in-reply-to:in-reply-to:references:references; bh=hJ/62GROS7IbAy6zzGYGjfT+wmu/PxDh0548wPz6kXc=; b=Eg7+zRV/vrNjgp793/hHvBwZXu0rASuCaZ6/s0lXd/aIWTV1UBs8eNuMSunVfZUcM0YC1R MomyZPrpFcy0EPXUi03Hgegbp0WIAOp2KOUWO2QPkIlmRWdJAU9hYY5gw2/+vD6z/abFxY fYgZwY6/S3pQq9C2/E1aOLJBxq2jAUo= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-njZg67iROPSgfEfh6geabA-1; Thu, 08 Aug 2024 21:48:16 -0400 X-MC-Unique: njZg67iROPSgfEfh6geabA-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E26F91944D30; Fri, 9 Aug 2024 01:48:13 +0000 (UTC) Received: from localhost (unknown [10.72.112.129]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8AB7A19560AA; Fri, 9 Aug 2024 01:48:10 +0000 (UTC) Date: Fri, 9 Aug 2024 09:48:07 +0800 From: Baoquan He To: Sourabh Jain Cc: Petr Tesarik , Hari Bathini , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: Re: [PATCH] Document/kexec: Generalize crash hotplug description Message-ID: References: <20240805050829.297171-1-sourabhjain@linux.ibm.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; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240805050829.297171-1-sourabhjain@linux.ibm.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 On 08/05/24 at 10:38am, Sourabh Jain wrote: > Commit 79365026f869 ("crash: add a new kexec flag for hotplug support") > generalizes the crash hotplug support to allow architectures to update > multiple kexec segments on CPU/Memory hotplug and not just elfcorehdr. > Therefore, update the relevant kernel documentation to reflect the same. > > No functional change. > > Cc: Petr Tesarik > Cc: Hari Bathini > Cc: kexec@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: x86@kernel.org > Signed-off-by: Sourabh Jain > --- > > Discussion about the documentation update: > https://lore.kernel.org/all/68d0328d-531a-4a2b-ab26-c97fd8a12e8b@linux.ibm.com/ > > --- > .../ABI/testing/sysfs-devices-memory | 6 ++-- > .../ABI/testing/sysfs-devices-system-cpu | 6 ++-- > .../admin-guide/mm/memory-hotplug.rst | 5 ++-- > Documentation/core-api/cpu_hotplug.rst | 10 ++++--- > kernel/crash_core.c | 29 ++++++++++++------- > 5 files changed, 33 insertions(+), 23 deletions(-) The overall looks good to me, except of concern from Petr. Thanks. > > diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory > index a95e0f17c35a..421acc8e2c6b 100644 > --- a/Documentation/ABI/testing/sysfs-devices-memory > +++ b/Documentation/ABI/testing/sysfs-devices-memory > @@ -115,6 +115,6 @@ What: /sys/devices/system/memory/crash_hotplug > Date: Aug 2023 > Contact: Linux kernel mailing list > Description: > - (RO) indicates whether or not the kernel directly supports > - modifying the crash elfcorehdr for memory hot un/plug and/or > - on/offline changes. > + (RO) indicates whether or not the kernel update of kexec > + segments on memory hot un/plug and/or on/offline events, > + avoiding the need to reload kdump kernel. > diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu > index 325873385b71..f4ada1cd2f96 100644 > --- a/Documentation/ABI/testing/sysfs-devices-system-cpu > +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu > @@ -703,9 +703,9 @@ What: /sys/devices/system/cpu/crash_hotplug > Date: Aug 2023 > Contact: Linux kernel mailing list > Description: > - (RO) indicates whether or not the kernel directly supports > - modifying the crash elfcorehdr for CPU hot un/plug and/or > - on/offline changes. > + (RO) indicates whether or not the kernel update of kexec > + segments on CPU hot un/plug and/or on/offline events, > + avoiding the need to reload kdump kernel. > > What: /sys/devices/system/cpu/enabled > Date: Nov 2022 > diff --git a/Documentation/admin-guide/mm/memory-hotplug.rst b/Documentation/admin-guide/mm/memory-hotplug.rst > index 098f14d83e99..cb2c080f400c 100644 > --- a/Documentation/admin-guide/mm/memory-hotplug.rst > +++ b/Documentation/admin-guide/mm/memory-hotplug.rst > @@ -294,8 +294,9 @@ The following files are currently defined: > ``crash_hotplug`` read-only: when changes to the system memory map > occur due to hot un/plug of memory, this file contains > '1' if the kernel updates the kdump capture kernel memory > - map itself (via elfcorehdr), or '0' if userspace must update > - the kdump capture kernel memory map. > + map itself (via elfcorehdr and other relevant kexec > + segments), or '0' if userspace must update the kdump > + capture kernel memory map. > > Availability depends on the CONFIG_MEMORY_HOTPLUG kernel > configuration option. > diff --git a/Documentation/core-api/cpu_hotplug.rst b/Documentation/core-api/cpu_hotplug.rst > index dcb0e379e5e8..a21dbf261be7 100644 > --- a/Documentation/core-api/cpu_hotplug.rst > +++ b/Documentation/core-api/cpu_hotplug.rst > @@ -737,8 +737,9 @@ can process the event further. > > When changes to the CPUs in the system occur, the sysfs file > /sys/devices/system/cpu/crash_hotplug contains '1' if the kernel > -updates the kdump capture kernel list of CPUs itself (via elfcorehdr), > -or '0' if userspace must update the kdump capture kernel list of CPUs. > +updates the kdump capture kernel list of CPUs itself (via elfcorehdr and > +other relevant kexec segment), or '0' if userspace must update the kdump > +capture kernel list of CPUs. > > The availability depends on the CONFIG_HOTPLUG_CPU kernel configuration > option. > @@ -750,8 +751,9 @@ file can be used in a udev rule as follows: > SUBSYSTEM=="cpu", ATTRS{crash_hotplug}=="1", GOTO="kdump_reload_end" > > For a CPU hot un/plug event, if the architecture supports kernel updates > -of the elfcorehdr (which contains the list of CPUs), then the rule skips > -the unload-then-reload of the kdump capture kernel. > +of the elfcorehdr (which contains the list of CPUs) and other relevant > +kexec segments, then the rule skips the unload-then-reload of the kdump > +capture kernel. > > Kernel Inline Documentations Reference > ====================================== > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index 63cf89393c6e..64dad01e260b 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -520,18 +520,25 @@ int crash_check_hotplug_support(void) > } > > /* > - * To accurately reflect hot un/plug changes of cpu and memory resources > - * (including onling and offlining of those resources), the elfcorehdr > - * (which is passed to the crash kernel via the elfcorehdr= parameter) > - * must be updated with the new list of CPUs and memories. > + * To accurately reflect hot un/plug changes of CPU and Memory resources > + * (including onling and offlining of those resources), the relevant > + * kexec segments must be updated with latest CPU and Memory resources. > * > - * In order to make changes to elfcorehdr, two conditions are needed: > - * First, the segment containing the elfcorehdr must be large enough > - * to permit a growing number of resources; the elfcorehdr memory size > - * is based on NR_CPUS_DEFAULT and CRASH_MAX_MEMORY_RANGES. > - * Second, purgatory must explicitly exclude the elfcorehdr from the > - * list of segments it checks (since the elfcorehdr changes and thus > - * would require an update to purgatory itself to update the digest). > + * Architectures must ensure two things for all segments that need > + * updating during hotplug events: > + * > + * 1. Segments must be large enough to accommodate a growing number of > + * resources. > + * 2. Exclude the segments from SHA verification. > + * > + * For example, on most architectures, the elfcorehdr (which is passed > + * to the crash kernel via the elfcorehdr= parameter) must include the > + * new list of CPUs and memory. To make changes to the elfcorehdr, it > + * should be large enough to permit a growing number of CPU and Memory > + * resources. One can estimate the elfcorehdr memory size based on > + * NR_CPUS_DEFAULT and CRASH_MAX_MEMORY_RANGES. The elfcorehdr is > + * excluded from SHA verification by default if the architecture > + * supports crash hotplug. > */ > static void crash_handle_hotplug_event(unsigned int hp_action, unsigned int cpu, void *arg) > { > -- > 2.45.2 >