From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id A5C81740034 for ; Tue, 30 Jul 2024 15:08:22 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=t6Ykz22JF5JM6LBjBaIdH4miqQ2splq92/+76xD1d04=; c=relaxed/simple; d=groups.io; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1722352102; v=1; b=tHevtDuCh+GMtB0sm7bjcDgfS1ilpseRNIH4iZIZpxitcDqt96UDBiWl6HsimidBpR0FeI/y TIcwEyh91YPAFIOZTQi12848Rn2K9Y0b7DrR/qnyWYxdx2gF2eQMZCQAMwzZ2w90jmt5vWvJeUl wJwbbNTmuYFZjTrrE2er9QuEVgw7PTnFhODx5MhKC1R+CDWaWDDrwnXhq+ubJNZUOGleNUPiB0h R1Mw8bV5vcMja6IubVA27zilyXgn6PDC466dlUHm86dUZfQf8F6TWVTI00u0DmXAsy69SDb7jn+ j181saczsvTsF0u/qdidVhoTGBWe7QoKO04ViHuulO3Qw== X-Received: by 127.0.0.2 with SMTP id YNGvYY7687511xoxlwUD2n5k; Tue, 30 Jul 2024 08:08:21 -0700 X-Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) by mx.groups.io with SMTP id smtpd.web10.42101.1722199489424900151 for ; Sun, 28 Jul 2024 13:44:49 -0700 X-Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-36835f6ebdcso1305383f8f.1 for ; Sun, 28 Jul 2024 13:44:49 -0700 (PDT) X-Gm-Message-State: GkclhfQZZXHh8mfW5OyEUMubx7686176AA= X-Google-Smtp-Source: AGHT+IG0ijZDc8lFEOl31aA6+COf5wpaW9sSiNvYpjcj3GcprOIEyVQ17sF/t7tLYcc/AHEDnLjU8wKP X-Received: from palermo.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:118a]) (user=ardb job=sendgmr) by 2002:adf:eb92:0:b0:368:3789:1a8 with SMTP id ffacd0b85a97d-36b5d0895d9mr8125f8f.10.1722199487526; Sun, 28 Jul 2024 13:44:47 -0700 (PDT) Date: Sun, 28 Jul 2024 22:44:30 +0200 In-Reply-To: <20240728204437.4064847-1-ardb+git@google.com> Mime-Version: 1.0 References: <20240728204437.4064847-1-ardb+git@google.com> Message-ID: <20240728204437.4064847-4-ardb+git@google.com> Subject: [edk2-devel] [PATCH edk2-platforms v2 3/8] Platform/RaspberryPi: Use depex based dispatch order for varstore From: "Ard Biesheuvel via groups.io" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Jeremy Linton Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 30 Jul 2024 08:08:17 -0700 Resent-From: ardb+git@google.com Reply-To: devel@edk2.groups.io,ardb+git@google.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=tHevtDuC; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io From: Ard Biesheuvel The VarBlockServiceDxe driver needs to be dispatched before the common VariableRuntimeDxe, but we are currently relying on FDF order and lack of transitive dependencies for this, which is fragile, and will break once we move to the generic reset runtime. So use the existing helper library for this, which can be plugged into the generic variable drivers, and force them to depex on a GUID that can be installed as a NULL protocol in VarBlockServiceDxe. Signed-off-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi3/RPi3.dsc | 6 +++++- Platform/RaspberryPi/RPi4/RPi4.dsc | 6 +++++- Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf | 2 ++ Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3/RPi3.dsc index 5977f1e0a310..c399d65aa0b5 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -607,9 +607,13 @@ [Components.common] ArmPkg/Drivers/CpuDxe/CpuDxe.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf - MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf { + + NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf + } MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { + NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf } diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc index 5cbc636ca7b1..f01875173601 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -627,9 +627,13 @@ [Components.common] ArmPkg/Drivers/CpuDxe/CpuDxe.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf - MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf { + + NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf + } MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { + NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf } diff --git a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf index c2edb25bd41d..9cf5e8b0d01f 100644 --- a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf +++ b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf @@ -34,6 +34,7 @@ [Sources] [Packages] ArmPkg/ArmPkg.dec + EmbeddedPkg/EmbeddedPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec Platform/RaspberryPi/RaspberryPi.dec @@ -51,6 +52,7 @@ [LibraryClasses] UefiRuntimeLib [Guids] + gEdkiiNvVarStoreFormattedGuid ## PRODUCES ## PROTOCOL gEfiEventVirtualAddressChangeGuid gRaspberryPiEventResetGuid gEfiEventReadyToBootGuid diff --git a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c index 4071a3fca468..d7be37f67af3 100644 --- a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c +++ b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c @@ -51,6 +51,8 @@ InstallProtocolInterfaces ( &FvbDevice->FwVolBlockInstance, &gEfiDevicePathProtocolGuid, FvbDevice->DevicePath, + &gEdkiiNvVarStoreFormattedGuid, + NULL, NULL ); ASSERT_EFI_ERROR (Status); -- 2.46.0.rc1.232.g9752f9e123-goog -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120103): https://edk2.groups.io/g/devel/message/120103 Mute This Topic: https://groups.io/mt/107628977/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-