Skip to contentSkip to conversation

arm64: zboot support

PATCH Applied Pingfan Liu 3 participants 14 messages Aug 3, 2023 – Aug 11, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v7 cover arm64: zboot support

From: root <[email protected]>

As more complicated capsule kernel format occurs like zboot, where the compressed kernel is stored as a payload. The straight forward decompression can not meet the demand.

As the first step, on aarch64, reading in the kernel file in a probe method and decide how to unfold the content by the method itself.

This series consists of two parts
[1/5], simplify the current aarch64 image probe
[2-5/5], return the kernel fd by the image load interface, and let the handling of zboot image built on it. (Thanks for Dave Young, who contributes the original idea and the code)

To ease the review, a branch is also available at https://github.com/pfliu/kexec-tools.git
branch zbootV7

To: [email protected]
Cc: Dave Young <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
v6 -> v7
Fix the included file issue in dist

v5 -> v6
introduce kexec_info.kernel_fd and return the fd through image load
interface.

Jeremy Linton (3):
kexec/zboot: Add arch independent zboot support
arm64: Add ZBOOT PE containing compressed image support
arm64: Hook up the ZBOOT support as vmlinuz

Pingfan Liu (2):
kexec/arm64: Simplify the code for zImage
kexec: Introduce a member kernel_fd in kexec_info

 include/Makefile                       |   1 +
 include/kexec-pe-zboot.h               |  15 ++
 kexec/Makefile                         |   1 +
 kexec/arch/arm64/Makefile              |   2 +-
 kexec/arch/arm64/image-header.h        |   1 +
 kexec/arch/arm64/kexec-arm64.c         |   2 +-
 kexec/arch/arm64/kexec-arm64.h         |   8 +-
 kexec/arch/arm64/kexec-image-arm64.c   |   2 +-
 kexec/arch/arm64/kexec-vmlinuz-arm64.c | 110 ++++++++++++
 kexec/arch/arm64/kexec-zImage-arm64.c  | 226 -------------------------
 kexec/kexec-pe-zboot.c                 | 131 ++++++++++++++
 kexec/kexec.c                          |  50 ++++--
 kexec/kexec.h                          |   1 +
 13 files changed, 299 insertions(+), 251 deletions(-)
 create mode 100644 include/kexec-pe-zboot.h
 create mode 100644 kexec/arch/arm64/kexec-vmlinuz-arm64.c
 delete mode 100644 kexec/arch/arm64/kexec-zImage-arm64.c
 create mode 100644 kexec/kexec-pe-zboot.c
Signature · 7 lines
2.31.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw

PATCH v7 1/5 kexec/arm64: Simplify the code for zImage

Inside zimage_probe(), it uncompresses the kernel and performs some check, similar to image_probe(). Taking a close look, the uncompressing has already executed before the image probe is called. What is missing here is to provide a fd, pointing to an uncompressed kernel image.

This patch creates a memfd based on the result produced by slurp_decompress_file(), and finally simplify the logical of the probe for aarch64.

The credit goes to the Dave Young, who contributes the original code.

To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 kexec/arch/arm64/Makefile             |   3 +-
 kexec/arch/arm64/kexec-arm64.c        |   1 -
 kexec/arch/arm64/kexec-arm64.h        |   6 -
 kexec/arch/arm64/kexec-image-arm64.c  |   2 +-
 kexec/arch/arm64/kexec-zImage-arm64.c | 226 --------------------------
 kexec/kexec.c                         |  42 +++--
 6 files changed, 26 insertions(+), 254 deletions(-)
 delete mode 100644 kexec/arch/arm64/kexec-zImage-arm64.c
kexec/arch/arm64/Makefile +1 -2
index d27c8ee..9d9111c 100644
@@ -15,8 +15,7 @@ arm64_KEXEC_SRCS += \
 	kexec/arch/arm64/kexec-arm64.c \
 	kexec/arch/arm64/kexec-elf-arm64.c \
 	kexec/arch/arm64/kexec-uImage-arm64.c \
-	kexec/arch/arm64/kexec-image-arm64.c \
-	kexec/arch/arm64/kexec-zImage-arm64.c
+	kexec/arch/arm64/kexec-image-arm64.c
 
 arm64_UIMAGE = kexec/kexec-uImage.c
 
kexec/arch/arm64/kexec-arm64.c +0 -1
index ec6df4b..a830ec7 100644
@@ -74,7 +74,6 @@ struct file_type file_type[] = {
 	{"vmlinux", elf_arm64_probe, elf_arm64_load, elf_arm64_usage},
 	{"Image", image_arm64_probe, image_arm64_load, image_arm64_usage},
 	{"uImage", uImage_arm64_probe, uImage_arm64_load, uImage_arm64_usage},
-	{"zImage", zImage_arm64_probe, zImage_arm64_load, zImage_arm64_usage},
 };
 
 int file_types = sizeof(file_type) / sizeof(file_type[0]);
kexec/arch/arm64/kexec-arm64.h +0 -6
index 5eb9fc0..d29b1b3 100644
@@ -44,12 +44,6 @@ int uImage_arm64_load(int argc, char **argv, const char *buf, off_t len,
 		      struct kexec_info *info);
 void uImage_arm64_usage(void);
 
-int zImage_arm64_probe(const char *kernel_buf, off_t kernel_size);
-int zImage_arm64_load(int argc, char **argv, const char *kernel_buf,
-	off_t kernel_size, struct kexec_info *info);
-void zImage_arm64_usage(void);
-
-
 extern off_t initrd_base;
 extern off_t initrd_size;
 
kexec/arch/arm64/kexec-image-arm64.c +1 -1
index aa8f2e2..a196747 100644
@@ -114,6 +114,6 @@ exit:
 void image_arm64_usage(void)
 {
 	printf(
-"     An ARM64 binary image, uncompressed, big or little endian.\n"
+"     An ARM64 binary image, compressed or not, big or little endian.\n"
 "     Typically an Image file.\n\n");
 }
kexec/arch/arm64/kexec-zImage-arm64.c deleted +0 -226

226 lines not on this page · raw message

kexec/kexec.c +24 -18

61 lines not on this page · raw message

Signature · 7 lines
2.31.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#2 lore raw

Re: [PATCHv7 1/5] kexec/arm64: Simplify the code for zImage

Quoted 5 lines · Pingfan Liu

Inside zimage_probe(), it uncompresses the kernel and performs some check, similar to image_probe(). Taking a close look, the uncompressing has already executed before the image probe is called. What is missing here is to provide a fd, pointing to an uncompressed kernel image.

Quoted 8 lines

This patch creates a memfd based on the result produced by slurp_decompress_file(), and finally simplify the logical of the probe for aarch64.

The credit goes to the Dave Young, who contributes the original code.

Dave, could I get a Signed-off-by line from you?
Likewise for patch 2/5.

I think simply replying to the relevant emails should be sufficient.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw

Re: [PATCHv7 1/5] kexec/arm64: Simplify the code for zImage

Quoted 11 lines · Simon Horman
Quoted 9 lines · Pingfan Liu

Inside zimage_probe(), it uncompresses the kernel and performs some check, similar to image_probe(). Taking a close look, the uncompressing has already executed before the image probe is called. What is missing here is to provide a fd, pointing to an uncompressed kernel image.

This patch creates a memfd based on the result produced by slurp_decompress_file(), and finally simplify the logical of the probe for aarch64.

Quoted 7 lines
Quoted 4 lines

The credit goes to the Dave Young, who contributes the original code.

Dave, could I get a Signed-off-by line from you?
Likewise for patch 2/5.

I Simon, sounds good to me, thanks!

Quoted 8 lines

I think simply replying to the relevant emails should be sufficient.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#4 lore raw

Re: [PATCHv7 1/5] kexec/arm64: Simplify the code for zImage

Quoted 14 lines · Dave Young
Quoted 13 lines · Simon Horman
Quoted 11 lines · Pingfan Liu

Inside zimage_probe(), it uncompresses the kernel and performs some check, similar to image_probe(). Taking a close look, the uncompressing has already executed before the image probe is called. What is missing here is to provide a fd, pointing to an uncompressed kernel image.

This patch creates a memfd based on the result produced by slurp_decompress_file(), and finally simplify the logical of the probe for aarch64.

The credit goes to the Dave Young, who contributes the original code.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Dave, could I get a Signed-off-by line from you?
Likewise for patch 2/5.

I Simon, sounds good to me, thanks!

Thanks, could your respond to the two patches with the following?

Signed-off by: <<your details go here>>

Quoted 10 lines
Quoted 9 lines

I think simply replying to the relevant emails should be sufficient.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#5 lore raw

Re: [PATCHv7 1/5] kexec/arm64: Simplify the code for zImage

Quoted 19 lines · Simon Horman
Quoted 17 lines · Dave Young
Quoted 16 lines · Simon Horman
Quoted 13 lines · Pingfan Liu

Inside zimage_probe(), it uncompresses the kernel and performs some check, similar to image_probe(). Taking a close look, the uncompressing has already executed before the image probe is called. What is missing here is to provide a fd, pointing to an uncompressed kernel image.

This patch creates a memfd based on the result produced by slurp_decompress_file(), and finally simplify the logical of the probe for aarch64.

The credit goes to the Dave Young, who contributes the original code.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Dave, could I get a Signed-off-by line from you?
Likewise for patch 2/5.

I Simon, sounds good to me, thanks!

Thanks, could your respond to the two patches with the following?

Signed-off by: <<your details go here>>

Sure, please feel free to add:

Quoted 12 lines
Quoted 11 lines
Quoted 10 lines

I think simply replying to the relevant emails should be sufficient.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#6 lore raw

PATCH v7 2/5 kexec: Introduce a member kernel_fd in kexec_info

In reply to Pingfan Liu

Utilize the image load interface to export the kernel fd, which points to the uncompressed kernel and will be passed to kexec_file_load.

The credit goes to the Dave Young, who contributes the original code.

To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 kexec/kexec.c | 8 ++++++++
 kexec/kexec.h | 1 +
 2 files changed, 9 insertions(+)
kexec/kexec.c +8 -0
index d132eb5..c3b182e 100644
@@ -1292,6 +1292,7 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
 	info.kexec_flags = flags;
 
 	info.file_mode = 1;
+	info.kernel_fd = -1;
 	info.initrd_fd = -1;
 
 	if (!is_kexec_file_load_implemented())
@@ -1337,6 +1338,13 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
 		return ret;
 	}
 
+       /*
+	* image type specific load functioin detect the capsule kernel type
+	* and create another fd for file load. For example the zboot kernel.
+	*/
+	if (info.kernel_fd != -1)
+		kernel_fd = info.kernel_fd;
+
 	/*
 	 * If there is no initramfs, set KEXEC_FILE_NO_INITRAMFS flag so that
 	 * kernel does not return error with negative initrd_fd.
kexec/kexec.h +1 -0
index 0d820ad..ed3b499 100644
@@ -164,6 +164,7 @@ struct kexec_info {
 	unsigned long file_mode :1;
 
 	/* Filled by kernel image processing code */
+	int kernel_fd;
 	int initrd_fd;
 	char *command_line;
 	int command_line_len;
Signature · 7 lines
2.31.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#7 lore raw

Re: [PATCHv7 2/5] kexec: Introduce a member kernel_fd in kexec_info

Hi,

Quoted 8 lines · Pingfan Liu

Utilize the image load interface to export the kernel fd, which points to the uncompressed kernel and will be passed to kexec_file_load.

The credit goes to the Dave Young, who contributes the original code.

Quoted 48 lines

To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 kexec/kexec.c | 8 ++++++++
 kexec/kexec.h | 1 +
 2 files changed, 9 insertions(+)
kexec/kexec.c +8 -0
index d132eb5..c3b182e 100644
@@ -1292,6 +1292,7 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
        info.kexec_flags = flags;
 
        info.file_mode = 1;
+       info.kernel_fd = -1;
        info.initrd_fd = -1;
 
        if (!is_kexec_file_load_implemented())
@@ -1337,6 +1338,13 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
                return ret;
        }
 
+       /*
+       * image type specific load functioin detect the capsule kernel type
+       * and create another fd for file load. For example the zboot kernel.
+       */
+       if (info.kernel_fd != -1)
+               kernel_fd = info.kernel_fd;
+
        /*
         * If there is no initramfs, set KEXEC_FILE_NO_INITRAMFS flag so that
         * kernel does not return error with negative initrd_fd.
kexec/kexec.h +1 -1
index 0d820ad..ed3b499 100644
@@ -164,6 +164,7 @@ struct kexec_info {
        unsigned long file_mode :1;
 
        /* Filled by kernel image processing code */
+       int kernel_fd;
        int initrd_fd;
        char *command_line;
        int command_line_len;
--
Quoted 2 lines

2.31.1

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#8 lore raw

PATCH v7 3/5 kexec/zboot: Add arch independent zboot support

In reply to Pingfan Liu

From: Jeremy Linton <[email protected]>

The linux kernel CONFIG_ZBOOT option creates self decompressing PE kernel images. So this means that kexec should have a generic understanding of the format which may be used by multiple arches.

So lets add an arch independent validation
and decompression routine.

[Modified by Pingfan to export kernel fd]

To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 include/Makefile         |   1 +
 include/kexec-pe-zboot.h |  15 +++++
 kexec/Makefile           |   1 +
 kexec/kexec-pe-zboot.c   | 131 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 148 insertions(+)
 create mode 100644 include/kexec-pe-zboot.h
 create mode 100644 kexec/kexec-pe-zboot.c
include/Makefile +1 -0
index 621ce9f..cd88a26 100644
@@ -1,6 +1,7 @@
 dist += include/Makefile		\
 	include/config.h		\
 	include/config.h.in		\
+	include/kexec-pe-zboot.h	\
 	include/kexec-uImage.h		\
 	include/x86/x86-linux.h		\
 	include/x86/mb_info.h		\
include/kexec-pe-zboot.h new file +15 -0
new file mode 100644
index 0000000..c588ca2
@@ -0,0 +1,15 @@
+#ifndef __KEXEC_PE_ZBOOT_H__
+#define __KEXEC_PE_ZBOOT_H__
+
+/* see drivers/firmware/efi/libstub/zboot-header.S */
+struct linux_pe_zboot_header {
+	uint32_t mz_magic;
+        uint32_t image_type;
+        uint32_t payload_offset;
+        uint32_t payload_size;
+        uint32_t reserved[2];
+        uint32_t compress_type;
+};
+
+int pez_prepare(const char *crude_buf, off_t buf_sz, int *kernel_fd);
+#endif
kexec/Makefile +1 -0
index 8a52e8d..11682bf 100644
@@ -17,6 +17,7 @@ KEXEC_SRCS_base += kexec/kexec-elf-exec.c
 KEXEC_SRCS_base += kexec/kexec-elf-core.c
 KEXEC_SRCS_base += kexec/kexec-elf-rel.c
 KEXEC_SRCS_base += kexec/kexec-elf-boot.c
+KEXEC_SRCS_base += kexec/kexec-pe-zboot.c
 KEXEC_SRCS_base += kexec/kexec-iomem.c
 KEXEC_SRCS_base += kexec/firmware_memmap.c
 KEXEC_SRCS_base += kexec/crashdump.c
kexec/kexec-pe-zboot.c new file +131 -0

131 lines not on this page · raw message

Signature · 7 lines
2.31.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#9 lore raw

Re: [PATCHv7 3/5] kexec/zboot: Add arch independent zboot support

Quoted 46 lines · Pingfan Liu

From: Jeremy Linton <[email protected]>

The linux kernel CONFIG_ZBOOT option creates self decompressing PE kernel images. So this means that kexec should have a generic understanding of the format which may be used by multiple arches.

So lets add an arch independent validation
and decompression routine.

[Modified by Pingfan to export kernel fd]

To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 include/Makefile         |   1 +
 include/kexec-pe-zboot.h |  15 +++++
 kexec/Makefile           |   1 +
 kexec/kexec-pe-zboot.c   | 131 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 148 insertions(+)
 create mode 100644 include/kexec-pe-zboot.h
 create mode 100644 kexec/kexec-pe-zboot.c
include/Makefile +1 -0
index 621ce9f..cd88a26 100644
@@ -1,6 +1,7 @@
 dist += include/Makefile		\
 	include/config.h		\
 	include/config.h.in		\
+	include/kexec-pe-zboot.h	\
 	include/kexec-uImage.h		\
 	include/x86/x86-linux.h		\
 	include/x86/mb_info.h		\
include/kexec-pe-zboot.h new file +2 -0
new file mode 100644
index 0000000..c588ca2
@@ -0,0 +1,15 @@
+#ifndef __KEXEC_PE_ZBOOT_H__
+#define __KEXEC_PE_ZBOOT_H__

include/kexec-pe-zboot.h line 12

Quoted 10 lines
include/kexec-pe-zboot.h new file +10 -0
+
+/* see drivers/firmware/efi/libstub/zboot-header.S */
+struct linux_pe_zboot_header {
+	uint32_t mz_magic;
+        uint32_t image_type;
+        uint32_t payload_offset;
+        uint32_t payload_size;
+        uint32_t reserved[2];
+        uint32_t compress_type;
+};

nit: the above should consistently use tabs for indentation.
I can try and fix this when applying if there is no v8.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#10 lore raw

Re: [PATCHv7 3/5] kexec/zboot: Add arch independent zboot support

Quoted 53 lines · Simon Horman
Quoted 51 lines · Pingfan Liu

From: Jeremy Linton <[email protected]>

The linux kernel CONFIG_ZBOOT option creates self decompressing PE kernel images. So this means that kexec should have a generic understanding of the format which may be used by multiple arches.

So lets add an arch independent validation
and decompression routine.

[Modified by Pingfan to export kernel fd]

To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 include/Makefile         |   1 +
 include/kexec-pe-zboot.h |  15 +++++
 kexec/Makefile           |   1 +
 kexec/kexec-pe-zboot.c   | 131 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 148 insertions(+)
 create mode 100644 include/kexec-pe-zboot.h
 create mode 100644 kexec/kexec-pe-zboot.c
include/Makefile +1 -0
index 621ce9f..cd88a26 100644
@@ -1,6 +1,7 @@
 dist += include/Makefile             \
      include/config.h                \
      include/config.h.in             \
+     include/kexec-pe-zboot.h        \
      include/kexec-uImage.h          \
      include/x86/x86-linux.h         \
      include/x86/mb_info.h           \
include/kexec-pe-zboot.h new file +7 -0
new file mode 100644
index 0000000..c588ca2
@@ -0,0 +1,15 @@
+#ifndef __KEXEC_PE_ZBOOT_H__
+#define __KEXEC_PE_ZBOOT_H__
+
+/* see drivers/firmware/efi/libstub/zboot-header.S */
+struct linux_pe_zboot_header {
+     uint32_t mz_magic;
+        uint32_t image_type;
Quoted 9 lines

include/kexec-pe-zboot.h line 12

Quoted 5 lines
include/kexec-pe-zboot.h new file +5 -0
+        uint32_t payload_offset;
+        uint32_t payload_size;
+        uint32_t reserved[2];
+        uint32_t compress_type;
+};

nit: the above should consistently use tabs for indentation.
I can try and fix this when applying if there is no v8.

Appreciate it if you do it. I think that no v8 if no other guys have opinions on this series.

Thanks,

Pingfan

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#11 lore raw

PATCH v7 4/5 arm64: Add ZBOOT PE containing compressed image support

In reply to Pingfan Liu

From: Jeremy Linton <[email protected]>

The kernel EFI stub ZBOOT feature creates a PE that contains a compressed linux kernel image. The stub when run in a valid UEFI environment then decompresses the resulting image and executes it.

Support these image formats with kexec as well to avoid having to keep an alternate kernel image around.

This patch adds a the _probe(), _load() and usage() routines needed for kexec to understand this format.

[Modified by Pingfan to export kernel fd with load method]

To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 kexec/arch/arm64/image-header.h        |   1 +
 kexec/arch/arm64/kexec-vmlinuz-arm64.c | 110 +++++++++++++++++++++++++
 2 files changed, 111 insertions(+)
 create mode 100644 kexec/arch/arm64/kexec-vmlinuz-arm64.c
kexec/arch/arm64/image-header.h +1 -0
index 158d411..26bb02f 100644
@@ -37,6 +37,7 @@ struct arm64_image_header {
 
 static const uint8_t arm64_image_magic[4] = {'A', 'R', 'M', 0x64U};
 static const uint8_t arm64_image_pe_sig[2] = {'M', 'Z'};
+static const uint8_t arm64_pe_machtype[6] = {'P','E', 0x0, 0x0, 0x64, 0xAA};
 static const uint64_t arm64_image_flag_be = (1UL << 0);
 static const uint64_t arm64_image_flag_page_size = (3UL << 1);
 static const uint64_t arm64_image_flag_placement = (1UL << 3);
kexec/arch/arm64/kexec-vmlinuz-arm64.c new file +110 -0

110 lines not on this page · raw message

Signature · 7 lines
2.31.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#12 lore raw

PATCH v7 5/5 arm64: Hook up the ZBOOT support as vmlinuz

In reply to Pingfan Liu

From: Jeremy Linton <[email protected]>

Add the previously defined _probe() and _usage() routines to the kexec file types table, and build the new module.

It should be noted that this "vmlinuz" support reuses the "Image" support to actually load the resulting image after it has been decompressed to a temporary file.

To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 kexec/arch/arm64/Makefile      | 3 ++-
 kexec/arch/arm64/kexec-arm64.c | 1 +
 kexec/arch/arm64/kexec-arm64.h | 6 ++++++
 3 files changed, 9 insertions(+), 1 deletion(-)
kexec/arch/arm64/Makefile +2 -1
index 9d9111c..59212f1 100644
@@ -15,7 +15,8 @@ arm64_KEXEC_SRCS += \
 	kexec/arch/arm64/kexec-arm64.c \
 	kexec/arch/arm64/kexec-elf-arm64.c \
 	kexec/arch/arm64/kexec-uImage-arm64.c \
-	kexec/arch/arm64/kexec-image-arm64.c
+	kexec/arch/arm64/kexec-image-arm64.c \
+	kexec/arch/arm64/kexec-vmlinuz-arm64.c
 
 arm64_UIMAGE = kexec/kexec-uImage.c
 
kexec/arch/arm64/kexec-arm64.c +1 -0
index a830ec7..4a67b0d 100644
@@ -74,6 +74,7 @@ struct file_type file_type[] = {
 	{"vmlinux", elf_arm64_probe, elf_arm64_load, elf_arm64_usage},
 	{"Image", image_arm64_probe, image_arm64_load, image_arm64_usage},
 	{"uImage", uImage_arm64_probe, uImage_arm64_load, uImage_arm64_usage},
+	{"vmlinuz", pez_arm64_probe, pez_arm64_load, pez_arm64_usage},
 };
 
 int file_types = sizeof(file_type) / sizeof(file_type[0]);
kexec/arch/arm64/kexec-arm64.h +6 -0
index d29b1b3..95fb5c2 100644
@@ -44,6 +44,12 @@ int uImage_arm64_load(int argc, char **argv, const char *buf, off_t len,
 		      struct kexec_info *info);
 void uImage_arm64_usage(void);
 
+int pez_arm64_probe(const char *kernel_buf, off_t kernel_size);
+int pez_arm64_load(int argc, char **argv, const char *buf, off_t len,
+			struct kexec_info *info);
+void pez_arm64_usage(void);
+
+
 extern off_t initrd_base;
 extern off_t initrd_size;
 
Signature · 7 lines
2.31.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Applied
#13 lore raw
In reply to Pingfan Liu
Quoted 16 lines · Pingfan Liu

From: root <[email protected]>

As more complicated capsule kernel format occurs like zboot, where the compressed kernel is stored as a payload. The straight forward decompression can not meet the demand.

As the first step, on aarch64, reading in the kernel file in a probe method and decide how to unfold the content by the method itself.

This series consists of two parts
[1/5], simplify the current aarch64 image probe
[2-5/5], return the kernel fd by the image load interface, and let the handling of zboot image built on it. (Thanks for Dave Young, who contributes the original idea and the code)

Quoted 8 lines

To ease the review, a branch is also available at https://github.com/pfliu/kexec-tools.git
branch zbootV7

To: [email protected]
Cc: Dave Young <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

Thanks everyone,

applied.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec