Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1091497rwo; Wed, 2 Aug 2023 08:35:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlFpAN0qvUDZ7F9YYWQGGpg7Y1nL5PKA5M4bSQHn3b540L18yE6YJ+/4d5l8hg0Mwi1W8HsA X-Received: by 2002:a05:651c:10d1:b0:2b9:cce3:a126 with SMTP id l17-20020a05651c10d100b002b9cce3a126mr5333113ljn.21.1690990515281; Wed, 02 Aug 2023 08:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690990515; cv=none; d=google.com; s=arc-20160816; b=WmBa4sSs6F2qreAoU3syymls10fD2ykqLCGynJrJna36Nj2BEug7lq5wf80wnpOmI4 6r4kCUSCqjonFBIh4MtexXzvX9AlJaMjfHt2jTRrC3OK1OKK69JVd2PzQn2v62meuuhb Cc0HcOO8y68Svy2cHxa7vD8ODgwy9axzI/eqHlv+H8PI4j/Y0hmHFefACZnI5x2zEEKH 7Zq9DTCtpkjEAZjtvDsvHrD6BAb2yViEBA5+R+5mqLN6I/81i6a/ETXaiXPOeoSCmCs1 sLuTvNI7on8BSMVOheb6dtJNOJ6NQ5KNJI4jS10jAMbpxmWMjelJqUa3w4SSgaBlLSoJ 0X5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xNK8tdHMCj9GjM1utrjrP7UHVZC4rx3fgg02yytje3w=; fh=/CRgEMFreXUXW/Yb8UUueEFGuE1BMPS1XNMsC1Sp4wQ=; b=INDALpH47JAbwdO2qYi4wo3QCJia4csPvsJoZaZN1xox9kPrmga5R5o+npPmFY2q99 QWWAIrWQUSulFR9Zl4C+vw5e3mtdYALHzbJjykhTxiGHbmvZe5IyWywKHEHrC4Hx84zm ckBoyxWvDLiBm6ga5A8VD2Qkp8DZAt4O8unMBR6gAntU2pJA8APklVOP7FK1Kn5xAmJe i6HDGKFZjuQ9CBb4S4OseWbRmizw/E7itE5yq6sWENPKQKTGKqWaUdl5sEHfMOnVttVK u7bP2+zlnBElI5s4tX6JqrhbaH2K9bwC0nXklLntxQTDl4xkpIUCrDlr2A5R8ntvtsqb 5nnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RBg2obuZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a1709061b4200b00992fee4bc4csi11480417ejg.647.2023.08.02.08.34.49; Wed, 02 Aug 2023 08:35:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RBg2obuZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235120AbjHBPRc (ORCPT + 99 others); Wed, 2 Aug 2023 11:17:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235143AbjHBPPs (ORCPT ); Wed, 2 Aug 2023 11:15:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8CD03592; Wed, 2 Aug 2023 08:14:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C83E3619F7; Wed, 2 Aug 2023 15:14:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C0CFC433C8; Wed, 2 Aug 2023 15:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690989276; bh=XfSU6iM72jxAI3h3l7DrR7eqMZzluEovcVBf1mWYoeM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RBg2obuZ4zyzAqv0xXhX6SHfCoTfRT9iHmGPDp3Y1QBc/FgGrwLxrKqLmrYVOztwY vviEaSDD/zwdzOLSyoz5Osulj6tE/YmNSHKoM4YwLQBAbPkbrQg5qAKtmn5wsY4Phn vbd0JlC7MNpdi0H5+nVThF4G3+rXM1Zehr6t6aBHW8VBc+zIcFiSBtblNjwOuCkUzK LT8n9TOcjqbLTrfQXmPABTMCuYlQxEmFOz/DPmaYFoM+jAPXNtaoSw1g+YoOwfEKSJ l6rKmST+GFA+hFgcsNElzM3fntwGGRzavJkx/KHMZjCv034vcligcS8ucqiwdn4O+l W+tD8kuS5/U4g== Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-4fe3678010eso5793049e87.3; Wed, 02 Aug 2023 08:14:36 -0700 (PDT) X-Gm-Message-State: ABy/qLZBTrOY0IR/YzyLX2KM+FY+i3S6ENEv9OeJ95MAdCptvOiHpJ1F ONCoswUhAlrkq/oWZ+lr9AOVCitK5jfB3Cm7Gfk= X-Received: by 2002:a19:e052:0:b0:4fb:8987:734e with SMTP id g18-20020a19e052000000b004fb8987734emr4902135lfj.68.1690989274245; Wed, 02 Aug 2023 08:14:34 -0700 (PDT) MIME-Version: 1.0 References: <20230802133704.2146580-1-ardb@kernel.org> <20230802142523.t5o36uy3z366jh27@box.shutemov.name> In-Reply-To: <20230802142523.t5o36uy3z366jh27@box.shutemov.name> From: Ard Biesheuvel Date: Wed, 2 Aug 2023 17:14:23 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] efi/x86: Ensure that EFI_RUNTIME_MAP is enabled for kexec To: "Kirill A . Shutemov" Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 Aug 2023 at 16:26, Kirill A . Shutemov wrote: > > On Wed, Aug 02, 2023 at 03:37:04PM +0200, Ard Biesheuvel wrote: > > CONFIG_EFI_RUNTIME_MAP needs to be enabled in order for kexec to be able > > to provide the required information about the EFI runtime mappings to > > the incoming kernel, regardless of whether kexec_load() or > > kexec_file_load() is being used. Without this information, kexec boot in > > EFI mode is not possible. > > > > The CONFIG_EFI_RUNTIME_MAP option is currently directly configurable if > > CONFIG_EXPERT is enabled, so that it can be turned on for debugging > > purposes even if KEXEC is. However, the upshot of this is that it can > > also be disabled even when it shouldn't. > > > > So tweak the Kconfig declarations to avoid this situation. > > > > Reported-by: Kirill A. Shutemov > > Signed-off-by: Ard Biesheuvel > > With the patch 'make oldconfig' updates config to enable > EFI_NEED_RUNTIME_MAP. > > Tested-by: Kirill A. Shutemov > > Thanks. > > --- > > arch/x86/Kconfig | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > index 7422db4097701c96..616498cdc91e8f01 100644 > > --- a/arch/x86/Kconfig > > +++ b/arch/x86/Kconfig > > @@ -2027,10 +2027,14 @@ config EFI_MAX_FAKE_MEM > > Ranges can be set up to this value using comma-separated list. > > The default value is 8. > > > > +config EFI_NEED_RUNTIME_MAP > > + def_bool y > > + depends on EFI && KEXEC_CORE > > + select EFI_RUNTIME_MAP > > + > > Just curious, why not extend 'config EFI' with 'select EFI_RUNTIME_MAP if KEXEC_CORE'? > It seems functionally equivalent, but more concise. > Yeah, agreed - I didn't realize every arch has its own 'config EFI' definition. > > config EFI_RUNTIME_MAP > > bool "Export EFI runtime maps to sysfs" if EXPERT > > depends on EFI > > - default KEXEC_CORE > > help > > Export EFI runtime memory regions to /sys/firmware/efi/runtime-map. > > That memory map is required by the 2nd kernel to set up EFI virtual > > -- > > 2.39.2 > > > > -- > Kiryl Shutsemau / Kirill A. Shutemov