[PATCHv7 3/5] kexec/zboot: Add arch independent zboot support
Pingfan Liu
piliu at redhat.com
Mon Aug 7 08:22:08 PDT 2023
On Mon, Aug 7, 2023 at 9:23 PM Simon Horman <horms at kernel.org> wrote:
>
> On Thu, Aug 03, 2023 at 10:41:50AM +0800, Pingfan Liu wrote:
> > From: Jeremy Linton <jeremy.linton at arm.com>
> >
> > 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.
> >
> > Signed-off-by: Jeremy Linton <jeremy.linton at arm.com>
> > [Modified by Pingfan to export kernel fd]
> > Signed-off-by: Pingfan Liu <piliu at redhat.com>
> > To: kexec at lists.infradead.org
> > Cc: horms at verge.net.au
> > Cc: ardb at kernel.org
> > Cc: jeremy.linton at arm.com
> > ---
> > 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
> >
> > diff --git a/include/Makefile b/include/Makefile
> > index 621ce9f..cd88a26 100644
> > --- a/include/Makefile
> > +++ b/include/Makefile
> > @@ -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 \
> > diff --git a/include/kexec-pe-zboot.h b/include/kexec-pe-zboot.h
> > new file mode 100644
> > index 0000000..c588ca2
> > --- /dev/null
> > +++ b/include/kexec-pe-zboot.h
> > @@ -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;
> > +};
>
> 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
More information about the kexec
mailing list