From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1A7391CEAA3; Mon, 26 Jan 2026 14:36:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769438175; cv=none; b=kNHKYfXAH7JUgsynoQEr08UyatVEgFHi4XxCrMwFFfKy9e8aBVFLQi2hwFKF+q0Z1438R0n9yi75+3hGfGfoLI9N5ugw/LiJRW7h4I4588oC2ec7fFvzhRQc0E1KmtSrTwPaAIiaoMYWONUz/kkdZJzeC6UPWFvESehipej0fJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769438175; c=relaxed/simple; bh=dMO1MIhjP4aVHBALuscN5a9iA1kviHKn9sIWzBNa0Wc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gE5mCKkSN5uHqdrzJ7TvSG4thB5+tMtm5DVAAXCPwCZyYNkiwUOoSbUz9aGj4HbtvLNmlLNVw05XkhErBlrtECVavETm3fSqbOv/i3r9JmOll51BSmzlHY3CRJKckpadyVgn+PN/zdqLxwGQr4WtVLyYv46Od0uc9YvydJJvcdM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d19x1kCD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d19x1kCD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D73C0C116C6; Mon, 26 Jan 2026 14:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769438174; bh=dMO1MIhjP4aVHBALuscN5a9iA1kviHKn9sIWzBNa0Wc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d19x1kCDYOnGx2Xo+GWKZ43qg670AhXoY+z9KwUBlxi+c469kki/9gZpuNlXlZiNa rZv3iCrRfTEHJA5rC1gwkwhr5H0JOyrF+WuH4kMmHUTcr68c+SvH2IbV/Dy39kGQwq svRwyM23nXqJ/x+vnjF0iIUwhrH5WCHqHP3G/PRUJoRhd/73wKtuLhnxaFr9h6XFsb 8d0PCPT3Fkp/jB2F5IQQtssYcq9rnL7dZB0zjOZvBWb1I7rzD2iYimD2+Sp0lm0acc kyW1vLZ3VVuiM+CCdHmjO1YG+mExxT6Yebnlb6Z/t8Wzh+4ynDm6n1DlvTtmLEoIH+ 1yFi7JsqmfQcQ== Date: Mon, 26 Jan 2026 14:36:08 +0000 From: Will Deacon To: Coiby Xu Cc: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Arnaud Lefebvre , Baoquan he , Dave Young , Kairui Song , Pingfan Liu , Andrew Morton , Krzysztof Kozlowski , Rob Herring , Catalin Marinas , Saravana Kannan , open list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" Subject: Re: [PATCH v3] arm64/kdump: pass dm-crypt keys to kdump kernel Message-ID: References: <20260123081326.1362666-1-coxu@redhat.com> Precedence: bulk X-Mailing-List: devicetree@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: <20260123081326.1362666-1-coxu@redhat.com> On Fri, Jan 23, 2026 at 04:13:25PM +0800, 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 ARM64, we only need to add device tree > property dmcryptkeys [2] as similar to elfcorehdr to pass the memory > address of the stored info of dm-crypt keys to the kdump kernel. Since > this property is only needed by the kdump kenrel, it won't be exposed to > user space. > > [1] https://lore.kernel.org/all/20250502011246.99238-1-coxu@redhat.com/ > [2] https://github.com/devicetree-org/dt-schema/pull/181 > > Cc: Arnaud Lefebvre > Cc: Baoquan he > Cc: Dave Young > Cc: Kairui Song > Cc: Pingfan Liu > Cc: Andrew Morton > Cc: Krzysztof Kozlowski > Cc: Rob Herring > Signed-off-by: Coiby Xu > --- > v3 > - Delete the property after reading it [Rob Herring] > > v2 > - Krzysztof > - Use imperative mood for commit message > - Add dt-schema ABI Documentation > https://github.com/devicetree-org/dt-schema/pull/181 > - Don't print dm-crypt keys address via pr_debug > > > arch/arm64/kernel/machine_kexec_file.c | 9 +++++++++ > drivers/of/fdt.c | 21 +++++++++++++++++++++ > drivers/of/kexec.c | 19 +++++++++++++++++++ > 3 files changed, 49 insertions(+) > > diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c > index 410060ebd86d..5f3bad8ca96d 100644 > --- a/arch/arm64/kernel/machine_kexec_file.c > +++ b/arch/arm64/kernel/machine_kexec_file.c > @@ -134,6 +134,15 @@ int load_other_segments(struct kimage *image, > > kexec_dprintk("Loaded elf core header at 0x%lx bufsz=0x%lx memsz=0x%lx\n", > image->elf_load_addr, kbuf.bufsz, kbuf.memsz); > + > + ret = crash_load_dm_crypt_keys(image); > + > + if (ret == -ENOENT) { > + kexec_dprintk("No dm crypt key to load\n"); > + } else if (ret) { > + pr_err("Failed to load dm crypt keys\n"); > + goto out_err; > + } This looks like an unusual mixture of kexec_dprintk() and pr_err(). Stepping back a second, why do we need to print anything from the arch code at all? It looks like crash_load_dm_crypt_keys() already prints for the -ENOENT case so I'd be inclined just to do: ret = crash_load_dm_crypt_keys(image); if (ret) goto out_err; Will