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 862B5C35FFC for ; Tue, 25 Mar 2025 07:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=19WP4WFqsV7qujfoRGQmqqeN7h9hu1fjTeGwGJQZMdQ=; b=VAIf1KWO5U6qkxIAqRLsS+unXD O/2vlIqH/lvvvkZYxJcIV0iPoDe2KfBICNnwnryjWncarNCM9vQp1hOUAU2Q53IbiNPOWwA7nsSRf jrW1NHarceHirH3+1G7kFvmRZaTjrOzzORYQCzEGi0v9nzc5QhNLWHURbnjXSMptAWwU6wtddKL9m xO6emTnWtxLRoYhS0CHaeEHbQ8z7044jHWVrKbEOGoiFe5O4VcF/3fW3eu5G8zR3XxObGjDYFnqYI iHbNVQAOc5sWJLb10UxbAfEnSS9aV4BlUKEbwsYrusZy+oKNCuP56FMKq0qj2y8sp78BAAHDOBR2z BqpxJXUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1twyGV-000000051S8-2zon; Tue, 25 Mar 2025 06:59:59 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1twyEl-000000051AM-3WSS for linux-arm-kernel@lists.infradead.org; Tue, 25 Mar 2025 06:58:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742885891; 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=19WP4WFqsV7qujfoRGQmqqeN7h9hu1fjTeGwGJQZMdQ=; b=ev66NZ/8YtW5ytaS3lOY2iBWFbmEonZdopiiYdp7xjjKqYSGa+UCDvEHurpx63W/ne5Z/g dMqvDmYUR1xB8ZROriUaYLIsstodLLCX/v0zmXc9P4td7/4CODjtfyLvTn0y+O6BnJSK3D i61fsmOf/Dh5oYJeQZ1tnyKEmrUd+Yg= 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-83-qE_0gAprMS2WIAV1lbNLxA-1; Tue, 25 Mar 2025 02:58:04 -0400 X-MC-Unique: qE_0gAprMS2WIAV1lbNLxA-1 X-Mimecast-MFC-AGG-ID: qE_0gAprMS2WIAV1lbNLxA_1742885880 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 E98ED18DBA01; Tue, 25 Mar 2025 06:57:58 +0000 (UTC) Received: from localhost (unknown [10.72.112.60]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6E607180B48C; Tue, 25 Mar 2025 06:57:54 +0000 (UTC) Date: Tue, 25 Mar 2025 14:57:50 +0800 From: Baoquan He To: Dave Young Cc: Changyuan Lyu , linux-kernel@vger.kernel.org, graf@amazon.com, akpm@linux-foundation.org, luto@kernel.org, anthony.yznaga@oracle.com, arnd@arndb.de, ashish.kalra@amd.com, benh@kernel.crashing.org, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, dwmw2@infradead.org, ebiederm@xmission.com, mingo@redhat.com, jgowans@amazon.com, corbet@lwn.net, krzk@kernel.org, rppt@kernel.org, mark.rutland@arm.com, pbonzini@redhat.com, pasha.tatashin@soleen.com, hpa@zytor.com, peterz@infradead.org, ptyadav@amazon.de, robh+dt@kernel.org, robh@kernel.org, saravanak@google.com, skinsburskii@linux.microsoft.com, rostedt@goodmis.org, tglx@linutronix.de, thomas.lendacky@amd.com, usama.arif@bytedance.com, will@kernel.org, devicetree@vger.kernel.org, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Subject: Re: [PATCH v5 11/16] kexec: add config option for KHO Message-ID: References: <20250320015551.2157511-1-changyuanl@google.com> <20250320015551.2157511-12-changyuanl@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250324_235811_945923_1CAED00A X-CRM114-Status: GOOD ( 27.02 ) 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 On 03/24/25 at 12:18pm, Dave Young wrote: > On Thu, 20 Mar 2025 at 23:05, Changyuan Lyu wrote: > > > > From: Alexander Graf > > > > We have all generic code in place now to support Kexec with KHO. This > > patch adds a config option that depends on architecture support to > > enable KHO support. > > > > Signed-off-by: Alexander Graf > > Co-developed-by: Mike Rapoport (Microsoft) > > Signed-off-by: Mike Rapoport (Microsoft) > > Co-developed-by: Changyuan Lyu > > Signed-off-by: Changyuan Lyu > > --- > > kernel/Kconfig.kexec | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > > > diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec > > index 4d111f871951..57db99e758a8 100644 > > --- a/kernel/Kconfig.kexec > > +++ b/kernel/Kconfig.kexec > > @@ -95,6 +95,21 @@ config KEXEC_JUMP > > Jump between original kernel and kexeced kernel and invoke > > code in physical address mode via KEXEC > > > > +config KEXEC_HANDOVER > > + bool "kexec handover" > > + depends on ARCH_SUPPORTS_KEXEC_HANDOVER && ARCH_SUPPORTS_KEXEC_FILE > > + select MEMBLOCK_KHO_SCRATCH > > + select KEXEC_FILE > > + select DEBUG_FS > > + select LIBFDT > > + select CMA > > + select XXHASH > > + help > > + Allow kexec to hand over state across kernels by generating and > > + passing additional metadata to the target kernel. This is useful > > + to keep data or state alive across the kexec. For this to work, > > + both source and target kernels need to have this option enabled. > > + > > Have you tested kdump? In my mind there are two issues, one is with > CMA enabled, it could cause kdump crashkernel memory reservation > failures more often due to the fragmented low memory. Secondly, in kho scracth memorys are reserved much later than crashkernel, we may not need to worry about it. ==================== start_kernel() ...... -->setup_arch(&command_line); -->arch_reserve_crashkernel(); ...... -->mm_core_init(); -->kho_memory_init(); > kdump kernel dump the crazy scratch memory in vmcore is not very > meaningful. Otherwise I suspect this is not tested under kdump. If > so please disable this option for kdump. Yeah, it's not meaningful to dump out scratch memorys into vmcore. We may need to dig them out from eflcorehdr. While it's an optimization, kho scratch is not big relative to the entire system memory. It can be done in later stage. My personal opinion.