Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp654260rdh; Sun, 24 Sep 2023 06:18:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBvFRtsjG1o/OtDnVOzuKOhpztzmGlOqcVw32M47om35jGQ0qxGFIMv0uhh2Srau+GcCMf X-Received: by 2002:a17:903:22c2:b0:1c3:3c0f:3dee with SMTP id y2-20020a17090322c200b001c33c0f3deemr3095813plg.31.1695561516911; Sun, 24 Sep 2023 06:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695561516; cv=none; d=google.com; s=arc-20160816; b=Hidkd6RpbfrjYsHIB4DlqcYKXgJ6O3SzuU18mQBV++3BSShwa5y5xnEHvnEQyY6/eT dtGNcT5GDbVDWOOp5EQ/IoXrsCLa+EvKG5YWI2ltopqvTdICDdG9pQl++SRr55Elb6uY 5p6AcBKaOSTLJkzS5baKZtFpV2os1OBC4SbbII6PpgXA+8P5mu6f2MlotjAMu5BqHVbU 7KQLj7ta97R7jYyXdaT5Mq+73C4f9qDQMkQoWaUNcxXC1w7AQMjXa2P5GC/RB0Eea9+J FdYdl1CQgk1PlQUm7Bfxun3nvmVuxLJb40CGY/niG+egQhyttDzA/KCI5TQ7s8JgizbF yZMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZhLkK1SxazgAztAgoDpJNpo59o6+CdJTsF6m7Ya9nts=; fh=RHYskXUITlV2DbS3s3MX/4gGHPYnRXxmKUInX4QnyPI=; b=r/T9mncijg7K0yVks/uRzIzqgMBcIi6YAGqoa1cq/hFOLKDIrU/371zp72Tw3Q52UP xGUh9Me/j6Wdd1rRrynUbQiKVJszXgVNDGa/h2jq1CVdRRpughVW8V/lX2e6ig8+kIQR P+Yr+yNDHi/BASdpumohFhDyx1is+L6PAjZ5J1G1GMYjIhYe4FI0PZcatDJlpFT8Zj00 HXPAFXl6uIeQ68XYEtmQeCb90IGs6myYV6Jqnow+vnpUar3FLDtFJODubc2+xJnLWDCB J9+w+cJQElh0OyKxs6Sh/EwktcEhejBQmi8iFRyIn3QE8B3m3ni8EnmzF7Q8OjCxrVrB g98w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="YKjgorE/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id la7-20020a170902fa0700b001bf7289d2b2si7494828plb.315.2023.09.24.06.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 06:18:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="YKjgorE/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 67358802B126; Sun, 24 Sep 2023 06:17:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230083AbjIXNRR (ORCPT + 99 others); Sun, 24 Sep 2023 09:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbjIXNQv (ORCPT ); Sun, 24 Sep 2023 09:16:51 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A82F71723; Sun, 24 Sep 2023 06:16:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7C82C43397; Sun, 24 Sep 2023 13:16:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695561375; bh=CPD5cAd3UaaukwSt0nuFKO6B+Lw57G4Q75f27knbMNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YKjgorE/VBuVrL8fzaRRxCDHSK2zvsj1/Yrju+/7bwTWnMLtF9NjG4QCBSeUuerQg ysdRI1Z63XUE9RE9fO6dpoLjkfAPveP/pL6f8yl96rlJ77fAfieH4g6BiCd59QP5zt IJKdtksbTqvYkCd4wEUF3ukx6ZIlGrWtqk3p+ekJS8ab9QSgpA+uFxIzrUaxS5Smt9 lFU9MZ3NzWBqU+qJVG99c9pc+crF83RG5bCaTH6cLKRHHaHtzVCV9iNt/Ub/On4zsD 3q9WS9pJQIQDw00C8Kw29hIre0Utr/GZ/lX5EUa3RPjRQoilWJBYCV+FKtMV95FEl2 eru8ndDMAMKIQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ard Biesheuvel , "Kirill A . Shutemov" , Sasha Levin , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org Subject: [PATCH AUTOSEL 6.5 20/41] efi/x86: Ensure that EFI_RUNTIME_MAP is enabled for kexec Date: Sun, 24 Sep 2023 09:15:08 -0400 Message-Id: <20230924131529.1275335-20-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230924131529.1275335-1-sashal@kernel.org> References: <20230924131529.1275335-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.5 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sun, 24 Sep 2023 06:17:30 -0700 (PDT) From: Ard Biesheuvel [ Upstream commit aba7e066c738d4b349413a271b2a236aa55bacbc ] 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 not enabled. 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 Signed-off-by: Sasha Levin --- arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e36261b4ea14f..68ce4f786dcd1 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1955,6 +1955,7 @@ config EFI select UCS2_STRING select EFI_RUNTIME_WRAPPERS select ARCH_USE_MEMREMAP_PROT + select EFI_RUNTIME_MAP if KEXEC_CORE help This enables the kernel to use EFI runtime services that are available (such as the EFI variable services). @@ -2030,7 +2031,6 @@ config EFI_MAX_FAKE_MEM 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.40.1