From nobody Sat Nov 2 12:24:56 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488999924805732.8534165778883; Wed, 8 Mar 2017 11:05:24 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id ACC5980375; Wed, 8 Mar 2017 11:05:22 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8C04780375 for ; Wed, 8 Mar 2017 11:05:21 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E8A9C80481; Wed, 8 Mar 2017 19:05:20 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-47.phx2.redhat.com [10.3.117.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28J5GPL014080; Wed, 8 Mar 2017 14:05:19 -0500 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 8 Mar 2017 20:05:06 +0100 Message-Id: <20170308190511.31195-2-lersek@redhat.com> In-Reply-To: <20170308190511.31195-1-lersek@redhat.com> References: <20170308190511.31195-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 08 Mar 2017 19:05:22 +0000 (UTC) Subject: [edk2] [PATCH 1/6] ArmVirtPkg/FdtClientDxe: supplement missing EFIAPI calling conv specifiers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 7cc0c44ca12a..547a29fce62c 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -29,6 +29,7 @@ STATIC VOID *mDeviceTreeBase; =20 STATIC EFI_STATUS +EFIAPI GetNodeProperty ( IN FDT_CLIENT_PROTOCOL *This, IN INT32 Node, @@ -55,6 +56,7 @@ GetNodeProperty ( =20 STATIC EFI_STATUS +EFIAPI SetNodeProperty ( IN FDT_CLIENT_PROTOCOL *This, IN INT32 Node, @@ -267,6 +269,7 @@ FindMemoryNodeReg ( =20 STATIC EFI_STATUS +EFIAPI GetOrInsertChosenNode ( IN FDT_CLIENT_PROTOCOL *This, OUT INT32 *Node --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 12:24:56 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488999929981357.45237444146244; Wed, 8 Mar 2017 11:05:29 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E391C80378; Wed, 8 Mar 2017 11:05:25 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 79F0280378 for ; Wed, 8 Mar 2017 11:05:24 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0EC65C04BD29; Wed, 8 Mar 2017 19:05:25 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-47.phx2.redhat.com [10.3.117.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28J5GPM014080; Wed, 8 Mar 2017 14:05:24 -0500 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 8 Mar 2017 20:05:07 +0100 Message-Id: <20170308190511.31195-3-lersek@redhat.com> In-Reply-To: <20170308190511.31195-1-lersek@redhat.com> References: <20170308190511.31195-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 08 Mar 2017 19:05:25 +0000 (UTC) Subject: [edk2] [PATCH 2/6] ArmVirtPkg: introduce FDT_CLIENT_PROTOCOL.GetOsExposure() member function X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Introduce a protocol member function that allows consumers of the protocol to determine whether the FDT is exposed to the guest OS. The initial implementation simply reflects !PcdPureAcpiBoot. Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/Include/Protocol/FdtClient.h | 26 ++++++++++++++++++++ ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 11 +++++++++ 2 files changed, 37 insertions(+) diff --git a/ArmVirtPkg/Include/Protocol/FdtClient.h b/ArmVirtPkg/Include/P= rotocol/FdtClient.h index aad76db388be..4e189c2a3d2a 100644 --- a/ArmVirtPkg/Include/Protocol/FdtClient.h +++ b/ArmVirtPkg/Include/Protocol/FdtClient.h @@ -115,6 +115,30 @@ EFI_STATUS OUT INT32 *Node ); =20 +/* + @param[out] FdtExposedToOs Whether the firmware exposes the FDT to the = guest + OS as an EFI system configuration table. + + @retval EFI_NOT_STARTED The protocol instance is in the process of + determining whether it should expose the FDT to= the + guest OS as an EFI system configuration table. + + This status code is never returned to modules t= hat + depend on the protocol with a DEPEX, or wait fo= r it + with a TPL_CALLBACK protocol notify. Protocol + notifies registered at higher task priority lev= els + may see this return value (but such protocol + notifies should not be used in the first place,= in + general). + + @retval EFI_SUCCESS FdtExposedToOs has been set. +*/ +typedef +EFI_STATUS +(EFIAPI *FDT_CLIENT_GET_OS_EXPOSURE) ( + OUT BOOLEAN *FdtExposedToOs + ); + struct _FDT_CLIENT_PROTOCOL { FDT_CLIENT_GET_NODE_PROPERTY GetNodeProperty; FDT_CLIENT_SET_NODE_PROPERTY SetNodeProperty; @@ -128,6 +152,8 @@ struct _FDT_CLIENT_PROTOCOL { FDT_CLIENT_FIND_NEXT_MEMORY_NODE_REG FindNextMemoryNodeReg; =20 FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE GetOrInsertChosenNode; + + FDT_CLIENT_GET_OS_EXPOSURE GetOsExposure; }; =20 extern EFI_GUID gFdtClientProtocolGuid; diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 547a29fce62c..6082b22d35c1 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -294,6 +294,16 @@ GetOrInsertChosenNode ( return EFI_SUCCESS; } =20 +STATIC +EFI_STATUS +GetOsExposure ( + OUT BOOLEAN *FdtExposedToOs + ) +{ + *FdtExposedToOs =3D !FeaturePcdGet (PcdPureAcpiBoot); + return EFI_SUCCESS; +} + STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol =3D { GetNodeProperty, SetNodeProperty, @@ -304,6 +314,7 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol =3D { FindMemoryNodeReg, FindNextMemoryNodeReg, GetOrInsertChosenNode, + GetOsExposure }; =20 EFI_STATUS --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 12:24:56 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488999930496762.8348002123088; Wed, 8 Mar 2017 11:05:30 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 240688037C; Wed, 8 Mar 2017 11:05:27 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A48B380370 for ; Wed, 8 Mar 2017 11:05:25 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 42D2C4D685; Wed, 8 Mar 2017 19:05:26 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-47.phx2.redhat.com [10.3.117.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28J5GPN014080; Wed, 8 Mar 2017 14:05:25 -0500 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 8 Mar 2017 20:05:08 +0100 Message-Id: <20170308190511.31195-4-lersek@redhat.com> In-Reply-To: <20170308190511.31195-1-lersek@redhat.com> References: <20170308190511.31195-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 08 Mar 2017 19:05:26 +0000 (UTC) Subject: [edk2] [PATCH 3/6] ArmVirtPkg/ArmVirtPL031FdtClientLib: get rid of PcdPureAcpiBoot dependency X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Replace the FeaturePCD dependency with a call to the new FdtClientProtocol member GetOsExposure(). ArmVirtPL031FdtClientLib depends on the protocol with a DEPEX, hence the call will always succeed. Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf |= 3 --- ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c |= 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtCli= entLib.inf b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtCli= entLib.inf index 32dbff6f0852..342193651a86 100644 --- a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.= inf +++ b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.= inf @@ -42,8 +42,5 @@ [Protocols] [Pcd] gArmPlatformTokenSpaceGuid.PcdPL031RtcBase =20 -[FeaturePcd] - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot - [Depex] gFdtClientProtocolGuid diff --git a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtCli= entLib.c b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClien= tLib.c index 82de7a51b32e..0de34df04308 100644 --- a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c +++ b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c @@ -35,6 +35,7 @@ ArmVirtPL031FdtClientLibConstructor ( UINT32 RegSize; UINT64 RegBase; RETURN_STATUS PcdStatus; + BOOLEAN FdtExposedToOs; =20 Status =3D gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL, (VOID **)&FdtClient); @@ -66,7 +67,10 @@ ArmVirtPL031FdtClientLibConstructor ( =20 DEBUG ((EFI_D_INFO, "Found PL031 RTC @ 0x%Lx\n", RegBase)); =20 - if (!FeaturePcdGet (PcdPureAcpiBoot)) { + Status =3D FdtClient->GetOsExposure (&FdtExposedToOs); + ASSERT_EFI_ERROR (Status); + + if (FdtExposedToOs) { // // UEFI takes ownership of the RTC hardware, and exposes its functiona= lity // through the UEFI Runtime Services GetTime, SetTime, etc. This means= we --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 12:24:56 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488999935618355.680447321237; Wed, 8 Mar 2017 11:05:35 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5D0FE80374; Wed, 8 Mar 2017 11:05:33 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7FBB680370 for ; Wed, 8 Mar 2017 11:05:31 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 17B8137EEB; Wed, 8 Mar 2017 19:05:32 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-47.phx2.redhat.com [10.3.117.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28J5GPO014080; Wed, 8 Mar 2017 14:05:27 -0500 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 8 Mar 2017 20:05:09 +0100 Message-Id: <20170308190511.31195-5-lersek@redhat.com> In-Reply-To: <20170308190511.31195-1-lersek@redhat.com> References: <20170308190511.31195-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 08 Mar 2017 19:05:32 +0000 (UTC) Subject: [edk2] [PATCH 4/6] ArmVirtPkg/QemuFwCfgLib: add explicitly initialized instance X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The QemuFwCfgLibExplicitInit instance differs from the normally used one in that the client module has to call the QemuFwCfgInitialize() function explicitly -- there is no library constructor --, and the client shall also ensure that the dependency on FDT_CLIENT_PROTOCOL is satisfied -- there is no DepEx. In particular this enables the module that produces FDT_CLIENT_PROTOCOL to use the library, after the protocol is installed. Note that neither QemuFwCfgLib instance calls FDT_CLIENT_PROTOCOL.GetOsExposure(). In fact, the QemuFwCfgLibExplicitInit instance will be utilized to implement FDT_CLIENT_PROTOCOL.GetOsExposure(). Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/Library/QemuFwCfgLib/{QemuFwCfgLib.inf =3D> QemuFwCfgLibExplici= tInit.inf} | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/ArmVirtPkg/= Library/QemuFwCfgLib/QemuFwCfgLibExplicitInit.inf similarity index 72% copy from ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf copy to ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLibExplicitInit.inf index eff4a2165062..007e5f1b2d54 100644 --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf +++ b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLibExplicitInit.inf @@ -1,8 +1,8 @@ ## @file # -# Stateful, implicitly initialized fw_cfg library. +# Stateful, explicitly initialized fw_cfg library. # -# Copyright (C) 2013 - 2014, Red Hat, Inc. +# Copyright (C) 2013 - 2017, Red Hat, Inc. # Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
# # This program and the accompanying materials are licensed and made avail= able @@ -18,13 +18,11 @@ =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D QemuFwCfgLib - FILE_GUID =3D B271F41F-B841-48A9-BA8D-545B4BC2E2BF + BASE_NAME =3D QemuFwCfgLibExplicitInit + FILE_GUID =3D 7DF98175-3819-4966-A48C-E56056EA8F42 MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D QemuFwCfgLib|DXE_DRIVER - - CONSTRUCTOR =3D QemuFwCfgInitialize + LIBRARY_CLASS =3D QemuFwCfgLib|DXE_DRIVER UEFI_DRIVER =20 # # The following information is for reference only and not required by the = build @@ -50,6 +48,3 @@ [LibraryClasses] =20 [Protocols] gFdtClientProtocolGuid ## CONSUMES - -[Depex] - gFdtClientProtocolGuid --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 12:24:56 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488999939675315.24135992698234; Wed, 8 Mar 2017 11:05:39 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8FDB18037A; Wed, 8 Mar 2017 11:05:35 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EDC358037F for ; Wed, 8 Mar 2017 11:05:33 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 878DE4E359; Wed, 8 Mar 2017 19:05:34 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-47.phx2.redhat.com [10.3.117.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28J5GPP014080; Wed, 8 Mar 2017 14:05:32 -0500 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 8 Mar 2017 20:05:10 +0100 Message-Id: <20170308190511.31195-6-lersek@redhat.com> In-Reply-To: <20170308190511.31195-1-lersek@redhat.com> References: <20170308190511.31195-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 08 Mar 2017 19:05:34 +0000 (UTC) Subject: [edk2] [PATCH 5/6] ArmVirtPkg/FdtClientDxe: don't forward DT to OS if QEMU provides ACPI X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" ArmVirtQemu can be built with -D PURE_ACPI_BOOT_ENABLE at the moment. We should replace that build-time setting with a dynamic one: forward the DT from QEMU to the guest kernel if and only if - the guest architecture is arm32, or - we run on Xen, or - ACPI payload is not available from QEMU. This will let QEMU's "-no-acpi" option exclusively expose DT vs. ACPI to the guest. Showing both is never needed (it is actually detrimental to the adoption of standards, such as SBSA / SBBR). Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/ArmVirtQemu.dsc | 5 +- ArmVirtPkg/ArmVirtQemuKernel.dsc | 5 +- ArmVirtPkg/ArmVirtXen.dsc | 5 +- ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 5 +- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 67 ++++++++++++++++++-- 5 files changed, 75 insertions(+), 12 deletions(-) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 477dfdcfc764..863077f53edf 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -301,7 +301,10 @@ [Components.common] # Platform Driver # ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf - ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf + ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf { + + QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLibExplicitIni= t.inf + } ArmVirtPkg/HighMemDxe/HighMemDxe.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf OvmfPkg/VirtioScsiDxe/VirtioScsi.inf diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index fd39c2802a85..08a8eafd60d0 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -290,7 +290,10 @@ [Components.common] # Platform Driver # ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf - ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf + ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf { + + QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLibExplicitIni= t.inf + } ArmVirtPkg/HighMemDxe/HighMemDxe.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf OvmfPkg/VirtioScsiDxe/VirtioScsi.inf diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index 3422d1e5d996..4442329907ae 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -197,7 +197,10 @@ [Components.common] # Platform Driver # ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf - ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf + ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf { + + QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLibExplicitIni= t.inf + } =20 # # FAT filesystem + GPT/MBR partitioning diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClien= tDxe/FdtClientDxe.inf index 3a0cd37040eb..832f85bacd9b 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -29,12 +29,14 @@ [Packages] EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] BaseLib DebugLib FdtLib HobLib + QemuFwCfgLib UefiBootServicesTableLib UefiDriverEntryPoint =20 @@ -45,8 +47,5 @@ [Guids] gFdtHobGuid gFdtTableGuid =20 -[FeaturePcd] - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot - [Depex] TRUE diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 6082b22d35c1..8def7662a271 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -18,6 +18,7 @@ #include #include #include +#include #include =20 #include @@ -27,6 +28,15 @@ =20 STATIC VOID *mDeviceTreeBase; =20 +typedef enum { + OsExposureUnavailable, + OsExposureEnabled, + OsExposureDisabled, + OsExposureMax +} OS_EXPOSURE_STATE; + +STATIC OS_EXPOSURE_STATE mOsExposure; + STATIC EFI_STATUS EFIAPI @@ -300,7 +310,11 @@ GetOsExposure ( OUT BOOLEAN *FdtExposedToOs ) { - *FdtExposedToOs =3D !FeaturePcdGet (PcdPureAcpiBoot); + ASSERT (mOsExposure < OsExposureMax); + if (mOsExposure =3D=3D OsExposureUnavailable) { + return EFI_NOT_STARTED; + } + *FdtExposedToOs =3D (BOOLEAN)(mOsExposure =3D=3D OsExposureEnabled); return EFI_SUCCESS; } =20 @@ -317,6 +331,12 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol =3D { GetOsExposure }; =20 +RETURN_STATUS +EFIAPI +QemuFwCfgInitialize ( + VOID + ); + EFI_STATUS EFIAPI InitializeFdtClientDxe ( @@ -327,6 +347,7 @@ InitializeFdtClientDxe ( VOID *Hob; VOID *DeviceTreeBase; EFI_STATUS Status; + EFI_TPL OldTpl; =20 Hob =3D GetFirstGuidHob (&gFdtHobGuid); if (Hob =3D=3D NULL || GET_GUID_HOB_DATA_SIZE (Hob) !=3D sizeof (UINT64)= ) { @@ -344,15 +365,49 @@ InitializeFdtClientDxe ( =20 DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase)); =20 - if (!FeaturePcdGet (PcdPureAcpiBoot)) { + // + // Install the protocol for our QemuFwCfgLibExplicitInit instance, but + // prevent any protocol notifies at TPL_CALLBACK from firing. + // + OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); + Status =3D gBS->InstallProtocolInterface (&ImageHandle, + &gFdtClientProtocolGuid, EFI_NATIVE_INTERFACE, + &mFdtClientProtocol); + if (EFI_ERROR (Status)) { + goto RestoreTpl; + } + + // + // Install the FDT as a configuration table only if: + // - we're running on 32-bit ARM, or + // - we're running on Xen, or + // - QEMU doesn't provide us with ACPI payload (e.g. due to the -no-acpi + // option). + // + mOsExposure =3D OsExposureEnabled; + if (MAX_UINTN !=3D MAX_UINT32) { // - // Only install the FDT as a configuration table if we want to leave i= t up - // to the OS to decide whether it prefers ACPI over DT. + // Call the fw_cfg library constructor explicitly. It always succeeds; + // we'll check fw_cfg availability separately. // + QemuFwCfgInitialize (); + if (QemuFwCfgIsAvailable ()) { + FIRMWARE_CONFIG_ITEM FwCfgItem; + UINTN FwCfgSize; + + if (!RETURN_ERROR (QemuFwCfgFindFile ("etc/table-loader", &FwCfgItem, + &FwCfgSize))) { + mOsExposure =3D OsExposureDisabled; + } + } + } + + if (mOsExposure =3D=3D OsExposureEnabled) { Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeB= ase); ASSERT_EFI_ERROR (Status); } =20 - return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolG= uid, - EFI_NATIVE_INTERFACE, &mFdtClientProtocol); +RestoreTpl: + gBS->RestoreTPL (OldTpl); + return Status; } --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 12:24:56 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 148899994257483.77136217981024; Wed, 8 Mar 2017 11:05:42 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C94F680382; Wed, 8 Mar 2017 11:05:35 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2AF2B80370 for ; Wed, 8 Mar 2017 11:05:35 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B8BCE5455D; Wed, 8 Mar 2017 19:05:35 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-47.phx2.redhat.com [10.3.117.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28J5GPQ014080; Wed, 8 Mar 2017 14:05:34 -0500 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 8 Mar 2017 20:05:11 +0100 Message-Id: <20170308190511.31195-7-lersek@redhat.com> In-Reply-To: <20170308190511.31195-1-lersek@redhat.com> References: <20170308190511.31195-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 08 Mar 2017 19:05:35 +0000 (UTC) Subject: [edk2] [PATCH 6/6] ArmVirtPkg: remove PURE_ACPI_BOOT_ENABLE and PcdPureAcpiBoot X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The build flag and the FeaturePCD have no effect any longer, remove them. Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/ArmVirtPkg.dec | 10 ---------- ArmVirtPkg/ArmVirtQemu.dsc | 5 ----- 2 files changed, 15 deletions(-) diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index a5ec42166445..efe83a383d55 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -58,13 +58,3 @@ [PcdsFixedAtBuild, PcdsPatchableInModule] # EFI_VT_100_GUID. # gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF= , 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|V= OID*|0x00000007 - -[PcdsFeatureFlag] - # - # Pure ACPI boot - # - # Inhibit installation of the FDT as a configuration table if this featu= re - # PCD is TRUE. Otherwise, the OS is presented with both a DT and an ACPI - # description of the platform, and it is up to the OS to choose. - # - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|FALSE|BOOLEAN|0x0000000a diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 863077f53edf..d17aab971a86 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -34,7 +34,6 @@ [Defines] # -D FLAG=3DVALUE # DEFINE SECURE_BOOT_ENABLE =3D FALSE - DEFINE PURE_ACPI_BOOT_ENABLE =3D FALSE =20 !include ArmVirtPkg/ArmVirt.dsc.inc =20 @@ -94,10 +93,6 @@ [PcdsFeatureFlag.common] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE =20 -!if $(PURE_ACPI_BOOT_ENABLE) =3D=3D TRUE - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|TRUE -!endif - [PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PcdCoreCount|1 !if $(ARCH) =3D=3D AARCH64 --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel