From: Dave Young <dyoung@redhat.com>
To: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: catalin.marinas@arm.com, will.deacon@arm.com,
bauerman@linux.vnet.ibm.com, dhowells@redhat.com,
vgoyal@redhat.com, herbert@gondor.apana.org.au,
davem@davemloft.net, akpm@linux-foundation.org,
mpe@ellerman.id.au, bhe@redhat.com, arnd@arndb.de,
ard.biesheuvel@linaro.org, kexec@lists.infradead.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 6/9] arm64: kexec_file: load initrd, device-tree and purgatory segments
Date: Mon, 11 Sep 2017 16:25:17 +0800 [thread overview]
Message-ID: <20170911082517.GA25352@dhcp-128-65.nay.redhat.com> (raw)
In-Reply-To: <20170911064754.GA7332@dhcp-128-65.nay.redhat.com>
> > +int arch_kimage_file_post_load_cleanup(struct kimage *image)
> > +{
> > + vfree(image->arch.dtb_buf);
> > + image->arch.dtb_buf = NULL;
> > +
> > + vfree(image->arch.elf_headers);
> > + image->arch.elf_headers = NULL;
> > + image->arch.elf_headers_sz = 0;
> > +
> > + if (!image->fops || !image->fops->cleanup)
> > + return 0;
> > +
> > + return image->fops->cleanup(image->image_loader_data);
> > +}
> > +
> > +#ifdef CONFIG_KEXEC_VERIFY_SIG
> > +int arch_kexec_kernel_verify_sig(struct kimage *image, void *kernel,
> > + unsigned long kernel_len)
> > +{
> > + if (!image->fops || !image->fops->verify_sig) {
> > + pr_debug("kernel loader does not support signature verification.\n");
> > + return -EKEYREJECTED;
> > + }
> > +
> > + return image->fops->verify_sig(kernel, kernel_len);
> > +}
>
>
> arch_kexec_kernel_verify_sig now be duplicated so it can be put in the
> general function in kexec_file.c
>
> Also the probe and load function are also duplicated, they can be moved
> to common code as well.
>
> The x86 load function can be cleaned up with removing the vfree
> callback.
>
> ---
> arch/x86/kernel/machine_kexec_64.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> --- linux-x86.orig/arch/x86/kernel/machine_kexec_64.c
> +++ linux-x86/arch/x86/kernel/machine_kexec_64.c
> @@ -384,9 +384,6 @@ int arch_kexec_kernel_image_probe(struct
>
> void *arch_kexec_kernel_image_load(struct kimage *image)
> {
> - vfree(image->arch.elf_headers);
> - image->arch.elf_headers = NULL;
> -
Hmm, should move above to arch_kimage_file_post_load_cleanup instead..
> if (!image->fops || !image->fops->load)
> return ERR_PTR(-ENOEXEC);
>
>
Thanks
Dave
next prev parent reply other threads:[~2017-09-11 8:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-08 3:16 [PATCH 0/9] kexec: add kexec_file_load() support AKASHI Takahiro
2017-09-08 3:16 ` [PATCH 1/9] include: pe.h: remove message[] from mz header definition AKASHI Takahiro
2017-09-08 3:16 ` [PATCH 2/9] resource: add walk_system_ram_res_rev() AKASHI Takahiro
2017-09-08 3:16 ` [PATCH 3/9] kexec_file: factor out crashdump elf header function from x86 AKASHI Takahiro
2017-09-12 5:55 ` Dave Young
2017-09-13 0:46 ` AKASHI Takahiro
2017-09-08 3:16 ` [PATCH 4/9] asm-generic: add kexec_file_load system call to unistd.h AKASHI Takahiro
2017-09-08 3:16 ` [PATCH 5/9] arm64: kexec_file: create purgatory AKASHI Takahiro
2017-09-08 3:16 ` [PATCH 6/9] arm64: kexec_file: load initrd, device-tree and purgatory segments AKASHI Takahiro
2017-09-11 6:47 ` Dave Young
2017-09-11 8:25 ` Dave Young [this message]
2017-09-12 4:46 ` AKASHI Takahiro
2017-09-08 3:16 ` [PATCH 7/9] arm64: kexec_file: set up for crash dump adding elf core header AKASHI Takahiro
2017-09-08 3:16 ` [PATCH 8/9] arm64: enable KEXEC_FILE config AKASHI Takahiro
2017-09-10 15:41 ` kbuild test robot
2017-09-12 4:43 ` AKASHI Takahiro
2017-09-08 3:16 ` [PATCH 9/9] arm64: kexec_file: add Image format support AKASHI Takahiro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170911082517.GA25352@dhcp-128-65.nay.redhat.com \
--to=dyoung@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=bauerman@linux.vnet.ibm.com \
--cc=bhe@redhat.com \
--cc=catalin.marinas@arm.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=kexec@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpe@ellerman.id.au \
--cc=takahiro.akashi@linaro.org \
--cc=vgoyal@redhat.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®