> On 8 Jul 2022, at 22:34, Demi Marie Obenour <d...@invisiblethingslab.com> 
> wrote:
> 
> The EFI System Resource Table (ESRT) is necessary for fwupd to identify
> firmware updates to install.  According to the UEFI specification §23.4,
> the ESRT shall be stored in memory of type EfiBootServicesData.  However,
> memory of type EfiBootServicesData is considered general-purpose memory
> by Xen, so the ESRT needs to be moved somewhere where Xen will not
> overwrite it.  Copy the ESRT to memory of type EfiRuntimeServicesData,
> which Xen will not reuse.  dom0 can use the ESRT if (and only if) it is
> in memory of type EfiRuntimeServicesData.
> 
> Earlier versions of this patch reserved the memory in which the ESRT was
> located.  This created awkward alignment problems, and required either
> splitting the E820 table or wasting memory.  It also would have required
> a new platform op for dom0 to use to indicate if the ESRT is reserved.
> By copying the ESRT into EfiRuntimeServicesData memory, the E820 table
> does not need to be modified, and dom0 can just check the type of the
> memory region containing the ESRT.  The copy is only done if the ESRT is
> not already in EfiRuntimeServicesData memory, avoiding memory leaks on
> repeated kexec.

Hi,

> 
> See https://lore.kernel.org/xen-devel/20200818184018.GN1679@mail-itl/T/
> for details.  Tested using qemu-system-x86_64 and xen.efi.

Not sure if “Tested using qemu-system-x86_64 and xen.efi.” should be added
in a section like this under your S-o-b:

---
Tested using qemu-system-x86_64 and xen.efi.
---

> 
> Signed-off-by: Demi Marie Obenour <d...@invisiblethingslab.com>

I’ve tested UEFI boot on an arm64 machine and Xen+Dom0+ACPI boots fine.

So if in v10 you don’t change anything apart from the style issues mentioned
by Jan, you can keep my tested-by:

Tested-by: Luca Fancellu <luca.fance...@arm.com>

> 
> +static void __init efi_relocate_esrt(EFI_SYSTEM_TABLE *SystemTable)
> +{
> +    EFI_STATUS status;
> +    UINTN info_size = 0, map_key, mdesc_size;
> +    void *memory_map = NULL;
> +    UINT32 ver;
> +    unsigned int i;
> +
> +    for ( ; ; ) {

Here, coding style wants the brackets on a new line (Jan comment):

for ( ; ; )
{


> +        status = efi_bs->GetMemoryMap(&info_size, memory_map, &map_key,
> +                                      &mdesc_size, &ver);
> 

Cheers,
Luca

Reply via email to