diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2022-10-12 15:28:31 +0300 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2022-11-09 14:42:03 +0300 |
commit | 1f1ba325a23df6739b6b5e52f40ec1aa228108b2 (patch) | |
tree | e6280eaf0ba616bd94cb40612ea6609c5222f28d /drivers/firmware/efi/libstub/zboot-header.S | |
parent | 42c8ea3dca094ab82776ca706fb7a9cbe8ac3dc9 (diff) | |
download | linux-1f1ba325a23df6739b6b5e52f40ec1aa228108b2.tar.xz |
efi: libstub: Add image code and data size to the zimage metadata
In order to be able to switch from LoadImage() [which treats the
supplied PE/COFF image as file input only, and reconstructs the memory
image based on the section descriptors] to a mode where we allocate the
memory directly, and invoke the image in place, we need to now how much
memory to allocate beyond the end of the image. So copy this information
from the payload's PE/COFF header to the end of the compressed version
of the payload, so that the decompressor app can access it before
performing the decompression itself.
We'll also need to size of the code region once we switch arm64 to
jumping to the kernel proper with MMU and caches enabled, so let's
capture that information as well. Note that SizeOfCode does not account
for the header, so we need SizeOfHeaders as well.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/zboot-header.S')
-rw-r--r-- | drivers/firmware/efi/libstub/zboot-header.S | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/efi/libstub/zboot-header.S b/drivers/firmware/efi/libstub/zboot-header.S index 9e6fe061ab07..bc2d7750d7f1 100644 --- a/drivers/firmware/efi/libstub/zboot-header.S +++ b/drivers/firmware/efi/libstub/zboot-header.S @@ -17,7 +17,7 @@ __efistub_efi_zboot_header: .long MZ_MAGIC .ascii "zimg" // image type .long __efistub__gzdata_start - .Ldoshdr // payload offset - .long __efistub__gzdata_size - ZBOOT_SIZE_LEN // payload size + .long __efistub__gzdata_size - 12 // payload size .long 0, 0 // reserved .asciz COMP_TYPE // compression type .org .Ldoshdr + 0x3c |