From nobody Thu May 16 09:46:52 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+106246+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+106246+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 1687332712421452.76809735760264; Wed, 21 Jun 2023 00:31:52 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id He5AYY1788612x8ZcJVbPnkm; Wed, 21 Jun 2023 00:31:52 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web10.5593.1687332711037583466 for ; Wed, 21 Jun 2023 00:31:51 -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 4QmFYy33CNz3d76; Wed, 21 Jun 2023 07:31:50 +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 4QmFYy2H7Cz3sNc; Wed, 21 Jun 2023 07:31:50 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687332710; 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=h/U1LTHDvpLAQa7s2S6sWuqI7AV47PQx35oX83qZ/WQ=; b=bJH8elzdWgRPeHHN/xk2SpDpScLa4IyvLgmBckW8GYQXzmU+EeYAftmCqwidotAADu88Dv Up+cdBgPD7vUaq/CG8C562TMNNi5C8fN0HyrMd1ydo0oEVUuISOAZ0aOPwtJ0q+zC6K6n0 PA38Dyaq5klg8tdVtrfYTRqT8sI2HzszmlhLxndzE/beBnxr7GVwpTyYYS0w1Rx9XK/mFS t823g4T3LxYzFu847Ld/JXSx5XyNhyjUnlcickzL7kGtZD77VJ+oF4Fu8iFbu64zdB/NT0 pPBo/5qoncLy2Hfpkd3QC3C44JfgJmYNL2nH84DfopryLDHdhP+coP5jwhEUSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687332710; a=rsa-sha256; cv=none; b=Zbbo962iguX9WMplb131o2zTgNtpMGqv/fEclvw01tlp6r7NVNHci735k2G4M6CcestHDG iHAPxFpjrKL6ww5ixLjtmMrc7pzCO5FfZ9twj7XTVQSTuHoHPzl7VxHZD+xOzY2/qshJpo N7oEbNq4dqLmc0RYGyoqWSm4u+b3iAGY/KHlpcjvPY9ncUndMXoWqw2F1HMjD7/7fosDo5 64nNg1YVApu7spOFTr56X2Fz9ghNP+RygbKTgMzckf12WWb/5eTrgTgRzT284TiZnZ6M/O pjqDWJ34kkyfat0so3K3j3sZGI4Ydd79K4ywndsARSp9IFPl6rXhxWimM5nppQ== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da6d:2500:f78a:5460:c2c3:5780]) (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 4QmFYx1P6BzNS4; Wed, 21 Jun 2023 07:31:49 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Gerd Hoffmann , Peter Grehan , Ard Biesheuvel , Jiewen Yao , Jordan Justen , Leif Lindholm , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v4 1/6] OvmfPkg/Library: fix definition of GetAcpiRsdpFromMemory Date: Wed, 21 Jun 2023 09:31:11 +0200 Message-ID: <20230621073141.149094-2-corvink@FreeBSD.org> In-Reply-To: <20230621073141.149094-1-corvink@FreeBSD.org> References: <20230621073141.149094-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: QmydML1OgzFddepdpcZlsByLx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687332712; bh=HxXp3pJ7eorPbvtbUCk1xGfH3Ev3Oy77CImwUgcXo5Y=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=fimRcBbgHHctA4Jw3OfsL+ncIsj/Aec8e5iEOzY4nL/hDZNU1V/UdGGKYkrMv1ZJb4c QTEVYBjlAPdeanoNmTGbfbH1wo3LGbO/73CnWQ663kCPiJNm9G8BLCg3HdofUIi1UO6s6 nUP/vayFJFkJBP1R2xumh+Aq2+P9rWslzDU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687332713229100001 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 Acked-by: Peter Grehan Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm Cc: Rebecca Cran Cc: Sami Mujawar --- 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 (#106246): https://edk2.groups.io/g/devel/message/106246 Mute This Topic: https://groups.io/mt/99672098/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 Thu May 16 09:46:52 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+106247+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+106247+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 168733271353362.08782846053623; Wed, 21 Jun 2023 00:31:53 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 5oRGYY1788612xkg9Kiv7Zit; Wed, 21 Jun 2023 00:31:53 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web11.5631.1687332712250996914 for ; Wed, 21 Jun 2023 00:31:52 -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 4QmFYz4HCTz3d2h; Wed, 21 Jun 2023 07:31:51 +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 4QmFYz3Wn3z3sYq; Wed, 21 Jun 2023 07:31:51 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687332711; 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=O6Z7sNL0ODwpclzF9eWaHGdTke4uc+HCicpWUD0xSq0=; b=rk2UqlOVURV8frrcpALyGXuKQXUXmdR5MIRI7XEqx8G19wHOxZLppNhm6qvUFcs2QMxAlF d9mrwM3cQ23sbJ5DjxAH+ndXgg+6RBjMb+GN2f1prv7PrpHNe/O2IFdqVUaOdl6kSMKran OZAkLwPbaidmW0+61Z/Soqf0hbPruDL9+NQqpHySzxgt+cotozp4Is3F9nhH1eDUfNwPm+ X1UdOEjjDphmtpd4HF/qNo9zp0lh323dv8ghqSr8RERs4aptAP3Rp2FFDZnzBFpeav+7xO bsdgMnf1CS0TNXFA+PdLRySWEvkWXhjpdWD8V+Je+1EcK11/CVsVpBL/zytrkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687332711; a=rsa-sha256; cv=none; b=xoxYZ79mf9VkIlxBk+ilKTjUWBypSzCmQJ6fZkeMGMeFZHvxOziOY0gDjH8qR27YHbWmFO x8WkUqGnRd9vFSeIzEZcQM6B+MG98TTWVlz0mSZGC+TwNsVW69Smq8AmjCc5QklrJB2Q1R zile0kKBRGZweQNNmYeRF1bnve2MydP65tDoLALxTJ6FdAdExDaaWNhwhjszqQqs/37w8o ggrBsf7KsfaVE+4IHY0OyPbqrt1RKAU/SBSfbRZ6bmn8ZVU6rbYlfPRVO1N/bXKWCEtZ+b k6L39WtODKp3xEshxqXxYTqn8H9AzFnL5pBk+wOSnZZyTxt3gA4uP+n0vt6kNw== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da6d:2500:f78a:5460:c2c3:5780]) (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 4QmFYy2hM7zMPb; Wed, 21 Jun 2023 07:31:50 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Peter Grehan , Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v4 2/6] OvmfPkg: avoid including AcpiPlatformLib twice Date: Wed, 21 Jun 2023 09:31:12 +0200 Message-ID: <20230621073141.149094-3-corvink@FreeBSD.org> In-Reply-To: <20230621073141.149094-1-corvink@FreeBSD.org> References: <20230621073141.149094-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: wiJo7hDpZAqMESJFCWfOYzynx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687332713; bh=HvCvqGOZW2BvGW3m+Xs8u56vFHMWhn20Ocsl/SU5bxw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=J6KqVrEY46heu8uWX55yTMHyR5aSJDjrI34sSkAaFoovvT2xrDukCd/lxzB5fNeVKPH q3fdAnsGdeXtBVjzdsChWwC3MDDjtIRn3dYJIjVzdd0Ga+E1i7XQeGnuh6dsODR9ByZaV lIvj7Jk0sifZqPBgui7zTsoIy7yJnWjNjXg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687332714018100004 Content-Type: text/plain; charset="utf-8" Signed-off-by: Corvin K=C3=B6hne Acked-by: Peter Grehan Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm 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 (#106247): https://edk2.groups.io/g/devel/message/106247 Mute This Topic: https://groups.io/mt/99672099/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 Thu May 16 09:46:52 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+106248+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+106248+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 1687332714540158.28746470441092; Wed, 21 Jun 2023 00:31:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id V5gAYY1788612xUFcbyM13mH; Wed, 21 Jun 2023 00:31:54 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web11.5632.1687332713394051122 for ; Wed, 21 Jun 2023 00:31:53 -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 4QmFZ05dRDz3dMt; Wed, 21 Jun 2023 07:31:52 +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 4QmFZ04sdMz3sbl; Wed, 21 Jun 2023 07:31:52 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687332712; 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=4SzCGTJI4Xoc32u96PmZZdkEHqINeD5RSlv7Xvj2/U4=; b=jFAsSeaZuYqxyq4Chw1DUGo3yAHkELtvW4opOCUB/xkE/xaltGQ3YBJh7Bqzx6U4ccxj3q TwBZjR35tsqdKbManWFLQBEnuPDe2WO+DQXN4nQ1o06fVUZa8DBk31a+zEzDgxIwsKkGI2 gxBH20F41Up0FIaVGzb070H9ZWYG+JH9upuYw0N3YFUEdrWrUBQUaR5h1yYnVJoFvqQoZT 9wBzch7gR9uREPd5jPKsriZrXiACi+uTuIpDXfuqnLGTDXrVJUCveyed2qnW9PUtwLznqo 7Z3wZWcsqCgH4S/ZkmHkm2aL6w86g2M+bFu4vpc1SoRkbf1l6J5E1O83M5cN/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687332712; a=rsa-sha256; cv=none; b=pnqnZCtn27z2ktNtYKp8gq8gcqiFxQ08YbcA068j7GL8iQr8HUdZOmcoJvvfzJVkuv1qmO YkitvTEIADioAdv50ly5YVJSEGkIn63SH6yJGDvjIx0o/uDmASCqOjrdXhGUMejkvdGuaA D6LCwoazZ7fL5/9nd031fODaYNyfzbwKrm1/3hhUWod3pU710qJiTA8LENTe4bAwQO8Otp cC46LUyM2a5hjOCcJN7M3dToQpwGCBRI3CRhDZZwx3KbKlCnJmXNNdsWZSo/OoVubQYt7L WkAyrQqbUpDO7Sc+1tKMTfhyc9BoRXLAZCc5B0dN+ufBvg3YSjfkjOnW4XTMKA== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da6d:2500:f78a:5460:c2c3:5780]) (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 4QmFYz3wbDzNMt; Wed, 21 Jun 2023 07:31:51 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Peter Grehan , Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v4 3/6] OvmfPkg: move PciEncoding into AcpiPlatformLib Date: Wed, 21 Jun 2023 09:31:13 +0200 Message-ID: <20230621073141.149094-4-corvink@FreeBSD.org> In-Reply-To: <20230621073141.149094-1-corvink@FreeBSD.org> References: <20230621073141.149094-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: ipCaeCh4cLR3hY4Xyva0alP7x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687332714; bh=WJ4UjPFcRZi6yIi154rfeM4cn4B225S72r/56YEEoiI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=xBW8vy9mTDm0JL4AaqxymmhgrqztaRKxCyaTPzYbV6AR49SVvuUtVVrbqHYIPzk8U5B CljZZc8jmRBTN00CE1BvKRaIydIW4gIgnKJ52M7TO5UNiB8qITM5GxCMEAWQDc7o1UqiU 5kLlMCDFGwQpiNJUp7R1gFWRwMuXj7Y3JMk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687332715544100013 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 Acked-by: Peter Grehan Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm 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 (#106248): https://edk2.groups.io/g/devel/message/106248 Mute This Topic: https://groups.io/mt/99672100/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 Thu May 16 09:46:52 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+106249+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+106249+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 1687332715873102.14333267117252; Wed, 21 Jun 2023 00:31:55 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id KBUEYY1788612x1E8y3d2DVr; Wed, 21 Jun 2023 00:31:55 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web11.5633.1687332714616475871 for ; Wed, 21 Jun 2023 00:31:54 -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 4QmFZ16vbQz3dRd; Wed, 21 Jun 2023 07:31:53 +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 4QmFZ166RQz3sYt; Wed, 21 Jun 2023 07:31:53 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687332713; 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=iQH+CkB0KIqsXGvOwY+VIVDCB09+VLNh6ubkXAn8WVE=; b=c8V2CTdWSgV9aSLLZOO51cmUqHiKT3bVr7Nm3/nNixtL9W1ayQcocSURtZBuCUKjY/AJNo s63S2UEWbogdGlCQLDh0fYasyauB0d8pekhTMJkeCZ77Zcmz8IhjkobtWmi6Q/OljxGYcF /C7IhLm7qRV+X0Y0BH2xx6UHXijswWwDVd96PLoJooFJxhNFlidtB96fB/I/lbVsAjfBuH S23zhdzTq6pb5jS06HZAHCm+DgKtPC3KLTKfgMab5kJHgJuqA/DrPNtncSVTP+EHZRfPVv DCm2QS0fAln6Di4a5w0hyQdeGCAyTX7VN1EoIsJXnId3M53kowmJONiVzOw2GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687332713; a=rsa-sha256; cv=none; b=WhcRkoXqrnMimw0y6eqV4zQPlAYds0UA438OS0EbBrK7bcnBbxg8ZGJTnOb8HXpOOsIOmu u6uyE1bOq4bwYnG4uzsxUYVnApNdHDMo1h/eEOT3He7RU+3KU7IZ9k6wsoVMfSxo+V3lSu x61ed1wFrWXgSD1eNDBf+VBQCbEq+za07DiP4ktr0TVtKiPo7mr4OcrVOvie2+wEgyBqR+ 2gcv1l7qhjwygdqPbTLcCyS4XoCWEOAPgJcIrPb2egD4PAQwOhoEQA8EnOd370+C39Si9K HPqyS7lmVStMPaEneFSUW3RBYtwrGuNUXytoj6tmSFq8lWQJdHDPppFx6SdO2Q== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da6d:2500:f78a:5460:c2c3:5780]) (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 4QmFZ05FthzMsv; Wed, 21 Jun 2023 07:31:52 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Peter Grehan , Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v4 4/6] OvmfPkg: move BootScript into AcpiPlatformLib Date: Wed, 21 Jun 2023 09:31:14 +0200 Message-ID: <20230621073141.149094-5-corvink@FreeBSD.org> In-Reply-To: <20230621073141.149094-1-corvink@FreeBSD.org> References: <20230621073141.149094-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: qPeuj3Rg2dWXsVNYHAN1SSLnx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687332715; bh=kUIo4lKFavFrl5/6ePkS8D/9t6jHDUEIIDP6FIoUc2I=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=V8H7HnbKChRijkourzY1Xq7vyM+m85MY3s/Ae7+nC6Dnu+r0mB1Ot/7rnegTN3FDknT Bj/9h3/SrQK1nTes2ZIwofciPlpPv3/AfttmYMtjLUXkt9do63ppTj0wz67I4EexuVtFd PMcEXM7/3N5gbR/lhNVx7OqmampCAcQzfhw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687332718035100021 Content-Type: text/plain; charset="utf-8" This is required to move InstallQemuFwCfgTables into AcpiPlatformLib. Signed-off-by: Corvin K=C3=B6hne Acked-by: Peter Grehan Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm 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 (#106249): https://edk2.groups.io/g/devel/message/106249 Mute This Topic: https://groups.io/mt/99672101/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 Thu May 16 09:46:52 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+106250+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+106250+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 1687332716720134.08380003074728; Wed, 21 Jun 2023 00:31:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Zn1GYY1788612xc5hua1Yxri; Wed, 21 Jun 2023 00:31:56 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web11.5634.1687332715754294044 for ; Wed, 21 Jun 2023 00:31:55 -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 4QmFZ30yFBz3d2j; Wed, 21 Jun 2023 07:31:55 +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 4QmFZ30Cgvz3snk; Wed, 21 Jun 2023 07:31:55 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687332715; 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=IYfrYU6rCR84EF1bqizCNQPu1Y9IyY5DRjIKme045PU=; b=TRzL+0fORpP0oe+rog+B6V+Q+UMJI0d4zTMJz+nmDRfiHJQW8wi4gKVJkbbHtTxUxdb5Da ZIo9HQljXbvoaFS/o/fqKFwi1IiFQlWS6zaZc5BEnVrEa1AMEoqtt6SnCeHXwlVLS0yykS rueOVNEAQwhBrC4ftaKQYApfmOk6ICExmYA2qHrtRbeo5hpmBUwjsptZ9jk5dXe34rpv7U GXHqWxmW5SEQFfpXm991TApxX2sjZW66eDO66q+CU8YFtbc1zkVQcp+AZuBWQCh1hbwU8c yUTlUXdAphH40/lB0qA13FsPWo4xbfeE8npoW61Wqnx8079VX5N3jYZsih0Yzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687332715; a=rsa-sha256; cv=none; b=ZhdwG7zWJL8L/vd9OwlIkt+nmaCMY8XIVm4ySAgNZhYsgPC8ENDLRtFpeQM2TRndzzB+Mv R3297Q/Qnu95q1XWXUa8LJJ42LRzt/6l95c0aWeMUCY02QMz4DEyodcoTiUqTruJRpC70r XKQoyoguAHU7DM2BFJgFD7T2p07HmXHRAFbg+eTEa8UtoAbDo68GsfvhptuT032D4TPvo6 NmgXtXZKKhSBXzv2zm9LkUTsRJPr9vpS2EqsmexasEv5ic9slH+aLN9V+2fhUlAmpmqy5Z iSR8F09fH48U6Kx4KouGR8CwusNQomqQu3JvpnXeGT3iXxSRt6GdEvDWFYtMLQ== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da6d:2500:f78a:5460:c2c3:5780]) (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 4QmFZ16VdvzN8j; Wed, 21 Jun 2023 07:31:53 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Peter Grehan , Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v4 5/6] OvmfPkg: move QemuFwCfgAcpi into AcpiPlatformLib Date: Wed, 21 Jun 2023 09:31:15 +0200 Message-ID: <20230621073141.149094-6-corvink@FreeBSD.org> In-Reply-To: <20230621073141.149094-1-corvink@FreeBSD.org> References: <20230621073141.149094-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: H0av4P6JYBB21ekFJiBG030ox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687332716; bh=/7o+5+XC/GYnvvn+WvvvYGSI6mnayk2LP1rUK0MpjcY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=MuaCrOsdYniz+MFMFkIAmeEGLbP9rrCycm9GXwsh+TWkaCz8HSrhlMMISx9p2J2efco SQGm+W22utJFKAZ2Yacgfd+ac0sO0lRLo3nA4nSaimN9n3M0appr7V2cQHVne2WyZ7DGX 9eHgreKOA0l9u0e89Ef2MdUYEhG23rBf7K8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687332717549100019 Content-Type: text/plain; charset="utf-8" This makes the InstallQemuFwcfgTables function reusable by bhyve. Signed-off-by: Corvin K=C3=B6hne Acked-by: Peter Grehan Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm 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 (#106250): https://edk2.groups.io/g/devel/message/106250 Mute This Topic: https://groups.io/mt/99672102/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 Thu May 16 09:46:52 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+106251+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+106251+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 168733271790020.632207323767375; Wed, 21 Jun 2023 00:31:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id bWDiYY1788612x59iRvFoHAv; Wed, 21 Jun 2023 00:31:57 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web10.5594.1687332716981620575 for ; Wed, 21 Jun 2023 00:31:57 -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 4QmFZ42d7Yz3d4s; Wed, 21 Jun 2023 07:31:56 +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 4QmFZ41SK1z3sbp; Wed, 21 Jun 2023 07:31:56 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687332716; 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=Ta99065p+8On8RkZfNPV26oc7W1svcgmWuMsakI3txA=; b=cla/Iit5CDNb/6gjquGb24bZ+qqB8UA5i+yYSJ6Mq62jYxyzXXMB7peBpzc8FAU5jH/zLm VX2GKtISZ0lUWkfFgeqp5AIDyQSTnOoc8Ks8514Ca/lbZB/08s85pSWlI66lki1zFAuDNH VEe3P04B7OxNuGjTYnRH7qbP3GxFeU9ZxvPjw9kbkhdAQy95k6D/N5wJZm4oHsuuvOkUnG dhu9JTLsR8llr12sETGF52fFNztFuHenEl+cd6XxjiILE6f6LzKYix+cKiQ3R0hP/a5hac udZ6pmuC8ETqERsMlDlQYZlQpHGyOWVCzAYgY9N9pcKj2eCmnXpLkFLP4ux08w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687332716; a=rsa-sha256; cv=none; b=O1CqH9Au27nJNTlPOZHHIZqrvtWYDxSulw924wtvKWF69WnzdwO2YFlp23zSqjs74tQrZV Td31nH+g2FBWbJt7Od58aCh2jWXrUnMtXkyeRFbklMdS3ru8ueo9qQ4rUDwNzIGHuaBBFy /RaKDbcbMU/Iy0J9eKOZ/rPxsQ10xngYPcK10oKuh/88B8E44Mmb+llw0T3LYy64+61hMw GzmboiH3Ke5y8EZ1sIWY8e4sjswIFPQDV4BS/u7Mp2k/I1ZpED1e7yZkpo7E2aDFkTgst+ EMLusCN3aOYTkgKdDXksGCRuRcf/C//H//39SwcfuU004RQe1LXBzLrwnyMgxg== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da6d:2500:f78a:5460:c2c3:5780]) (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 4QmFZ30czTzN8k; Wed, 21 Jun 2023 07:31:54 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Peter Grehan , Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Rebecca Cran , Sami Mujawar Subject: [edk2-devel] [PATCH v4 6/6] OvmfPkg/Bhyve: install Acpi tables provided by FwCfg Date: Wed, 21 Jun 2023 09:31:16 +0200 Message-ID: <20230621073141.149094-7-corvink@FreeBSD.org> In-Reply-To: <20230621073141.149094-1-corvink@FreeBSD.org> References: <20230621073141.149094-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: LEUppB9QvxNT9wFtYC6m3g6wx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687332717; bh=bWHtQcb7uucoOsF072WRDyFVbSrbvko69UeUYTgYxHk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Ow1WMyfIL8MfgLijDOQNG7S2QGMbDCD7jI1cp2gJQyO8wrZY8hNXRgjsSS7doU8KfK9 YXXHuyB+RTigi2Obukjo/knZR4lsVebXnOdtR3m7rn1hJStsJQ/PDR+NDDuBEecJqIKdJ 9JtXiwW+6JetUdUJfbVH0wo2Vr2cCEoV7z0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687332719232100025 Content-Type: text/plain; charset="utf-8" Signed-off-by: Corvin K=C3=B6hne Acked-by: Peter Grehan Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm 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 (#106251): https://edk2.groups.io/g/devel/message/106251 Mute This Topic: https://groups.io/mt/99672103/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-