mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
EFI: Fix relocating ESRT for dom0
Fix calculating the table size - it consists of a header + entries, not
just entries.
This bug caused the last entry to have garbage in its final fields,
including LowestSupportedFwVersion and CapsuleFlags, which (usually)
made fwupd able to detect firmware update availability, but refuse
actually installing it.
Fixes: dc7da0874b ("EFI: preserve the System Resource Table for dom0")
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
This commit is contained in:
1 parent
5513bfd054
commit
3ea44aa78c
1 file changed
+2
-1
@@ -675,7 +675,8 @@ static size_t __init get_esrt_size(const EFI_MEMORY_DESCRIPTOR *desc)
|
|||||||
if ( esrt_ptr->FwResourceCount > available_len / sizeof(esrt_ptr->Entries[0]) )
|
if ( esrt_ptr->FwResourceCount > available_len / sizeof(esrt_ptr->Entries[0]) )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return esrt_ptr->FwResourceCount * sizeof(esrt_ptr->Entries[0]);
|
return offsetof(EFI_SYSTEM_RESOURCE_TABLE,
|
||||||
|
Entries[esrt_ptr->FwResourceCount]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EFI_GUID __initdata esrt_guid = EFI_SYSTEM_RESOURCE_TABLE_GUID;
|
static EFI_GUID __initdata esrt_guid = EFI_SYSTEM_RESOURCE_TABLE_GUID;
|
||||||
|
|||||||