From nobody Tue May 7 02:52:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523494549490269.53452888645813; Wed, 11 Apr 2018 17:55:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 85DFB226CD79C; Wed, 11 Apr 2018 17:55:47 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 119CE226CD785 for ; Wed, 11 Apr 2018 17:55:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3EBB7406F972; Thu, 12 Apr 2018 00:55:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-97.rdu2.redhat.com [10.10.120.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4160A1208F7B; Thu, 12 Apr 2018 00:55:44 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Thu, 12 Apr 2018 02:55:31 +0200 Message-Id: <20180412005540.26651-2-lersek@redhat.com> In-Reply-To: <20180412005540.26651-1-lersek@redhat.com> References: <20180412005540.26651-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 12 Apr 2018 00:55:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 12 Apr 2018 00:55:45 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 01/10] Omap35xxPkg/InterruptDxe: replace CPU Arch Protocol depex with notify X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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 a later patch, we'll modify the depex of "ArmPkg/Drivers/CpuDxe/CpuDxe.inf" (currently "AFTER gArmGicDxeFileGuid") to "gHardwareInterruptProtocolGuid OR gHardwareInterrupt2ProtocolGuid". Considering platforms that include "ArmPkg/Drivers/CpuDxe/CpuDxe.inf", there are two classes: (1) The platform gets its gHardwareInterruptProtocolGuid or gHardwareInterrupt2ProtocolGuid instance from "ArmPkg/Drivers/ArmGic/ArmGicDxe.inf". For such platforms, the upcoming CpuDxe change is not a problem, because commit 61a7b0ec634f made ArmGicDxe wait for the CPU Arch Protocol with a protocol notify. (2) The platform gets its hardware interrupt protocol(s) from a different driver that has a hard depex on the CPU Arch Protocol. The upcoming CpuDxe change would lead to a loop in the DXE dispatch order. In the edk2 tree, only "BeagleBoardPkg/BeagleBoardPkg.dsc" falls in class (2), and the driver in question is "Omap35xxPkg/InterruptDxe". Port (most of) commit 61a7b0ec634f to it. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Steve Capper Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Tested-by: Steve Capper --- Notes: build-tested only, as part of BeagleBoardPkg Omap35xxPkg/InterruptDxe/InterruptDxe.inf | 6 +- Omap35xxPkg/InterruptDxe/HardwareInterrupt.c | 81 +++++++++++++++----- 2 files changed, 66 insertions(+), 21 deletions(-) diff --git a/Omap35xxPkg/InterruptDxe/InterruptDxe.inf b/Omap35xxPkg/Interr= uptDxe/InterruptDxe.inf index 6deb8c3f675c..61ad89af2758 100644 --- a/Omap35xxPkg/InterruptDxe/InterruptDxe.inf +++ b/Omap35xxPkg/InterruptDxe/InterruptDxe.inf @@ -41,14 +41,14 @@ [LibraryClasses] PrintLib UefiDriverEntryPoint IoLib ArmLib =20 [Protocols] - gHardwareInterruptProtocolGuid - gEfiCpuArchProtocolGuid + gHardwareInterruptProtocolGuid ## PRODUCES + gEfiCpuArchProtocolGuid ## CONSUMES ## NOTIFY =20 [FixedPcd.common] gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress =20 [Depex] - gEfiCpuArchProtocolGuid + TRUE diff --git a/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c b/Omap35xxPkg/Int= erruptDxe/HardwareInterrupt.c index 09e22b5921b0..2ddc7c0566d0 100644 --- a/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c +++ b/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c @@ -293,12 +293,60 @@ EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptPro= tocol =3D { EnableInterruptSource, DisableInterruptSource, GetInterruptSourceState, EndOfInterrupt }; =20 +STATIC VOID *mCpuArchProtocolNotifyEventRegistration; + +STATIC +VOID +EFIAPI +CpuArchEventProtocolNotify ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_CPU_ARCH_PROTOCOL *Cpu; + EFI_STATUS Status; + + // + // Get the CPU protocol that this driver requires. + // + Status =3D gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **= )&Cpu); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: gBS->LocateProtocol() - %r\n", __FUNCTION__, + Status)); + ASSERT (FALSE); + return; + } + + // + // Unregister the default exception handler. + // + Status =3D Cpu->RegisterInterruptHandler (Cpu, EXCEPT_ARM_IRQ, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Cpu->RegisterInterruptHandler() - %r\n", + __FUNCTION__, Status)); + ASSERT (FALSE); + return; + } + + // + // Register to receive interrupts + // + Status =3D Cpu->RegisterInterruptHandler (Cpu, EXCEPT_ARM_IRQ, + IrqInterruptHandler); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Cpu->RegisterInterruptHandler() - %r\n", + __FUNCTION__, Status)); + ASSERT (FALSE); + return; + } +} + /** Initialize the state information for the CPU Architectural Protocol =20 @param ImageHandle of the loaded driver @param SystemTable Pointer to the System Table =20 @@ -311,13 +359,13 @@ EFI_STATUS InterruptDxeInitialize ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; - EFI_CPU_ARCH_PROTOCOL *Cpu; + EFI_EVENT CpuArchEvent; =20 // Make sure the Interrupt Controller Protocol is not already installed = in the system. ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid= ); =20 // Make sure all interrupts are disabled by default. MmioWrite32 (INTCPS_MIR(0), 0xFFFFFFFF); @@ -328,30 +376,27 @@ InterruptDxeInitialize ( Status =3D gBS->InstallMultipleProtocolInterfaces(&gHardwareInterruptHan= dle, &gHardwareInterruptProto= colGuid, &gHardwareInterruptProtocol, NULL); ASSERT_EFI_ERROR(Status); =20 // - // Get the CPU protocol that this driver requires. - // - Status =3D gBS->LocateProtocol(&gEfiCpuArchProtocolGuid, NULL, (VOID **)= &Cpu); - ASSERT_EFI_ERROR(Status); - - // - // Unregister the default exception handler. - // - Status =3D Cpu->RegisterInterruptHandler(Cpu, EXCEPT_ARM_IRQ, NULL); - ASSERT_EFI_ERROR(Status); - - // - // Register to receive interrupts - // - Status =3D Cpu->RegisterInterruptHandler(Cpu, EXCEPT_ARM_IRQ, IrqInterru= ptHandler); - ASSERT_EFI_ERROR(Status); + // Install the interrupt handler as soon as the CPU arch protocol appear= s. + // + CpuArchEvent =3D EfiCreateProtocolNotifyEvent ( + &gEfiCpuArchProtocolGuid, + TPL_CALLBACK, + CpuArchEventProtocolNotify, + NULL, + &mCpuArchProtocolNotifyEventRegistration + ); + ASSERT (CpuArchEvent !=3D NULL); =20 // Register for an ExitBootServicesEvent Status =3D gBS->CreateEvent(EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, E= xitBootServicesEvent, NULL, &EfiExitBootServicesEvent); - ASSERT_EFI_ERROR(Status); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + gBS->CloseEvent (CpuArchEvent); + } =20 return Status; } =20 --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 02:52:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523494551803232.66175573906753; Wed, 11 Apr 2018 17:55:51 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B5487226CD7A2; Wed, 11 Apr 2018 17:55:47 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 367A7226CD796 for ; Wed, 11 Apr 2018 17:55:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7BE7E8DC2A; Thu, 12 Apr 2018 00:55:46 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-97.rdu2.redhat.com [10.10.120.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E0121208F7B; Thu, 12 Apr 2018 00:55:45 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Thu, 12 Apr 2018 02:55:32 +0200 Message-Id: <20180412005540.26651-3-lersek@redhat.com> In-Reply-To: <20180412005540.26651-1-lersek@redhat.com> References: <20180412005540.26651-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 12 Apr 2018 00:55:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 12 Apr 2018 00:55:46 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 02/10] ArmPkg/ArmGicDxe: annotate protocol usage in "ArmGicDxe.inf" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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" "ArmGicDxe.inf" currently does not document how the protocols in the [Protocols] section are used. Such comments help us analyze behavior, so let's add them now. - gHardwareInterruptProtocolGuid and gHardwareInterrupt2ProtocolGuid are always produced on the InterruptDxeInitialize() -> (GicV2DxeInitialize() | GicV3DxeInitialize()) -> InstallAndRegisterInterruptService() call path. - gEfiCpuArchProtocolGuid is consumed in the CpuArchEventProtocolNotify() protocol notify callback. (Technically this is "conditional"; however the firmware cannot work without architectural protocols, so we can call it unconditional.) While at it, drop the gArmGicDxeFileGuid comment from FILE_GUID; we're going to make that GUID uninteresting soon. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Steve Capper Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Tested-by: Steve Capper --- ArmPkg/Drivers/ArmGic/ArmGicDxe.inf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf b/ArmPkg/Drivers/ArmGic/Ar= mGicDxe.inf index 24b02ef30e83..9c85b1e069dc 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf +++ b/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf @@ -13,13 +13,13 @@ # #**/ =20 [Defines] INF_VERSION =3D 0x00010005 BASE_NAME =3D ArmGicDxe - FILE_GUID =3D DE371F7C-DEC4-4D21-ADF1-593ABCC15882 = # gArmGicDxeFileGuid + FILE_GUID =3D DE371F7C-DEC4-4D21-ADF1-593ABCC15882 MODULE_TYPE =3D DXE_DRIVER VERSION_STRING =3D 1.0 =20 ENTRY_POINT =3D InterruptDxeInitialize =20 [Sources.common] @@ -45,15 +45,15 @@ [LibraryClasses] UefiDriverEntryPoint IoLib PcdLib UefiLib =20 [Protocols] - gHardwareInterruptProtocolGuid - gHardwareInterrupt2ProtocolGuid - gEfiCpuArchProtocolGuid + gHardwareInterruptProtocolGuid ## PRODUCES + gHardwareInterrupt2ProtocolGuid ## PRODUCES + gEfiCpuArchProtocolGuid ## CONSUMES ## NOTIFY =20 [Pcd.common] gArmTokenSpaceGuid.PcdGicDistributorBase gArmTokenSpaceGuid.PcdGicRedistributorsBase gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 02:52:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523494554266966.4425005648706; Wed, 11 Apr 2018 17:55:54 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DD37B226CD7AB; Wed, 11 Apr 2018 17:55:49 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 78C28226CD7A5 for ; Wed, 11 Apr 2018 17:55:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B7D138DC2D; Thu, 12 Apr 2018 00:55:47 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-97.rdu2.redhat.com [10.10.120.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA7791208F7B; Thu, 12 Apr 2018 00:55:46 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Thu, 12 Apr 2018 02:55:33 +0200 Message-Id: <20180412005540.26651-4-lersek@redhat.com> In-Reply-To: <20180412005540.26651-1-lersek@redhat.com> References: <20180412005540.26651-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 12 Apr 2018 00:55:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 12 Apr 2018 00:55:47 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 03/10] ArmPkg/CpuDxe: order CpuDxe after ArmGicDxe via protocol depex X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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" Commit 61a7b0ec634f ("ArmPkg/Gic: force GIC driver to run before CPU arch protocol driver", 2018-02-06) explains why CpuDxe should be dispatched after ArmGicDxe. To implement the ordering, we should use a regular protocol depex rather than the less flexible AFTER opcode. ArmGicDxe installs gHardwareInterruptProtocolGuid and gHardwareInterrupt2ProtocolGuid as one of the last actions on its entry point stack; either of those is OK for CpuDxe to wait for. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Steve Capper Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Tested-by: Steve Capper --- ArmPkg/ArmPkg.dec | 2 -- ArmPkg/Drivers/CpuDxe/CpuDxe.inf | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index a55b6268ff85..5dbd019e2966 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -45,14 +45,12 @@ [Guids.common] gArmTokenSpaceGuid =3D { 0xBB11ECFE, 0x820F, 0x4968, { 0xBB, 0xA6,= 0xF7, 0x6A, 0xFE, 0x30, 0x25, 0x96 } } =20 ## ARM MPCore table # Include/Guid/ArmMpCoreInfo.h gArmMpCoreInfoGuid =3D { 0xa4ee0728, 0xe5d7, 0x4ac5, {0xb2, 0x1e, 0x65,= 0x8e, 0xd8, 0x57, 0xe8, 0x34} } =20 - gArmGicDxeFileGuid =3D { 0xde371f7c, 0xdec4, 0x4d21, { 0xad, 0xf1, 0x59,= 0x3a, 0xbc, 0xc1, 0x58, 0x82 } } - [Ppis] ## Include/Ppi/ArmMpCoreInfo.h gArmMpCoreInfoPpiGuid =3D { 0x6847cc74, 0xe9ec, 0x4f8f, {0xa2, 0x9d, 0xa= b, 0x44, 0xe7, 0x54, 0xa8, 0xfc} } =20 [PcdsFeatureFlag.common] gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport|FALSE|BOOLEAN|0x00000001 diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf b/ArmPkg/Drivers/CpuDxe/CpuDx= e.inf index b748f0344537..c32d2cb9c7d4 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.inf @@ -71,7 +71,7 @@ [Pcd.common] gArmTokenSpaceGuid.PcdVFPEnabled =20 [FeaturePcd.common] gArmTokenSpaceGuid.PcdDebuggerExceptionSupport =20 [Depex] - AFTER gArmGicDxeFileGuid + gHardwareInterruptProtocolGuid OR gHardwareInterrupt2ProtocolGuid --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 02:52:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523494556836311.95451164992335; Wed, 11 Apr 2018 17:55:56 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 17FDA226CD7B0; Wed, 11 Apr 2018 17:55:51 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 AF6E9226CD7A6 for ; Wed, 11 Apr 2018 17:55:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F323B81A88A6; Thu, 12 Apr 2018 00:55:48 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-97.rdu2.redhat.com [10.10.120.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 028A61208F81; Thu, 12 Apr 2018 00:55:47 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Thu, 12 Apr 2018 02:55:34 +0200 Message-Id: <20180412005540.26651-5-lersek@redhat.com> In-Reply-To: <20180412005540.26651-1-lersek@redhat.com> References: <20180412005540.26651-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 12 Apr 2018 00:55:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 12 Apr 2018 00:55:49 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 04/10] EmbeddedPkg: introduce NvVarStoreFormattedLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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" Some platforms don't format a variable store template at build time; instead they format the non-volatile varstore flash chip during boot, dynamically. Introduce NvVarStoreFormattedLib to enable such platforms to delay the "variable read" service drivers until the platform specific module(s) report that the variable store has been formatted. The platform-specific module that performs the formatting during startup is usually an FVB or MM FVB driver. Under the proposed scheme, it becomes responsible for installing gEdkiiNvVarStoreFormattedGuid with a NULL interface in the protocol database. In turn, the platform DSC will hook NvVarStoreFormattedLib into the variable service driver, to make the latter wait for the FVB driver. Platforms that need not delay the variable service driver like this may still use the same FVB driver; gEdkiiNvVarStoreFormattedGuid will simply be ignored. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Steve Capper Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Tested-by: Steve Capper --- EmbeddedPkg/EmbeddedPkg.dec | 3= ++ EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf | 52= ++++++++++++++++++++ EmbeddedPkg/Include/Guid/NvVarStoreFormatted.h | 39= +++++++++++++++ EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.c | 41= +++++++++++++++ 4 files changed, 135 insertions(+) diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index e48ce2e95bf7..c7b134dd34e6 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -64,12 +64,15 @@ [Guids.common] # File GUID for default DTB image embedded in the firmware volume gDtPlatformDefaultDtbFileGuid =3D { 0x25462cda, 0x221f, 0x47df, { 0xac, = 0x1d, 0x25, 0x9c, 0xfa, 0xa4, 0xe3, 0x26 } } =20 # HII form set GUID for ConsolePrefDxe driver gConsolePrefFormSetGuid =3D { 0x2d2358b4, 0xe96c, 0x484d, { 0xb2, 0xdd, = 0x7c, 0x2e, 0xdf, 0xc7, 0xd5, 0x6f } } =20 + ## Include/Guid/NvVarStoreFormatted.h + gEdkiiNvVarStoreFormattedGuid =3D { 0xd1a86e3f, 0x0707, 0x4c35, { 0x83, = 0xcd, 0xdc, 0x2c, 0x29, 0xc8, 0x91, 0xa3 } } + [Protocols.common] gHardwareInterruptProtocolGuid =3D { 0x2890B3EA, 0x053D, 0x1643, { 0xAD= , 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } } gHardwareInterrupt2ProtocolGuid =3D { 0x32898322, 0x2da1, 0x474a, { 0xba= , 0xaa, 0xf3, 0xf7, 0xcf, 0x56, 0x94, 0x70 } } gEmbeddedDeviceGuid =3D { 0xbf4b9d10, 0x13ec, 0x43dd, { 0x88, 0x80, 0x= e9, 0xb, 0x71, 0x8f, 0x27, 0xde } } gEmbeddedExternalDeviceProtocolGuid =3D { 0x735F8C64, 0xD696, 0x44D0, { = 0xBD, 0xF2, 0x44, 0x7F, 0xD0, 0x5A, 0x54, 0x06 }} gEmbeddedGpioProtocolGuid =3D { 0x17a0a3d7, 0xc0a5, 0x4635, { = 0xbb, 0xd5, 0x07, 0x21, 0x87, 0xdf, 0xe2, 0xee }} diff --git a/EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormatted= Lib.inf b/EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib= .inf new file mode 100644 index 000000000000..b02fc7810948 --- /dev/null +++ b/EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf @@ -0,0 +1,52 @@ +## @file +# A hook-in library for: +# - MdeModulePkg/Universal/Variable/Pei/VariablePei.inf +# - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf +# - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf +# +# Plugging this library instance into one of the above modules makes that +# variable service backend wait for another platform module to dynamically +# initialize or verify EFI_FIRMWARE_VOLUME_HEADER and VARIABLE_STORE_HEADE= R in +# the non-volatile variable store FVB device. The initialization / verific= ation +# is signaled by installing gEdkiiNvVarStoreFormattedGuid into the +# phase-matching PPI or protocol database, with a NULL interface. (Note th= at +# installing gEdkiiNvVarStoreFormattedGuid into either the DXE or the MM +# protocol database will unblock VariableSmm -- refer to EFI_SECTION_MM_DE= PEX +# in the PI spec.) +# +# Copyright (C) 2018, 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.27 + BASE_NAME =3D NvVarStoreFormattedLib + FILE_GUID =3D 78f76ae8-ae62-4455-8148-c3a7ebaaa3f3 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D NvVarStoreFormattedLib|PEIM DXE_RUNTI= ME_DRIVER DXE_SMM_DRIVER + CONSTRUCTOR =3D NvVarStoreFormattedInitialize + +[Sources] + NvVarStoreFormattedLib.c + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + +# +# The matching DEPEX section below will generate the EFI_SECTION_PEI_DEPEX, +# EFI_SECTION_DXE_DEPEX or EFI_SECTION_MM_DEPEX leaf section for the PEIM +# (EFI_FV_FILETYPE_PEIM), DXE_RUNTIME_DRIVER (EFI_FV_FILETYPE_DRIVER), or +# DXE_SMM_DRIVER (EFI_FV_FILETYPE_MM) module, respectively. +# +[Depex.common.PEIM, Depex.common.DXE_RUNTIME_DRIVER, Depex.common.DXE_SMM_= DRIVER] + gEdkiiNvVarStoreFormattedGuid diff --git a/EmbeddedPkg/Include/Guid/NvVarStoreFormatted.h b/EmbeddedPkg/I= nclude/Guid/NvVarStoreFormatted.h new file mode 100644 index 000000000000..4e057e4d894d --- /dev/null +++ b/EmbeddedPkg/Include/Guid/NvVarStoreFormatted.h @@ -0,0 +1,39 @@ +/** @file + EDKII NvVarStore Formatted GUID + + A NULL protocol instance with this GUID in the DXE and/or MM protocol + databases, and/or a NULL PPI with this GUID in the PPI database, implies= that + a DXE or MM driver, or a PEIM, has verified (or dynamically ensured) tha= t the + non-volatile variable store has valid and consistent headers + (EFI_FIRMWARE_VOLUME_HEADER and VARIABLE_STORE_HEADER). + + Said predicate is required by the read-only variable PEIM, and the read = side + of the runtime variable DXE and MM drivers, immediately after they are + dispatched. This GUID presents platforms with one way to coordinate betw= een + their module(s) that format the variable store FVB device and the variab= le + service drivers. + + Copyright (C) 2018, 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_NV_VAR_STORE_FORMATTED_H__ +#define __EDKII_NV_VAR_STORE_FORMATTED_H__ + +#define EDKII_NV_VAR_STORE_FORMATTED_GUID \ + { \ + 0xd1a86e3f, 0x0707, 0x4c35, \ + { 0x83, 0xcd, 0xdc, 0x2c, 0x29, 0xc8, 0x91, 0xa3 } \ + } + +extern EFI_GUID gEdkiiNvVarStoreFormattedGuid; + +#endif diff --git a/EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormatted= Lib.c b/EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.c new file mode 100644 index 000000000000..001e47cfe87c --- /dev/null +++ b/EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.c @@ -0,0 +1,41 @@ +/** @file + A hook-in library for: + - MdeModulePkg/Universal/Variable/Pei/VariablePei.inf + - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf + - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf + + Plugging this library instance into one of the above modules makes that + variable service backend wait for another platform module to dynamically + initialize or verify EFI_FIRMWARE_VOLUME_HEADER and VARIABLE_STORE_HEADE= R in + the non-volatile variable store FVB device. The initialization / verific= ation + is signaled by installing gEdkiiNvVarStoreFormattedGuid into the + phase-matching PPI or protocol database, with a NULL interface. (Note th= at + installing gEdkiiNvVarStoreFormattedGuid into either the DXE or the MM + protocol database will unblock VariableSmm -- refer to EFI_SECTION_MM_DE= PEX + in the PI spec.) + + Copyright (C) 2018, 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 +NvVarStoreFormattedInitialize ( + VOID + ) +{ + // + // Do nothing, just imbue VariablePei / VariableRuntimeDxe / VariableSmm= with + // a PPI or protocol dependency on EDKII_NV_VAR_STORE_FORMATTED_GUID. + // + return RETURN_SUCCESS; +} --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 02:52:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523494561441910.8509608482564; Wed, 11 Apr 2018 17:56:01 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 585EA226CD7B6; Wed, 11 Apr 2018 17:55:52 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 EF6B5226CD7AD for ; Wed, 11 Apr 2018 17:55:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3AB8281A88BF; Thu, 12 Apr 2018 00:55:50 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-97.rdu2.redhat.com [10.10.120.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E3E21208F7B; Thu, 12 Apr 2018 00:55:49 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Thu, 12 Apr 2018 02:55:35 +0200 Message-Id: <20180412005540.26651-6-lersek@redhat.com> In-Reply-To: <20180412005540.26651-1-lersek@redhat.com> References: <20180412005540.26651-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 12 Apr 2018 00:55:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 12 Apr 2018 00:55:50 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 05/10] ArmPlatformPkg/NorFlashDxe: initialize varstore headers eagerly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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 lazy initialization of the varstore FVB makes no longer sense at this point: - "mNorFlashInstanceTemplate.Initialize" is NULL; - in NorFlashCreateInstance(), we only set Instance->Initialize to non-NULL -- namely NorFlashFvbInitialize() -- if the FVB stands for the variable store (see "ContainVariableStorage" / "SupportFvb"); - we call Instance->Initialize() from three places: - from NorFlashWriteSingleBlock(), which is too late for the variable read service ("variable write" depends on "variable read"); - from InitializeFvAndVariableStoreHeaders(), but that is only reachable from NorFlashFvbInitialize(), i.e. recursively from Instance->Initialize() itself; - and from FvbRead(), which is never called by the variable driver, only by the FTW driver. However, the variable driver may read (not write) the memory-mapped varstore flash chip before the FTW driver is dispatched. Therefore the lazy initialization is both superfluous and insufficient. Initialize the varstore headers eagerly, before we install the FVB protocol interface. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Steve Capper Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Tested-by: Steve Capper --- ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h | 6 ------ ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c | 13 +------------ ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c | 9 --------- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h b/ArmPlatform= Pkg/Drivers/NorFlashDxe/NorFlashDxe.h index c24680098f62..5c07694fbfaa 100644 --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h @@ -119,36 +119,30 @@ #define INSTANCE_FROM_FVB_THIS(a) CR(a, NOR_FLASH_INSTANCE= , FvbProtocol, NOR_FLASH_SIGNATURE) #define INSTANCE_FROM_BLKIO_THIS(a) CR(a, NOR_FLASH_INSTANCE= , BlockIoProtocol, NOR_FLASH_SIGNATURE) #define INSTANCE_FROM_DISKIO_THIS(a) CR(a, NOR_FLASH_INSTANCE= , DiskIoProtocol, NOR_FLASH_SIGNATURE) =20 typedef struct _NOR_FLASH_INSTANCE NOR_FLASH_INSTANCE; =20 -typedef EFI_STATUS (*NOR_FLASH_INITIALIZE) (NOR_FLASH_INSTANCE* Ins= tance); - typedef struct { VENDOR_DEVICE_PATH Vendor; EFI_DEVICE_PATH_PROTOCOL End; } NOR_FLASH_DEVICE_PATH; =20 struct _NOR_FLASH_INSTANCE { UINT32 Signature; EFI_HANDLE Handle; =20 - BOOLEAN Initialized; - NOR_FLASH_INITIALIZE Initialize; - UINTN DeviceBaseAddress; UINTN RegionBaseAddress; UINTN Size; EFI_LBA StartLba; =20 EFI_BLOCK_IO_PROTOCOL BlockIoProtocol; EFI_BLOCK_IO_MEDIA Media; EFI_DISK_IO_PROTOCOL DiskIoProtocol; =20 - BOOLEAN SupportFvb; EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL FvbProtocol; VOID* ShadowBuffer; =20 NOR_FLASH_DEVICE_PATH DevicePath; }; =20 diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c b/ArmPlatform= Pkg/Drivers/NorFlashDxe/NorFlashDxe.c index 1098d9501cc7..46e815beb343 100644 --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c @@ -29,15 +29,12 @@ NOR_FLASH_INSTANCE **mNorFlashInstances; UINT32 mNorFlashDeviceCount; =20 NOR_FLASH_INSTANCE mNorFlashInstanceTemplate =3D { NOR_FLASH_SIGNATURE, // Signature NULL, // Handle ... NEED TO BE FILLED =20 - FALSE, // Initialized - NULL, // Initialize - 0, // DeviceBaseAddress ... NEED TO BE FILLED 0, // RegionBaseAddress ... NEED TO BE FILLED 0, // Size ... NEED TO BE FILLED 0, // StartLba =20 { @@ -66,13 +63,12 @@ NOR_FLASH_INSTANCE mNorFlashInstanceTemplate =3D { { EFI_DISK_IO_PROTOCOL_REVISION, // Revision NorFlashDiskIoReadDisk, // ReadDisk NorFlashDiskIoWriteDisk // WriteDisk }, =20 - FALSE, // SupportFvb ... NEED TO BE FILLED { FvbGetAttributes, // GetAttributes FvbSetAttributes, // SetAttributes FvbGetPhysicalAddress, // GetPhysicalAddress FvbGetBlockSize, // GetBlockSize FvbRead, // Read @@ -134,14 +130,13 @@ NorFlashCreateInstance ( Instance->ShadowBuffer =3D AllocateRuntimePool (BlockSize);; if (Instance->ShadowBuffer =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } =20 if (SupportFvb) { - Instance->SupportFvb =3D TRUE; - Instance->Initialize =3D NorFlashFvbInitialize; + NorFlashFvbInitialize (Instance); =20 Status =3D gBS->InstallMultipleProtocolInterfaces ( &Instance->Handle, &gEfiDevicePathProtocolGuid, &Instance->DevicePath, &gEfiBlockIoProtocolGuid, &Instance->BlockIoProtocol, &gEfiFirmwareVolumeBlockProtocolGuid, &Instance->FvbProt= ocol, @@ -149,14 +144,12 @@ NorFlashCreateInstance ( ); if (EFI_ERROR(Status)) { FreePool (Instance); return Status; } } else { - Instance->Initialized =3D TRUE; - Status =3D gBS->InstallMultipleProtocolInterfaces ( &Instance->Handle, &gEfiDevicePathProtocolGuid, &Instance->DevicePath, &gEfiBlockIoProtocolGuid, &Instance->BlockIoProtocol, &gEfiDiskIoProtocolGuid, &Instance->DiskIoProtocol, NULL @@ -921,16 +914,12 @@ NorFlashWriteSingleBlock ( UINTN BlockSize; UINTN BlockAddress; UINTN PrevBlockAddress; =20 PrevBlockAddress =3D 0; =20 - if (!Instance->Initialized && Instance->Initialize) { - Instance->Initialize(Instance); - } - DEBUG ((DEBUG_BLKIO, "NorFlashWriteSingleBlock(Parameters: Lba=3D%ld, Of= fset=3D0x%x, *NumBytes=3D0x%x, Buffer @ 0x%08x)\n", Lba, Offset, *NumBytes,= Buffer)); =20 // Detect WriteDisabled state if (Instance->Media.ReadOnly =3D=3D TRUE) { DEBUG ((EFI_D_ERROR, "NorFlashWriteSingleBlock: ERROR - Can not write:= Device is in WriteDisabled state.\n")); // It is in WriteDisabled state, return an error right away diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c b/ArmPlatf= ormPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c index 3ea858f46ffb..c3e6489f398f 100644 --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c @@ -56,16 +56,12 @@ InitializeFvAndVariableStoreHeaders ( EFI_STATUS Status; VOID* Headers; UINTN HeadersLength; EFI_FIRMWARE_VOLUME_HEADER *FirmwareVolumeHeader; VARIABLE_STORE_HEADER *VariableStoreHeader; =20 - if (!Instance->Initialized && Instance->Initialize) { - Instance->Initialize (Instance); - } - HeadersLength =3D sizeof(EFI_FIRMWARE_VOLUME_HEADER) + sizeof(EFI_FV_BLO= CK_MAP_ENTRY) + sizeof(VARIABLE_STORE_HEADER); Headers =3D AllocateZeroPool(HeadersLength); =20 // FirmwareVolumeHeader->FvLength is declared to have the Variable area = AND the FTW working area AND the FTW Spare contiguous. ASSERT(PcdGet32(PcdFlashNvStorageVariableBase) + PcdGet32(PcdFlashNvStor= ageVariableSize) =3D=3D PcdGet32(PcdFlashNvStorageFtwWorkingBase)); ASSERT(PcdGet32(PcdFlashNvStorageFtwWorkingBase) + PcdGet32(PcdFlashNvSt= orageFtwWorkingSize) =3D=3D PcdGet32(PcdFlashNvStorageFtwSpareBase)); @@ -428,16 +424,12 @@ FvbRead ( NOR_FLASH_INSTANCE *Instance; =20 Instance =3D INSTANCE_FROM_FVB_THIS(This); =20 DEBUG ((DEBUG_BLKIO, "FvbRead(Parameters: Lba=3D%ld, Offset=3D0x%x, *Num= Bytes=3D0x%x, Buffer @ 0x%08x)\n", Instance->StartLba + Lba, Offset, *NumBy= tes, Buffer)); =20 - if (!Instance->Initialized && Instance->Initialize) { - Instance->Initialize(Instance); - } - TempStatus =3D EFI_SUCCESS; =20 // Cache the block size to avoid de-referencing pointers all the time BlockSize =3D Instance->Media.BlockSize; =20 DEBUG ((DEBUG_BLKIO, "FvbRead: Check if (Offset=3D0x%x + NumBytes=3D0x%x= ) <=3D BlockSize=3D0x%x\n", Offset, *NumBytes, BlockSize )); @@ -746,13 +738,12 @@ NorFlashFvbInitialize ( =20 Status =3D gDS->SetMemorySpaceAttributes ( Instance->DeviceBaseAddress, RuntimeMmioRegionSize, EFI_MEMORY_UC | EFI_MEMORY_RUNTIME); ASSERT_EFI_ERROR (Status); =20 - Instance->Initialized =3D TRUE; mFlashNvStorageVariableBase =3D FixedPcdGet32 (PcdFlashNvStorageVariable= Base); =20 // Set the index of the first LBA for the FVB Instance->StartLba =3D (PcdGet32 (PcdFlashNvStorageVariableBase) - Insta= nce->RegionBaseAddress) / Instance->Media.BlockSize; =20 BootMode =3D GetBootModeHob (); --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 02:52:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523494564209481.79827306400284; Wed, 11 Apr 2018 17:56:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 84077226CD7BD; Wed, 11 Apr 2018 17:55:53 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 318F4226CD790 for ; Wed, 11 Apr 2018 17:55:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 770F98DC2A; Thu, 12 Apr 2018 00:55:51 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-97.rdu2.redhat.com [10.10.120.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A42A1208F7B; Thu, 12 Apr 2018 00:55:50 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Thu, 12 Apr 2018 02:55:36 +0200 Message-Id: <20180412005540.26651-7-lersek@redhat.com> In-Reply-To: <20180412005540.26651-1-lersek@redhat.com> References: <20180412005540.26651-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 12 Apr 2018 00:55:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 12 Apr 2018 00:55:51 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 06/10] ArmPlatformPkg/NorFlashDxe: cue the variable driver with NvVarStoreFormatted X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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 BEFORE depex opcode that we currently use to force ourselves in front of the variable driver cannot be combined with other depex opcodes. Replace the depex with TRUE, and signal NvVarStoreFormattedLib through the installation of "gEdkiiNvVarStoreFormattedGuid". Platforms that rely on NorFlashDxe to format the variable store (as opposed to formatting a variable store template through an FDF file, as part of the build) should hook NvVarStoreFormattedLib into the variable drivers they use, so that the latter await our cue. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Steve Capper Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Tested-by: Steve Capper --- ArmPlatformPkg/ArmPlatformPkg.dec | 4 ---- ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf | 7 +++---- ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c | 13 +++++++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec b/ArmPlatformPkg/ArmPlatform= Pkg.dec index 7cec775abeee..8f32a5e2c14d 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dec +++ b/ArmPlatformPkg/ArmPlatformPkg.dec @@ -37,16 +37,12 @@ [LibraryClasses] LcdPlatformLib|Include/Library/LcdPlatformLib.h NorFlashPlatformLib|Include/Library/NorFlashPlatformLib.h PL011UartLib|Include/Library/PL011UartLib.h =20 [Guids.common] gArmPlatformTokenSpaceGuid =3D { 0x9c0aaed4, 0x74c5, 0x4043, { 0xb4, 0= x17, 0xa3, 0x22, 0x38, 0x14, 0xce, 0x76 } } - # - # Following Guid must match FILE_GUID in MdeModulePkg/Universal/Variable= /RuntimeDxe/VariableRuntimeDxe.inf - # - gVariableRuntimeDxeFileGuid =3D { 0xcbd2e4d5, 0x7068, 0x4ff5, { 0xb4, 0x= 62, 0x98, 0x22, 0xb4, 0xad, 0x8d, 0x60 } } =20 [PcdsFeatureFlag.common] gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores|FALSE|BOOLE= AN|0x00000004 =20 gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked|FALSE|BOOLEAN|0x0= 000003C =20 diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf b/ArmPlatfo= rmPkg/Drivers/NorFlashDxe/NorFlashDxe.inf index 812dafd065b2..c40ac27a6599 100644 --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf @@ -28,12 +28,13 @@ [Sources.common] NorFlashBlockIoDxe.c =20 [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec ArmPlatformPkg/ArmPlatformPkg.dec + EmbeddedPkg/EmbeddedPkg.dec =20 [LibraryClasses] IoLib BaseLib DebugLib HobLib @@ -46,12 +47,13 @@ [LibraryClasses] =20 [Guids] gEfiSystemNvDataFvGuid gEfiVariableGuid gEfiAuthenticatedVariableGuid gEfiEventVirtualAddressChangeGuid + gEdkiiNvVarStoreFormattedGuid ## PRODUCES ## PROTOCOL =20 [Protocols] gEfiBlockIoProtocolGuid gEfiDevicePathProtocolGuid gEfiFirmwareVolumeBlockProtocolGuid gEfiDiskIoProtocolGuid @@ -64,10 +66,7 @@ [Pcd.common] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize =20 gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked =20 [Depex] - # - # NorFlashDxe must be loaded before VariableRuntimeDxe in case empty fla= sh needs populating with default values - # - BEFORE gVariableRuntimeDxeFileGuid + TRUE diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c b/ArmPlatf= ormPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c index c3e6489f398f..e62ffbb433d0 100644 --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c @@ -22,12 +22,13 @@ #include #include #include =20 #include #include +#include =20 #include "NorFlashDxe.h" =20 STATIC EFI_EVENT mFvbVirtualAddrChangeEvent; STATIC UINTN mFlashNvStorageVariableBase; =20 @@ -773,12 +774,24 @@ NorFlashFvbInitialize ( Status =3D InitializeFvAndVariableStoreHeaders (Instance); if (EFI_ERROR(Status)) { return Status; } } =20 + // + // The driver implementing the variable read service can now be dispatch= ed; + // the varstore headers are in place. + // + Status =3D gBS->InstallProtocolInterface ( + &gImageHandle, + &gEdkiiNvVarStoreFormattedGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + ASSERT_EFI_ERROR (Status); + // // Register for the virtual address change event // Status =3D gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, TPL_NOTIFY, --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 02:52:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523494567000327.44920844236833; Wed, 11 Apr 2018 17:56:07 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BDF69226CD7BC; Wed, 11 Apr 2018 17:55:55 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 6DE5C226CD7A6 for ; Wed, 11 Apr 2018 17:55:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B30E4EB6F6; Thu, 12 Apr 2018 00:55:52 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-97.rdu2.redhat.com [10.10.120.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id B66981208F7B; Thu, 12 Apr 2018 00:55:51 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Thu, 12 Apr 2018 02:55:37 +0200 Message-Id: <20180412005540.26651-8-lersek@redhat.com> In-Reply-To: <20180412005540.26651-1-lersek@redhat.com> References: <20180412005540.26651-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 12 Apr 2018 00:55:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 12 Apr 2018 00:55:52 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 07/10] ArmPlatformPkg/NorFlashDxe: depend on gEfiCpuArchProtocolGuid X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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" NorFlashFvbInitialize() calls gDS->SetMemorySpaceAttributes() to mark the varstore flash region as uncached. This DXE service depends on the CPU Architectural protocol, and the DXE core is allowed to return EFI_NOT_AVAILABLE_YET if it hasn't dispatched ArmPkg/Drivers/CpuDxe earlier. Make the dependency explicit. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Steve Capper Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Tested-by: Steve Capper --- ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf b/ArmPlatfo= rmPkg/Drivers/NorFlashDxe/NorFlashDxe.inf index c40ac27a6599..a59a21a03e0a 100644 --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf @@ -66,7 +66,7 @@ [Pcd.common] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize =20 gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked =20 [Depex] - TRUE + gEfiCpuArchProtocolGuid --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 02:52:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523494569523505.66893631914445; Wed, 11 Apr 2018 17:56:09 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E432D226FAA76; Wed, 11 Apr 2018 17:55:55 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 AF701226CD790 for ; Wed, 11 Apr 2018 17:55:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EEAEBEB713; Thu, 12 Apr 2018 00:55:53 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-97.rdu2.redhat.com [10.10.120.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1CD51208F81; Thu, 12 Apr 2018 00:55:52 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Thu, 12 Apr 2018 02:55:38 +0200 Message-Id: <20180412005540.26651-9-lersek@redhat.com> In-Reply-To: <20180412005540.26651-1-lersek@redhat.com> References: <20180412005540.26651-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 12 Apr 2018 00:55:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 12 Apr 2018 00:55:54 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 08/10] ArmPlatformPkg/PL031RealTimeClockLib: depend on gEfiCpuArchProtocolGuid X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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 RealTimeClockLib class is declared under EmbeddedPkg, so that platforms can provide the internals for the EmbeddedPkg/RealTimeClockRuntimeDxe driver. In turn the driver produces the Real Time Clock Arch Protocol, without which UEFI drivers cannot be dispatched. The PL031RealTimeClockLib instance calls gDS->SetMemorySpaceAttributes() in the LibRtcInitialize() public function. This DXE service depends on the CPU Arch Protocol. Add it to the depex. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Steve Capper Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Tested-by: Steve Capper --- ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf | 5= ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeCloc= kLib.inf b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockL= ib.inf index a3e4f73e7d05..3d62aeabd670 100644 --- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf +++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf @@ -16,13 +16,13 @@ [Defines] INF_VERSION =3D 0x00010005 BASE_NAME =3D PL031RealTimeClockLib FILE_GUID =3D 470DFB96-E205-4515-A75E-2E60F853E79D MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D RealTimeClockLib + LIBRARY_CLASS =3D RealTimeClockLib|DXE_RUNTIME_DRIVER =20 [Sources.common] PL031RealTimeClockLib.c =20 [Packages] MdePkg/MdePkg.dec @@ -41,6 +41,9 @@ [LibraryClasses] [Guids] gEfiEventVirtualAddressChangeGuid =20 [Pcd] gArmPlatformTokenSpaceGuid.PcdPL031RtcBase gArmPlatformTokenSpaceGuid.PcdPL031RtcPpmAccuracy + +[Depex.common.DXE_RUNTIME_DRIVER] + gEfiCpuArchProtocolGuid --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 02:52:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523494572199580.9936896766004; Wed, 11 Apr 2018 17:56:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1E2822270D32F; Wed, 11 Apr 2018 17:55:58 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 F3A732270D325 for ; Wed, 11 Apr 2018 17:55:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36990EBFF0; Thu, 12 Apr 2018 00:55:55 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-97.rdu2.redhat.com [10.10.120.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39ED41208F7B; Thu, 12 Apr 2018 00:55:54 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Thu, 12 Apr 2018 02:55:39 +0200 Message-Id: <20180412005540.26651-10-lersek@redhat.com> In-Reply-To: <20180412005540.26651-1-lersek@redhat.com> References: <20180412005540.26651-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 12 Apr 2018 00:55:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 12 Apr 2018 00:55:55 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 09/10] ArmVirtPkg/PlatformHasAcpiDtDxe: depend on gEfiVariableArchProtocolGuid X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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" PlatformHasAcpiDtDxe consumes the DynamicHii PCD called "gArmVirtTokenSpaceGuid.PcdForceNoAcpi". The PcdGetBool() library call terminates in gRT->GetVariable(), in the MdeModulePkg/Universal/PCD/Dxe driver. Put "gEfiVariableArchProtocolGuid" on PlatformHasAcpiDtDxe's DEPEX so that we not attempt the call before the PCD driver can successfully read non-volatile variables. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Steve Capper Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Tested-by: Steve Capper --- ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf b/Arm= VirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf index 5351e741aa41..8346f7f24b32 100644 --- a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf @@ -44,7 +44,7 @@ [Guids] gEdkiiPlatformHasDeviceTreeGuid ## SOMETIMES_PRODUCES ## PROTOCOL =20 [Pcd] gArmVirtTokenSpaceGuid.PcdForceNoAcpi =20 [Depex] - TRUE + gEfiVariableArchProtocolGuid --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 02:52:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523494574842638.7611167546306; Wed, 11 Apr 2018 17:56:14 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 46AF72270D32B; Wed, 11 Apr 2018 17:56:00 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 2CA392270D32B for ; Wed, 11 Apr 2018 17:55:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72146406F972; Thu, 12 Apr 2018 00:55:56 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-97.rdu2.redhat.com [10.10.120.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75E1B1208F7B; Thu, 12 Apr 2018 00:55:55 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Thu, 12 Apr 2018 02:55:40 +0200 Message-Id: <20180412005540.26651-11-lersek@redhat.com> In-Reply-To: <20180412005540.26651-1-lersek@redhat.com> References: <20180412005540.26651-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 12 Apr 2018 00:55:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 12 Apr 2018 00:55:56 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 10/10] ArmVirtPkg/ArmVirtQemu: hook NvVarStoreFormattedLib into VariableRuntimeDxe X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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 spite of both ArmVirtQemu and ArmVirtQemuKernel formatting the variable store template at build time, link NvVarStoreFormattedLib into VariableRuntimeDxe via NULL class resolution on both platforms. This lets us test the depexes implemented in the previous patches. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Steve Capper Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Tested-by: Steve Capper --- ArmVirtPkg/ArmVirtQemu.dsc | 1 + ArmVirtPkg/ArmVirtQemuKernel.dsc | 1 + 2 files changed, 2 insertions(+) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 76a83b99a303..824070edc2a9 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -254,12 +254,13 @@ [Components.common] # ArmPkg/Drivers/CpuDxe/CpuDxe.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf + NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedL= ib.inf # don't use unaligned CopyMem () on the UEFI varstore NOR flash regi= on BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf } !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index 7d9a9196d640..2368ba283bff 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -243,12 +243,13 @@ [Components.common] # ArmPkg/Drivers/CpuDxe/CpuDxe.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf + NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedL= ib.inf # don't use unaligned CopyMem () on the UEFI varstore NOR flash regi= on BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf } !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel