From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::22c; helo=mail-io0-x22c.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 55FB521FC7466 for ; Fri, 6 Oct 2017 14:23:47 -0700 (PDT) Received: by mail-io0-x22c.google.com with SMTP id 101so4896507ioj.3 for ; Fri, 06 Oct 2017 14:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SByjR8hWLuqkf8xZZejzGaA439NKqg6Lq5xq7W+AeB4=; b=Mt3XBqxQiZzdzh5ldBFHq3XUmp1KWnbgmhGgmHP0YUfJYJXgmJ6kQmCULgvuY1Mg5A xEWHe7Q4pchvQMJboaIk65WanNA/jDZTlHROh89Zr1WPm4vHuIBBI59lcDUIAZx7ozZH mlbqn1RwLeTgfwBzETYvfGQg0CgPWUDvnMIto= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SByjR8hWLuqkf8xZZejzGaA439NKqg6Lq5xq7W+AeB4=; b=b5sPR41OnF3v26r9Zg6/KJ1T6x8kH/9+4dfzMQbHq9K49Ow+eXbM8LLjQws31JPTAQ qaryw2pdUc8qB3FRU43l6J7fDDcf6GzHePxUpYZGvs8CW8qxbbStRJik5E9NS51eho93 5lGdaPI4PKI+xbXs15neZxpHMkK0xNtSB21VVhOo8F8sMdFM3I0ASwkRepigFKBSGXoL 9R8auaKHBe8r9me4Y6YCoFftzNPJMnfATcJhsuzZH4w8bAWhAmDAJsLxOz8e/LRFwLLM PY1bTeLn6y7XxIMo9VVhQUT7FAibPqQnh975ywcglr/lzBn/kh85Y205Ztl1pgMIS0Gr iL/A== X-Gm-Message-State: AMCzsaXjZKz8CoDAob0Mm9meEOckbDGfJ3K5k5L2HyqEf7i0WKFZzznA l87Woqmdeigr1JocQvq/qeP6DHRvjCeT1BBMMHm6h9tQ X-Google-Smtp-Source: AOwi7QDURMObDoUjVcjFf9MCQpDPZIUdUFxYrVCkOI8ello4cviU0TFELL/wnZXPdI4K6ZnzIL5Fc+hhrQC0O7BjI9Y= X-Received: by 10.107.154.84 with SMTP id c81mr4324170ioe.95.1507325231248; Fri, 06 Oct 2017 14:27:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.167 with HTTP; Fri, 6 Oct 2017 14:27:10 -0700 (PDT) In-Reply-To: <20171002190226.25103-1-ard.biesheuvel@linaro.org> References: <20171002190226.25103-1-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Fri, 6 Oct 2017 22:27:10 +0100 Message-ID: To: "edk2-devel@lists.01.org" , Leif Lindholm Cc: Ard Biesheuvel Subject: Re: [PATCH] ArmPkg/PlatformBootManagerLib: call ESRT hooks at appropriate times 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: , X-List-Received-Date: Fri, 06 Oct 2017 21:23:48 -0000 Content-Type: text/plain; charset="UTF-8" On 2 October 2017 at 20:02, Ard Biesheuvel wrote: > The ESRT management protocol needs to be invoked at the appropriate times > to get the ESRT config table to be published at when the ReadyToBoot is > signalled. So add this handling to the default ArmPkg implementation of > PlatformBootManagerLib. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel > --- > ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 23 ++++++++++++++++++-- > ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 + > 2 files changed, 22 insertions(+), 2 deletions(-) > > diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > index a3b2d7925f72..d4a7859ca9e8 100644 > --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -449,12 +450,23 @@ PlatformBootManagerBeforeConsole ( > VOID > ) > { > - EFI_STATUS Status; > + EFI_STATUS Status; > + ESRT_MANAGEMENT_PROTOCOL *EsrtManagement; > > if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { > DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n")); > Status = ProcessCapsules (); > DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status)); > + } else { > + if (EsrtManagement != NULL) { > + EsrtManagement->SyncEsrtFmp(); > + } > + } > + > + Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL, > + (VOID **)&EsrtManagement); > + if (EFI_ERROR(Status)) { > + EsrtManagement = NULL; > } > Sigh. Not sure what happened here, but this is obviously bogus. I will fix and merge right away. > // > @@ -524,7 +536,8 @@ PlatformBootManagerAfterConsole ( > VOID > ) > { > - EFI_STATUS Status; > + ESRT_MANAGEMENT_PROTOCOL *EsrtManagement; > + EFI_STATUS Status; > > // > // Show the splash screen. > @@ -538,6 +551,12 @@ PlatformBootManagerAfterConsole ( > // > EfiBootManagerConnectAll (); > > + Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL, > + (VOID **)&EsrtManagement); > + if (!EFI_ERROR(Status)) { > + EsrtManagement->SyncEsrtFmp(); > + } > + > if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { > DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n")); > Status = ProcessCapsules (); > diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > index 58c4d6d2c7d6..fce7349ff867 100644 > --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > @@ -82,3 +82,4 @@ [Protocols] > gEfiLoadedImageProtocolGuid > gEfiPciRootBridgeIoProtocolGuid > gEfiSimpleFileSystemProtocolGuid > + gEsrtManagementProtocolGuid > -- > 2.11.0 >