From patchwork Mon Apr 24 16:57:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 87118 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2890769vqo; Mon, 24 Apr 2023 10:11:29 -0700 (PDT) X-Google-Smtp-Source: AKy350ZPhCfrYyACwVRIkqTZSbhKul8pm6rSyDXBbHpJXyVYYPmXQjJXKgKx+5G+4r7jmKc1ZjlR X-Received: by 2002:a17:902:70c9:b0:1a8:bc5:4930 with SMTP id l9-20020a17090270c900b001a80bc54930mr13160340plt.61.1682356289424; Mon, 24 Apr 2023 10:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682356289; cv=none; d=google.com; s=arc-20160816; b=Z7MNyfwdQCagyDNM21vc2K03fYSfahbxfXe9oBlHUc20s6F11PgDQVNy8ifiSgwqw4 1bjUlr2RRAWtPwXYczyswsa6jmKSmaFKDFHUESi6+dpwk0ykpynTI0PhrLRPDOP6HLQW Xg74IsEG0ZAS16Bh5+jVmkwfiBeym05jwMtvFzSJKMk9FsVonUBgKoxHJDnvu2mOJURH Eg9GqTgOo3QtHuGhAa+vDECoAn7T0xFLUPaAxZXe16urv6JJFiOkRJ1cL0qV8Ctudb/C XqgcNXW6c6sid8e6wNdIN6fF6DCE/R/R6bm5UPOUrwSMCJjceWDkz/nan6moX/+llV6B NTaQ== 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=60A6TA5OT12AUEsOQ94ShpB6fxuv1uLpPZrwijcq6PE=; b=CHeiF/5N6HaFMccT7OA8yfdOusR8qFVTGIUDyO3xHV6u3oHCy/GtGmcq58/e8uL8Xk tcqxbDwWJDGznaUrOkMoVbORwuSIhuQZYwQpkAfwzG1lnwOVlZl4AAhjq/il/pOl69/9 PCT8/JTCFf27IxE4+tnPNWZoLfkqQT/9h2sEtVbdtR+Rz3JL3kpds14Ime6xwuRKCE1N a8uwcl20vPDiypvok3/4a8rcCfT0qFuFjvzt4VXLsNOQdanuFK/+o2TUbjJXm5Y7hXKH LNk3oW1cgjd2M843P3C7NprPFwwAdBJaUEU7jPU6mDnN9jrkigg8h2+N7+9YOt8GyArt GthQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=my7xhwSk; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a170902ea0c00b001a97bf417cdsi2313546plg.571.2023.04.24.10.11.13; Mon, 24 Apr 2023 10:11:29 -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=my7xhwSk; 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 S231332AbjDXQ6F (ORCPT + 99 others); Mon, 24 Apr 2023 12:58:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232245AbjDXQ57 (ORCPT ); Mon, 24 Apr 2023 12:57:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A741AA26B; Mon, 24 Apr 2023 09:57:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6FF876272F; Mon, 24 Apr 2023 16:57:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BD3AC4339C; Mon, 24 Apr 2023 16:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682355468; bh=r/rF9eDTXhHmlrkb2lsJlgyLhYQxh0Hseo352Wqu2+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=my7xhwSkW6ZiIiIYMlrS49valDwR9XPU+7UEgHKhK/8yi+F/VZFrxbvy0m21Rc7sm UzcBnn2OUdXmfJ4H99y3qn4ZID7nbaIaGnjKLJ9PYECIMhsY2BSs9KbddcvGh5JxMC GHAyrpXVnRYUoSY0seRh/wCOra6PWFocfbMPEAw/SnQUWgCCWnUJRwyiZ5AinvrnIG xmzxf2LP13OI8ygnrZxWcnlnVz+dM9tzTPtHU7GnLy9+mDa5T4LYlOeFTG6Dh/Q+tZ 4Xq00RobvlP/RvKmVbo0rzqajnwNDc8cZxE4VUrVylliUVqdlxfrlroT37OZ2BRHuz Gp6YqaR2V4y6w== From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , Evgeniy Baskov , Borislav Petkov , Andy Lutomirski , Dave Hansen , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Alexey Khoroshilov , Peter Jones , Gerd Hoffmann , Dave Young , Mario Limonciello , Kees Cook , Tom Lendacky , "Kirill A . Shutemov" , Linus Torvalds Subject: [PATCH 3/6] x86: efistub: Obtain ACPI RSDP address while running in the stub Date: Mon, 24 Apr 2023 18:57:23 +0200 Message-Id: <20230424165726.2245548-4-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230424165726.2245548-1-ardb@kernel.org> References: <20230424165726.2245548-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1119; i=ardb@kernel.org; h=from:subject; bh=r/rF9eDTXhHmlrkb2lsJlgyLhYQxh0Hseo352Wqu2+Y=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIcVty8dvM+dItfbu4b80N7Sy/OvTQLfZIn/5XKZK+fhsE I4Pj4/pKGVhEONgkBVTZBGY/ffdztMTpWqdZ8nCzGFlAhnCwMUpABOZ3sfwv0DDddqvaRv+T7Rn XfjU2OCBZjDH2ZjnU9k+VFuctRSPVGP4p2tvZvfwamN53fRvFcl9th9lt1meX1z6okS+zzSTn/k LEwA= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764078428598708913?= X-GMAIL-MSGID: =?utf-8?q?1764078428598708913?= One of the actions performed by the decompressor is populating the RSDP address field in the boot_params struct, and when doing EFI boot, EFI configuration tables are the preferred source for this information. In preparation for removing the decompressor code from the EFI stub boot path, set this field from the EFI stub code. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/x86-stub.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c index a0bfd31358ba97b1..e136c94037dda8d3 100644 --- a/drivers/firmware/efi/libstub/x86-stub.c +++ b/drivers/firmware/efi/libstub/x86-stub.c @@ -787,6 +787,11 @@ asmlinkage unsigned long efi_main(efi_handle_t handle, efi_dxe_table = NULL; } + if (!boot_params->acpi_rsdp_addr) + boot_params->acpi_rsdp_addr = (unsigned long) + (get_efi_config_table(ACPI_20_TABLE_GUID) ?: + get_efi_config_table(ACPI_TABLE_GUID)); + /* * If the kernel isn't already loaded at a suitable address, * relocate it.