Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp648307rdb; Thu, 30 Nov 2023 14:35:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXOI2IKglY6/KoFYc8aOeGZs1k3iZFZ4h3sqBDGFUIcrvo5fRcU21IiXxo8z+uNEiSeXFH X-Received: by 2002:a05:6a00:10c3:b0:6cd:dc1d:6842 with SMTP id d3-20020a056a0010c300b006cddc1d6842mr6746556pfu.20.1701383712520; Thu, 30 Nov 2023 14:35:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701383712; cv=none; d=google.com; s=arc-20160816; b=mATzZdowzyblbbeZsgKz9FKFPABKZIl5NbgLcZEp1pRPTeGrx83Q9xr7g4xAnuJ1D9 Fvpag7TowjZUYxyNSsqLHSwMsFJxCU2gCz7ZgbGYdPh7Cfublj+j5dT6GyjmVcHq/JxE nVAAeuvG2fYjzicPOfSL4o/Mlx3rlif5lcBt4wtK9UJuGRiaAdrQaDixXkpGN2pJ9PxV UjcYpzlJD+YU0IjwD8Cq85FQjrGbEwS3Mwp9uvSFSAIYXo6gl7UP6T2NIavtF9REGAyB JNILpqQBVwqoErkRB83VRVjGFw/HoP1+piLKRX9Dpw4S2NUvpI1khEPNyn61C52HBb+O 4yzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ne8Ng3wwFV0sSDNp47bQa0X5+QEcWPxh8lp0rduKGrs=; fh=jJQmKdKQ0/g/P5rRakRaSahfbjRMAkLUbZUIrN5jJT8=; b=aM8UieyzWEPrIUbRBrsSHeCsOUZROhbUn9ywk69SF57GK/XnZHgXzR+Zn+qPJUT5q5 zuoFUx1wcclZBGygU5vZ2v2C0hUrM8/4ZzYl0Xy3RFRe3ahl0jqi8ui/qVhm5EfXrhCz HQAvwSFq0eGdWAtJkKME+XGBiM7uT9jq8N3iGLPvzRaCJ4Gi4MviCnIHKrHQg4Xv+QJM E7mDZ6Wqqska6iVJCvfA9aMc+v2EDZENa57yNYLHbFzW1mKNN8cJak5V/pQCoLph+yQY wulCuOdm56T/Rfasu6YzTEQ+ueDen6f7TA6AdqlHros3tL51kqF44vj1cWiAQ0cveKop N5+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=JGicVOo6; spf=pass (google.com: domain of linux-crypto+bounces-433-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-433-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x10-20020aa793aa000000b006c4dacc3912si2005092pff.169.2023.11.30.14.35.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 14:35:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-433-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=JGicVOo6; spf=pass (google.com: domain of linux-crypto+bounces-433-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-433-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0873A28161E for ; Thu, 30 Nov 2023 22:35:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B23515A113 for ; Thu, 30 Nov 2023 22:35:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b="JGicVOo6" X-Original-To: linux-crypto@vger.kernel.org Received: from sonic305-22.consmr.mail.ne1.yahoo.com (sonic305-22.consmr.mail.ne1.yahoo.com [66.163.185.148]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E7AC10FF for ; Thu, 30 Nov 2023 12:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1701377669; bh=ne8Ng3wwFV0sSDNp47bQa0X5+QEcWPxh8lp0rduKGrs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=JGicVOo6W3oxikQfqbz6foRiMHrkrtI8Fr/XTdZ0VcCYfRHDFPOhoueJNmkaMB8Fdty/CK7gfGglh9h0WZRpAGJoan+V6Fg5pveMfZgL8PjXswOQQlib/3BYTNERRTuQsfG4udjoGtYUEh4CMypMwOb5qrdlnut2e8PoU/EHL2u9HyRIviRmUyvMiTSmrCzYA6g7kbKMxpPAWNMrdCV6DxcdLan52784L5sOuenVBltVsFka1AtA+gzXZi94+WERAuMewdGR5RkYPNhFd7NGZwAdPWhtNdvg6x8tWDKaME1Q29yfsgq3f/FixWsfbfPJruXqoxyQCrWXJ0BACHR63g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1701377669; bh=FOXWBmKcWljovWqKTntK95uyrbFs9+Kcax4hueMvFDR=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=Zlcy2MNjffmXBGWB04qQOk4ROxPN4TVIvB4qtLKjOBjulqgVbZYwhbe7NMFPqOpePDXl+jqC8xHOPzV3a4VzxO4d3vTk1BI8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zqFDXrf6g5fjGPG6h62EYASFAzQmsJopgXlPjF0mPK7dQ3L7nzIitj9f1BxT2Wo8pKV BQngqTZHhaDLovz4rCSGBlbJAGExiQMJfoT.tgbRvBY6k4RLILGP26Htot9wpIs8zbOqlsTCkLh1 LLR.pdWgdqNTmeMejrLbr8K_fACdKyoMEK5RnF_K_OD_I81ZU5g3_YH1JoJlju3978NPmeHHjdKT W7RHfIYChahX0Sclxa9a5vfX3mxy14rmUifAFYCQNMhurr1mxyHoVncNBzrO6r.UwMeMUntDfPfS .TMsLM4wRPHzmeJGYeMi0OJ0YSUsZPNv_ttw85dv1Ae72fF6FV1rypL7knGoJDGlZkEOAhP0fhiX xHkwlmPkn0E2zAdnJpKoGC5aBVdkTQTukxbAQRbX5awItBbFKY1jnFhm.cgqdEPSBJJb1lzmAqxv MtSbMyUo- X-Sonic-MF: X-Sonic-ID: c68a4d6e-7c9b-46cc-b3b8-770553b3962f Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Thu, 30 Nov 2023 20:54:29 +0000 Received: by hermes--production-bf1-5d8dc66654-fb2td (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 718f32cd8f139020ed74360f54b88507; Thu, 30 Nov 2023 20:54:27 +0000 (UTC) Message-ID: Date: Thu, 30 Nov 2023 14:54:24 -0600 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] kexec: fix KEXEC_FILE dependencies Content-Language: en-US To: Andrew Morton , Baoquan He Cc: Arnd Bergmann , Vivek Goyal , linux-kernel@vger.kernel.org, kexec@lists.infradead.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org References: <20231023110308.1202042-1-arnd@kernel.org> <20231130085657.6f7f500cc17b663747e4ee76@linux-foundation.org> From: Eric DeVolder In-Reply-To: <20231130085657.6f7f500cc17b663747e4ee76@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailer: WebService/1.1.21896 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo On 11/30/23 10:56, Andrew Morton wrote: > On Thu, 2 Nov 2023 16:03:18 +0800 Baoquan He wrote: > >>>> CONFIG_KEXEC_FILE, but still get purgatory code built in which is >>>> totally useless. >>>> >>>> Not sure if I think too much over this. >>> I see your point here, and I would suggest changing the >>> CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY symbol to just indicate >>> the availability of the purgatory code for the arch, rather >>> than actually controlling the code itself. I already mentioned >>> this for s390, but riscv would need the same thing on top. >>> >>> I think the change below should address your concern. >> Since no new comment, do you mind spinning v2 to wrap all these up? > This patchset remains in mm-hotfixes-unstable from the previous -rc > cycle. Eric, do you have any comments? Arnd, do you plan on a v2? If > not, should I merge v1? If so, should I now add cc:stable? My apologies, I lost this. I've looked at these changes, and I am in favor of these changes. Furthermore, I ran the following thru the Kconfig regression script, and did not find anything! I believe the following patch represents the current discussion threads around Kconfig and KEXEC/CRASH. Reviewed-by: Eric DeVolder Tested-by: Eric DeVolder Thanks! eric diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 6f105ee4f3cf..1f11a62809f2 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -608,10 +608,10 @@ config ARCH_SUPPORTS_KEXEC      def_bool PPC_BOOK3S || PPC_E500 || (44x && !SMP)  config ARCH_SUPPORTS_KEXEC_FILE -    def_bool PPC64 && CRYPTO=y && CRYPTO_SHA256=y +    def_bool PPC64  config ARCH_SUPPORTS_KEXEC_PURGATORY -    def_bool KEXEC_FILE +    def_bool y  config ARCH_SELECTS_KEXEC_FILE      def_bool y diff --git a/arch/riscv/Kbuild b/arch/riscv/Kbuild index d25ad1c19f88..ab181d187c23 100644 --- a/arch/riscv/Kbuild +++ b/arch/riscv/Kbuild @@ -5,7 +5,7 @@ obj-$(CONFIG_BUILTIN_DTB) += boot/dts/  obj-y += errata/  obj-$(CONFIG_KVM) += kvm/ -obj-$(CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY) += purgatory/ +obj-$(CONFIG_KEXEC_FILE) += purgatory/  # for cleaning  subdir- += boot diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 95a2a06acc6a..98857d76e458 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -702,9 +702,7 @@ config ARCH_SELECTS_KEXEC_FILE      select KEXEC_ELF  config ARCH_SUPPORTS_KEXEC_PURGATORY -    def_bool KEXEC_FILE -    depends on CRYPTO=y -    depends on CRYPTO_SHA256=y +    def_bool y  config ARCH_SUPPORTS_CRASH_DUMP      def_bool y diff --git a/arch/riscv/kernel/elf_kexec.c b/arch/riscv/kernel/elf_kexec.c index e60fbd8660c4..3ac341d296db 100644 --- a/arch/riscv/kernel/elf_kexec.c +++ b/arch/riscv/kernel/elf_kexec.c @@ -266,7 +266,7 @@ static void *elf_kexec_load(struct kimage *image, char *kernel_buf,          cmdline = modified_cmdline;      } -#ifdef CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY +#ifdef CONFIG_KEXEC_FILE      /* Add purgatory to the image */      kbuf.top_down = true;      kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; @@ -280,7 +280,7 @@ static void *elf_kexec_load(struct kimage *image, char *kernel_buf,                           sizeof(kernel_start), 0);      if (ret)          pr_err("Error update purgatory ret=%d\n", ret); -#endif /* CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY */ +#endif /* CONFIG_KEXEC_FILE */      /* Add the initrd to the image */      if (initrd != NULL) { diff --git a/arch/s390/Kbuild b/arch/s390/Kbuild index a5d3503b353c..f2ce80b65551 100644 --- a/arch/s390/Kbuild +++ b/arch/s390/Kbuild @@ -7,7 +7,7 @@ obj-$(CONFIG_S390_HYPFS)    += hypfs/  obj-$(CONFIG_APPLDATA_BASE)    += appldata/  obj-y                += net/  obj-$(CONFIG_PCI)        += pci/ -obj-$(CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY) += purgatory/ +obj-$(CONFIG_KEXEC_FILE) += purgatory/  # for cleaning  subdir- += boot tools diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 3bec98d20283..d5d8f99d1f25 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -254,13 +254,13 @@ config ARCH_SUPPORTS_KEXEC      def_bool y  config ARCH_SUPPORTS_KEXEC_FILE -    def_bool CRYPTO && CRYPTO_SHA256 && CRYPTO_SHA256_S390 +    def_bool y  config ARCH_SUPPORTS_KEXEC_SIG      def_bool MODULE_SIG_FORMAT  config ARCH_SUPPORTS_KEXEC_PURGATORY -    def_bool KEXEC_FILE +    def_bool y  config ARCH_SUPPORTS_CRASH_DUMP      def_bool y diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 3762f41bb092..1566748f16c4 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2072,7 +2072,7 @@ config ARCH_SUPPORTS_KEXEC      def_bool y  config ARCH_SUPPORTS_KEXEC_FILE -    def_bool X86_64 && CRYPTO && CRYPTO_SHA256 +    def_bool X86_64  config ARCH_SELECTS_KEXEC_FILE      def_bool y @@ -2080,7 +2080,7 @@ config ARCH_SELECTS_KEXEC_FILE      select HAVE_IMA_KEXEC if IMA  config ARCH_SUPPORTS_KEXEC_PURGATORY -    def_bool KEXEC_FILE +    def_bool y  config ARCH_SUPPORTS_KEXEC_SIG      def_bool y diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec index 7aff28ded2f4..92120e396008 100644 --- a/kernel/Kconfig.kexec +++ b/kernel/Kconfig.kexec @@ -36,6 +36,7 @@ config KEXEC  config KEXEC_FILE      bool "Enable kexec file based system call"      depends on ARCH_SUPPORTS_KEXEC_FILE +    depends on CRYPTO_SHA256=y || !ARCH_SUPPORTS_KEXEC_PURGATORY      select KEXEC_CORE      help        This is new version of kexec system call. This system call is @@ -94,10 +95,8 @@ config KEXEC_JUMP  config CRASH_DUMP      bool "kernel crash dumps"      depends on ARCH_SUPPORTS_CRASH_DUMP -    depends on ARCH_SUPPORTS_KEXEC      select CRASH_CORE      select KEXEC_CORE -    select KEXEC      help        Generate crash dump after being started by kexec.        This should be normally only set in special crash dump kernels