Re: UEFI EBS() failures on Lenovo T14s
From: Ard Biesheuvel
Date: Thu Nov 28 2024 - 10:21:35 EST
On Thu, 28 Nov 2024 at 15:46, Johan Hovold <johan@xxxxxxxxxx> wrote:
>
> On Thu, Nov 28, 2024 at 12:05:09PM +0100, Ard Biesheuvel wrote:
>
> > If you're happy to experiment more, you could try and register a
> > notification for EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES using
> > CreateEventEx(), and see if it gets called when ExitBootServices() is
> > called. That would at least help narrow it down.
>
> Thanks for the suggestion.
>
> I see the notify function being called when I signal it as well as on
> each ExitBootServices().
>
Interesting. That means the EDK2 fork is fairly recent.
FYI https://github.com/tianocore/edk2/pull/6481
> With an efi_printk() in the callback ExitBootServices() fails as
> expected, but with an empty function the kernel seems to start every
> time.
>
> Interestingly, ExitBootServices() now succeeds also if I add back the
> CloseEvent() call. In fact, it works also if I never signal the event
> (i.e. if I just create and close the event).
>
Is it still invoked by the firmware if you closed the event before EBS()?
> The patch below should suffice as a workaround I can carry until the
> firmware has been fixed.
>
Ok. I'd prefer to get this fixed on the firmware side as well.