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 28BC72940D for ; Thu, 12 Feb 2026 02:05:28 +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=1770861930; cv=none; b=qB0NlQLJ56J8nTgkQJoNg7ZBVwZcy2qc2I5/ihATTFcuwN/1eL2IEW4M7Aa7QZGS+Oci31DvUZ8cp60RqXf/UIFselcGspE2W3ywiYVYgj+dmgwU8nBg5qFr/W7BLCLB/OVvqvOe9V/ds+7AcpbQ4dnNOHIXfUNEa4etmwdWIbo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770861930; c=relaxed/simple; bh=WOyzWWXK6xsPjUEPf3AnRP+f4QppHKpUNZstQPWUwTA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EIfRQ4eSZrThHG2yZtKmnHa28YT98jgGKx08J9WMhAZ+jeflfbkmbpIopXADMo5Y2wBBmPcV7k7glq+YAotzrhhbGGABZMW9HLvD6gHkzDxS8UswNL8GU6YUdN++gCeHpCnW0GGTxYHYblEqtbHn85mKHyFHLywtKn0MnFvsLDI= 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=ULDh7QcQ; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=VcRr092P; 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="ULDh7QcQ"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="VcRr092P" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770861928; 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=PizJXKd85zXyZ9iQQX+Ej3hfH7kGalbAW0kYbFZfhf4=; b=ULDh7QcQOGgvZj2wTFEoOjuxG4CSW61nO1C0xeArzSl5Q8k/eAwJOhFcOlv0KuUwdSUn0D kdy083qKTD66V88t0Et4GMkxCkB9ukBB1aoR3l0SwJjds3a2gi1vO9mcvGGckNRsF8StIM cA6s4WMAxT67AtNYsjwxkzY/MMOG/fA= 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-423-Nl_cKU0SOnq3XS0V3jsBug-1; Wed, 11 Feb 2026 21:05:26 -0500 X-MC-Unique: Nl_cKU0SOnq3XS0V3jsBug-1 X-Mimecast-MFC-AGG-ID: Nl_cKU0SOnq3XS0V3jsBug_1770861926 Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2aad5fc5b2fso26713225ad.1 for ; Wed, 11 Feb 2026 18:05:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770861926; x=1771466726; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=PizJXKd85zXyZ9iQQX+Ej3hfH7kGalbAW0kYbFZfhf4=; b=VcRr092PSPVW7OY5U1fVtA3jxN+yiz/TYlC/ZBfEoTVxw5YTauXZvA6XNhuN7B4KX0 9aICmgNPwVIb9Mx1gXNk4AAKLUBy/yYzA6yBj+IBVzfLhinGGFBlP9oXXIor8q4H8gPc XGGkGNW7zIiCYH3X2P1C80ptOjAGSC0/7xEwigD+La/Ds0v9tXbKx/m3NnqonEjbTE4L wvROPqyuczUbOLDrm1D0VF/0/UJ0TEwS9PnSjkSlbYgQbaJVyaZeG78Dg8rySgQ2f5Vu kpeCTlFcdkar8+bFkrXoG+ovRiUaaaF4iBSwLLupiGJf1rMNwDxgayurdGbs6PYCuZOd UNNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770861926; x=1771466726; h=in-reply-to:content-transfer-encoding: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=PizJXKd85zXyZ9iQQX+Ej3hfH7kGalbAW0kYbFZfhf4=; b=TQcXIzgByC18zMUC53oOarfBe0F0NHms+4kIQmsd34fKv/hHMh2Me5NEVMKikfNGdp WnD98/1AYgy6p9qNuMK4vaSVzM5BM39x699lLVPp9O0oojZ1MXg8S0FEjtsJWBoBXpKV JRCQLsGNxxcrq9QRy1D38zBbSSSERX2uRgkM8Mk5pax9cjDJbJYGfZuN0M+Zd5E8/ULQ b1f8BUYrgxe3MPJ39MES2u4nj2nQcbDkUFu713DJBevRwJkr8mwY9wdAxfXAIdCyg/X8 MI6/FXTHYXZuCB8Wz53k3uAM0bR0u4M2JJK7cz3xrPmpugFq0RLoeOfr5WvW3g5oW75q JGtA== X-Forwarded-Encrypted: i=1; AJvYcCUmq8Vj2uEIJAhtpkCBk/qBSz3hD2QxNJff79jGaFyKE8g5RoTfZR9PHEJDd1jr9ShCGNlDJeGaH6qT1Hw=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2M5c8UJqbOilybMH/PMSRcK6d3718vifaIlVe9eD7An2hebru KTgxyHJd2ho7ESIsg/YVEV9rbpbtGzAZprzOY0sT7sMYxhcz6m2Ks7ZIjZ5hG4qCBU+3XWeEfYM j01LUJ6CI4xVpN8I4L+Cvm2GfSppq7dhwJoa7tA897ZfUOcrbOZA3r4Fmko4XpsyXTA== X-Gm-Gg: AZuq6aJ8M4jdxKpngtR3ozLy086kn44/l2Ci/hqxxk78NiO0pOGcGx/pTov+xwpOzwd bW8mP/Ic/utE4nh3h0JF65XFhMnRYclmhvzRlLRLe29adZkEpSG9xUZmzOrf0lJx43u9mnSQPD/ 7fzw6NQXSTqprKgFebVb2TeP5/Fv05VvJxG1kyBN7eOCULgLZ+1l6dMf0vN1q1ryA7178D6LQTq RqfYj+NkJmkkA3dKzMjQWDVdBZcAesovdmOx46ojOjurbTotVDFaquGFLSI4DckuLBDFfvMF2yF Oxf4EGihd4eogFcmf91xD4m1lDJWPtcvS8RywU3dKUApxeAHsx3ZZNfBP3Sbdl3cP+IKKjMr4Ag IKCNGX/ccyfLK X-Received: by 2002:a17:903:1663:b0:2a0:de4f:c99 with SMTP id d9443c01a7336-2ab3b1583c5mr6716795ad.9.1770861925456; Wed, 11 Feb 2026 18:05:25 -0800 (PST) X-Received: by 2002:a17:903:1663:b0:2a0:de4f:c99 with SMTP id d9443c01a7336-2ab3b1583c5mr6716465ad.9.1770861924935; Wed, 11 Feb 2026 18:05:24 -0800 (PST) Received: from localhost ([209.132.188.88]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ab2984c07bsm34405605ad.7.2026.02.11.18.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Feb 2026 18:05:24 -0800 (PST) Date: Thu, 12 Feb 2026 10:01:58 +0800 From: Coiby Xu To: "Christophe Leroy (CS GROUP)" Cc: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Arnaud Lefebvre , Baoquan he , Dave Young , Kairui Song , Pingfan Liu , Andrew Morton , Krzysztof Kozlowski , Rob Herring , Thomas Staudt , Sourabh Jain , Will Deacon , Catalin Marinas , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Saravana Kannan , open list Subject: Re: [PATCH v4 2/2] arm64,ppc64le/kdump: pass dm-crypt keys to kdump kernel Message-ID: References: <20260211082401.2407853-1-coxu@redhat.com> <20260211082401.2407853-3-coxu@redhat.com> <423a3431-1271-4c35-94fe-8ca880679ed9@kernel.org> 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=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <423a3431-1271-4c35-94fe-8ca880679ed9@kernel.org> On Wed, Feb 11, 2026 at 10:55:17AM +0100, Christophe Leroy (CS GROUP) wrote: > > >Le 11/02/2026 à 09:24, Coiby Xu a écrit : >>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 and PowerPC, we only need to add > >What do you want to say exactly with 'only' ? Hi Christophe, Thanks for raising the question! To clarify, CONFIG_CRASH_DM_CRYPT provides the framework to address these challenges for LUKS-encrypted dump target. Since the heavy lifting is handled in the arch-independent code, we only need to... If it looks good to you, I'll rephrase it as "To also enable this feature for ARM64 and PowerPC, the missing piece is to let the kdump kernel know where to find the dm-crypt keys which are randomly stored in memory reserved for kdump. I'll introduce a new device tree property dmcryptkeys ...". > >>a 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 kernel, it won't >>be exposed to user space. >> >>[1] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fall%2F20250502011246.99238-1-coxu%40redhat.com%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7C0aa5f3b34d694b23b0cc08de6946f66c%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C639063950684962054%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=8uCc%2Bg6YNojymf8UpZhmJY19vpWXJCC9KIf3qMyQ3dI%3D&reserved=0 >>[2] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdevicetree-org%2Fdt-schema%2Fpull%2F181&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7C0aa5f3b34d694b23b0cc08de6946f66c%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C639063950684987003%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=1s5NPHgF1LsXdrDXBhawduFXOqnHPlkbohQHHvolLw4%3D&reserved=0 >> >>Cc: Arnaud Lefebvre >>Cc: Baoquan he >>Cc: Dave Young >>Cc: Kairui Song >>Cc: Pingfan Liu >>Cc: Andrew Morton >>Cc: Krzysztof Kozlowski >>Cc: Rob Herring >>Cc: Thomas Staudt >>Cc: Sourabh Jain >>Cc: Will Deacon >>Signed-off-by: Coiby Xu >>--- >> arch/arm64/kernel/machine_kexec_file.c | 4 ++++ >> arch/powerpc/kexec/elf_64.c | 4 ++++ >> drivers/of/fdt.c | 21 +++++++++++++++++++++ >> drivers/of/kexec.c | 19 +++++++++++++++++++ >> 4 files changed, 48 insertions(+) >> >>diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c >>index 331646d667b9..2967e4aff807 100644 >>--- a/drivers/of/fdt.c >>+++ b/drivers/of/fdt.c >>@@ -866,6 +866,26 @@ static void __init early_init_dt_check_for_elfcorehdr(unsigned long node) >> elfcorehdr_addr, elfcorehdr_size); >> } >>+static void __init early_init_dt_check_for_dmcryptkeys(unsigned long node) >>+{ >>+ const char *prop_name = "linux,dmcryptkeys"; >>+ const __be32 *prop; >>+ >>+ if (!IS_ENABLED(CONFIG_CRASH_DM_CRYPT)) >>+ return; >>+ >>+ pr_debug("Looking for dmcryptkeys property... "); >>+ >>+ prop = of_get_flat_dt_prop(node, prop_name, NULL); >>+ if (!prop) >>+ return; >>+ >>+ dm_crypt_keys_addr = dt_mem_next_cell(dt_root_addr_cells, &prop); >>+ >>+ /* Property only accessible to crash dump kernel */ >>+ fdt_delprop(initial_boot_params, node, prop_name); > >Shouldn't this property be deleted regardless of whether kernel is >built with CONFIG_CRASH_DM_CRYPT or without ? This property will be created only if 1) CONFIG_CRASH_DM_CRYPT is enabled and 2) the dump target is LUKS-encrypted. So there is no need to delete it if it doesn't exist at all. > >>+} >>+ >> static unsigned long chosen_node_offset = -FDT_ERR_NOTFOUND; >> /* >>@@ -1097,6 +1117,7 @@ int __init early_init_dt_scan_chosen(char *cmdline) >> early_init_dt_check_for_initrd(node); >> early_init_dt_check_for_elfcorehdr(node); >>+ early_init_dt_check_for_dmcryptkeys(node); >> rng_seed = of_get_flat_dt_prop(node, "rng-seed", &l); >> if (rng_seed && l > 0) { > -- Best regards, Coiby