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 5B6734B9E4B for ; Thu, 8 Jan 2026 10:35:25 +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=1767868529; cv=none; b=D7q1ESlQ33j8tunYkN9whY/XzI9YVtds4b/Nopa+hFGhI5O+NG3GeKqDVLfwgzipMYBhIY7NuF7rHJeIDeG4Bm4e/Mtw2U8KKMPrZHrWuvKpq0dg6VH5FGsnc2Efp8E4T67u3AJzETEfGyKXuQL+DJZ4Ij8dVd8RAPldyiXH33U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767868529; c=relaxed/simple; bh=mEzAX61YsLYXN0P3qq7+lDokGIJiHwkM3/J5ThZGHnM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rz+f80FDtbNonjtTBd06JH9EnP8D3LJazBy2Y7evw8R0dOqEmX7RP9Oat5JzHqngrHDEhAAxFBUNSfRQOVakNfCcL6acZ80GCE3g577Y5/Yt7DnlwVu0eci5jPjTyuMQe4aJNL6TfF6cC0TQIoRheQfYLn1q1yv8cz8CMNIqZ3M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=a6iNZwtw; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=kp1NZt4h; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="a6iNZwtw"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="kp1NZt4h" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767868524; 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=Q4CgrKoI+gqPjZdUskKAdxCjFm05f46fwS6i3N+5Edg=; b=a6iNZwtwj68FrR08CGGPfZQ7h7LczQZi0bEvFPAPHNsQ5XLUOA85kAXGfzM1mMJV/9y+h5 8Z5fZ8Q1fLiPupAkIRy0eR5k8/1Uq8NcCt/5UyJRMQw91/AMJp+0ukf8EIy+A55W5sxZ43 UQpzbIqWWM7Xg0xzxzk97gZF5CvyrOw= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-481-tuZKSnaiOOuPv809nPuL-w-1; Thu, 08 Jan 2026 05:35:23 -0500 X-MC-Unique: tuZKSnaiOOuPv809nPuL-w-1 X-Mimecast-MFC-AGG-ID: tuZKSnaiOOuPv809nPuL-w_1767868522 Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-29f1f79d6afso45636635ad.0 for ; Thu, 08 Jan 2026 02:35:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1767868522; x=1768473322; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Q4CgrKoI+gqPjZdUskKAdxCjFm05f46fwS6i3N+5Edg=; b=kp1NZt4hHp1z5k40vLMtpKcQ3/eLOu7dAbd3+1fJCoyMwUHE3UZqjlh8lByjqLDz0p 36crWVAIdO/FXO/IQ8iBTpA8x7RITI+T5t/X6EPmXK/UqERlNJmaycDXqQP68HQP3YsL YueJ4zs4epqRkIRVaRR+6QhdAGIMCmJBtBfulKBtlQMw1qljyYAm9qNRRVzdMKX+IbhD /YJ6nfiBdv4AoiIllDgZ8xTgi59RSumspTPjeaFnOdwccVGTmm/HZa7NduGKNpS6BK8t TjhpPmrIMOCTxMi8FJIKxW0ux5rMiUqfICzose48U3DYbhpjU3fRQgDtQTE1xSy0C+rg zljg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767868522; x=1768473322; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q4CgrKoI+gqPjZdUskKAdxCjFm05f46fwS6i3N+5Edg=; b=GNYfw2mCAdQSPuMRgbCFjcT/My8k67yMqMZLKhflCygp5ISDCtynGmmBadXhHkFuww vnAhy99WSyR1qJbGkZxnrlIz7J9bloRh748uYByO+S033zXQxoHk1/YrTbG6om7jfNnl mfXqmlBOTOvdjW2goTLD3y5v5uhbV/2GlpB2GofkGGUqHDnU1ulKoefk0E1Z0WAIUrRf pkkVOcJZq0Q+LYYi4JPkXlyJX4Yv+Wg/F0VkEfNwSr4VE2+9/asNP5hmgLBWO5C59RX3 x2MDVrADKGE3vgtGIr3foisxHx5GQPh4vDFyH7VdjhwiKnoIAJvTyBN/cKCizAbf1CEr 2Aig== X-Forwarded-Encrypted: i=1; AJvYcCUlfxLjpEvZaUk8CqVzzqCKaK+5otKkFIT4Eq/81OrJzw/eauupvAr673V+uwWLuaD6v0rsJpEfrotaVcg=@vger.kernel.org X-Gm-Message-State: AOJu0YwWmv7DeqcV5sI8m+DhtdY3k16Yig8J8F7V9KzdNWm+OddBpds1 r6OhpIxItWwudjfkItdos0SqsZfpRCsPRara23sGixcCCOIHq7MOqv2iNr59xKh8rN3RJLb2zbx LQIMHo2sDyAwFQYEFfxA3IZilb0y28vADdrMeUUd8phiPEjH9tO5X0jH07v3fiXaT6A== X-Gm-Gg: AY/fxX46wHNpoS02vzt0prcUDC96tR9lbzsA4ahzc67YZseIzZxpS2ahUWIe9AJYNaa 9jLixsoYZJ/eCzCBeY5+Xj+R8vBQeawzOCftbRBw9e2sDSRcLr/4CNd955D0MTW00rBgU6dVNPu 8xwp/cRYGgeha24oe4qFqT4rKfvV/rWaqKYGyMkGEkG5618KRsGYB/30jfuWJtUweEs9AVU8b1Y d1z9XA+ZjLdHf2x+YD/N2xml0+vfleEkCkK7JRAbHNP+6Lt8cwAeNhoaM7iMVYRg0D0p9lPEilB dmSTNBrYdfMEQ/GY7i8tgmOR+oaPGuh3wU7qD0tRHq0LOQrcgr7ANnu/7dWi5Rxrlb7Xh58h7dw + X-Received: by 2002:a17:903:46c5:b0:2a3:e89c:593e with SMTP id d9443c01a7336-2a3ee41f181mr62398245ad.4.1767868522227; Thu, 08 Jan 2026 02:35:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFWb7Nq1EAzfMOaDGj/G/lGftVbslZgXtHq29CNW23TT+aB3wwbYZDR2hEBzPzfJM832bE6sw== X-Received: by 2002:a17:903:46c5:b0:2a3:e89c:593e with SMTP id d9443c01a7336-2a3ee41f181mr62397775ad.4.1767868521555; Thu, 08 Jan 2026 02:35:21 -0800 (PST) Received: from localhost ([209.132.188.88]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a3e3c48c2bsm74465035ad.26.2026.01.08.02.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jan 2026 02:35:21 -0800 (PST) Date: Thu, 8 Jan 2026 18:32:55 +0800 From: Coiby Xu To: Sourabh Jain Cc: kexec@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Thomas Staudt , Arnaud Lefebvre , Baoquan he , Dave Young , Kairui Song , Pingfan Liu , Andrew Morton , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Vivek Goyal , open list Subject: Re: [PATCH v2] powerpc/kdump: pass dm-crypt keys to kdump kernel Message-ID: References: <20251226140636.1378505-1-coxu@redhat.com> <20260106074039.564707-1-coxu@redhat.com> <9aa592c9-c766-4aac-a60c-25dd5c2f143d@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; format=flowed Content-Disposition: inline In-Reply-To: <9aa592c9-c766-4aac-a60c-25dd5c2f143d@linux.ibm.com> On Wed, Jan 07, 2026 at 02:32:41PM +0530, Sourabh Jain wrote: > > >On 06/01/26 13:10, Coiby Xu wrote: >>CONFIG_CRASH_DM_CRYPT has been introduced to support LUKS-encrypted >>device dump target by addressing two challenges [1], >> - Kdump kernel may not be able to decrypt the LUKS partition. For some >> machines, a system administrator may not have a chance to enter the >> password to decrypt the device in kdump initramfs after the 1st kernel >> crashes >> >> - LUKS2 by default use the memory-hard Argon2 key derivation function >> which is quite memory-consuming compared to the limited memory reserved >> for kdump. >> >>To also enable this feature for PowerPC, we only need to let 1st kernel >>build up the kernel command parameter dmcryptkeys as similar to >>elfcorehdr to pass the memory address of the stored info of dm-crypt >>keys to the kdump kernel. >> >>Note to avoid a building failure [2] caused by undeclared function >>crash_load_dm_crypt_keys when CONFIG_CRASH_DUMP is not enabled, >>realign the function declaration with CONFIG_CRASH_DM_CRYPT. >> >>[1] https://lore.kernel.org/all/20250502011246.99238-1-coxu@redhat.com/ >>[2] https://lore.kernel.org/oe-kbuild-all/202512272218.ghBaSjzO-lkp@intel.com/ >> >>Cc: Thomas Staudt >>Cc: Arnaud Lefebvre >>Cc: Baoquan he >>Cc: Dave Young >>Cc: Kairui Song >>Cc: Pingfan Liu >>Cc: Andrew Morton >>Cc: Sourabh Jain >>Signed-off-by: Coiby Xu >>--- >>v2: >>- fix double kfree issue [Sourabh] >>- corretly kfree old modified_cmdline >>- use imperative mood for commit message >>- fix a compiling error caught by kernel test robot >> >> arch/powerpc/include/asm/kexec.h | 3 ++- >> arch/powerpc/kexec/elf_64.c | 27 ++++++++++++++++++++++++++- >> arch/powerpc/kexec/file_load.c | 18 ++++++++++-------- >> include/linux/crash_core.h | 14 +++++++------- >> 4 files changed, 45 insertions(+), 17 deletions(-) >> >>diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h >>index bd4a6c42a5f3..f3d098d543b4 100644 >>--- a/arch/powerpc/include/asm/kexec.h >>+++ b/arch/powerpc/include/asm/kexec.h >>@@ -80,7 +80,8 @@ struct kimage_arch { >> }; >> char *setup_kdump_cmdline(struct kimage *image, char *cmdline, >>- unsigned long cmdline_len); >>+ unsigned long cmdline_len, >>+ char *name, unsigned long addr); >> int setup_purgatory(struct kimage *image, const void *slave_code, >> const void *fdt, unsigned long kernel_load_addr, >> unsigned long fdt_load_addr); >>diff --git a/arch/powerpc/kexec/elf_64.c b/arch/powerpc/kexec/elf_64.c >>index 5d6d616404cf..995d7e8e98e1 100644 >>--- a/arch/powerpc/kexec/elf_64.c >>+++ b/arch/powerpc/kexec/elf_64.c >>@@ -81,13 +81,38 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, >> /* Setup cmdline for kdump kernel case */ >> modified_cmdline = setup_kdump_cmdline(image, cmdline, >>- cmdline_len); >>+ cmdline_len, >>+ "elfcorehdr", >>+ image->elf_load_addr); >> if (!modified_cmdline) { >> pr_err("Setting up cmdline for kdump kernel failed\n"); >> ret = -EINVAL; >> goto out; >> } >> cmdline = modified_cmdline; >>+ cmdline_len = strlen(cmdline) + 1; > >I have a limited understanding of the new dm-crypt keys, but the way they >are loaded and the additional command-line options added for the kdump >kernel look good to me. > >Feel free to add: >Acked-by: Sourabh Jain Thanks for reviewing and acknowledging the patch! -- Best regards, Coiby