diff mbox series

[RFC,v1,1/7] efi_loader: make efi_exit_boot_services() call bootstage_report()

Message ID 20250411153040.1772000-2-jerome.forissier@linaro.org
State New
Headers show
Series Bootstage reports for CI | expand

Commit Message

Jerome Forissier April 11, 2025, 3:29 p.m. UTC
CONFIG_BOOTSTAGE_REPORT is currently supported in the bootm command
only. Add support to the EFI boot.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
---

 lib/efi_loader/efi_boottime.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Simon Glass April 11, 2025, 6:32 p.m. UTC | #1
Hi Jerome,

On Fri, 11 Apr 2025 at 09:31, Jerome Forissier
<jerome.forissier@linaro.org> wrote:
>
> CONFIG_BOOTSTAGE_REPORT is currently supported in the bootm command
> only. Add support to the EFI boot.
>
> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> ---
>
>  lib/efi_loader/efi_boottime.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>

If you have time, could you take a look at unifying
announce_and_cleanup() with the duplicate code in EFI?

Regards,
Simon
Tom Rini April 11, 2025, 6:46 p.m. UTC | #2
On Fri, Apr 11, 2025 at 12:32:12PM -0600, Simon Glass wrote:
> Hi Jerome,
> 
> On Fri, 11 Apr 2025 at 09:31, Jerome Forissier
> <jerome.forissier@linaro.org> wrote:
> >
> > CONFIG_BOOTSTAGE_REPORT is currently supported in the bootm command
> > only. Add support to the EFI boot.
> >
> > Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> > ---
> >
> >  lib/efi_loader/efi_boottime.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> 
> If you have time, could you take a look at unifying
> announce_and_cleanup() with the duplicate code in EFI?

And the duplicating code in arch/{arm,x86,riscv}. Maybe there's some
good place we can stick the bootstage calls, board_quiesce_devices() and
dm_remove_devices_active(). But maybe not, I'm not sure honestly.
Simon Glass April 12, 2025, 12:44 p.m. UTC | #3
Hi Tom,

On Fri, 11 Apr 2025 at 12:46, Tom Rini <trini@konsulko.com> wrote:
>
> On Fri, Apr 11, 2025 at 12:32:12PM -0600, Simon Glass wrote:
> > Hi Jerome,
> >
> > On Fri, 11 Apr 2025 at 09:31, Jerome Forissier
> > <jerome.forissier@linaro.org> wrote:
> > >
> > > CONFIG_BOOTSTAGE_REPORT is currently supported in the bootm command
> > > only. Add support to the EFI boot.
> > >
> > > Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> > > ---
> > >
> > >  lib/efi_loader/efi_boottime.c | 7 +++++++
> > >  1 file changed, 7 insertions(+)
> > >
> >
> > If you have time, could you take a look at unifying
> > announce_and_cleanup() with the duplicate code in EFI?
>
> And the duplicating code in arch/{arm,x86,riscv}. Maybe there's some
> good place we can stick the bootstage calls, board_quiesce_devices() and
> dm_remove_devices_active(). But maybe not, I'm not sure honestly.

Yes. I started a series at the weekend to drop board_quiesce_devices()
but in a few cases it is needed, so then I thought about creating an
event for those 3-4 cases, but then I didn't go any further. I will
see if I can at least send a WIP series this weekend to help.

Regards,
Simon
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index c8d9a6037f7..96da279afd4 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -8,6 +8,7 @@ 
 #define LOG_CATEGORY LOGC_EFI
 
 #include <bootm.h>
+#include <bootstage.h>
 #include <div64.h>
 #include <dm/device.h>
 #include <dm/root.h>
@@ -2179,6 +2180,12 @@  static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
 
 	EFI_ENTRY("%p, %zx", image_handle, map_key);
 
+#if !defined(USE_HOSTCC)
+#if CONFIG_IS_ENABLED(BOOTSTAGE)
+	bootstage_report();
+#endif
+#endif
+
 	/* Check that the caller has read the current memory map */
 	if (map_key != efi_memory_map_key) {
 		ret = EFI_INVALID_PARAMETER;