From nobody Sun Apr 28 21:33:32 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 1490395112317761.2454038091254; Fri, 24 Mar 2017 15:38:32 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0F8F221DFA7B7; Fri, 24 Mar 2017 15:38:29 -0700 (PDT) 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 BD5F921DFA7B0 for ; Fri, 24 Mar 2017 15:38:27 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32DCE85543; Fri, 24 Mar 2017 22:38:28 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id 249697FCE1; Fri, 24 Mar 2017 22:38:26 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 32DCE85543 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 32DCE85543 From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:08 +0100 Message-Id: <20170324223819.11377-2-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 24 Mar 2017 22:38:28 +0000 (UTC) Subject: [edk2] [PATCH v3 01/12] Revert "ArmVirtPkg/FdtClientDxe: make DT table installation !ACPI dependent" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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" This reverts commit 78c41ff519b187d8979cda7074f007a6323f9acd. We realized that DXE drivers that are independent of AcpiPlatformDxe (that is, independent of QEMU's ACPI generation), such as RamDiskDxe and BootGraphicsResourceTableDxe, may produce and/or manipulate ACPI tables, at driver dispatch or even at Ready To Boot. This makes it unsafe for us to check for ACPI presence in the UEFI system config table in a Ready To Boot callback, in order to decide about exposing the DT. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - pick up Ard's R-b ArmVirtPkg/ArmVirtPkg.dec | 10 ++++++++++ ArmVirtPkg/ArmVirtQemu.dsc | 5 +++++ ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 5 +++-- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 16 +++++----------- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index efe83a383d55..a5ec42166445 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -58,3 +58,13 @@ [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 4f686faa559c..4b556f309a6c 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -34,6 +34,7 @@ [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,6 +95,10 @@ [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 diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClien= tDxe/FdtClientDxe.inf index 9861f41e968b..00017727c32c 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -37,16 +37,17 @@ [LibraryClasses] HobLib UefiBootServicesTableLib UefiDriverEntryPoint - UefiLib =20 [Protocols] gFdtClientProtocolGuid ## PRODUCES =20 [Guids] - gEfiAcpi20TableGuid gEfiEventReadyToBootGuid gFdtHobGuid gFdtTableGuid =20 +[FeaturePcd] + gArmVirtTokenSpaceGuid.PcdPureAcpiBoot + [Depex] TRUE diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 21c1074e331c..4cf79f70cb2a 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -17,11 +17,9 @@ #include #include #include -#include #include #include =20 -#include #include #include #include @@ -318,16 +316,12 @@ OnReadyToBoot ( ) { EFI_STATUS Status; - VOID *Table; =20 - // - // Only install the FDT as a configuration table if we are not exposing - // ACPI 2.0 (or later) tables. Note that the legacy ACPI table GUID has - // no meaning on ARM since we need at least ACPI 5.0 support, and the - // 64-bit ACPI 2.0 table GUID is mandatory in that case. - // - Status =3D EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &Table); - if (EFI_ERROR (Status) || Table =3D=3D NULL) { + if (!FeaturePcdGet (PcdPureAcpiBoot)) { + // + // 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. + // Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTree= Base); ASSERT_EFI_ERROR (Status); } --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun Apr 28 21:33:32 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 1490395114145976.439695733501; Fri, 24 Mar 2017 15:38:34 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3EEF321DFA7B6; Fri, 24 Mar 2017 15:38:31 -0700 (PDT) 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 68FC421DFA8FB for ; Fri, 24 Mar 2017 15:38:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D65F985543; Fri, 24 Mar 2017 22:38:30 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id C573080F78; Fri, 24 Mar 2017 22:38:29 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D65F985543 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D65F985543 From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:09 +0100 Message-Id: <20170324223819.11377-3-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 24 Mar 2017 22:38:31 +0000 (UTC) Subject: [edk2] [PATCH v3 02/12] Revert "ArmVirtPkg/FdtClientDxe: install DT configuration table at ReadyToBoot" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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" This reverts commit 18f6d4df9ece8b91b86511bcdd1cf7da478c3627. We realized that DXE drivers that are independent of AcpiPlatformDxe (that is, independent of QEMU's ACPI generation), such as RamDiskDxe and BootGraphicsResourceTableDxe, may produce and/or manipulate ACPI tables, at driver dispatch or even at Ready To Boot. This makes it unsafe for us to check for ACPI presence in the UEFI system config table in a Ready To Boot callback, in order to decide about exposing the DT. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - pick up Ard's R-b ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 1 - ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 49 ++++---------------- 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClien= tDxe/FdtClientDxe.inf index 00017727c32c..3a0cd37040eb 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -42,7 +42,6 @@ [Protocols] gFdtClientProtocolGuid ## PRODUCES =20 [Guids] - gEfiEventReadyToBootGuid gFdtHobGuid gFdtTableGuid =20 diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 4cf79f70cb2a..547a29fce62c 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -20,7 +20,6 @@ #include #include =20 -#include #include #include =20 @@ -307,30 +306,6 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol =3D { GetOrInsertChosenNode, }; =20 -STATIC -VOID -EFIAPI -OnReadyToBoot ( - EFI_EVENT Event, - VOID *Context - ) -{ - EFI_STATUS Status; - - if (!FeaturePcdGet (PcdPureAcpiBoot)) { - // - // 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. - // - Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTree= Base); - ASSERT_EFI_ERROR (Status); - } - - gBS->CloseEvent (Event); -} - -STATIC EFI_EVENT mReadyToBootEvent; - EFI_STATUS EFIAPI InitializeFdtClientDxe ( @@ -358,21 +333,15 @@ InitializeFdtClientDxe ( =20 DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase)); =20 - Status =3D gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProto= colGuid, - EFI_NATIVE_INTERFACE, &mFdtClientProtocol); - if (EFI_ERROR (Status)) { - return Status; + if (!FeaturePcdGet (PcdPureAcpiBoot)) { + // + // 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. + // + Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeB= ase); + ASSERT_EFI_ERROR (Status); } =20 - Status =3D gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, - OnReadyToBoot, - NULL, - &gEfiEventReadyToBootGuid, - &mReadyToBootEvent - ); - ASSERT_EFI_ERROR (Status); - - return EFI_SUCCESS; + return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolG= uid, + EFI_NATIVE_INTERFACE, &mFdtClientProtocol); } --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun Apr 28 21:33:32 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 14903951169221016.2299438548423; Fri, 24 Mar 2017 15:38:36 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7778B21DFA8FE; Fri, 24 Mar 2017 15:38:33 -0700 (PDT) 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 DC32B21DFA8FE for ; Fri, 24 Mar 2017 15:38:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5872C4E02D; Fri, 24 Mar 2017 22:38:32 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3AF437FCE1; Fri, 24 Mar 2017 22:38:31 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5872C4E02D Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5872C4E02D From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:10 +0100 Message-Id: <20170324223819.11377-4-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 Mar 2017 22:38:32 +0000 (UTC) Subject: [edk2] [PATCH v3 03/12] ArmVirtPkg/XenAcpiPlatformDxe: don't cast UINT64 to pointer directly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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" Because that breaks the (potential) 32-bit build of the driver. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - modify commit message (s/upcoming/potential/ build) to reflect that we won't actually include the ACPI stuff in the 32-bit builds [Ard] - pick up Ard's R-b ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c b/ArmVirtPk= g/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c index 203946f97bf8..49f9b5d2822a 100644 --- a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c +++ b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c @@ -73,7 +73,8 @@ GetXenArmAcpiRsdp ( ASSERT (RegSize =3D=3D 2 * sizeof (UINT64)); =20 RegBase =3D SwapBytes64(Reg[0]); - RsdpStructurePtr =3D (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)Reg= Base; + RsdpStructurePtr =3D + (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)(UINTN)RegBase; =20 if (RsdpStructurePtr && RsdpStructurePtr->Revision >=3D 2) { Sum =3D CalculateSum8 ((CONST UINT8 *)RsdpStructurePtr, --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun Apr 28 21:33:32 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 1490395118602585.2518682890968; Fri, 24 Mar 2017 15:38:38 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A8D1F21DFA902; Fri, 24 Mar 2017 15:38:35 -0700 (PDT) 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 CD6C421DFA901 for ; Fri, 24 Mar 2017 15:38:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B9534E02E; Fri, 24 Mar 2017 22:38:34 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDD447FCE1; Fri, 24 Mar 2017 22:38:32 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3B9534E02E Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3B9534E02E From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:11 +0100 Message-Id: <20170324223819.11377-5-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 Mar 2017 22:38:34 +0000 (UTC) Subject: [edk2] [PATCH v3 04/12] MdeModulePkg: introduce EDKII Platform Has ACPI GUID X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Feng Tian , Star Zeng , Leif Lindholm , 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 presence of this GUID in the PPI database, and/or in the DXE protocol database (as dictated by the platform's needs in these firmware phases) implies that the platform provides the operating system with an ACPI-based hardware description. This is not necessarily exclusive with other types of hardware description (for example, a Device Tree-based one). A platform PEIM and/or DXE driver is supposed to produce a single instance of the PPI and/or protocol (with NULL contents), if appropriate. The decision to produce the PPI and/or protocol is platform specific; for example, in the DXE phase, it could depend on an HII checkbox / underlying non-volatile UEFI variable. In the DXE phase, the protocol is meant to be depended-upon by "MdeModulePkg/Universal/Acpi/AcpiTableDxe", indirectly: * In the long term, interested platforms will establish this dependency by hooking an (upcoming) NULL-class DepexLib instance into AcpiTableDxe in their DSC files, pointing DepexLib's DEPEX through a FixedAtBuild PCD to the GUID introduced here. (For the prerequisite BaseTools feature, refer to ). * In the short term, an interested platform may hook a private NULL-class library instance (called e.g. "PlatformHasAcpiLib") into AcpiTableDxe. Such a library instance would be a specialization of the above described generic DepexLib, with the DEPEX open-coded on the GUID introduced here. Either way, the platform makes EFI_ACPI_TABLE_PROTOCOL and (if enabled) EFI_ACPI_SDT_PROTOCOL dependent on the platform's dynamic decision to produce or not to produce a NULL protocol instance with this GUID. In turn, other (platform and universal) DXE drivers that produce ACPI tables will wait for EFI_ACPI_TABLE_PROTOCOL / EFI_ACPI_SDT_PROTOCOL, via DEPEX, protocol notify, or a simple gBS->LocateProtocol() in a "late enough" callback (such as Ready To Boot). Because this GUID is not standard, it is prefixed with EDKII / Edkii, as seen elsewhere in MdeModulePkg and SecurityPkg. In addition, an effort is made to avoid the phrase "AcpiPlatform", as that belongs to drivers / libraries that produce platform specific ACPI content (as opposed to deciding whether the entire firmware will have access to EFI_ACPI_TABLE_PROTOCOL, or any similar facilities in the PEI phase). Cc: Ard Biesheuvel Cc: Feng Tian Cc: Leif Lindholm Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - rename gEdkiiPlatformHasAcpiProtocolGuid to gEdkiiPlatformHasAcpiGuid [Star] - update commit message and code comments to reflect possible use as a PPI as well [Star] - move GUID from ArmPkg to MdeModulePkg [Leif, Ard] - split PlatformHasAcpiLib to a separate patch [Star] MdeModulePkg/MdeModulePkg.dec | 3 ++ MdeModulePkg/Include/Guid/PlatformHasAcpi.h | 35 ++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 626e479f5e45..2d94881206d3 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -382,6 +382,9 @@ [Guids] gEdkiiNonDiscoverableUhciDeviceGuid =3D { 0xA8CDA0A2, 0x4F37, 0x4A1B, {0= x8E, 0x10, 0x8E, 0xF3, 0xCC, 0x3B, 0xF3, 0xA8 } } gEdkiiNonDiscoverableXhciDeviceGuid =3D { 0xB1BE0BC5, 0x6C28, 0x442D, {0= xAA, 0x37, 0x15, 0x1B, 0x42, 0x57, 0xBD, 0x78 } } =20 + ## Include/Guid/PlatformHasAcpi.h + gEdkiiPlatformHasAcpiGuid =3D { 0xf0966b41, 0xc23f, 0x41b9, { 0x96, 0x04= , 0x0f, 0xf7, 0xe1, 0x11, 0x96, 0x5a } } + [Ppis] ## Include/Ppi/AtaController.h gPeiAtaControllerPpiGuid =3D { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0,= 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }} diff --git a/MdeModulePkg/Include/Guid/PlatformHasAcpi.h b/MdeModulePkg/Inc= lude/Guid/PlatformHasAcpi.h new file mode 100644 index 000000000000..ad517821375d --- /dev/null +++ b/MdeModulePkg/Include/Guid/PlatformHasAcpi.h @@ -0,0 +1,35 @@ +/** @file + EDKII Platform Has ACPI GUID + + A NULL protocol instance with this GUID in the DXE protocol database, an= d/or + a NULL PPI with this GUID in the PPI database, implies that the platform + provides the operating system with an ACPI-based hardware description. N= ote + that this is not necessarily exclusive with different kinds of hardware + description (for example, a Device Tree-based one). A platform driver an= d/or + PEIM is supposed to produce a single instance of the protocol and/or PPI + (with NULL contents), if appropriate. + + Copyright (C) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License that accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + + +#ifndef __EDKII_PLATFORM_HAS_ACPI_H__ +#define __EDKII_PLATFORM_HAS_ACPI_H__ + +#define EDKII_PLATFORM_HAS_ACPI_GUID \ + { \ + 0xf0966b41, 0xc23f, 0x41b9, \ + { 0x96, 0x04, 0x0f, 0xf7, 0xe1, 0x11, 0x96, 0x5a } \ + } + +extern EFI_GUID gEdkiiPlatformHasAcpiGuid; + +#endif --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun Apr 28 21:33:32 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 1490395120811431.5676130580475; Fri, 24 Mar 2017 15:38:40 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E365721DFA905; Fri, 24 Mar 2017 15:38:36 -0700 (PDT) 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 3442621DFA901 for ; Fri, 24 Mar 2017 15:38:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A5CE141A27; Fri, 24 Mar 2017 22:38:35 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97AB17FCE1; Fri, 24 Mar 2017 22:38:34 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A5CE141A27 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A5CE141A27 From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:12 +0100 Message-Id: <20170324223819.11377-6-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 24 Mar 2017 22:38:35 +0000 (UTC) Subject: [edk2] [PATCH v3 05/12] ArmPkg: introduce PlatformHasAcpiLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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" Add the shorter-term library instance outlined in the previous (MdeModulePkg) patch to ArmPkg, so that we can imbue AcpiTableDxe with a protocol dependency on EDKII_PLATFORM_HAS_ACPI_GUID. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - move GUID to MdeModulePkg (see previous patch) [Leif, Ard] - replace ArmPkg.dec package dependency with MdeModulePkg.dec in INF file - rename gEdkiiPlatformHasAcpiProtocolGuid to gEdkiiPlatformHasAcpiGuid [Star] - update comment in empty constructor function accordingly ArmPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf | 40 ++++++++++++= ++++++++ ArmPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c | 36 ++++++++++++= ++++++ 2 files changed, 76 insertions(+) diff --git a/ArmPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf b/Arm= Pkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf new file mode 100644 index 000000000000..0613b0e999d2 --- /dev/null +++ b/ArmPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf @@ -0,0 +1,40 @@ +## @file +# A hook-in library for MdeModulePkg/Universal/Acpi/AcpiTableDxe. +# +# Plugging this library instance into AcpiTableDxe makes +# EFI_ACPI_TABLE_PROTOCOL and (if enabled) EFI_ACPI_SDT_PROTOCOL depend on= the +# platform's dynamic decision whether to expose an ACPI-based hardware +# description to the operating system. +# +# Universal and platform specific DXE drivers that produce ACPI tables dep= end +# on EFI_ACPI_TABLE_PROTOCOL / EFI_ACPI_SDT_PROTOCOL in turn. +# +# Copyright (C) 2017, Red Hat, Inc. +# +# This program and the accompanying materials are licensed and made availa= ble +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +## + +[Defines] + INF_VERSION =3D 1.25 + BASE_NAME =3D PlatformHasAcpiLib + FILE_GUID =3D 29beb028-0958-447b-be0a-12229235d77d + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PlatformHasAcpiLib|DXE_DRIVER + CONSTRUCTOR =3D PlatformHasAcpiInitialize + +[Sources] + PlatformHasAcpiLib.c + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + +[Depex] + gEdkiiPlatformHasAcpiGuid diff --git a/ArmPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c b/ArmPk= g/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c new file mode 100644 index 000000000000..2c73e71769eb --- /dev/null +++ b/ArmPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c @@ -0,0 +1,36 @@ +/** @file + A hook-in library for MdeModulePkg/Universal/Acpi/AcpiTableDxe. + + Plugging this library instance into AcpiTableDxe makes + EFI_ACPI_TABLE_PROTOCOL and (if enabled) EFI_ACPI_SDT_PROTOCOL depend on= the + platform's dynamic decision whether to expose an ACPI-based hardware + description to the operating system. + + Universal and platform specific DXE drivers that produce ACPI tables dep= end + on EFI_ACPI_TABLE_PROTOCOL / EFI_ACPI_SDT_PROTOCOL in turn. + + Copyright (C) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#include + +RETURN_STATUS +EFIAPI +PlatformHasAcpiInitialize ( + VOID + ) +{ + // + // Do nothing, just imbue AcpiTableDxe with a protocol dependency on + // EDKII_PLATFORM_HAS_ACPI_GUID. + // + return RETURN_SUCCESS; +} --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun Apr 28 21:33:32 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 1490395123153818.4623217975691; Fri, 24 Mar 2017 15:38:43 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2C6DA21DFA8F9; Fri, 24 Mar 2017 15:38:39 -0700 (PDT) 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 C05F521DFA7B1 for ; Fri, 24 Mar 2017 15:38:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 20B05C05490A; Fri, 24 Mar 2017 22:38:37 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DBDE7FCE1; Fri, 24 Mar 2017 22:38:35 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 20B05C05490A Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 20B05C05490A From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:13 +0100 Message-Id: <20170324223819.11377-7-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 24 Mar 2017 22:38:37 +0000 (UTC) Subject: [edk2] [PATCH v3 06/12] EmbeddedPkg: introduce EDKII Platform Has Device Tree GUID X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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 presence of this GUID in the PPI database, and/or in the DXE protocol database (as dictated by the platform's needs in these firmware phases) implies that the platform provides the operating system with a Device Tree-based hardware description. This is not necessarily exclusive with other types of hardware description (for example, an ACPI-based one). A platform PEIM and/or DXE driver is supposed to produce a single instance of the PPI and/or protocol (with NULL contents), if appropriate. The decision to produce the PPI and/or protocol is platform specific; for example, in the DXE phase, it could depend on an HII checkbox / underlying non-volatile UEFI variable. In the DXE phase, the protocol is meant to be consumed by the platform driver that - owns the Device Tree description of the hardware, and - is responsible for installing it as a system configuration table. Said FDT-owner driver can wait for the protocol via DEPEX or protocol notify. Because this GUID is not standard, it is prefixed with EDKII / Edkii, as seen elsewhere (for example in MdeModulePkg and SecurityPkg). Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - move GUID from ArmPkg to EmbeddedPkg [Leif] - apply the protocol -> generic GUID changes to naming, comments, and the commit message, that were suggested by Star for the MdeModulePkg / ACPI counterpart EmbeddedPkg/EmbeddedPkg.dec | 3 ++ EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h | 35 ++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 2c2cf41103c2..002b053a921a 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -56,6 +56,9 @@ [Guids.common] gFdtHobGuid =3D { 0x16958446, 0x19B7, 0x480B, { 0xB0, 0x47, 0x74, 0x85= , 0xAD, 0x3F, 0x71, 0x6D } } gFdtVariableGuid =3D { 0x25a4fd4a, 0x9703, 0x4ba9, { 0xa1, 0x90, 0xb7, 0= xc8, 0x4e, 0xfb, 0x3e, 0x57 } } =20 + ## Include/Guid/PlatformHasDeviceTree.h + gEdkiiPlatformHasDeviceTreeGuid =3D { 0x7ebb920d, 0x1aaf, 0x46d9, { 0xb2= , 0xaf, 0x54, 0x1e, 0x1d, 0xce, 0x14, 0x8b } } + [Protocols.common] gHardwareInterruptProtocolGuid =3D { 0x2890B3EA, 0x053D, 0x1643, { 0xAD= , 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } } gEfiDebugSupportPeriodicCallbackProtocolGuid =3D { 0x9546e07c, 0x2cbb, 0= x4c88, { 0x98, 0x6c, 0xcd, 0x34, 0x10, 0x86, 0xf0, 0x44 } } diff --git a/EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h b/EmbeddedPkg= /Include/Guid/PlatformHasDeviceTree.h new file mode 100644 index 000000000000..a9bc51270cda --- /dev/null +++ b/EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h @@ -0,0 +1,35 @@ +/** @file + EDKII Platform Has Device Tree GUID + + A NULL protocol instance with this GUID in the DXE protocol database, an= d/or + a NULL PPI with this GUID in the PPI database, implies that the platform + provides the operating system with a Device Tree-based hardware descript= ion. + Note that this is not necessarily exclusive with different kinds of hard= ware + description (for example, an ACPI-based one). A platform driver and/or P= EIM + is supposed to produce a single instance of the protocol and/or PPI (with + NULL contents), if appropriate. + + Copyright (C) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License that accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + + +#ifndef __EDKII_PLATFORM_HAS_DEVICE_TREE_H__ +#define __EDKII_PLATFORM_HAS_DEVICE_TREE_H__ + +#define EDKII_PLATFORM_HAS_DEVICE_TREE_GUID \ + { \ + 0x7ebb920d, 0x1aaf, 0x46d9, \ + { 0xb2, 0xaf, 0x54, 0x1e, 0x1d, 0xce, 0x14, 0x8b } \ + } + +extern EFI_GUID gEdkiiPlatformHasDeviceTreeGuid; + +#endif --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun Apr 28 21:33:32 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 1490395125178633.2644730611452; Fri, 24 Mar 2017 15:38:45 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6090521DFA907; Fri, 24 Mar 2017 15:38:41 -0700 (PDT) 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 220C021DFA901 for ; Fri, 24 Mar 2017 15:38:38 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 86F8D85543; Fri, 24 Mar 2017 22:38:38 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id 771147FCE1; Fri, 24 Mar 2017 22:38:37 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 86F8D85543 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 86F8D85543 From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:14 +0100 Message-Id: <20170324223819.11377-8-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 24 Mar 2017 22:38:38 +0000 (UTC) Subject: [edk2] [PATCH v3 07/12] ArmVirtPkg: add PlatformHasAcpiDtDxe X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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" This driver produces the EDKII Platform Has ACPI and Platform Has Device Tree protocols, exactly matching the current ACPI / DT exposure on QEMU, according to ARM vs. AARCH64, and (in the latter case) to PcdPureAcpiBoot. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - update package dependencies in INF file according to the GUID relocations in prior patches (replace ArmPkg.dec with EmbeddedPkg.dec and MdeModulePkg.dec) - rename gEdkiiPlatformHasAcpiProtocolGuid -> gEdkiiPlatformHasAcpiGuid - rename gEdkiiPlatformHasDeviceTreeProtocolGuid -> gEdkiiPlatformHasDeviceTreeGuid - adapt include paths and INF sections to protocol -> general GUID change - pick up Ard's R-b ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf | 48 ++++++++++++ ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c | 77 ++++++++++++= ++++++++ 2 files changed, 125 insertions(+) diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf b/Arm= VirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf new file mode 100644 index 000000000000..e77bb04e2e9d --- /dev/null +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf @@ -0,0 +1,48 @@ +## @file +# Decide whether the firmware should expose an ACPI- and/or a Device Tree-= based +# hardware description to the operating system. +# +# Copyright (c) 2017, Red Hat, Inc. +# +# This program and the accompanying materials are licensed and made availa= ble +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +## + +[Defines] + INF_VERSION =3D 1.25 + BASE_NAME =3D PlatformHasAcpiDtDxe + FILE_GUID =3D 9d1dd27f-6d7f-427b-aec4-b62f6279c2f1 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D PlatformHasAcpiDt + +[Sources] + PlatformHasAcpiDtDxe.c + +[Packages] + ArmVirtPkg/ArmVirtPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseLib + DebugLib + PcdLib + UefiBootServicesTableLib + UefiDriverEntryPoint + +[Guids] + gEdkiiPlatformHasAcpiGuid ## SOMETIMES_PRODUCES ## PROTOCOL + gEdkiiPlatformHasDeviceTreeGuid ## SOMETIMES_PRODUCES ## PROTOCOL + +[FeaturePcd] + gArmVirtTokenSpaceGuid.PcdPureAcpiBoot ## CONSUMES + +[Depex] + TRUE diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c b/ArmVi= rtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c new file mode 100644 index 000000000000..a718ce1b5a7b --- /dev/null +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c @@ -0,0 +1,77 @@ +/** @file + Decide whether the firmware should expose an ACPI- and/or a Device Tree-= based + hardware description to the operating system. + + Copyright (c) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#include +#include +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +PlatformHasAcpiDt ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + Status =3D EFI_SUCCESS; + + // + // If we fail to install any of the necessary protocols below, the OS wi= ll be + // unbootable anyway (due to lacking hardware description), so tolerate = no + // errors here. + // + // Always make ACPI available on 64-bit systems. + // + if (MAX_UINTN =3D=3D MAX_UINT64) { + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiPlatformHasAcpiGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + goto Failed; + } + } + + // + // Expose the Device Tree unless PcdPureAcpiBoot is set. + // + if (!FeaturePcdGet (PcdPureAcpiBoot)) { + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiPlatformHasDeviceTreeGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + goto Failed; + } + } + + return Status; + +Failed: + ASSERT_EFI_ERROR (Status); + CpuDeadLoop (); + // + // Keep compilers happy. + // + 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 Sun Apr 28 21:33:32 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 1490395127337741.0634677801213; Fri, 24 Mar 2017 15:38:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9038E21DFA90C; Fri, 24 Mar 2017 15:38:41 -0700 (PDT) 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 8BEBE21DFA907 for ; Fri, 24 Mar 2017 15:38:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F03F0C05AA41; Fri, 24 Mar 2017 22:38:39 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0BB37FCE1; Fri, 24 Mar 2017 22:38:38 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F03F0C05AA41 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com F03F0C05AA41 From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:15 +0100 Message-Id: <20170324223819.11377-9-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 24 Mar 2017 22:38:40 +0000 (UTC) Subject: [edk2] [PATCH v3 08/12] ArmVirtPkg: add XenPlatformHasAcpiDtDxe X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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" This driver produces the EDKII Platform Has ACPI and Platform Has Device Tree protocols, exactly matching the current ACPI / DT exposure on Xen, according to ARM vs. AARCH64. At this point it differs from the QEMU driver PlatformHasAcpiDtDxe in that this one always installs the DT. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - update package dependencies in INF file according to the GUID relocations in prior patches (replace ArmPkg.dec with EmbeddedPkg.dec and MdeModulePkg.dec) - drop superfluous ArmVirtPkg.dec package dependency - rename gEdkiiPlatformHasAcpiProtocolGuid -> gEdkiiPlatformHasAcpiGuid - rename gEdkiiPlatformHasDeviceTreeProtocolGuid -> gEdkiiPlatformHasDeviceTreeGuid - adapt include paths and INF sections to protocol -> general GUID change - pick up Ard's R-b ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf | 43 ++++++= ++++++ ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.c | 72 ++++++= ++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf= b/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf new file mode 100644 index 000000000000..26965c50c12b --- /dev/null +++ b/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf @@ -0,0 +1,43 @@ +## @file +# Decide whether the firmware should expose an ACPI- and/or a Device Tree-= based +# hardware description to the operating system. +# +# Copyright (c) 2017, Red Hat, Inc. +# +# This program and the accompanying materials are licensed and made availa= ble +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +## + +[Defines] + INF_VERSION =3D 1.25 + BASE_NAME =3D XenPlatformHasAcpiDtDxe + FILE_GUID =3D 6914c46f-d46e-48dc-9998-8a5f64f02553 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D XenPlatformHasAcpiDt + +[Sources] + XenPlatformHasAcpiDtDxe.c + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseLib + DebugLib + UefiBootServicesTableLib + UefiDriverEntryPoint + +[Guids] + gEdkiiPlatformHasAcpiGuid ## SOMETIMES_PRODUCES ## PROTOCOL + gEdkiiPlatformHasDeviceTreeGuid ## PRODUCES ## PROTOCOL + +[Depex] + TRUE diff --git a/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.c b= /ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.c new file mode 100644 index 000000000000..596f4ea8ddca --- /dev/null +++ b/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.c @@ -0,0 +1,72 @@ +/** @file + Decide whether the firmware should expose an ACPI- and/or a Device Tree-= based + hardware description to the operating system. + + Copyright (c) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#include +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +XenPlatformHasAcpiDt ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + // + // If we fail to install any of the necessary protocols below, the OS wi= ll be + // unbootable anyway (due to lacking hardware description), so tolerate = no + // errors here. + // + // Always make ACPI available on 64-bit systems. + // + if (MAX_UINTN =3D=3D MAX_UINT64) { + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiPlatformHasAcpiGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + goto Failed; + } + } + + // + // Expose the Device Tree unconditionally. + // + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiPlatformHasDeviceTreeGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + goto Failed; + } + + return Status; + +Failed: + ASSERT_EFI_ERROR (Status); + CpuDeadLoop (); + // + // Keep compilers happy. + // + 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 Sun Apr 28 21:33:32 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 1490395129661785.0381662087973; Fri, 24 Mar 2017 15:38:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C06A121DFA908; Fri, 24 Mar 2017 15:38:43 -0700 (PDT) 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 EC40321DFA907 for ; Fri, 24 Mar 2017 15:38:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 658CD19D39C; Fri, 24 Mar 2017 22:38:41 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56B5F7FCE1; Fri, 24 Mar 2017 22:38:40 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 658CD19D39C Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 658CD19D39C From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:16 +0100 Message-Id: <20170324223819.11377-10-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 24 Mar 2017 22:38:41 +0000 (UTC) Subject: [edk2] [PATCH v3 09/12] ArmVirtPkg: enable AcpiTableDxe and EFI_ACPI_TABLE_PROTOCOL dynamically X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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" In this patch, the ACPI protocol / driver chain is enabled dynamically, when appropriate. This is being done in one larger patch, because ArmVirt.dsc.inc, where AcpiTableDxe is built, is used by all the platform DSCs. No change in behavior should be observable after this patch on any ArmVirtPkg platform. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - don't enable dynamism for 32-bit (ARM) [Ard] ArmVirtPkg/ArmVirt.dsc.inc | 9 ++++++++- ArmVirtPkg/ArmVirtQemu.dsc | 1 + ArmVirtPkg/ArmVirtQemuKernel.dsc | 1 + ArmVirtPkg/ArmVirtXen.dsc | 1 + ArmVirtPkg/ArmVirtXen.fdf | 1 + ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 1 + 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index f61fd0680612..90ab97c240a1 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -443,5 +443,12 @@ [Components.AARCH64] # # ACPI Support # - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf + MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf { + + NULL|ArmPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf + } + + # + # EBC support + # MdeModulePkg/Universal/EbcDxe/EbcDxe.inf diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 4b556f309a6c..c2427a6fcea2 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -382,6 +382,7 @@ [Components.AARCH64] # # ACPI Support # + ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf { diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index 6b6555c889a3..c7317a056c0e 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -371,6 +371,7 @@ [Components.AARCH64] # # ACPI Support # + ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf { diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index 3422d1e5d996..679ca67ffa0f 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -222,5 +222,6 @@ [Components.common] # ACPI support # !if $(ARCH) =3D=3D AARCH64 + ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf !endif diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf index c997251b12b8..aaae9755cd53 100644 --- a/ArmVirtPkg/ArmVirtXen.fdf +++ b/ArmVirtPkg/ArmVirtXen.fdf @@ -184,6 +184,7 @@ [FV.FvMain] # ACPI support # !if $(ARCH) =3D=3D AARCH64 + INF ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf INF ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf =20 diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuF= vMain.fdf.inc index cc5d12aaefea..b4381132c864 100644 --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc @@ -144,6 +144,7 @@ [FV.FvMain] # # ACPI Support # + INF ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphic= sResourceTableDxe.inf INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun Apr 28 21:33:32 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 1490395131766748.2838660856976; Fri, 24 Mar 2017 15:38:51 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id F14D321DFA912; Fri, 24 Mar 2017 15:38:43 -0700 (PDT) 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 5DB8121DFA900 for ; Fri, 24 Mar 2017 15:38:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CED994E02D; Fri, 24 Mar 2017 22:38:42 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id C05EF7FCE1; Fri, 24 Mar 2017 22:38:41 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CED994E02D Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CED994E02D From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:17 +0100 Message-Id: <20170324223819.11377-11-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 Mar 2017 22:38:43 +0000 (UTC) Subject: [edk2] [PATCH v3 10/12] ArmVirtPkg/FdtClientDxe: install DT as sysconfig table in protocol notify X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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 dependency on PcdPureAcpiBoot with a Platform Has Device Tree notification callback. Move the sysconfig table installation from the entry point function to the callback. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - replace gEdkiiPlatformHasDeviceTreeProtocolGuid with gEdkiiPlatformHasDeviceTreeGuid - adapt Protocols / Guids sections in INF file - drop now superfluous ArmPkg.dec dependency in INF file - adapt include paths - pick up Ard's R-b ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 4 +- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 105 ++++++++++++++++++-- 2 files changed, 97 insertions(+), 12 deletions(-) diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClien= tDxe/FdtClientDxe.inf index 3a0cd37040eb..8a5182a3ce99 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -42,11 +42,9 @@ [Protocols] gFdtClientProtocolGuid ## PRODUCES =20 [Guids] + gEdkiiPlatformHasDeviceTreeGuid ## CONSUMES ## PROTOCOL gFdtHobGuid gFdtTableGuid =20 -[FeaturePcd] - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot - [Depex] TRUE diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 547a29fce62c..2d867b16fda8 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -22,6 +22,7 @@ =20 #include #include +#include =20 #include =20 @@ -306,6 +307,40 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol =3D { GetOrInsertChosenNode, }; =20 +STATIC +VOID +EFIAPI +OnPlatformHasDeviceTree ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + VOID *Interface; + VOID *DeviceTreeBase; + + Status =3D gBS->LocateProtocol ( + &gEdkiiPlatformHasDeviceTreeGuid, + NULL, // Registration + &Interface + ); + if (EFI_ERROR (Status)) { + return; + } + + DeviceTreeBase =3D Context; + DEBUG (( + DEBUG_INFO, + "%a: exposing DTB @ 0x%p to OS\n", + __FUNCTION__, + DeviceTreeBase + )); + Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBas= e); + ASSERT_EFI_ERROR (Status); + + gBS->CloseEvent (Event); +} + EFI_STATUS EFIAPI InitializeFdtClientDxe ( @@ -316,6 +351,8 @@ InitializeFdtClientDxe ( VOID *Hob; VOID *DeviceTreeBase; EFI_STATUS Status; + EFI_EVENT PlatformHasDeviceTreeEvent; + VOID *Registration; =20 Hob =3D GetFirstGuidHob (&gFdtHobGuid); if (Hob =3D=3D NULL || GET_GUID_HOB_DATA_SIZE (Hob) !=3D sizeof (UINT64)= ) { @@ -333,15 +370,65 @@ InitializeFdtClientDxe ( =20 DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase)); =20 - if (!FeaturePcdGet (PcdPureAcpiBoot)) { - // - // 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. - // - Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeB= ase); - ASSERT_EFI_ERROR (Status); + // + // Register a protocol notify for the EDKII Platform Has Device Tree + // Protocol. + // + Status =3D gBS->CreateEvent ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + OnPlatformHasDeviceTree, + DeviceTreeBase, // Context + &PlatformHasDeviceTreeEvent + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: CreateEvent(): %r\n", __FUNCTION__, Status)); + return Status; } =20 - return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolG= uid, - EFI_NATIVE_INTERFACE, &mFdtClientProtocol); + Status =3D gBS->RegisterProtocolNotify ( + &gEdkiiPlatformHasDeviceTreeGuid, + PlatformHasDeviceTreeEvent, + &Registration + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "%a: RegisterProtocolNotify(): %r\n", + __FUNCTION__, + Status + )); + goto CloseEvent; + } + + // + // Kick the event; the protocol could be available already. + // + Status =3D gBS->SignalEvent (PlatformHasDeviceTreeEvent); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: SignalEvent(): %r\n", __FUNCTION__, Status)); + goto CloseEvent; + } + + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gFdtClientProtocolGuid, + EFI_NATIVE_INTERFACE, + &mFdtClientProtocol + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "%a: InstallProtocolInterface(): %r\n", + __FUNCTION__, + Status + )); + goto CloseEvent; + } + + return Status; + +CloseEvent: + gBS->CloseEvent (PlatformHasDeviceTreeEvent); + 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 Sun Apr 28 21:33:32 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 1490395133734567.4236495243981; Fri, 24 Mar 2017 15:38:53 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2CB7B21DFA911; Fri, 24 Mar 2017 15:38:46 -0700 (PDT) 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 CE93421DFA90F for ; Fri, 24 Mar 2017 15:38:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 48320C05AA41; Fri, 24 Mar 2017 22:38:44 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id 365B37FCE1; Fri, 24 Mar 2017 22:38:43 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 48320C05AA41 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 48320C05AA41 From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:18 +0100 Message-Id: <20170324223819.11377-12-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 24 Mar 2017 22:38:44 +0000 (UTC) Subject: [edk2] [PATCH v3 11/12] ArmVirtPkg/PlatformHasAcpiDtDxe: don't expose DT if QEMU provides ACPI X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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" 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). * Without "-no-acpi", the firmware logs (from PlatformHasAcpiDtDxe) > Found FwCfg @ 0x9020008/0x9020000 > Found FwCfg DMA @ 0x9020010 > InstallProtocolInterface: [EdkiiPlatformHasAcpi] 0 plus the usual messages. Later the guest kernel logs > [ 0.000000] efi: SMBIOS 3.0=3D0x13bdb0000 ACPI 2.0=3D0x138440000 > MEMATTR=3D0x13a675018 before it lists the ACPI tables one by one. In addition, in the guest, the "/sys/firmware/devicetree/*" shell pattern matches no files, while the "/sys/firmware/acpi/tables/*" pattern matches the ACPI tables. * With "-no-acpi", the firmware logs: > PlatformHasAcpiDtDxe | Found FwCfg @ 0x9020008/0x9020000 > PlatformHasAcpiDtDxe | Found FwCfg DMA @ 0x9020010 > PlatformHasAcpiDtDxe | InstallProtocolInterface: > PlatformHasAcpiDtDxe | [EdkiiPlatformHasDeviceTree] 0 > FdtClientDxe | OnPlatformHasDeviceTree: exposing DTB @ > FdtClientDxe | 0x13FFBF000 to OS > ... > DXE_CORE | Driver [AcpiTableDxe] was discovered but not > DXE_CORE | loaded!! > DXE_CORE | Driver [QemuFwCfgAcpiPlatform] was discovered but > DXE_CORE | not loaded!! > ... > RamDiskDxe | RamDiskAcpiCheck: Cannot locate the EFI ACPI > RamDiskDxe | Table Protocol, unable to publish RAM disks to > RamDiskDxe | NFIT. (BootGraphicsResourceTableDxe's ReadyToBoot callback -- InstallBootGraphicsResourceTable() -- handles the lack of EFI_ACPI_TABLE_PROTOCOL silently.) Later the guest kernel logs > [ 0.000000] efi: SMBIOS 3.0=3D0x13bdb0000 MEMATTR=3D0x138caa018 In addition, in the guest, the "/sys/firmware/devicetree/*" shell pattern matches the directory "/sys/firmware/devicetree/base", which contains a large number of DT nodes, while the "/sys/firmware/acpi/tables/*" pattern matches no files. Cc: Ard Biesheuvel Cc: Leif Lindholm Ref: https://bugzilla.redhat.com/show_bug.cgi?id=3D1430262 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - pick up MEMATTR log from repeated testing with Fedora guest (ACPI case) [Ard] - extend the commit message with "/sys/firmware/devicetree/*" and "/sys/firmware/acpi/tables/*" pattern matching in the guest - drop ArmVirtPkg.dec package dependency -- with the removal of the "pure ACPI boot" PCD dependency, ArmVirtPkg.dec actually becomes superfluous - adapt patch to protocol -> generic GUID renaming - pick up Ard's R-b ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf | 7 +-- ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c | 45 ++++++++++++= -------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf b/Arm= VirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf index e77bb04e2e9d..3fcbb6b080d8 100644 --- a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf @@ -25,15 +25,15 @@ [Sources] PlatformHasAcpiDtDxe.c =20 [Packages] - ArmVirtPkg/ArmVirtPkg.dec EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] BaseLib DebugLib - PcdLib + QemuFwCfgLib UefiBootServicesTableLib UefiDriverEntryPoint =20 @@ -41,8 +41,5 @@ [Guids] gEdkiiPlatformHasAcpiGuid ## SOMETIMES_PRODUCES ## PROTOCOL gEdkiiPlatformHasDeviceTreeGuid ## SOMETIMES_PRODUCES ## PROTOCOL =20 -[FeaturePcd] - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot ## CONSUMES - [Depex] TRUE diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c b/ArmVi= rtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c index a718ce1b5a7b..8932dacabec5 100644 --- a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include =20 EFI_STATUS @@ -27,18 +27,27 @@ PlatformHasAcpiDt ( IN EFI_SYSTEM_TABLE *SystemTable ) { - EFI_STATUS Status; - - Status =3D EFI_SUCCESS; + EFI_STATUS Status; + FIRMWARE_CONFIG_ITEM FwCfgItem; + UINTN FwCfgSize; =20 // // If we fail to install any of the necessary protocols below, the OS wi= ll be // unbootable anyway (due to lacking hardware description), so tolerate = no // errors here. // - // Always make ACPI available on 64-bit systems. - // - if (MAX_UINTN =3D=3D MAX_UINT64) { + if (MAX_UINTN =3D=3D MAX_UINT64 && + !EFI_ERROR ( + QemuFwCfgFindFile ( + "etc/table-loader", + &FwCfgItem, + &FwCfgSize + ) + )) { + // + // Only make ACPI available on 64-bit systems, and only if QEMU genera= tes + // (a subset of) the ACPI tables. + // Status =3D gBS->InstallProtocolInterface ( &ImageHandle, &gEdkiiPlatformHasAcpiGuid, @@ -48,21 +57,21 @@ PlatformHasAcpiDt ( if (EFI_ERROR (Status)) { goto Failed; } + + return Status; } =20 // - // Expose the Device Tree unless PcdPureAcpiBoot is set. + // Expose the Device Tree otherwise. // - if (!FeaturePcdGet (PcdPureAcpiBoot)) { - Status =3D gBS->InstallProtocolInterface ( - &ImageHandle, - &gEdkiiPlatformHasDeviceTreeGuid, - EFI_NATIVE_INTERFACE, - NULL - ); - if (EFI_ERROR (Status)) { - goto Failed; - } + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiPlatformHasDeviceTreeGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + goto Failed; } =20 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 Sun Apr 28 21:33:32 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 1490395135810384.5823142780039; Fri, 24 Mar 2017 15:38:55 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5A94321DFA916; Fri, 24 Mar 2017 15:38:46 -0700 (PDT) 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 3E5E621DFA913 for ; Fri, 24 Mar 2017 15:38:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AFC3E83F46; Fri, 24 Mar 2017 22:38:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0BF57FCE1; Fri, 24 Mar 2017 22:38:44 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AFC3E83F46 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AFC3E83F46 From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 24 Mar 2017 23:38:19 +0100 Message-Id: <20170324223819.11377-13-lersek@redhat.com> In-Reply-To: <20170324223819.11377-1-lersek@redhat.com> References: <20170324223819.11377-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 24 Mar 2017 22:38:45 +0000 (UTC) Subject: [edk2] [PATCH v3 12/12] ArmVirtPkg: remove PURE_ACPI_BOOT_ENABLE and PcdPureAcpiBoot X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , 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 Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - pick up Ard's R-b 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 c2427a6fcea2..4075b92aa2cb 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 @@ -95,10 +94,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