Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1859015rda; Tue, 24 Oct 2023 05:45:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDE72HcQGSS8BNmX8tIiBS7VtMzI/dlxL8Y+IDE//MzgjbKo6VJcpymkc0CDAmTozhMZub X-Received: by 2002:a17:902:e851:b0:1c9:e3b1:1f4 with SMTP id t17-20020a170902e85100b001c9e3b101f4mr12212620plg.62.1698151538421; Tue, 24 Oct 2023 05:45:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698151538; cv=none; d=google.com; s=arc-20160816; b=S4KuevnOA4fB9vfWdwKEHtn7hCXO4bcPuDjJAqUtyTkLjKGnLdc+NCwHepNdl3WWB1 XXgg+JbwLO2buxty8gPUbfGbvN99xdLgf9dLAd6sXqdoCHR73IylyZROeo/gFDzocyiv v9ZwcuP27zbItGqDblUOA5gnEY8pRJXhKwPtdtXB2IS67hyWhPIsiFqKyKX5FskiFIxN CEf+KO9sRsi8P7E4nf4QTPoawK4yL+45D22eJdVW9vu+8EWdCgSpoQoWA11kOBvOCUuU iVsFJnxOtUIPjlPTLTa/rOvbai02xIJOELqZ/V/gx2M5l3uIYgAM8cAVxFXQsTQF4HFh bu/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CODKCtH5hmSRh9bBGyaKTVCZDnlLHU54pzgVooF1R0k=; fh=Yj4Jr7jK8p9jJciqPA5zVY3eHh15wUx9dXw94jpKuGw=; b=XGDrFYNgVOTpJHhBDcaqHAzcFjgEEe5EsSdOPdHUrlfEpdL3IbhoBOUnNoS/Hb6TXl kpEZuAchklRgfDMQAr5w9KPMaNQ+14OAvmmhNlWxyBOWH6PptM0yzeHYk5QkeWtYLkhH OkGgOrfcsPygir3R9hzPbWSY5sotqJ6lV18KBqpxpbWdoI6NTOHZY4bbDXsp0RBbiuD+ Bs9UCnFQCib9+Q3mniaAPhxhlGQuLio7qFPcUwzpQGMiU/i87LSho7JIL23Td3rOncuk Mf46OnM3mzv0Vdow5hZOmfw6mbNQoD81iMZhnu5W6qyFWTALX5YeBYRCtAhUfKHgJo7Q 6r0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jAIjJmLw; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id w2-20020a1709029a8200b001c72d694ec7si8015331plp.328.2023.10.24.05.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 05:45:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jAIjJmLw; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5BBE4809C124; Tue, 24 Oct 2023 05:45:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234299AbjJXMpa (ORCPT + 99 others); Tue, 24 Oct 2023 08:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232280AbjJXMp3 (ORCPT ); Tue, 24 Oct 2023 08:45:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0695690 for ; Tue, 24 Oct 2023 05:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698151490; 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=CODKCtH5hmSRh9bBGyaKTVCZDnlLHU54pzgVooF1R0k=; b=jAIjJmLwLDyclSE3THZzKh+7GWejHPZxJ7qe+OQ++5Qlh0CbXklhPED/sasqdzwwQs8Hwy 9zUU9uu8DJj4ickzxjAJM5YaJHJYK844AWRX1eR7AbjEqLbhZGZPLtAlavtWkFU1yRgATZ gzkK1j13THizOAHYxKsd1NUbYwqXQRE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-596-tcJAmO1PPUKcVk6oYnFHmw-1; Tue, 24 Oct 2023 08:44:41 -0400 X-MC-Unique: tcJAmO1PPUKcVk6oYnFHmw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 74E253C0F435; Tue, 24 Oct 2023 12:44:40 +0000 (UTC) Received: from localhost (unknown [10.72.112.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C6822026D4C; Tue, 24 Oct 2023 12:44:39 +0000 (UTC) Date: Tue, 24 Oct 2023 20:44:36 +0800 From: Baoquan He To: Arnd Bergmann Cc: Vivek Goyal , Andrew Morton , 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, eric_devolder@yahoo.com Subject: Re: [PATCH 1/2] kexec: fix KEXEC_FILE dependencies Message-ID: References: <20231023110308.1202042-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231023110308.1202042-1-arnd@kernel.org> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 24 Oct 2023 05:45:33 -0700 (PDT) Just add people and mailing list to CC since I didn't find this mail in my box, just drag it via 'b4 am'. On 10/23/23 at 01:01pm, Arnd Bergmann wrote: ...... > --- > arch/powerpc/Kconfig | 4 ++-- > arch/riscv/Kconfig | 4 +--- > arch/s390/Kconfig | 4 ++-- > arch/x86/Kconfig | 4 ++-- > kernel/Kconfig.kexec | 1 + > 5 files changed, 8 insertions(+), 9 deletions(-) > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index d5d5388973ac7..4640cee33f123 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -607,10 +607,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/Kconfig b/arch/riscv/Kconfig > index 25474f8c12b79..f571bad2d22d0 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -687,9 +687,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/s390/Kconfig b/arch/s390/Kconfig > index b0d67ac8695f9..ec77106af4137 100644 > --- a/arch/s390/Kconfig > +++ b/arch/s390/Kconfig > @@ -253,13 +253,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 94efde80ebf35..f9975b15ccd57 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -2073,7 +2073,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 > @@ -2081,7 +2081,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 7aff28ded2f48..bfc636d64ff2b 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 I am not sure if the logic is correct. In theory, kexec_file code utilizes purgatory to verify the checksum digested during kernel loading when try to jump to the kernel. That means kexec_file depends on purgatory, but not contrary? With these changes, we can achieve the goal to avoid building issue, whereas the code logic becomes confusing. E.g people could disable CONFIG_KEXEC_FILE, but still get purgatory code built in which is totally useless. Not sure if I think too much over this. > select KEXEC_CORE > help > This is new version of kexec system call. This system call is > -- > 2.39.2