Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1106915rwo; Wed, 2 Aug 2023 08:49:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEbyV+USq7uCIzPKjWo6YOw1IsonjHzxZCRI2ao/6JzukVd2HRf1+SftXuqvsF6KBiWPOHR X-Received: by 2002:a17:906:77d6:b0:99b:4a2b:2ea3 with SMTP id m22-20020a17090677d600b0099b4a2b2ea3mr5440482ejn.17.1690991350870; Wed, 02 Aug 2023 08:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690991350; cv=none; d=google.com; s=arc-20160816; b=VW3PLwS9vJgVuwVbjMdH0UPphCRIqA7BPr8NQzONr2MtnsxrMURHUCOkGRrmdm/Q3A aJV1JSiqrsmAYPf7m4TiFS/zeQjh+/BY1hZHf7YhLNCmwaBHVJiQGtLDKFs6LXAoNIEA 7E+EXoniMYHoqcTRA/MciyF0ldUaeT5ARPfbZwefLzFClFTIM5XYiUfQSHsC71Dssf2x 5lht5kJD0QVhD8CEbU/4JQ54UmquUppEThuKNhq33hRyc7Qmxfbu9W7j/tK7+MDLMep2 y9YPG3MsQlic6ay1lyWtWSg9Uwyiwy2W5QW5BjPNrdn4Gz4UyPDc1a6Dr7UPXsNV8Bzi bRjA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=x0ftg86TGRGj26+RVYt84rI+Vdo6tDNVVkq/Rv8vXuw=; fh=VwvVUlFpFEUgC1VwV2FsYcMIgkDizonsh+Ll3fNhxk0=; b=DjWXT9HKOcQ2o9sDdU8JD2lalvCEI1CXIwyunF9HDofkt2QwvvpyrL72Dkh4K/s00i 5MmQsr6jD4Htql1QVZfKHkwhqGP2R9n8qoYjKM9meGoTQGAvIrselCwmCaxOQ/0S8kf/ ngAYM8vct+tN7Q3WXHmuD7235VirEg5Lw+Z4i5lEjPIiwAskvJmyynrHXD2AhZ9EpTjT R/ZhmqJd0E4AVpYJULholAvnt+OtT3ABCo4Ksasi4mr71rjnNqN5HJePlRu7XluPjH4P /fzOZvs5oomTeDebFh4zaJfWirrh/lyAEx4axLEapyWTAAPC9bEZCMraFp1Qyda25/pM 8XRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gXRkQn0B; 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 oq26-20020a170906cc9a00b0099b5c6c643fsi5871008ejb.316.2023.08.02.08.48.45; Wed, 02 Aug 2023 08:49:10 -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=gXRkQn0B; 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 S234442AbjHBPYF (ORCPT + 99 others); Wed, 2 Aug 2023 11:24:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235266AbjHBPXB (ORCPT ); Wed, 2 Aug 2023 11:23:01 -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 2A5E43C3F; Wed, 2 Aug 2023 08:19:32 -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 2E050619F7; Wed, 2 Aug 2023 15:18:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C0CCC433C9; Wed, 2 Aug 2023 15:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690989506; bh=tRQPMDxU+F3jAUXl9q55Kx+aMQJoipoNjURVaaxY4UM=; h=From:To:Cc:Subject:Date:From; b=gXRkQn0BN6bkcNs7HUTgvw8CBgYUu1WUoq4n2EXGZPCNUeKZbqtQFQbRBnsuM8pGQ pxtBrLUPZwV0zNRnbwPpkuxq62aT75dBr4a6uKJHpFuCLLyMUOSApkQgHkkbYQJ+9Y GdEgdzPKWmniUTo1RUf9s12pjM/IzSBeBALuw7sSPEGsnNLabFzOpAOyWhwMW/L+a3 KCCtlhWZfRarqQeJOIlTUrsRcFrLpDe2lyJDoNZ7LQSnpvBWnp8aa4SWuQ8/eieCmV xuUfXmNto8uY3OK/YO9yQY4zjaF3ENEiQhGg6jR7y5IRS/MSH/RT/UY+fmMQ5PnXv0 5wX40+pZDv0bA== From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Ard Biesheuvel , "Kirill A . Shutemov" Subject: [PATCH v2] efi/x86: Ensure that EFI_RUNTIME_MAP is enabled for kexec Date: Wed, 2 Aug 2023 17:17:04 +0200 Message-Id: <20230802151704.2147028-1-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1659; i=ardb@kernel.org; h=from:subject; bh=tRQPMDxU+F3jAUXl9q55Kx+aMQJoipoNjURVaaxY4UM=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIeVUcf66rqmbvzCaX1km8nPlqUmKu2+vSrgr7bd1lXN5S UjkdTuBjlIWBjEOBlkxRRaB2X/f7Tw9UarWeZYszBxWJpAhDFycAjCR/FRGhoX9a9KvhaV8qnt2 Ijx/XvddG4tJx7tzlERirEXD1Tp2/GD4HzF575vLVhxep3lUVv43PlBXW9D1755B4pYu317lT80 vuAE= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit 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 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 --- v2: use simpler conditional 'select EFI_RUNTIME_MAP' in CONFIG_EFI arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 7422db4097701c96..bfbf53b49fee95a3 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.39.2