From nobody Fri May 17 00:10:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106208+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106208+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 168726566106198.31793975825167; Tue, 20 Jun 2023 05:54:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id TtsgYY1788612x1IvmD9cefl; Tue, 20 Jun 2023 05:54:20 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web11.9456.1687265659710715045 for ; Tue, 20 Jun 2023 05:54:19 -0700 X-Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4QlmmW0Td2z3ZR7; Tue, 20 Jun 2023 12:54:19 +0000 (UTC) (envelope-from corvink@FreeBSD.org) X-Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QlmmV6k9tz4T0M; Tue, 20 Jun 2023 12:54:18 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687265658; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IP0ij2KhX5/0/OBcFGQJigh1kp2B1mNHyfmoafhpvjo=; b=cWlPElvMfpuE1uOHQKe4t4Dj06aGVluHUug5pKoauzVwNsct3zJM00YnkH+/LkO/nMM/i/ Qu2UGQWqFiDLiO2S66MC0FWfZ5qBDHw40m7aDkTPTRCdFFxYA8gT7NEHV9DVaJ/Ul9Ajf8 VRzEPdsS7bwyUefRBfBR33aS5epYDpPgpbsEL9CtChKKIfVLprT80xdUmCjzn3iJZ2U3cG pLEs48D3AdCcHhiGekC1b6OkEH+ESU7eKibgWO0q14yzVKbLhp4U01zSAsckKYv+4Qdzsr fXMKMCnLqdQBBsEzmPXj5xdXxhGs63ZoXypxaDLBVmFzaL82t+eFsit9NHVaMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687265658; a=rsa-sha256; cv=none; b=YDFVz/km3XAhRjTOgntTU+dQ1CBGpyLiqzKgCcNWUs1V+iALwCp8B4Onz5EqxqOsoQXizL gPP3aMdq+AiUWZy5uhLSJZ/1REdHqEgmrRpXFfzRQQ0Q3swfCofweUeYfZue1Gmi5eW5Zd 2LWG7jKPTQ2Tzkj3yyf/IpOfKEORxTYMzE7wOk6m7S6mjLP1dtDNku4tQ78/XNo5Gvah2E XgPBBz/DivUw8eL8uBcj9LYknw+cQKpezLxjM//wvbc0OMcBHw1vET5+48BrMAut7HU7lx 64GSTf5tqH/F7rDiLA6Xyam1oE1UIHNtyFKKHA4iqOMMh+Ox9wMxfQhcb1LACA== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da45:9200:c724:a25a:dc54:e67e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: corvink) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QlmmT5wRjzyy3; Tue, 20 Jun 2023 12:54:17 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Gerd Hoffmann , Ard Biesheuvel , Jiewen Yao , Jordan Justen , Leif Lindholm , Peter Grehan , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v3 1/6] OvmfPkg/Library: fix definition of GetAcpiRsdpFromMemory Date: Tue, 20 Jun 2023 14:53:35 +0200 Message-ID: <20230620125407.516697-2-corvink@FreeBSD.org> In-Reply-To: <20230620125407.516697-1-corvink@FreeBSD.org> References: <20230620125407.516697-1-corvink@FreeBSD.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,corvink@FreeBSD.org X-Gm-Message-State: dPJyOV1JFaatfef3uR23YyqHx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687265660; bh=Ya21KAUeYiOU0rgVR1fyspY5rJhUyhfFpwGk1FSZjpk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=QRSKkHm1pPgFxAhb1ar6HnyG9LrA4P30q/fHEcU91v2j/KUSRdurdWSlfy9Jcx+138O BR7eS97fq/LIYbp/G/lwblwXah2+BoefB37ae411Z4lJfQP+AAIUamFtMbc0tEos6uGyQ 3/L7Iafzks+Mm24EWB05w68AXS5OeiS5tvI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687265662393100006 Content-Type: text/plain; charset="utf-8" The definition and declaration of GetAcpiRsdpFromMemory doesn't match. We don't get a compile error yet because UINTN is the same as UINT64 on 64bit machines. As the function works on memory addresses, UINTN is the correct type of the input parameters. Signed-off-by: Corvin K=C3=B6hne Tested-by: Gerd Hoffmann Acked-by: Gerd Hoffmann Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm Cc: Peter Grehan Cc: Rebecca Cran Cc: Sami Mujawar Acked-by: Peter Grehan --- OvmfPkg/Include/Library/AcpiPlatformLib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/Li= brary/AcpiPlatformLib.h index 73a170636032..78d5010e91d5 100644 --- a/OvmfPkg/Include/Library/AcpiPlatformLib.h +++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h @@ -20,8 +20,8 @@ EFI_STATUS EFIAPI GetAcpiRsdpFromMemory ( - IN UINT64 StartAddress, - IN UINT64 EndAddress, + IN UINTN StartAddress, + IN UINTN EndAddress, OUT EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER **RsdpPtr ); =20 --=20 2.41.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106208): https://edk2.groups.io/g/devel/message/106208 Mute This Topic: https://groups.io/mt/99643180/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 00:10:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106209+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106209+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1687265662094805.9379559359771; Tue, 20 Jun 2023 05:54:22 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rCbbYY1788612x4iQERUOt9f; Tue, 20 Jun 2023 05:54:21 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web10.9557.1687265660923762802 for ; Tue, 20 Jun 2023 05:54:21 -0700 X-Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4QlmmX1VmQz3Zdy; Tue, 20 Jun 2023 12:54:20 +0000 (UTC) (envelope-from corvink@FreeBSD.org) X-Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QlmmX0hktz4Sxf; Tue, 20 Jun 2023 12:54:20 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687265660; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gSqxMmGiiKPehaKebtzCrhX7dDeYY/oC2wKS1BLKzYI=; b=Pce0RNrO6553tqIW5kmCyYhAEuxp3ErUuzYMWhhn+VzzUydlQpazL5XgBS5RUfIuDDDX6i H+w6nl9uEAhECIm4u7FKrkcm5Bh3MudnJRBcTudUo7L+wNGXpr2nniuIuWEbfhI0+S9k3V bqb8ya4sd2xuHIi8uNRyamrDdMvs4tUMm4CoGBXIQtGRsifGd51GGVcWwY4dWCITBPnaHK Osdxvn01BNSl2d4+17e0Dvn9VgUSdZ6D7iCLQ+VGgSBgkCcm0Vpl55IQPT7/jILjyODjvA zzwjcOEEL85yCBkOLLzLNVWWXSyd5SoHmgI68B25rmT2WrVQb0fm1kj0DcytKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687265660; a=rsa-sha256; cv=none; b=YK5ZiX/hmw4A5z4vLjhOVqy2N2iirZjqatMrtHHRFrA36FSpLw3LAzX4qpY5sSE92BfUEu 2PxbWkpANJJKaNPErOgLRBe70rSLf4GcVYcIGRPyMKLY/y1BOp/L4qckuUSbRvF/wDykTc qqLOb4u38cWsa0EXLhOQoiEljeymMYtKOcLl2/HK6VICtw9LMxqV1Ns8m+hfbPt5oKpRG/ AZ23Sc5HF+fTSiqJUqOMGxIOGu8PBxfftIF7fOkURM87Q4wQLc6EOYfA56Wh7YZvWZ9SiY T7xSl0e6Y65oZM/4XWDmyaaARbk+ft6pcIrjWI+rwxXkl/1GR9i6F3KgbQX9jA== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da45:9200:c724:a25a:dc54:e67e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: corvink) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QlmmW00Ctz10pH; Tue, 20 Jun 2023 12:54:18 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Peter Grehan , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v3 2/6] OvmfPkg: avoid including AcpiPlatformLib twice Date: Tue, 20 Jun 2023 14:53:36 +0200 Message-ID: <20230620125407.516697-3-corvink@FreeBSD.org> In-Reply-To: <20230620125407.516697-1-corvink@FreeBSD.org> References: <20230620125407.516697-1-corvink@FreeBSD.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,corvink@FreeBSD.org X-Gm-Message-State: vUtVIiZdHp5hgwhU8InrHDUbx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687265661; bh=hUOv8QbF2FSxoT+ccKitZR+53rrkP82RnMwIzANhRcM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=GObaLmBHDb1Q0mYTYU8W7IgODJOUbetTmvqieXS6HX4j/hDdpP6+VYZyRQ8xx0GIXcL lKPgIAtXwhAceTWonBAWMXFvc53WXH2XOVlAmFbs69tMbe9bxF+RC9o6lCwONucxoPBLw 8wORbnQLY82jnqr+TTXc5SDsgM6Prz77ppU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687265662394100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Corvin K=C3=B6hne Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm Cc: Peter Grehan Cc: Rebecca Cran Cc: Sami Mujawar --- OvmfPkg/Include/Library/AcpiPlatformLib.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OvmfPkg/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/Li= brary/AcpiPlatformLib.h index 78d5010e91d5..617265000315 100644 --- a/OvmfPkg/Include/Library/AcpiPlatformLib.h +++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h @@ -4,6 +4,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 +#ifndef ACPI_PLATFORM_LIB_H_ +#define ACPI_PLATFORM_LIB_H_ + #include =20 /** @@ -47,3 +50,5 @@ InstallAcpiTablesFromRsdp ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, IN EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp ); + +#endif --=20 2.41.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106209): https://edk2.groups.io/g/devel/message/106209 Mute This Topic: https://groups.io/mt/99643181/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 00:10:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106210+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106210+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1687265663042233.59488561315231; Tue, 20 Jun 2023 05:54:23 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rPBtYY1788612xhF7fJ8zdTK; Tue, 20 Jun 2023 05:54:22 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web10.9558.1687265661956132511 for ; Tue, 20 Jun 2023 05:54:22 -0700 X-Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4QlmmY2M3wz3ZKl; Tue, 20 Jun 2023 12:54:21 +0000 (UTC) (envelope-from corvink@FreeBSD.org) X-Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QlmmY1rpvz4Sxj; Tue, 20 Jun 2023 12:54:21 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687265661; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RPgNfez5yMVWfi07b+wu8LndskB4XvrnE6YzdFECj0E=; b=AOUtuPgZCfxYrpLu07Nu3hFYaoGG0/I7oTE+a9gqtNOuPnSU5EBYA4dGRrpKyZJA9n/mBz a1X2pMDQG9ypWPIIqZjqpW+xLgQn8hVzXC+PRBbLZ2fySBFpdoITxVVrarHP+F2A9yWlMW A36xeLWFYBCBRywROOTNjyp4vqBoApKY7ywJ9mvPPvhF8KECx5l7q0BIpYN1/g+H9RUVR1 6BJDqgIYpjWVzm/X4TQYgwMQSyiKZczaFDcU9DLHxUtJnUTUztARmvxDqpgAoB7VvrSZja AoCo3BhYTjOrjCnFVL5vtq4YN3gbTyocGreqI4Ekd3R6JaEenk/GQLDbTxe9tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687265661; a=rsa-sha256; cv=none; b=MVuRK9ZRo8O3SnkQL0vNlaUTE9nnlt2xkVzmbgItB++YWwwMEbqw4sinR2al67OTxn1rWA +oqzGKkECf50bh4Y5kWrXD2311JecIDznZUT/gEL/e7TFV73H7UQ3wCZiacvi6JrwltYDw G591kmoBmY2lRdW4R29nPI15J1U7dRZpvN5DxC+YqutNj9QQqkfqjxiT/OKhULOCK8mbdw r/hzPohXQb4TBxOT9n5KJAMJWRlHCFPVYb0zNYl9lP03iIfwkb/CuQDa6axRbOGpBA0qKi aU+xu5ulzofbRwd1/Td2HYjhmvAO9wJcm/UN3TBfGLE7nYaPhQ5/AT1RylxFNQ== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da45:9200:c724:a25a:dc54:e67e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: corvink) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QlmmX13T7z1119; Tue, 20 Jun 2023 12:54:20 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Peter Grehan , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v3 3/6] OvmfPkg: move PciEncoding into AcpiPlatformLib Date: Tue, 20 Jun 2023 14:53:37 +0200 Message-ID: <20230620125407.516697-4-corvink@FreeBSD.org> In-Reply-To: <20230620125407.516697-1-corvink@FreeBSD.org> References: <20230620125407.516697-1-corvink@FreeBSD.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,corvink@FreeBSD.org X-Gm-Message-State: EFV7kZpfps5ZNniqWlLM1lYox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687265662; bh=eC6RY4oM9eJwQ4lHp/mAljnan9C3PSpNOi1bw+gXAgc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=UHqqUPApxrGaM9jjUoLOACHXfGvl1kZfs5Ts2XGUFQbNBwTrx0vDI5WbdAeYPNPFLto EUz0zAI0QwslNkzlzwsyWTiO9QO/hQx/9cxACW2Jpn9aZjnhBhKI/w9RVd6xZH7cGXhS1 bhBcw8Jn9XshjyD7/DS0Ggj9AXEvEeHgS8Y= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687265664420100015 Content-Type: text/plain; charset="utf-8" Bhyve supports providing ACPI tables by FwCfg. Therefore, InstallQemuFwCfgTables should be moved to AcpiPlatformLib to reuse the code. As first step, move PciEncoding into AcpiPlatformLib. Signed-off-by: Corvin K=C3=B6hne Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm Cc: Peter Grehan Cc: Rebecca Cran Cc: Sami Mujawar --- ArmVirtPkg/ArmVirtQemu.dsc | 1 + ArmVirtPkg/ArmVirtQemuKernel.dsc | 1 + OvmfPkg/AmdSev/AmdSevX64.dsc | 1 + OvmfPkg/CloudHv/CloudHvX64.dsc | 1 + OvmfPkg/IntelTdx/IntelTdxX64.dsc | 1 + OvmfPkg/Microvm/MicrovmX64.dsc | 1 + OvmfPkg/OvmfPkgIa32.dsc | 1 + OvmfPkg/OvmfPkgIa32X64.dsc | 1 + OvmfPkg/OvmfPkgX64.dsc | 1 + OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 1 + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 5 +- .../Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 - .../AcpiPlatformLib/DxeAcpiPlatformLib.inf | 7 + OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 18 -- OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h | 17 -- OvmfPkg/Include/Library/AcpiPlatformLib.h | 18 ++ OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 1 + OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c | 232 ------------------ .../AcpiPlatformLib}/PciDecoding.c | 3 +- 19 files changed, 38 insertions(+), 274 deletions(-) delete mode 100644 OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c rename OvmfPkg/{AcpiPlatformDxe =3D> Library/AcpiPlatformLib}/PciDecoding.= c (96%) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index d998f816b2b3..1e0225951aef 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -111,6 +111,7 @@ [LibraryClasses.AARCH64.PEIM] ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuPeiLib.inf =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf =20 !if $(TPM2_ENABLE) =3D=3D TRUE diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index c9d2b18392b9..8ef5927b53ff 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -83,6 +83,7 @@ [LibraryClasses.common] TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLi= bNull/PeiDxeTpmPlatformHierarchyLib.inf =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf =20 [LibraryClasses.common.UEFI_DRIVER] diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index d24909e847b4..2c6ed7c9745f 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -329,6 +329,7 @@ [LibraryClasses.common.UEFI_DRIVER] PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc index dd9aa403d6a0..e000deed9e4d 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.dsc +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc @@ -366,6 +366,7 @@ [LibraryClasses.common.UEFI_DRIVER] PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX6= 4.dsc index db4953a82ec6..193657ff2d61 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -289,6 +289,7 @@ [LibraryClasses.common.UEFI_DRIVER] PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index 82da3a7e7cce..2f7585639374 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -368,6 +368,7 @@ [LibraryClasses.common.UEFI_DRIVER] PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExp= ressLib.inf =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLibMicrovm.i= nf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 08b04e65cab7..8d1ef4e833b2 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -373,6 +373,7 @@ [LibraryClasses.common.UEFI_DRIVER] PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index d456896a45fb..afee349910a2 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -378,6 +378,7 @@ [LibraryClasses.common.UEFI_DRIVER] PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index e1c0a6fe9ff7..24ac834e0631 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -399,6 +399,7 @@ [LibraryClasses.common.UEFI_DRIVER] PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf diff --git a/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc b/OvmfPkg/RiscVVirt/RiscVV= irtQemu.dsc index 414d186179fb..06c300c4e850 100644 --- a/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc +++ b/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc @@ -113,6 +113,7 @@ [LibraryClasses.common] !endif =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExp= ressLib.inf =20 diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf index 3fd0483b50eb..b22aad95e081 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -26,7 +26,6 @@ [Sources] BootScript.c CloudHvAcpi.c EntryPoint.c - PciDecoding.c QemuFwCfgAcpi.c =20 [Packages] @@ -35,15 +34,13 @@ [Packages] OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] + AcpiPlatformLib BaseLib BaseMemoryLib - DebugLib MemoryAllocationLib OrderedCollectionLib - PcdLib QemuFwCfgLib QemuFwCfgS3Lib - UefiBootServicesTableLib UefiDriverEntryPoint HobLib TpmMeasurementLib diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/Bh= yve/AcpiPlatformDxe/AcpiPlatformDxe.inf index 75ed8e4a7deb..2e228d815b87 100644 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -26,7 +26,6 @@ [Sources] AcpiPlatform.h Bhyve.c EntryPoint.c - PciDecoding.c =20 [Packages] MdePkg/MdePkg.dec diff --git a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf b/OvmfP= kg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf index dfe0e5623d32..4be501bb2c58 100644 --- a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf +++ b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf @@ -16,11 +16,18 @@ [Defines] =20 [Sources] DxeAcpiPlatformLib.c + PciDecoding.c =20 [Packages] + MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] BaseLib DebugLib + PcdLib + UefiBootServicesTableLib + +[Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.h index 3ec509865863..1328f6d1cba6 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -10,12 +10,6 @@ #define ACPI_PLATFORM_H_ =20 #include // EFI_ACPI_TABLE_PROTOCOL -#include // EFI_PCI_IO_PROTOCOL - -typedef struct { - EFI_PCI_IO_PROTOCOL *PciIo; - UINT64 PciAttributes; -} ORIGINAL_ATTRIBUTES; =20 typedef struct S3_CONTEXT S3_CONTEXT; =20 @@ -43,18 +37,6 @@ InstallAcpiTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable ); =20 -VOID -EnablePciDecoding ( - OUT ORIGINAL_ATTRIBUTES **OriginalAttributes, - OUT UINTN *Count - ); - -VOID -RestorePciDecoding ( - IN ORIGINAL_ATTRIBUTES *OriginalAttributes, - IN UINTN Count - ); - EFI_STATUS AllocateS3Context ( OUT S3_CONTEXT **S3Context, diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/Bhyve/A= cpiPlatformDxe/AcpiPlatform.h index 54d1af073eab..b75292b73546 100644 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h @@ -21,11 +21,6 @@ #include #include =20 -typedef struct { - EFI_PCI_IO_PROTOCOL *PciIo; - UINT64 PciAttributes; -} ORIGINAL_ATTRIBUTES; - typedef struct S3_CONTEXT S3_CONTEXT; =20 EFI_STATUS @@ -58,16 +53,4 @@ InstallAcpiTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable ); =20 -VOID -EnablePciDecoding ( - OUT ORIGINAL_ATTRIBUTES **OriginalAttributes, - OUT UINTN *Count - ); - -VOID -RestorePciDecoding ( - IN ORIGINAL_ATTRIBUTES *OriginalAttributes, - IN UINTN Count - ); - #endif /* _ACPI_PLATFORM_H_INCLUDED_ */ diff --git a/OvmfPkg/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/Li= brary/AcpiPlatformLib.h index 617265000315..167d6c49d6e2 100644 --- a/OvmfPkg/Include/Library/AcpiPlatformLib.h +++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h @@ -8,6 +8,12 @@ #define ACPI_PLATFORM_LIB_H_ =20 #include +#include + +typedef struct { + EFI_PCI_IO_PROTOCOL *PciIo; + UINT64 PciAttributes; +} ORIGINAL_ATTRIBUTES; =20 /** Searches and returns the address of the ACPI Root System Description Poi= nter (RSDP) in system memory. @@ -51,4 +57,16 @@ InstallAcpiTablesFromRsdp ( IN EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp ); =20 +VOID +EnablePciDecoding ( + OUT ORIGINAL_ATTRIBUTES **OriginalAttributes, + OUT UINTN *Count + ); + +VOID +RestorePciDecoding ( + IN ORIGINAL_ATTRIBUTES *OriginalAttributes, + IN UINTN Count + ); + #endif diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatform= Dxe/QemuFwCfgAcpi.c index a073b292b743..3de039d57414 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c @@ -11,6 +11,7 @@ #include // EFI_ACPI_DESCRIPTION_HEAD= ER #include // QEMU_LOADER_FNAME_SIZE #include +#include #include // AsciiStrCmp() #include // CopyMem() #include // DEBUG() diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c b/OvmfPkg/Bhyve/Ac= piPlatformDxe/PciDecoding.c deleted file mode 100644 index 0dcf3517f1e7..000000000000 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c +++ /dev/null @@ -1,232 +0,0 @@ -/** @file - Temporarily enable IO and MMIO decoding for all PCI devices while QEMU - regenerates the ACPI tables. - - Copyright (C) 2016, Red Hat, Inc. - - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include - -#include "AcpiPlatform.h" - -/** - Collect all PciIo protocol instances in the system. Save their original - attributes, and enable IO and MMIO decoding for each. - - This is a best effort function; it doesn't return status codes. Its - caller is supposed to proceed even if this function fails. - - @param[out] OriginalAttributes On output, a dynamically allocated array= of - ORIGINAL_ATTRIBUTES elements. The array = lists - the PciIo protocol instances found in the - system at the time of the call, plus the - original PCI attributes for each. - - Before returning, the function enables I= O and - MMIO decoding for each PciIo instance it - finds. - - On error, or when no such instances are - found, OriginalAttributes is set to NULL. - - @param[out] Count On output, the number of elements in - OriginalAttributes. On error it is set to - zero. -**/ -VOID -EnablePciDecoding ( - OUT ORIGINAL_ATTRIBUTES **OriginalAttributes, - OUT UINTN *Count - ) -{ - EFI_STATUS Status; - UINTN NoHandles; - EFI_HANDLE *Handles; - ORIGINAL_ATTRIBUTES *OrigAttrs; - UINTN Idx; - - *OriginalAttributes =3D NULL; - *Count =3D 0; - - if (PcdGetBool (PcdPciDisableBusEnumeration)) { - // - // The platform downloads ACPI tables from QEMU in general, but there = are - // no root bridges in this execution. We're done. - // - return; - } - - Status =3D gBS->LocateHandleBuffer ( - ByProtocol, - &gEfiPciIoProtocolGuid, - NULL /* SearchKey */, - &NoHandles, - &Handles - ); - if (Status =3D=3D EFI_NOT_FOUND) { - // - // No PCI devices were found on either of the root bridges. We're done. - // - return; - } - - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_WARN, - "%a: LocateHandleBuffer(): %r\n", - __func__, - Status - )); - return; - } - - OrigAttrs =3D AllocatePool (NoHandles * sizeof *OrigAttrs); - if (OrigAttrs =3D=3D NULL) { - DEBUG (( - DEBUG_WARN, - "%a: AllocatePool(): out of resources\n", - __func__ - )); - goto FreeHandles; - } - - for (Idx =3D 0; Idx < NoHandles; ++Idx) { - EFI_PCI_IO_PROTOCOL *PciIo; - UINT64 Attributes; - - // - // Look up PciIo on the handle and stash it - // - Status =3D gBS->HandleProtocol ( - Handles[Idx], - &gEfiPciIoProtocolGuid, - (VOID **)&PciIo - ); - ASSERT_EFI_ERROR (Status); - OrigAttrs[Idx].PciIo =3D PciIo; - - // - // Stash the current attributes - // - Status =3D PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationGet, - 0, - &OrigAttrs[Idx].PciAttributes - ); - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_WARN, - "%a: EfiPciIoAttributeOperationGet: %r\n", - __func__, - Status - )); - goto RestoreAttributes; - } - - // - // Retrieve supported attributes - // - Status =3D PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationSupported, - 0, - &Attributes - ); - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_WARN, - "%a: EfiPciIoAttributeOperationSupported: %r\n", - __func__, - Status - )); - goto RestoreAttributes; - } - - // - // Enable IO and MMIO decoding - // - Attributes &=3D EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY; - Status =3D PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationEnable, - Attributes, - NULL - ); - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_WARN, - "%a: EfiPciIoAttributeOperationEnable: %r\n", - __func__, - Status - )); - goto RestoreAttributes; - } - } - - // - // Success - // - FreePool (Handles); - *OriginalAttributes =3D OrigAttrs; - *Count =3D NoHandles; - return; - -RestoreAttributes: - while (Idx > 0) { - --Idx; - OrigAttrs[Idx].PciIo->Attributes ( - OrigAttrs[Idx].PciIo, - EfiPciIoAttributeOperationSet, - OrigAttrs[Idx].PciAttributes, - NULL - ); - } - - FreePool (OrigAttrs); - -FreeHandles: - FreePool (Handles); -} - -/** - Restore the original PCI attributes saved with EnablePciDecoding(). - - @param[in] OriginalAttributes The array allocated and populated by - EnablePciDecoding(). This parameter may be - NULL. If OriginalAttributes is NULL, then= the - function is a no-op; otherwise the PciIo - attributes will be restored, and the - OriginalAttributes array will be freed. - - @param[in] Count The Count value stored by EnablePciDecodi= ng(), - the number of elements in OriginalAttribu= tes. - Count may be zero if and only if - OriginalAttributes is NULL. -**/ -VOID -RestorePciDecoding ( - IN ORIGINAL_ATTRIBUTES *OriginalAttributes, - IN UINTN Count - ) -{ - UINTN Idx; - - ASSERT ((OriginalAttributes =3D=3D NULL) =3D=3D (Count =3D=3D 0)); - if (OriginalAttributes =3D=3D NULL) { - return; - } - - for (Idx =3D 0; Idx < Count; ++Idx) { - OriginalAttributes[Idx].PciIo->Attributes ( - OriginalAttributes[Idx].PciIo, - EfiPciIoAttributeOperationSet, - OriginalAttributes[Idx].PciAttributes, - NULL - ); - } - - FreePool (OriginalAttributes); -} diff --git a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c b/OvmfPkg/Library/AcpiPl= atformLib/PciDecoding.c similarity index 96% rename from OvmfPkg/AcpiPlatformDxe/PciDecoding.c rename to OvmfPkg/Library/AcpiPlatformLib/PciDecoding.c index c7dbfb1baaea..58fbfeefda36 100644 --- a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c +++ b/OvmfPkg/Library/AcpiPlatformLib/PciDecoding.c @@ -7,12 +7,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 +#include #include // DEBUG() #include // AllocatePool() #include // gBS =20 -#include "AcpiPlatform.h" - /** Collect all PciIo protocol instances in the system. Save their original attributes, and enable IO and MMIO decoding for each. --=20 2.41.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106210): https://edk2.groups.io/g/devel/message/106210 Mute This Topic: https://groups.io/mt/99643182/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 00:10:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106211+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106211+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16872656641848.47191549521358; Tue, 20 Jun 2023 05:54:24 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8vrwYY1788612xUy8tsSosKl; Tue, 20 Jun 2023 05:54:23 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web11.9458.1687265663146404604 for ; Tue, 20 Jun 2023 05:54:23 -0700 X-Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4QlmmZ3n0sz3ZRF; Tue, 20 Jun 2023 12:54:22 +0000 (UTC) (envelope-from corvink@FreeBSD.org) X-Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QlmmZ2sK2z4T30; Tue, 20 Jun 2023 12:54:22 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687265662; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zEfQOzZlriC8xgfdqfWBecoWMPyKztz5zACneSjtJnE=; b=pJwFI0XCV81NrOzhUptNKNBC9NBI877d2nigQHJCGEivshhNuMqIWtc4thfGFU7Ul7h3qh K6FeYrAEIddVB+MvO1UwyLPUuX6Duvvow4Qmbv9hvw9tbkVoQX2fMj3nlKYQ5ArZmgt/Zd VMCsDWOSEj6OuwgRLEgnxhQNPXq+UXEerpV+AYj0yRXUyRROcUbUGhLF/zr0Au7Fw1DD38 ZdchmZgAYp6cqiQYF0f1hfs/YUtjnoj+cHLdNwqql7vkVxbUJcCA9DMtGc8SUXHyZ0p1Ii mLp/J4UzN+4aHpnmjNVN1fErb8i2KK5ZqxTbvilD3hE90tSz3on67gOMa/TVPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687265662; a=rsa-sha256; cv=none; b=blNvzmTqiyKgF19NSppx0oZZA9o3W8Dh2RXnSde1cAflig3rWAIhBpavL3i+HoZ/aFOVOE 9nOe2QVvKh0WAQoOYiEbeYh6vY/1A3VsMRnuAB4gEBR/NnzzS99z5uyn4nZNKX3j1AaDBO ItdKx49gaTINxpCuy32Dgz6muYeom4EwAH5SVGM4OqNpgrG9v4pG2Ym5CjSO9KxdGxFa6H LFCafOzQMUxYMXiytJ7VLS5LGH6KEOBYHMC3NB2XF5ZLOXN2G9yjfiGIj1wTjWCNLZoiF0 74mx9FAsZsPjveW+GQ6VrMXF8rgADMAowCI12x1KX+xG5p3QL6ULH1zgjPm5Ag== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da45:9200:c724:a25a:dc54:e67e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: corvink) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QlmmY2Chxz10rg; Tue, 20 Jun 2023 12:54:21 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Peter Grehan , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v3 4/6] OvmfPkg: move BootScript into AcpiPlatformLib Date: Tue, 20 Jun 2023 14:53:38 +0200 Message-ID: <20230620125407.516697-5-corvink@FreeBSD.org> In-Reply-To: <20230620125407.516697-1-corvink@FreeBSD.org> References: <20230620125407.516697-1-corvink@FreeBSD.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,corvink@FreeBSD.org X-Gm-Message-State: Ds6bqkucKv2poPkHEH4nUOszx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687265663; bh=T7I9JL4EvkoXROkvHF3BO72WDN6wXPx2zJm41prRIlI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Y1Z4oNuCWLdahvnhbUjwE+bdC9I8XRfy/oEADtTodQvYhAjPkXrfDb3OABjAbwbdjlu f0r9wG3SMjg4R7U0mr2uU37kcJlVjF2BRNDfXJSUUswafZRIwiKKAhDw0qIbHsUKjNfaZ RfehjBvN2KTLKhMmxBUbP3v8otwLVMGTxpo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687265664420100016 Content-Type: text/plain; charset="utf-8" This is required to move InstallQemuFwCfgTables into AcpiPlatformLib. Signed-off-by: Corvin K=C3=B6hne Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm Cc: Peter Grehan Cc: Rebecca Cran Cc: Sami Mujawar --- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 2 -- .../AcpiPlatformLib/DxeAcpiPlatformLib.inf | 2 ++ OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 27 ------------------- OvmfPkg/Include/Library/AcpiPlatformLib.h | 27 +++++++++++++++++++ .../AcpiPlatformLib}/BootScript.c | 3 +-- 5 files changed, 30 insertions(+), 31 deletions(-) rename OvmfPkg/{AcpiPlatformDxe =3D> Library/AcpiPlatformLib}/BootScript.c= (96%) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf index b22aad95e081..6001b9626970 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -23,7 +23,6 @@ [Defines] [Sources] AcpiPlatform.c AcpiPlatform.h - BootScript.c CloudHvAcpi.c EntryPoint.c QemuFwCfgAcpi.c @@ -40,7 +39,6 @@ [LibraryClasses] MemoryAllocationLib OrderedCollectionLib QemuFwCfgLib - QemuFwCfgS3Lib UefiDriverEntryPoint HobLib TpmMeasurementLib diff --git a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf b/OvmfP= kg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf index 4be501bb2c58..b6e55b618cbb 100644 --- a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf +++ b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf @@ -15,6 +15,7 @@ [Defines] LIBRARY_CLASS =3D AcpiPlatformLib =20 [Sources] + BootScript.c DxeAcpiPlatformLib.c PciDecoding.c =20 @@ -27,6 +28,7 @@ [LibraryClasses] BaseLib DebugLib PcdLib + QemuFwCfgS3Lib UefiBootServicesTableLib =20 [Pcd] diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.h index 1328f6d1cba6..c9f2755014a1 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -11,8 +11,6 @@ =20 #include // EFI_ACPI_TABLE_PROTOCOL =20 -typedef struct S3_CONTEXT S3_CONTEXT; - EFI_STATUS EFIAPI InstallCloudHvTablesTdx ( @@ -37,29 +35,4 @@ InstallAcpiTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable ); =20 -EFI_STATUS -AllocateS3Context ( - OUT S3_CONTEXT **S3Context, - IN UINTN WritePointerCount - ); - -VOID -ReleaseS3Context ( - IN S3_CONTEXT *S3Context - ); - -EFI_STATUS -SaveCondensedWritePointerToS3Context ( - IN OUT S3_CONTEXT *S3Context, - IN UINT16 PointerItem, - IN UINT8 PointerSize, - IN UINT32 PointerOffset, - IN UINT64 PointerValue - ); - -EFI_STATUS -TransferS3ContextToBootScript ( - IN S3_CONTEXT *S3Context - ); - #endif diff --git a/OvmfPkg/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/Li= brary/AcpiPlatformLib.h index 167d6c49d6e2..70c974dce05e 100644 --- a/OvmfPkg/Include/Library/AcpiPlatformLib.h +++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h @@ -15,6 +15,8 @@ typedef struct { UINT64 PciAttributes; } ORIGINAL_ATTRIBUTES; =20 +typedef struct S3_CONTEXT S3_CONTEXT; + /** Searches and returns the address of the ACPI Root System Description Poi= nter (RSDP) in system memory. =20 @@ -69,4 +71,29 @@ RestorePciDecoding ( IN UINTN Count ); =20 +EFI_STATUS +AllocateS3Context ( + OUT S3_CONTEXT **S3Context, + IN UINTN WritePointerCount + ); + +VOID +ReleaseS3Context ( + IN S3_CONTEXT *S3Context + ); + +EFI_STATUS +SaveCondensedWritePointerToS3Context ( + IN OUT S3_CONTEXT *S3Context, + IN UINT16 PointerItem, + IN UINT8 PointerSize, + IN UINT32 PointerOffset, + IN UINT64 PointerValue + ); + +EFI_STATUS +TransferS3ContextToBootScript ( + IN S3_CONTEXT *S3Context + ); + #endif diff --git a/OvmfPkg/AcpiPlatformDxe/BootScript.c b/OvmfPkg/Library/AcpiPla= tformLib/BootScript.c similarity index 96% rename from OvmfPkg/AcpiPlatformDxe/BootScript.c rename to OvmfPkg/Library/AcpiPlatformLib/BootScript.c index ff1491de0d2d..1b1658d703b0 100644 --- a/OvmfPkg/AcpiPlatformDxe/BootScript.c +++ b/OvmfPkg/Library/AcpiPlatformLib/BootScript.c @@ -7,13 +7,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 +#include #include // CpuDeadLoop() #include // DEBUG() #include // AllocatePool() #include // QemuFwCfgS3ScriptSkipBytes() =20 -#include "AcpiPlatform.h" - // // Condensed structure for capturing the fw_cfg operations -- select, skip, // write -- inherent in executing a QEMU_LOADER_WRITE_POINTER command. --=20 2.41.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106211): https://edk2.groups.io/g/devel/message/106211 Mute This Topic: https://groups.io/mt/99643184/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 00:10:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106212+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106212+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1687265665324824.2238426070543; Tue, 20 Jun 2023 05:54:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FhnuYY1788612xTYq6qULVnC; Tue, 20 Jun 2023 05:54:25 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web11.9460.1687265664291889328 for ; Tue, 20 Jun 2023 05:54:24 -0700 X-Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4Qlmmb4h3hz3Zf3; Tue, 20 Jun 2023 12:54:23 +0000 (UTC) (envelope-from corvink@FreeBSD.org) X-Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qlmmb3vKzz4T36; Tue, 20 Jun 2023 12:54:23 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687265663; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DoJtGLtZGy0jQOGKrgvDoz0SwhcJsMopHomtdMhlmJw=; b=U9/sbpTC35pCKfXiKg5M8VXhqrNfySYJMxR32OZGbSqpbGRZB4Tg3LjdE5jDpuhhzf0CET UWV3NB06rqqg6gFbG9zoX/1RJrba7woVgNb3r5azi0enYGj14XsTHfiTDKoAlwvOxccZ60 FFYrDSCC5vUkbQFtj8nF0EezVGtSwMaMxPOcpPBjTgVwAfGIg3Udiw04C5ZRLQy0tgV8+R nMVEuPqfmBEi1rxFusZFyavdwOd4KwNh6ufhbYp/QqpBObx+QlPLrU6/gr0p2Q8HvBAHed CltPhg2cnLdZ7qIgfpTrs9LWsscz4UtQDHHhqri/v9KXmK4u0LeZ9DnZq9Kb7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687265663; a=rsa-sha256; cv=none; b=N1JZ8/qkjMz+rgK4VgVV7x8pKqhBYD5WLpNa03F00LIlfalGIYB7wf7Mm1fA/chSYgcFxl KKCN/2Ttuhx0cyepY8uNPnk4D6yXzeJeyHgPnGSW1cQqlt0gm3iDoOhMXUQsqonfyH4WBB xKcI2dcbigBgj6Vwla9XPYkwILihLoZTZxrpp47yrIXZ/UVd1OHIY1W1yRb+gQkP7e0y83 FsCuB5gRQwe6L3FjLaxF9n5eLXplneFi6Ju5AAaDn5y1j7+t+CQBv+KdYaRfR0h5lgUYWX b1qX90KoLAGhUwNe0k9lPdA6pBUfdZFjqVLdLbM2xn8oKWgkNJitBAZP3dF6dQ== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da45:9200:c724:a25a:dc54:e67e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: corvink) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QlmmZ3DxZz10rh; Tue, 20 Jun 2023 12:54:22 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Peter Grehan , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v3 5/6] OvmfPkg: move QemuFwCfgAcpi into AcpiPlatformLib Date: Tue, 20 Jun 2023 14:53:39 +0200 Message-ID: <20230620125407.516697-6-corvink@FreeBSD.org> In-Reply-To: <20230620125407.516697-1-corvink@FreeBSD.org> References: <20230620125407.516697-1-corvink@FreeBSD.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,corvink@FreeBSD.org X-Gm-Message-State: NBXp1LTRev7vL51VTw38mjO5x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687265665; bh=iYPJ4UQ1hd1z8x4L8X71fpbsZwbXr97mwF3ZK65q0SU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=hnQEj8xDSIuIESL9f5WbhLzTjs1usEF099Spn8dDMupA5g9yjPu/11b7G2ADJToVITw J+SqbX3ZFJxIBX80y+NoK6qfkyrjRgGrVjicRZP4ifV1NXLUgXRqQLf3EhzpYpu/h7lXh dp9KA6m/BqK7huLVIiks4xxFZEP5ZAhsPNI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687265666978100023 Content-Type: text/plain; charset="utf-8" This makes the InstallQemuFwcfgTables function reusable by bhyve. Signed-off-by: Corvin K=C3=B6hne Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm Cc: Peter Grehan Cc: Rebecca Cran Cc: Sami Mujawar --- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 3 --- OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf | 5 +++++ OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 6 ------ OvmfPkg/Include/Library/AcpiPlatformLib.h | 6 ++++++ OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c | 3 +++ .../AcpiPlatformLib}/QemuFwCfgAcpi.c | 2 -- 6 files changed, 14 insertions(+), 11 deletions(-) rename OvmfPkg/{AcpiPlatformDxe =3D> Library/AcpiPlatformLib}/QemuFwCfgAcp= i.c (96%) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf index 6001b9626970..622589e607e9 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -25,7 +25,6 @@ [Sources] AcpiPlatform.h CloudHvAcpi.c EntryPoint.c - QemuFwCfgAcpi.c =20 [Packages] MdeModulePkg/MdeModulePkg.dec @@ -41,12 +40,10 @@ [LibraryClasses] QemuFwCfgLib UefiDriverEntryPoint HobLib - TpmMeasurementLib =20 [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiPciIoProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED - gQemuAcpiTableNotifyProtocolGuid # PROTOCOL PRODUCES =20 [Guids] gRootBridgesConnectedEventGroupGuid diff --git a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf b/OvmfP= kg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf index b6e55b618cbb..59fcb957d059 100644 --- a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf +++ b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf @@ -18,6 +18,7 @@ [Sources] BootScript.c DxeAcpiPlatformLib.c PciDecoding.c + QemuFwCfgAcpi.c =20 [Packages] MdeModulePkg/MdeModulePkg.dec @@ -30,6 +31,10 @@ [LibraryClasses] PcdLib QemuFwCfgS3Lib UefiBootServicesTableLib + TpmMeasurementLib + +[Protocols] + gQemuAcpiTableNotifyProtocolGuid # PROTOCOL PRODUCES =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.h index c9f2755014a1..f4ae84b5a194 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -23,12 +23,6 @@ InstallCloudHvTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol ); =20 -EFI_STATUS -EFIAPI -InstallQemuFwCfgTables ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol - ); - EFI_STATUS EFIAPI InstallAcpiTables ( diff --git a/OvmfPkg/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/Li= brary/AcpiPlatformLib.h index 70c974dce05e..277be93a50bc 100644 --- a/OvmfPkg/Include/Library/AcpiPlatformLib.h +++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h @@ -59,6 +59,12 @@ InstallAcpiTablesFromRsdp ( IN EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp ); =20 +EFI_STATUS +EFIAPI +InstallQemuFwCfgTables ( + IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol + ); + VOID EnablePciDecoding ( OUT ORIGINAL_ATTRIBUTES **OriginalAttributes, diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.c index b446bb487234..20c98bb67fa3 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c @@ -9,6 +9,9 @@ =20 #include // CLOUDHV_DEVICE_ID #include + +#include + #include "AcpiPlatform.h" =20 /** diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/Library/Acpi= PlatformLib/QemuFwCfgAcpi.c similarity index 96% rename from OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c rename to OvmfPkg/Library/AcpiPlatformLib/QemuFwCfgAcpi.c index 3de039d57414..d9d0163ffd9f 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/Library/AcpiPlatformLib/QemuFwCfgAcpi.c @@ -22,8 +22,6 @@ #include // gBS #include =20 -#include "AcpiPlatform.h" - // // The user structure for the ordered collection that will track the fw_cfg // blobs under processing. --=20 2.41.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106212): https://edk2.groups.io/g/devel/message/106212 Mute This Topic: https://groups.io/mt/99643186/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 00:10:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106213+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106213+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1687265666401625.7446755250562; Tue, 20 Jun 2023 05:54:26 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id vOmGYY1788612x531pL2nVvz; Tue, 20 Jun 2023 05:54:26 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web11.9461.1687265665546187658 for ; Tue, 20 Jun 2023 05:54:25 -0700 X-Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4Qlmmc6WsCz3Zc5; Tue, 20 Jun 2023 12:54:24 +0000 (UTC) (envelope-from corvink@FreeBSD.org) X-Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qlmmc5Njwz4T0T; Tue, 20 Jun 2023 12:54:24 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687265664; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/VOmxePrvMsiNqraP9Tm1MTiUlaUpRqS9z0/bTQVdS0=; b=XllEi2qFbBaYvlQ8s5kGJiFqMVy74oYc7IBjoETqYTdXpIISLkfJ1o8wOE2OLP24hRq0SQ l0PtE1jNq4k3dbz+Lx9gpQalhn/7aaFbPEhHaZ4seSsRFOFPMkbNMLo+Ik8TdGlLz5mkXw XC8Uvec5nz4ajs2PgW4Rr71gFZEPVmQ15srlHy+jxg8VyT7XCYle/8FYjEHe+qh0oFpZ2m 77Bsm3bWt6wA5S4ZxHaapal4uVW8opn+VqimgnsjEmEpC3kwp40kZQEgY1EbzpVycrawUP kSHTVplKz5T4Xyf98mS/tIPh5palbTQ9Helt3oOZlBY9sMpmhuEJyB5GH3vUTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687265664; a=rsa-sha256; cv=none; b=uYveb2CGYhabyuJRAF0krpSETMoDIquRVFOqO2iY2NAsYfuWNsQFhrqtAKUbotrf0kjN1G PYOmxcOxI6iNP8LNXIJFcKNcAfXdMjGhC90BRT5ZEh1yiwRZpP9MNMlLYVIieMZw+aa5sc SZUvGa2zw5HlVKTAQkUoELTQUnrYRfhWYdlExo2jMHZRpaqH3ZdbZ6GRoGlIXLc2hT1M3q FEZwQYH/0mpfPIols6NS7Ar1sTY7Z+uFwRrcqHrxXqH2aMSbGSUFNou0eXSuu7EPlRKOnn ruWUqe9cy9doHGYZ+eeO98gV1vmBLNu4Xw/y7PzaMkNRR/hnHcURRl4x6GuNVA== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da45:9200:c724:a25a:dc54:e67e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: corvink) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Qlmmb4JJ5z11Jg; Tue, 20 Jun 2023 12:54:23 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Peter Grehan , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v3 6/6] OvmfPkg/Bhyve: install Acpi tables provided by FwCfg Date: Tue, 20 Jun 2023 14:53:40 +0200 Message-ID: <20230620125407.516697-7-corvink@FreeBSD.org> In-Reply-To: <20230620125407.516697-1-corvink@FreeBSD.org> References: <20230620125407.516697-1-corvink@FreeBSD.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,corvink@FreeBSD.org X-Gm-Message-State: ZiKGqAili76pc2DbTMmbI0eEx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687265666; bh=mxdiQYawcFt7vWJdQcKWitvsim+uSLemaLv7tZyg/Cc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=ia2GXc8dEb1zEuwZZiu/76nzbPQiseJK7uGlSfUdGg7kLwmiUGPOvuL9g+0hQ3Qb1Az ecYsD9uYdT3Xs/DcCkZXfC1BjfIzicmExMmcCH7KAymlWeGdmWQ4Rdt8K0we3kU4XXTOY /1niMKjS20R3ADMmyUr2P528Dkmtv59/oyY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687265667462100027 Content-Type: text/plain; charset="utf-8" Signed-off-by: Corvin K=C3=B6hne Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm Cc: Peter Grehan Cc: Rebecca Cran Cc: Sami Mujawar --- OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/Bhyve/A= cpiPlatformDxe/AcpiPlatform.c index 1e1c90614ea1..fb926a8bd803 100644 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c @@ -249,6 +249,11 @@ InstallAcpiTables ( EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp; EFI_STATUS Status; =20 + Status =3D InstallQemuFwCfgTables (AcpiTable); + if (!EFI_ERROR (Status)) { + return EFI_SUCCESS; + } + Status =3D GetAcpiRsdpFromMemory ( BHYVE_ACPI_PHYSICAL_ADDRESS, BHYVE_BIOS_PHYSICAL_END, --=20 2.41.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106213): https://edk2.groups.io/g/devel/message/106213 Mute This Topic: https://groups.io/mt/99643188/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-