[{"id":1772496,"web_url":"http://patchwork.ozlabs.org/comment/1772496/","msgid":"<20170921073516.GA6643@dhcp-128-65.nay.redhat.com>","list_archive_url":null,"date":"2017-09-21T07:35:16","subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","submitter":{"id":16844,"url":"http://patchwork.ozlabs.org/api/people/16844/","name":"Dave Young","email":"dyoung@redhat.com"},"content":"Hi AKASHI,\nOn 09/15/17 at 07:59pm, AKASHI Takahiro wrote:\n> arch_kexec_kernel_*() and arch_kimage_file_post_load_cleanup can now be\n> duplicated among some architectures, so let's factor them out.\n> \n> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>\n> Cc: Dave Young <dyoung@redhat.com>\n> Cc: Vivek Goyal <vgoyal@redhat.com>\n> Cc: Baoquan He <bhe@redhat.com>\n> Cc: Michael Ellerman <mpe@ellerman.id.au>\n> Cc: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>\n> ---\n>  arch/powerpc/include/asm/kexec.h            |  4 ++\n>  arch/powerpc/kernel/machine_kexec_file_64.c | 36 ++----------------\n>  arch/x86/kernel/machine_kexec_64.c          | 59 +----------------------------\n>  include/linux/kexec.h                       | 26 ++++++++++---\n>  kernel/kexec_file.c                         | 52 +++++++++++++++++++------\n>  5 files changed, 70 insertions(+), 107 deletions(-)\n> \n> diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h\n> index 25668bc8cb2a..50810d24e38f 100644\n> --- a/arch/powerpc/include/asm/kexec.h\n> +++ b/arch/powerpc/include/asm/kexec.h\n> @@ -94,6 +94,10 @@ static inline bool kdump_in_progress(void)\n>  #ifdef CONFIG_KEXEC_FILE\n>  extern struct kexec_file_ops kexec_elf64_ops;\n>  \n> +#define arch_kexec_kernel_image_probe arch_kexec_kernel_image_probe\n> +int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> +\t\t\t\t  unsigned long buf_len);\n> +\n>  #ifdef CONFIG_IMA_KEXEC\n>  #define ARCH_HAS_KIMAGE_ARCH\n>  \n> diff --git a/arch/powerpc/kernel/machine_kexec_file_64.c b/arch/powerpc/kernel/machine_kexec_file_64.c\n> index 992c0d258e5d..5b7c4a3fbb50 100644\n> --- a/arch/powerpc/kernel/machine_kexec_file_64.c\n> +++ b/arch/powerpc/kernel/machine_kexec_file_64.c\n> @@ -31,8 +31,9 @@\n>  \n>  #define SLAVE_CODE_SIZE\t\t256\n>  \n> -static struct kexec_file_ops *kexec_file_loaders[] = {\n> +struct kexec_file_ops *kexec_file_loaders[] = {\n>  \t&kexec_elf64_ops,\n> +\tNULL\n>  };\n>  \n>  int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> @@ -45,38 +46,7 @@ int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n>  \tif (image->type == KEXEC_TYPE_CRASH)\n>  \t\treturn -ENOTSUPP;\n>  \n> -\tfor (i = 0; i < ARRAY_SIZE(kexec_file_loaders); i++) {\n> -\t\tfops = kexec_file_loaders[i];\n> -\t\tif (!fops || !fops->probe)\n> -\t\t\tcontinue;\n> -\n> -\t\tret = fops->probe(buf, buf_len);\n> -\t\tif (!ret) {\n> -\t\t\timage->fops = fops;\n> -\t\t\treturn ret;\n> -\t\t}\n> -\t}\n> -\n> -\treturn ret;\n> -}\n> -\n> -void *arch_kexec_kernel_image_load(struct kimage *image)\n> -{\n> -\tif (!image->fops || !image->fops->load)\n> -\t\treturn ERR_PTR(-ENOEXEC);\n> -\n> -\treturn image->fops->load(image, image->kernel_buf,\n> -\t\t\t\t image->kernel_buf_len, image->initrd_buf,\n> -\t\t\t\t image->initrd_buf_len, image->cmdline_buf,\n> -\t\t\t\t image->cmdline_buf_len);\n> -}\n> -\n> -int arch_kimage_file_post_load_cleanup(struct kimage *image)\n> -{\n> -\tif (!image->fops || !image->fops->cleanup)\n> -\t\treturn 0;\n> -\n> -\treturn image->fops->cleanup(image->image_loader_data);\n> +\treturn kexec_kernel_image_probe(image, buf, buf_len);\n>  }\n>  \n>  /**\n> diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c\n> index cb0a30473c23..f4df8315d001 100644\n> --- a/arch/x86/kernel/machine_kexec_64.c\n> +++ b/arch/x86/kernel/machine_kexec_64.c\n> @@ -30,8 +30,9 @@\n>  #include <asm/set_memory.h>\n>  \n>  #ifdef CONFIG_KEXEC_FILE\n> -static struct kexec_file_ops *kexec_file_loaders[] = {\n> +struct kexec_file_ops *kexec_file_loaders[] = {\n>  \t\t&kexec_bzImage64_ops,\n> +\t\tNULL\n>  };\n>  #endif\n>  \n> @@ -361,62 +362,6 @@ void arch_crash_save_vmcoreinfo(void)\n>  /* arch-dependent functionality related to kexec file-based syscall */\n>  \n>  #ifdef CONFIG_KEXEC_FILE\n> -int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> -\t\t\t\t  unsigned long buf_len)\n> -{\n> -\tint i, ret = -ENOEXEC;\n> -\tstruct kexec_file_ops *fops;\n> -\n> -\tfor (i = 0; i < ARRAY_SIZE(kexec_file_loaders); i++) {\n> -\t\tfops = kexec_file_loaders[i];\n> -\t\tif (!fops || !fops->probe)\n> -\t\t\tcontinue;\n> -\n> -\t\tret = fops->probe(buf, buf_len);\n> -\t\tif (!ret) {\n> -\t\t\timage->fops = fops;\n> -\t\t\treturn ret;\n> -\t\t}\n> -\t}\n> -\n> -\treturn ret;\n> -}\n> -\n> -void *arch_kexec_kernel_image_load(struct kimage *image)\n> -{\n> -\tvfree(image->arch.elf_headers);\n> -\timage->arch.elf_headers = NULL;\n> -\n> -\tif (!image->fops || !image->fops->load)\n> -\t\treturn ERR_PTR(-ENOEXEC);\n> -\n> -\treturn image->fops->load(image, image->kernel_buf,\n> -\t\t\t\t image->kernel_buf_len, image->initrd_buf,\n> -\t\t\t\t image->initrd_buf_len, image->cmdline_buf,\n> -\t\t\t\t image->cmdline_buf_len);\n> -}\n> -\n> -int arch_kimage_file_post_load_cleanup(struct kimage *image)\n> -{\n> -\tif (!image->fops || !image->fops->cleanup)\n> -\t\treturn 0;\n> -\n> -\treturn image->fops->cleanup(image->image_loader_data);\n> -}\n> -\n> -#ifdef CONFIG_KEXEC_VERIFY_SIG\n> -int arch_kexec_kernel_verify_sig(struct kimage *image, void *kernel,\n> -\t\t\t\t unsigned long kernel_len)\n> -{\n> -\tif (!image->fops || !image->fops->verify_sig) {\n> -\t\tpr_debug(\"kernel loader does not support signature verification.\");\n> -\t\treturn -EKEYREJECTED;\n> -\t}\n> -\n> -\treturn image->fops->verify_sig(kernel, kernel_len);\n> -}\n> -#endif\n> -\n>  /*\n>   * Apply purgatory relocations.\n>   *\n> diff --git a/include/linux/kexec.h b/include/linux/kexec.h\n> index dd056fab9e35..4a2b24d94e04 100644\n> --- a/include/linux/kexec.h\n> +++ b/include/linux/kexec.h\n> @@ -134,6 +134,26 @@ struct kexec_file_ops {\n>  #endif\n>  };\n>  \n> +int kexec_kernel_image_probe(struct kimage *image, void *buf,\n> +\t\t\t     unsigned long buf_len);\n> +void *kexec_kernel_image_load(struct kimage *image);\n> +int kexec_kernel_post_load_cleanup(struct kimage *image);\n> +int kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> +\t\t\t    unsigned long buf_len);\n> +\n> +#ifndef arch_kexec_kernel_image_probe\n> +#define arch_kexec_kernel_image_probe kexec_kernel_image_probe\n> +#endif\n> +#ifndef arch_kexec_kernel_image_load\n> +#define arch_kexec_kernel_image_load kexec_kernel_image_load\n> +#endif\n> +#ifndef arch_kimage_file_post_load_cleanup\n> +#define arch_kimage_file_post_load_cleanup kexec_kernel_post_load_cleanup\n> +#endif\n> +#ifndef arch_kexec_kernel_verify_sig\n> +#define arch_kexec_kernel_verify_sig kexec_kernel_verify_sig\n> +#endif\n> +\n>  /**\n>   * struct kexec_buf - parameters for finding a place for a buffer in memory\n>   * @image:\tkexec image in which memory to search.\n> @@ -276,12 +296,6 @@ int crash_shrink_memory(unsigned long new_size);\n>  size_t crash_get_memory_size(void);\n>  void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);\n>  \n> -int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> -\t\t\t\t\t unsigned long buf_len);\n> -void * __weak arch_kexec_kernel_image_load(struct kimage *image);\n> -int __weak arch_kimage_file_post_load_cleanup(struct kimage *image);\n> -int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> -\t\t\t\t\tunsigned long buf_len);\n\nI thought we can keep using the __weak function in common code and drop\nthe arch functions, no need the #ifndef arch_kexec_kernel_image_probe\nand the function renaming stuff.  But I did not notice the powerpc\n_probe function checks KEXEC_ON_CRASH, that should be checked earlier\nand we can fail out early if not supported, but I have no idea\nhow to do it gracefully for now.\n\nAlso for x86 _load function it cleanups image->arch.elf_headers, it can\nnot be dropped simply.\n\nConsider the above two issues, maybe you can keep the powerpc\nversion of _probe() and x86 version of _load(), and still copy the common code\nto kexec_file.c weak functions. I can post patch to cleanup the x86\n_load function in the future.\n\n>  int __weak arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr,\n>  \t\t\t\t\tElf_Shdr *sechdrs, unsigned int relsec);\n>  int __weak arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,\n> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c\n> index 9f48f4412297..6203b54e04c5 100644\n> --- a/kernel/kexec_file.c\n> +++ b/kernel/kexec_file.c\n> @@ -26,30 +26,60 @@\n>  #include <linux/vmalloc.h>\n>  #include \"kexec_internal.h\"\n>  \n> +__weak struct kexec_file_ops *kexec_file_loaders[] = {NULL};\n> +\n>  static int kexec_calculate_store_digests(struct kimage *image);\n>  \n> -/* Architectures can provide this probe function */\n> -int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> -\t\t\t\t\t unsigned long buf_len)\n> +int kexec_kernel_image_probe(struct kimage *image, void *buf,\n> +\t\t\t     unsigned long buf_len)\n>  {\n> -\treturn -ENOEXEC;\n> +\tint i, ret = -ENOEXEC;\n> +\tstruct kexec_file_ops *fops;\n> +\n> +\tfor (i = 0; ; i++) {\n> +\t\tfops = kexec_file_loaders[i];\n> +\t\tif (!fops || !fops->probe)\n> +\t\t\tbreak;\n> +\n> +\t\tret = fops->probe(buf, buf_len);\n> +\t\tif (!ret) {\n> +\t\t\timage->fops = fops;\n> +\t\t\treturn ret;\n> +\t\t}\n> +\t}\n> +\n> +\treturn ret;\n>  }\n>  \n> -void * __weak arch_kexec_kernel_image_load(struct kimage *image)\n> +void *kexec_kernel_image_load(struct kimage *image)\n>  {\n> -\treturn ERR_PTR(-ENOEXEC);\n> +\tif (!image->fops || !image->fops->load)\n> +\t\treturn ERR_PTR(-ENOEXEC);\n> +\n> +\treturn image->fops->load(image, image->kernel_buf,\n> +\t\t\t\t image->kernel_buf_len, image->initrd_buf,\n> +\t\t\t\t image->initrd_buf_len, image->cmdline_buf,\n> +\t\t\t\t image->cmdline_buf_len);\n>  }\n>  \n> -int __weak arch_kimage_file_post_load_cleanup(struct kimage *image)\n> +int kexec_kernel_post_load_cleanup(struct kimage *image)\n>  {\n> -\treturn -EINVAL;\n> +\tif (!image->fops || !image->fops->cleanup)\n> +\t\treturn 0;\n> +\n> +\treturn image->fops->cleanup(image->image_loader_data);\n>  }\n>  \n>  #ifdef CONFIG_KEXEC_VERIFY_SIG\n> -int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> -\t\t\t\t\tunsigned long buf_len)\n> +int kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> +\t\t\t    unsigned long buf_len)\n>  {\n> -\treturn -EKEYREJECTED;\n> +\tif (!image->fops || !image->fops->verify_sig) {\n> +\t\tpr_debug(\"kernel loader does not support signature verification.\\n\");\n> +\t\treturn -EKEYREJECTED;\n> +\t}\n> +\n> +\treturn image->fops->verify_sig(buf, buf_len);\n>  }\n>  #endif\n>  \n> -- \n> 2.14.1\n> \n> \n> _______________________________________________\n> kexec mailing list\n> kexec@lists.infradead.org\n> http://lists.infradead.org/mailman/listinfo/kexec\n\nThanks\nDave","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"pCgobmXa\"; dkim-atps=neutral","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dyoung@redhat.com"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xyT2F2fM5z9sNc\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 17:36:37 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1duw2D-0007cz-Sy; Thu, 21 Sep 2017 07:36:33 +0000","from mx1.redhat.com ([209.132.183.28])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1duw1X-0007QJ-K3; Thu, 21 Sep 2017 07:35:54 +0000","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id E343CC0828B0;\n\tThu, 21 Sep 2017 07:35:29 +0000 (UTC)","from dhcp-128-65.nay.redhat.com (ovpn-12-20.pek2.redhat.com\n\t[10.72.12.20])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 54CED600C2;\n\tThu, 21 Sep 2017 07:35:20 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=d4yDGYS+LkzWMVieB3NQ7LC1ueTwRLw0Z21IvpitGXM=;\n\tb=pCgobmXacQO581\n\tv9/T4UBwRxfrqHJh7TebKIjb3r7C7Gn+SHnY9+SJUEVp0pV260aHbGbAqf/qXNfcFaOJVr5FkHgR0\n\tgCeGkSD0BSdhNk0EvGjFTyO3zGFr7FB+l0YoFvgutKKQw7tD+uvsXNBFR/8yyPiOg/Z+NJemOyGiU\n\tih4dYhO/wZSnflaX6CInTuEeZRRTWee2QjocIYqhw1wi4qHpL2i47WH97RfekydTZRcoPzvL5t5Ma\n\tH0i3WKhmSL+rMSPVG89fxidukWsmQ9AzQ+MfWbgOHxhzeYT60/l48R2KyQw64eUzqhlCYSCs5xGtz\n\tTQ2AqnbDrwml7Ir6LOfQ==;","DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com E343CC0828B0","Date":"Thu, 21 Sep 2017 15:35:16 +0800","From":"Dave Young <dyoung@redhat.com>","To":"AKASHI Takahiro <takahiro.akashi@linaro.org>","Subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","Message-ID":"<20170921073516.GA6643@dhcp-128-65.nay.redhat.com>","References":"<20170915105932.25338-1-takahiro.akashi@linaro.org>\n\t<20170915105932.25338-4-takahiro.akashi@linaro.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20170915105932.25338-4-takahiro.akashi@linaro.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]); Thu, 21 Sep 2017 07:35:30 +0000 (UTC)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170921_003551_732439_2C86A253 ","X-CRM114-Status":"GOOD (  26.14  )","X-Spam-Score":"-6.9 (------)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-6.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/,\n\thigh trust [209.132.183.28 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-0.0 SPF_HELO_PASS          SPF: HELO matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"herbert@gondor.apana.org.au, bhe@redhat.com, ard.biesheuvel@linaro.org, \n\tcatalin.marinas@arm.com, will.deacon@arm.com,\n\tlinux-kernel@vger.kernel.org, \n\tkexec@lists.infradead.org, dhowells@redhat.com, arnd@arndb.de,\n\tlinux-arm-kernel@lists.infradead.org, mpe@ellerman.id.au,\n\tbauerman@linux.vnet.ibm.com, akpm@linux-foundation.org,\n\tdavem@davemloft.net, vgoyal@redhat.com","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1773335,"web_url":"http://patchwork.ozlabs.org/comment/1773335/","msgid":"<20170922075807.GM17186@linaro.org>","list_archive_url":null,"date":"2017-09-22T07:58:09","subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","submitter":{"id":61166,"url":"http://patchwork.ozlabs.org/api/people/61166/","name":"AKASHI Takahiro","email":"takahiro.akashi@linaro.org"},"content":"Hi Dave,\n\nOn Thu, Sep 21, 2017 at 03:35:16PM +0800, Dave Young wrote:\n> Hi AKASHI,\n> On 09/15/17 at 07:59pm, AKASHI Takahiro wrote:\n> > arch_kexec_kernel_*() and arch_kimage_file_post_load_cleanup can now be\n> > duplicated among some architectures, so let's factor them out.\n> > \n> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>\n> > Cc: Dave Young <dyoung@redhat.com>\n> > Cc: Vivek Goyal <vgoyal@redhat.com>\n> > Cc: Baoquan He <bhe@redhat.com>\n> > Cc: Michael Ellerman <mpe@ellerman.id.au>\n> > Cc: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>\n> > ---\n> >  arch/powerpc/include/asm/kexec.h            |  4 ++\n> >  arch/powerpc/kernel/machine_kexec_file_64.c | 36 ++----------------\n> >  arch/x86/kernel/machine_kexec_64.c          | 59 +----------------------------\n> >  include/linux/kexec.h                       | 26 ++++++++++---\n> >  kernel/kexec_file.c                         | 52 +++++++++++++++++++------\n> >  5 files changed, 70 insertions(+), 107 deletions(-)\n> > \n> > diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h\n> > index 25668bc8cb2a..50810d24e38f 100644\n> > --- a/arch/powerpc/include/asm/kexec.h\n> > +++ b/arch/powerpc/include/asm/kexec.h\n> > @@ -94,6 +94,10 @@ static inline bool kdump_in_progress(void)\n> >  #ifdef CONFIG_KEXEC_FILE\n> >  extern struct kexec_file_ops kexec_elf64_ops;\n> >  \n> > +#define arch_kexec_kernel_image_probe arch_kexec_kernel_image_probe\n> > +int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > +\t\t\t\t  unsigned long buf_len);\n> > +\n> >  #ifdef CONFIG_IMA_KEXEC\n> >  #define ARCH_HAS_KIMAGE_ARCH\n> >  \n> > diff --git a/arch/powerpc/kernel/machine_kexec_file_64.c b/arch/powerpc/kernel/machine_kexec_file_64.c\n> > index 992c0d258e5d..5b7c4a3fbb50 100644\n> > --- a/arch/powerpc/kernel/machine_kexec_file_64.c\n> > +++ b/arch/powerpc/kernel/machine_kexec_file_64.c\n> > @@ -31,8 +31,9 @@\n> >  \n> >  #define SLAVE_CODE_SIZE\t\t256\n> >  \n> > -static struct kexec_file_ops *kexec_file_loaders[] = {\n> > +struct kexec_file_ops *kexec_file_loaders[] = {\n> >  \t&kexec_elf64_ops,\n> > +\tNULL\n> >  };\n> >  \n> >  int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > @@ -45,38 +46,7 @@ int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> >  \tif (image->type == KEXEC_TYPE_CRASH)\n> >  \t\treturn -ENOTSUPP;\n> >  \n> > -\tfor (i = 0; i < ARRAY_SIZE(kexec_file_loaders); i++) {\n> > -\t\tfops = kexec_file_loaders[i];\n> > -\t\tif (!fops || !fops->probe)\n> > -\t\t\tcontinue;\n> > -\n> > -\t\tret = fops->probe(buf, buf_len);\n> > -\t\tif (!ret) {\n> > -\t\t\timage->fops = fops;\n> > -\t\t\treturn ret;\n> > -\t\t}\n> > -\t}\n> > -\n> > -\treturn ret;\n> > -}\n> > -\n> > -void *arch_kexec_kernel_image_load(struct kimage *image)\n> > -{\n> > -\tif (!image->fops || !image->fops->load)\n> > -\t\treturn ERR_PTR(-ENOEXEC);\n> > -\n> > -\treturn image->fops->load(image, image->kernel_buf,\n> > -\t\t\t\t image->kernel_buf_len, image->initrd_buf,\n> > -\t\t\t\t image->initrd_buf_len, image->cmdline_buf,\n> > -\t\t\t\t image->cmdline_buf_len);\n> > -}\n> > -\n> > -int arch_kimage_file_post_load_cleanup(struct kimage *image)\n> > -{\n> > -\tif (!image->fops || !image->fops->cleanup)\n> > -\t\treturn 0;\n> > -\n> > -\treturn image->fops->cleanup(image->image_loader_data);\n> > +\treturn kexec_kernel_image_probe(image, buf, buf_len);\n> >  }\n> >  \n> >  /**\n> > diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c\n> > index cb0a30473c23..f4df8315d001 100644\n> > --- a/arch/x86/kernel/machine_kexec_64.c\n> > +++ b/arch/x86/kernel/machine_kexec_64.c\n> > @@ -30,8 +30,9 @@\n> >  #include <asm/set_memory.h>\n> >  \n> >  #ifdef CONFIG_KEXEC_FILE\n> > -static struct kexec_file_ops *kexec_file_loaders[] = {\n> > +struct kexec_file_ops *kexec_file_loaders[] = {\n> >  \t\t&kexec_bzImage64_ops,\n> > +\t\tNULL\n> >  };\n> >  #endif\n> >  \n> > @@ -361,62 +362,6 @@ void arch_crash_save_vmcoreinfo(void)\n> >  /* arch-dependent functionality related to kexec file-based syscall */\n> >  \n> >  #ifdef CONFIG_KEXEC_FILE\n> > -int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > -\t\t\t\t  unsigned long buf_len)\n> > -{\n> > -\tint i, ret = -ENOEXEC;\n> > -\tstruct kexec_file_ops *fops;\n> > -\n> > -\tfor (i = 0; i < ARRAY_SIZE(kexec_file_loaders); i++) {\n> > -\t\tfops = kexec_file_loaders[i];\n> > -\t\tif (!fops || !fops->probe)\n> > -\t\t\tcontinue;\n> > -\n> > -\t\tret = fops->probe(buf, buf_len);\n> > -\t\tif (!ret) {\n> > -\t\t\timage->fops = fops;\n> > -\t\t\treturn ret;\n> > -\t\t}\n> > -\t}\n> > -\n> > -\treturn ret;\n> > -}\n> > -\n> > -void *arch_kexec_kernel_image_load(struct kimage *image)\n> > -{\n> > -\tvfree(image->arch.elf_headers);\n> > -\timage->arch.elf_headers = NULL;\n> > -\n> > -\tif (!image->fops || !image->fops->load)\n> > -\t\treturn ERR_PTR(-ENOEXEC);\n> > -\n> > -\treturn image->fops->load(image, image->kernel_buf,\n> > -\t\t\t\t image->kernel_buf_len, image->initrd_buf,\n> > -\t\t\t\t image->initrd_buf_len, image->cmdline_buf,\n> > -\t\t\t\t image->cmdline_buf_len);\n> > -}\n> > -\n> > -int arch_kimage_file_post_load_cleanup(struct kimage *image)\n> > -{\n> > -\tif (!image->fops || !image->fops->cleanup)\n> > -\t\treturn 0;\n> > -\n> > -\treturn image->fops->cleanup(image->image_loader_data);\n> > -}\n> > -\n> > -#ifdef CONFIG_KEXEC_VERIFY_SIG\n> > -int arch_kexec_kernel_verify_sig(struct kimage *image, void *kernel,\n> > -\t\t\t\t unsigned long kernel_len)\n> > -{\n> > -\tif (!image->fops || !image->fops->verify_sig) {\n> > -\t\tpr_debug(\"kernel loader does not support signature verification.\");\n> > -\t\treturn -EKEYREJECTED;\n> > -\t}\n> > -\n> > -\treturn image->fops->verify_sig(kernel, kernel_len);\n> > -}\n> > -#endif\n> > -\n> >  /*\n> >   * Apply purgatory relocations.\n> >   *\n> > diff --git a/include/linux/kexec.h b/include/linux/kexec.h\n> > index dd056fab9e35..4a2b24d94e04 100644\n> > --- a/include/linux/kexec.h\n> > +++ b/include/linux/kexec.h\n> > @@ -134,6 +134,26 @@ struct kexec_file_ops {\n> >  #endif\n> >  };\n> >  \n> > +int kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > +\t\t\t     unsigned long buf_len);\n> > +void *kexec_kernel_image_load(struct kimage *image);\n> > +int kexec_kernel_post_load_cleanup(struct kimage *image);\n> > +int kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> > +\t\t\t    unsigned long buf_len);\n> > +\n> > +#ifndef arch_kexec_kernel_image_probe\n> > +#define arch_kexec_kernel_image_probe kexec_kernel_image_probe\n> > +#endif\n> > +#ifndef arch_kexec_kernel_image_load\n> > +#define arch_kexec_kernel_image_load kexec_kernel_image_load\n> > +#endif\n> > +#ifndef arch_kimage_file_post_load_cleanup\n> > +#define arch_kimage_file_post_load_cleanup kexec_kernel_post_load_cleanup\n> > +#endif\n> > +#ifndef arch_kexec_kernel_verify_sig\n> > +#define arch_kexec_kernel_verify_sig kexec_kernel_verify_sig\n> > +#endif\n> > +\n> >  /**\n> >   * struct kexec_buf - parameters for finding a place for a buffer in memory\n> >   * @image:\tkexec image in which memory to search.\n> > @@ -276,12 +296,6 @@ int crash_shrink_memory(unsigned long new_size);\n> >  size_t crash_get_memory_size(void);\n> >  void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);\n> >  \n> > -int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > -\t\t\t\t\t unsigned long buf_len);\n> > -void * __weak arch_kexec_kernel_image_load(struct kimage *image);\n> > -int __weak arch_kimage_file_post_load_cleanup(struct kimage *image);\n> > -int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> > -\t\t\t\t\tunsigned long buf_len);\n> \n> I thought we can keep using the __weak function in common code and drop\n> the arch functions, no need the #ifndef arch_kexec_kernel_image_probe\n> and the function renaming stuff.  But I did not notice the powerpc\n> _probe function checks KEXEC_ON_CRASH, that should be checked earlier\n> and we can fail out early if not supported, but I have no idea\n> how to do it gracefully for now.\n> \n> Also for x86 _load function it cleanups image->arch.elf_headers, it can\n> not be dropped simply.\n\nYeah, arm64 post_load_cleanup function also has some extra stuff.\nSee my patch #7/8.\n\n> Consider the above two issues, maybe you can keep the powerpc\n> version of _probe() and x86 version of _load(), and still copy the common code\n> to kexec_file.c weak functions.\n\nIt was exactly what I made before submitting v3, but I changed\nmy mind a bit. My intension is to prevent the code being duplicated\neven though it has only a few lines of code.\n\nI agree that '#ifndef arch_kexec_kernel_image_probe' in kexec.h would be\nquite ugly, but similar usages can be spotted in the kernel source.\n\nThat said if you don't like it at all, I defer to you.\n\nThanks,\n-Takahiro AKASHI\n\n> I can post patch to cleanup the x86\n> _load function in the future.\n\n> >  int __weak arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr,\n> >  \t\t\t\t\tElf_Shdr *sechdrs, unsigned int relsec);\n> >  int __weak arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,\n> > diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c\n> > index 9f48f4412297..6203b54e04c5 100644\n> > --- a/kernel/kexec_file.c\n> > +++ b/kernel/kexec_file.c\n> > @@ -26,30 +26,60 @@\n> >  #include <linux/vmalloc.h>\n> >  #include \"kexec_internal.h\"\n> >  \n> > +__weak struct kexec_file_ops *kexec_file_loaders[] = {NULL};\n> > +\n> >  static int kexec_calculate_store_digests(struct kimage *image);\n> >  \n> > -/* Architectures can provide this probe function */\n> > -int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > -\t\t\t\t\t unsigned long buf_len)\n> > +int kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > +\t\t\t     unsigned long buf_len)\n> >  {\n> > -\treturn -ENOEXEC;\n> > +\tint i, ret = -ENOEXEC;\n> > +\tstruct kexec_file_ops *fops;\n> > +\n> > +\tfor (i = 0; ; i++) {\n> > +\t\tfops = kexec_file_loaders[i];\n> > +\t\tif (!fops || !fops->probe)\n> > +\t\t\tbreak;\n> > +\n> > +\t\tret = fops->probe(buf, buf_len);\n> > +\t\tif (!ret) {\n> > +\t\t\timage->fops = fops;\n> > +\t\t\treturn ret;\n> > +\t\t}\n> > +\t}\n> > +\n> > +\treturn ret;\n> >  }\n> >  \n> > -void * __weak arch_kexec_kernel_image_load(struct kimage *image)\n> > +void *kexec_kernel_image_load(struct kimage *image)\n> >  {\n> > -\treturn ERR_PTR(-ENOEXEC);\n> > +\tif (!image->fops || !image->fops->load)\n> > +\t\treturn ERR_PTR(-ENOEXEC);\n> > +\n> > +\treturn image->fops->load(image, image->kernel_buf,\n> > +\t\t\t\t image->kernel_buf_len, image->initrd_buf,\n> > +\t\t\t\t image->initrd_buf_len, image->cmdline_buf,\n> > +\t\t\t\t image->cmdline_buf_len);\n> >  }\n> >  \n> > -int __weak arch_kimage_file_post_load_cleanup(struct kimage *image)\n> > +int kexec_kernel_post_load_cleanup(struct kimage *image)\n> >  {\n> > -\treturn -EINVAL;\n> > +\tif (!image->fops || !image->fops->cleanup)\n> > +\t\treturn 0;\n> > +\n> > +\treturn image->fops->cleanup(image->image_loader_data);\n> >  }\n> >  \n> >  #ifdef CONFIG_KEXEC_VERIFY_SIG\n> > -int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> > -\t\t\t\t\tunsigned long buf_len)\n> > +int kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> > +\t\t\t    unsigned long buf_len)\n> >  {\n> > -\treturn -EKEYREJECTED;\n> > +\tif (!image->fops || !image->fops->verify_sig) {\n> > +\t\tpr_debug(\"kernel loader does not support signature verification.\\n\");\n> > +\t\treturn -EKEYREJECTED;\n> > +\t}\n> > +\n> > +\treturn image->fops->verify_sig(buf, buf_len);\n> >  }\n> >  #endif\n> >  \n> > -- \n> > 2.14.1\n> > \n> > \n> > _______________________________________________\n> > kexec mailing list\n> > kexec@lists.infradead.org\n> > http://lists.infradead.org/mailman/listinfo/kexec\n> \n> Thanks\n> Dave","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"tqVawb38\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"II4Bzm6C\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xz5RZ6Xplz9sPm\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 17:57:14 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dvIpi-0003K8-AJ; Fri, 22 Sep 2017 07:57:10 +0000","from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dvIor-0002h4-L7 for linux-arm-kernel@lists.infradead.org;\n\tFri, 22 Sep 2017 07:56:40 +0000","by mail-io0-x232.google.com with SMTP id 21so1283338iof.6\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tFri, 22 Sep 2017 00:55:56 -0700 (PDT)","from linaro.org ([121.95.100.191])\n\tby smtp.googlemail.com with ESMTPSA id\n\tr85sm1810934ioi.8.2017.09.22.00.55.51\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 22 Sep 2017 00:55:55 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=OLSegPS1/S89kqoHjL8Bj1oKpld4YwPWddc7mgsu3b0=;\n\tb=tqVawb38FJCO6a\n\tz53zOLr8yAYsq3ytaO+vyNKPa6l3jgYKvQGUpNSnAOSDu451hjftaCngOZGQCL/RclxVmVd7uxaek\n\tjYOnNj3ZE5daIaLD0XIWNHGGQVuQZA9PQwZjBKwxgCbKyP7IL5OKXISBFpRnIo4vg2ipLSvb2+oG7\n\tnktnqlKK0bg3hynsjsrzTNyN3b/JB3B12XG7tm1ueh4RayHl7+iJifG07kkLjmBJDOZm9E6kowxor\n\tWdyZD+7sfc9qaYcHpK0pdV5JqH2Mh7CDZGkh+pw5FZ8WNLNXL2gWmJb44rk67Y3a4gyaCpg2KQj8/\n\tIVGXBG9GDCSKqVCZ9rKg==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=date:from:to:cc:subject:message-id:mail-followup-to:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=5G3f14dQ3St45pohn1LhCwz1IEdppMfBGLHSnnbTTjk=;\n\tb=II4Bzm6CPPA18z2EFBIxcQUw7ByOcTxIDUHx73sH/c41Yi7RYZnCmzCPgE1BLOSqkm\n\tORDECSXJPMPoyw998Il9QPFAFjcAWaeFj2LYfxV6pRUNH8KVfo4gen19G/wy6Z8aiL6+\n\t3hnUCRANLD2I5qk4KUKGgPx8HeybNMfXK6ROI="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id\n\t:mail-followup-to:references:mime-version:content-disposition\n\t:in-reply-to:user-agent;\n\tbh=5G3f14dQ3St45pohn1LhCwz1IEdppMfBGLHSnnbTTjk=;\n\tb=t9P7rV7ze980DTGilrfCbXZR6WW4zGxh9TRQiRbPLksaOYLTkcaCQbPuULvnU5/usr\n\tVow7sYqHw3ud1eR60WNKvC9AzZWCvOjtrCzdHYCpRTUhM18boHac+zZhCLvDZ6jnT4Zo\n\t9ptm/XvF0T67aZOC1M+0RKAWiCr4AkbrJbTOzK9gmpvxNIJUcUzNzzK9W0Pv9VN5E70b\n\tEbZj1so5JvU9nFcAJmMnv1G2Pvc9RQcgDjoFK4riphhq/waeUQwaFIXPetyF/eBzKJ4B\n\tfvJ7YXUAmb5M8lgnVrQ44xqbJxTQoQt7OAM7kGq/yuiAQq5zE7jbiRSfLDSwR/YULSjD\n\tp/1Q==","X-Gm-Message-State":"AHPjjUjj+NyQ3+9xFByxOMKe0S6g61Wk5+SJPRg2Rd3ZMY7NebO/4G9m\n\t7eHe3TipKXwUdu7LFvH75oLFba0+cjQ=","X-Google-Smtp-Source":"AOwi7QBeX36ixcEG/CuAWoQkZIzgU/TY54zZUk4VuFI2VydkqraktEGYmZs4AtUHf1/svmgloYgb5Q==","X-Received":"by 10.107.136.2 with SMTP id k2mr5750073iod.143.1506066955949;\n\tFri, 22 Sep 2017 00:55:55 -0700 (PDT)","Date":"Fri, 22 Sep 2017 16:58:09 +0900","From":"AKASHI Takahiro <takahiro.akashi@linaro.org>","To":"Dave Young <dyoung@redhat.com>","Subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","Message-ID":"<20170922075807.GM17186@linaro.org>","Mail-Followup-To":"AKASHI Takahiro <takahiro.akashi@linaro.org>,\n\tDave Young <dyoung@redhat.com>, catalin.marinas@arm.com,\n\twill.deacon@arm.com, bauerman@linux.vnet.ibm.com,\n\tdhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, \n\tdavem@davemloft.net, akpm@linux-foundation.org, mpe@ellerman.id.au,\n\tbhe@redhat.com, arnd@arndb.de, ard.biesheuvel@linaro.org,\n\tkexec@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org","References":"<20170915105932.25338-1-takahiro.akashi@linaro.org>\n\t<20170915105932.25338-4-takahiro.akashi@linaro.org>\n\t<20170921073516.GA6643@dhcp-128-65.nay.redhat.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20170921073516.GA6643@dhcp-128-65.nay.redhat.com>","User-Agent":"Mutt/1.5.24 (2015-08-30)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170922_005618_650495_BC4DD04A ","X-CRM114-Status":"GOOD (  31.20  )","X-Spam-Score":"-2.7 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.7 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow\n\ttrust [2607:f8b0:4001:c06:0:0:0:232 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"herbert@gondor.apana.org.au, bhe@redhat.com, ard.biesheuvel@linaro.org, \n\tcatalin.marinas@arm.com, will.deacon@arm.com,\n\tlinux-kernel@vger.kernel.org, \n\tkexec@lists.infradead.org, dhowells@redhat.com, arnd@arndb.de,\n\tlinux-arm-kernel@lists.infradead.org, mpe@ellerman.id.au,\n\tbauerman@linux.vnet.ibm.com, akpm@linux-foundation.org,\n\tdavem@davemloft.net, vgoyal@redhat.com","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1774491,"web_url":"http://patchwork.ozlabs.org/comment/1774491/","msgid":"<20170925080313.GA5970@dhcp-128-65.nay.redhat.com>","list_archive_url":null,"date":"2017-09-25T08:03:13","subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","submitter":{"id":16844,"url":"http://patchwork.ozlabs.org/api/people/16844/","name":"Dave Young","email":"dyoung@redhat.com"},"content":"HI AKASHI,\nOn 09/22/17 at 04:58pm, AKASHI Takahiro wrote:\n> Hi Dave,\n> \n[snip]\n\n> > >  /*\n> > >   * Apply purgatory relocations.\n> > >   *\n> > > diff --git a/include/linux/kexec.h b/include/linux/kexec.h\n> > > index dd056fab9e35..4a2b24d94e04 100644\n> > > --- a/include/linux/kexec.h\n> > > +++ b/include/linux/kexec.h\n> > > @@ -134,6 +134,26 @@ struct kexec_file_ops {\n> > >  #endif\n> > >  };\n> > >  \n> > > +int kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > > +\t\t\t     unsigned long buf_len);\n> > > +void *kexec_kernel_image_load(struct kimage *image);\n> > > +int kexec_kernel_post_load_cleanup(struct kimage *image);\n> > > +int kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> > > +\t\t\t    unsigned long buf_len);\n> > > +\n> > > +#ifndef arch_kexec_kernel_image_probe\n> > > +#define arch_kexec_kernel_image_probe kexec_kernel_image_probe\n> > > +#endif\n> > > +#ifndef arch_kexec_kernel_image_load\n> > > +#define arch_kexec_kernel_image_load kexec_kernel_image_load\n> > > +#endif\n> > > +#ifndef arch_kimage_file_post_load_cleanup\n> > > +#define arch_kimage_file_post_load_cleanup kexec_kernel_post_load_cleanup\n> > > +#endif\n> > > +#ifndef arch_kexec_kernel_verify_sig\n> > > +#define arch_kexec_kernel_verify_sig kexec_kernel_verify_sig\n> > > +#endif\n> > > +\n> > >  /**\n> > >   * struct kexec_buf - parameters for finding a place for a buffer in memory\n> > >   * @image:\tkexec image in which memory to search.\n> > > @@ -276,12 +296,6 @@ int crash_shrink_memory(unsigned long new_size);\n> > >  size_t crash_get_memory_size(void);\n> > >  void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);\n> > >  \n> > > -int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > > -\t\t\t\t\t unsigned long buf_len);\n> > > -void * __weak arch_kexec_kernel_image_load(struct kimage *image);\n> > > -int __weak arch_kimage_file_post_load_cleanup(struct kimage *image);\n> > > -int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> > > -\t\t\t\t\tunsigned long buf_len);\n> > \n> > I thought we can keep using the __weak function in common code and drop\n> > the arch functions, no need the #ifndef arch_kexec_kernel_image_probe\n> > and the function renaming stuff.  But I did not notice the powerpc\n> > _probe function checks KEXEC_ON_CRASH, that should be checked earlier\n> > and we can fail out early if not supported, but I have no idea\n> > how to do it gracefully for now.\n> > \n> > Also for x86 _load function it cleanups image->arch.elf_headers, it can\n> > not be dropped simply.\n> \n> Yeah, arm64 post_load_cleanup function also has some extra stuff.\n> See my patch #7/8.\n\nBut the x86 cleanup was dropped silently, can you add it in x86\npost_load_cleanup as well?\n\n> \n> > Consider the above two issues, maybe you can keep the powerpc\n> > version of _probe() and x86 version of _load(), and still copy the common code\n> > to kexec_file.c weak functions.\n> \n> It was exactly what I made before submitting v3, but I changed\n> my mind a bit. My intension is to prevent the code being duplicated\n> even though it has only a few lines of code.\n> \n> I agree that '#ifndef arch_kexec_kernel_image_probe' in kexec.h would be\n> quite ugly, but similar usages can be spotted in the kernel source.\n> \n> That said if you don't like it at all, I defer to you.\n\nI understand your concern, maybe still use a weak function for \narch_kexec_kernel_image_*, and they call the kexec_kernel_image_* in\nkexec_file.c common code.\n\nLike in general code:\n\nint __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n                                         unsigned long buf_len)\n{\n\treturn kexec_kernel_image_probe(image, buf, buf_len);\n}\n\nIn architechture code it can add other code and call\nkexec_kernel_image_*\n\nIt looks a bit better than the #ifdef way. \n\n[snip]\n\n> \n> Thanks,\n> -Takahiro AKASHI\n> \n\nThanks\nDave","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"qEJV9ErL\"; dkim-atps=neutral","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dyoung@redhat.com"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0xSP5jb1z9tXP\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 18:04:21 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwONE-0006t7-0d; Mon, 25 Sep 2017 08:04:16 +0000","from mx1.redhat.com ([209.132.183.28])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwOMj-0005y6-Ms; Mon, 25 Sep 2017 08:03:48 +0000","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 218CA4E33A;\n\tMon, 25 Sep 2017 08:03:24 +0000 (UTC)","from dhcp-128-65.nay.redhat.com (ovpn-12-48.pek2.redhat.com\n\t[10.72.12.48])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id EE5576017D;\n\tMon, 25 Sep 2017 08:03:16 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=MfuDfrKAn7kBRZOs6GoGbx9wQCyivfA+CMi03zhDF9I=;\n\tb=qEJV9ErLX5/RS/\n\tEYvV5vo5WjeoAeO6pVrYrxoFqUJg5WuS6hXryDgZRQEiRnuwp4bz09nI8mMZPM1alcPW9z7cL5Hbv\n\tN2CYDbG7pULOmZ3Tah8oLTDYmOHRluRFLAwNspnFc1pChjrvLtB+9Xj2zj6d6suvbNhCArYfImAj4\n\tmsg3EC3KnLApPg95XEgGTgA6fcaQC4UYkPQMzFLoA7/GDSsiLAVCrgeB77fW8FdGZazS6uEYy/lcE\n\t51zTIZZsDwMJcGHVYZ1wELRxmsMaGX3jEMjcRqvqauYmDyqLd+gP3lMTPeYOjx1K0BjixSaWZpOn4\n\tjRYE0C5lob4YS6NLWiyw==;","DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 218CA4E33A","Date":"Mon, 25 Sep 2017 16:03:13 +0800","From":"Dave Young <dyoung@redhat.com>","To":"AKASHI Takahiro <takahiro.akashi@linaro.org>, catalin.marinas@arm.com,\n\twill.deacon@arm.com, bauerman@linux.vnet.ibm.com,\n\tdhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, \n\tdavem@davemloft.net, akpm@linux-foundation.org, mpe@ellerman.id.au,\n\tbhe@redhat.com, arnd@arndb.de, ard.biesheuvel@linaro.org,\n\tkexec@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org","Subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","Message-ID":"<20170925080313.GA5970@dhcp-128-65.nay.redhat.com>","References":"<20170915105932.25338-1-takahiro.akashi@linaro.org>\n\t<20170915105932.25338-4-takahiro.akashi@linaro.org>\n\t<20170921073516.GA6643@dhcp-128-65.nay.redhat.com>\n\t<20170922075807.GM17186@linaro.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20170922075807.GM17186@linaro.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]); Mon, 25 Sep 2017 08:03:24 +0000 (UTC)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170925_010345_902397_2EBD8247 ","X-CRM114-Status":"GOOD (  25.58  )","X-Spam-Score":"-6.9 (------)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-6.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/,\n\thigh trust [209.132.183.28 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-0.0 SPF_HELO_PASS          SPF: HELO matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1774516,"web_url":"http://patchwork.ozlabs.org/comment/1774516/","msgid":"<20170925083041.GB5970@dhcp-128-65.nay.redhat.com>","list_archive_url":null,"date":"2017-09-25T08:30:41","subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","submitter":{"id":16844,"url":"http://patchwork.ozlabs.org/api/people/16844/","name":"Dave Young","email":"dyoung@redhat.com"},"content":"On 09/25/17 at 04:03pm, Dave Young wrote:\n> HI AKASHI,\n> On 09/22/17 at 04:58pm, AKASHI Takahiro wrote:\n> > Hi Dave,\n> > \n> [snip]\n> \n> > > >  /*\n> > > >   * Apply purgatory relocations.\n> > > >   *\n> > > > diff --git a/include/linux/kexec.h b/include/linux/kexec.h\n> > > > index dd056fab9e35..4a2b24d94e04 100644\n> > > > --- a/include/linux/kexec.h\n> > > > +++ b/include/linux/kexec.h\n> > > > @@ -134,6 +134,26 @@ struct kexec_file_ops {\n> > > >  #endif\n> > > >  };\n> > > >  \n> > > > +int kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > > > +\t\t\t     unsigned long buf_len);\n> > > > +void *kexec_kernel_image_load(struct kimage *image);\n> > > > +int kexec_kernel_post_load_cleanup(struct kimage *image);\n> > > > +int kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> > > > +\t\t\t    unsigned long buf_len);\n> > > > +\n> > > > +#ifndef arch_kexec_kernel_image_probe\n> > > > +#define arch_kexec_kernel_image_probe kexec_kernel_image_probe\n> > > > +#endif\n> > > > +#ifndef arch_kexec_kernel_image_load\n> > > > +#define arch_kexec_kernel_image_load kexec_kernel_image_load\n> > > > +#endif\n> > > > +#ifndef arch_kimage_file_post_load_cleanup\n> > > > +#define arch_kimage_file_post_load_cleanup kexec_kernel_post_load_cleanup\n> > > > +#endif\n> > > > +#ifndef arch_kexec_kernel_verify_sig\n> > > > +#define arch_kexec_kernel_verify_sig kexec_kernel_verify_sig\n> > > > +#endif\n> > > > +\n> > > >  /**\n> > > >   * struct kexec_buf - parameters for finding a place for a buffer in memory\n> > > >   * @image:\tkexec image in which memory to search.\n> > > > @@ -276,12 +296,6 @@ int crash_shrink_memory(unsigned long new_size);\n> > > >  size_t crash_get_memory_size(void);\n> > > >  void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);\n> > > >  \n> > > > -int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > > > -\t\t\t\t\t unsigned long buf_len);\n> > > > -void * __weak arch_kexec_kernel_image_load(struct kimage *image);\n> > > > -int __weak arch_kimage_file_post_load_cleanup(struct kimage *image);\n> > > > -int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> > > > -\t\t\t\t\tunsigned long buf_len);\n> > > \n> > > I thought we can keep using the __weak function in common code and drop\n> > > the arch functions, no need the #ifndef arch_kexec_kernel_image_probe\n> > > and the function renaming stuff.  But I did not notice the powerpc\n> > > _probe function checks KEXEC_ON_CRASH, that should be checked earlier\n> > > and we can fail out early if not supported, but I have no idea\n> > > how to do it gracefully for now.\n> > > \n> > > Also for x86 _load function it cleanups image->arch.elf_headers, it can\n> > > not be dropped simply.\n> > \n> > Yeah, arm64 post_load_cleanup function also has some extra stuff.\n> > See my patch #7/8.\n> \n> But the x86 cleanup was dropped silently, can you add it in x86\n> post_load_cleanup as well?\n> \n> > \n> > > Consider the above two issues, maybe you can keep the powerpc\n> > > version of _probe() and x86 version of _load(), and still copy the common code\n> > > to kexec_file.c weak functions.\n> > \n> > It was exactly what I made before submitting v3, but I changed\n> > my mind a bit. My intension is to prevent the code being duplicated\n> > even though it has only a few lines of code.\n> > \n> > I agree that '#ifndef arch_kexec_kernel_image_probe' in kexec.h would be\n> > quite ugly, but similar usages can be spotted in the kernel source.\n> > \n> > That said if you don't like it at all, I defer to you.\n> \n> I understand your concern, maybe still use a weak function for \n> arch_kexec_kernel_image_*, and they call the kexec_kernel_image_* in\n> kexec_file.c common code.\n> \n> Like in general code:\n> \n> int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n>                                          unsigned long buf_len)\n> {\n> \treturn kexec_kernel_image_probe(image, buf, buf_len);\n\nin this way, we maybe move kexec_kernel_image_probe to\n_kexec_kernel_image_probe, add a underscore prefix to mean that is used\ninternally.\n\n> }\n> \n> In architechture code it can add other code and call\n> kexec_kernel_image_*\n> \n> It looks a bit better than the #ifdef way. \n> \n> [snip]\n> \n> > \n> > Thanks,\n> > -Takahiro AKASHI\n> > \n> \n> Thanks\n> Dave\n> \n> _______________________________________________\n> kexec mailing list\n> kexec@lists.infradead.org\n> http://lists.infradead.org/mailman/listinfo/kexec","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"ElqtmnvA\"; dkim-atps=neutral","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dyoung@redhat.com"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0y4R6813z9t62\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 18:32:04 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwOo2-0006g5-N5; Mon, 25 Sep 2017 08:31:58 +0000","from mx1.redhat.com ([209.132.183.28])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwOnJ-00061h-9o; Mon, 25 Sep 2017 08:31:20 +0000","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 9D450C0587E3;\n\tMon, 25 Sep 2017 08:30:52 +0000 (UTC)","from dhcp-128-65.nay.redhat.com (ovpn-12-48.pek2.redhat.com\n\t[10.72.12.48])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 520EA1725C;\n\tMon, 25 Sep 2017 08:30:46 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=wYXsUVpHe9uuXfgwQWH8kiRiWS/kHvYEN5Vd/LKqCYM=;\n\tb=ElqtmnvAAcHdnI\n\tyFzW8Apqp7nC4fo/WHPQN1N0cXqW3SiWQ0DVGmLL8cnzRm84Lj4AUYIQCpGBJ4WbybPB1S9EuHqoW\n\tuL9H0TS7OsM9Uf+UaTxDX4haIWx9ys4vADttBR9q84H4UhGchCWSaqD8zbg6yrCU3Lxobo2xqYTTe\n\ttYs/x/F1s7a0p94wGxnonFzjUv44oLoN0iMMFZTXnPQ4SIAwk5eqAsxxecciq/YYXFXUwyT1M01tt\n\thjaRQFNAMbACQp991RGe88Bdd9HRDeBMuhBwBgrRkyykfKe+K9khE4DcNT/Bp+t9xskqzP4GGQI/9\n\tZdbOXOE1jwTzy54gZeCA==;","DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 9D450C0587E3","Date":"Mon, 25 Sep 2017 16:30:41 +0800","From":"Dave Young <dyoung@redhat.com>","To":"AKASHI Takahiro <takahiro.akashi@linaro.org>, catalin.marinas@arm.com,\n\twill.deacon@arm.com, bauerman@linux.vnet.ibm.com,\n\tdhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, \n\tdavem@davemloft.net, akpm@linux-foundation.org, mpe@ellerman.id.au,\n\tbhe@redhat.com, arnd@arndb.de, ard.biesheuvel@linaro.org,\n\tkexec@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org","Subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","Message-ID":"<20170925083041.GB5970@dhcp-128-65.nay.redhat.com>","References":"<20170915105932.25338-1-takahiro.akashi@linaro.org>\n\t<20170915105932.25338-4-takahiro.akashi@linaro.org>\n\t<20170921073516.GA6643@dhcp-128-65.nay.redhat.com>\n\t<20170922075807.GM17186@linaro.org>\n\t<20170925080313.GA5970@dhcp-128-65.nay.redhat.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20170925080313.GA5970@dhcp-128-65.nay.redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]); Mon, 25 Sep 2017 08:30:52 +0000 (UTC)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170925_013113_420216_B7390C5A ","X-CRM114-Status":"GOOD (  30.04  )","X-Spam-Score":"-6.9 (------)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-6.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/,\n\thigh trust [209.132.183.28 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-0.0 SPF_HELO_PASS          SPF: HELO matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1774810,"web_url":"http://patchwork.ozlabs.org/comment/1774810/","msgid":"<1623.1506353803@warthog.procyon.org.uk>","list_archive_url":null,"date":"2017-09-25T15:36:43","subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","submitter":{"id":59,"url":"http://patchwork.ozlabs.org/api/people/59/","name":"David Howells","email":"dhowells@redhat.com"},"content":"AKASHI Takahiro <takahiro.akashi@linaro.org> wrote:\n\n> > > -static struct kexec_file_ops *kexec_file_loaders[] = {\n> > > +struct kexec_file_ops *kexec_file_loaders[] = {\n> > >  \t&kexec_elf64_ops,\n> > > +\tNULL\n> > >  };\n\nconst?\n\nDavid","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"COeIJ7YE\"; dkim-atps=neutral","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dhowells@redhat.com"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y17WP3Wlrz9tXD\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 01:37:37 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwVRb-0000zx-BE; Mon, 25 Sep 2017 15:37:15 +0000","from mx1.redhat.com ([209.132.183.28])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwVRW-0000wH-Iz; Mon, 25 Sep 2017 15:37:12 +0000","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id E4B418764C;\n\tMon, 25 Sep 2017 15:36:48 +0000 (UTC)","from warthog.procyon.org.uk (ovpn-120-81.rdu2.redhat.com\n\t[10.10.120.81])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 1B8305D9C1;\n\tMon, 25 Sep 2017 15:36:43 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:Message-ID:Date:Content-ID:MIME-Version\n\t:Subject:To:References:In-Reply-To:From:Reply-To:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=0xmE7fbBJr43uaAoEb0wXh7iQvvrXr0Zm/QxrTr3+s0=;\n\tb=COeIJ7YElc3+ev\n\ttOP8sKV/OdHFmv/YMI22d1TJGj7YZKNOqDGMdCW/GzaCIQGVmmp7ACTCjTLCcvYPMnBq6nX9UY0M4\n\tSPIBnsmhm54wJxpwXERAtuHICdR5SyQyvXmlJLDfdcCFfdBPGT1U1TXKurJfwSFi6MsEYV3nyn+Ld\n\tf7j/RFO24rHyYGa3a7+yrv0U2KB7YKWL41EfvFmYP/mgDnX/XQ0gbVn9YaunnCPt3Eo1lY4NIvn45\n\tM0S+qKJsd0We/gdUEJwNmxXEByfazekt776hT+kIplHl9ul0YmcALcOOQe5EnvBu8n0rL/NnYPIyB\n\t2z156S7oyuS8FAe1z8WA==;","DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com E4B418764C","Organization":"Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley\n\tPlace, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United\n\tKingdom.\n\tRegistered in England and Wales under Company Registration No.\n\t3798903","From":"David Howells <dhowells@redhat.com>","In-Reply-To":"<20170922075807.GM17186@linaro.org>","References":"<20170922075807.GM17186@linaro.org>\n\t<20170915105932.25338-1-takahiro.akashi@linaro.org>\n\t<20170915105932.25338-4-takahiro.akashi@linaro.org>\n\t<20170921073516.GA6643@dhcp-128-65.nay.redhat.com>","To":"AKASHI Takahiro <takahiro.akashi@linaro.org>","Subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","MIME-Version":"1.0","Content-ID":"<1622.1506353803.1@warthog.procyon.org.uk>","Date":"Mon, 25 Sep 2017 16:36:43 +0100","Message-ID":"<1623.1506353803@warthog.procyon.org.uk>","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]); Mon, 25 Sep 2017 15:36:49 +0000 (UTC)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170925_083710_663113_EB23BEB2 ","X-CRM114-Status":"GOOD (  11.05  )","X-Spam-Score":"-6.9 (------)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-6.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/,\n\thigh trust [209.132.183.28 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-0.0 SPF_HELO_PASS          SPF: HELO matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"herbert@gondor.apana.org.au, bhe@redhat.com, ard.biesheuvel@linaro.org, \n\tcatalin.marinas@arm.com, will.deacon@arm.com,\n\tlinux-kernel@vger.kernel.org, \n\tkexec@lists.infradead.org, dhowells@redhat.com, arnd@arndb.de,\n\tlinux-arm-kernel@lists.infradead.org, mpe@ellerman.id.au,\n\tbauerman@linux.vnet.ibm.com, akpm@linux-foundation.org,\n\tDave Young <dyoung@redhat.com>, davem@davemloft.net, vgoyal@redhat.com","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1774908,"web_url":"http://patchwork.ozlabs.org/comment/1774908/","msgid":"<20170925181524.75sknpadahf5wcqa@dragonfly>","list_archive_url":null,"date":"2017-09-25T18:15:30","subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","submitter":{"id":61166,"url":"http://patchwork.ozlabs.org/api/people/61166/","name":"AKASHI Takahiro","email":"takahiro.akashi@linaro.org"},"content":"On Mon, Sep 25, 2017 at 04:03:13PM +0800, Dave Young wrote:\n> HI AKASHI,\n> On 09/22/17 at 04:58pm, AKASHI Takahiro wrote:\n> > Hi Dave,\n> > \n> [snip]\n> \n> > > >  /*\n> > > >   * Apply purgatory relocations.\n> > > >   *\n> > > > diff --git a/include/linux/kexec.h b/include/linux/kexec.h\n> > > > index dd056fab9e35..4a2b24d94e04 100644\n> > > > --- a/include/linux/kexec.h\n> > > > +++ b/include/linux/kexec.h\n> > > > @@ -134,6 +134,26 @@ struct kexec_file_ops {\n> > > >  #endif\n> > > >  };\n> > > >  \n> > > > +int kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > > > +\t\t\t     unsigned long buf_len);\n> > > > +void *kexec_kernel_image_load(struct kimage *image);\n> > > > +int kexec_kernel_post_load_cleanup(struct kimage *image);\n> > > > +int kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> > > > +\t\t\t    unsigned long buf_len);\n> > > > +\n> > > > +#ifndef arch_kexec_kernel_image_probe\n> > > > +#define arch_kexec_kernel_image_probe kexec_kernel_image_probe\n> > > > +#endif\n> > > > +#ifndef arch_kexec_kernel_image_load\n> > > > +#define arch_kexec_kernel_image_load kexec_kernel_image_load\n> > > > +#endif\n> > > > +#ifndef arch_kimage_file_post_load_cleanup\n> > > > +#define arch_kimage_file_post_load_cleanup kexec_kernel_post_load_cleanup\n> > > > +#endif\n> > > > +#ifndef arch_kexec_kernel_verify_sig\n> > > > +#define arch_kexec_kernel_verify_sig kexec_kernel_verify_sig\n> > > > +#endif\n> > > > +\n> > > >  /**\n> > > >   * struct kexec_buf - parameters for finding a place for a buffer in memory\n> > > >   * @image:\tkexec image in which memory to search.\n> > > > @@ -276,12 +296,6 @@ int crash_shrink_memory(unsigned long new_size);\n> > > >  size_t crash_get_memory_size(void);\n> > > >  void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);\n> > > >  \n> > > > -int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n> > > > -\t\t\t\t\t unsigned long buf_len);\n> > > > -void * __weak arch_kexec_kernel_image_load(struct kimage *image);\n> > > > -int __weak arch_kimage_file_post_load_cleanup(struct kimage *image);\n> > > > -int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,\n> > > > -\t\t\t\t\tunsigned long buf_len);\n> > > \n> > > I thought we can keep using the __weak function in common code and drop\n> > > the arch functions, no need the #ifndef arch_kexec_kernel_image_probe\n> > > and the function renaming stuff.  But I did not notice the powerpc\n> > > _probe function checks KEXEC_ON_CRASH, that should be checked earlier\n> > > and we can fail out early if not supported, but I have no idea\n> > > how to do it gracefully for now.\n> > > \n> > > Also for x86 _load function it cleanups image->arch.elf_headers, it can\n> > > not be dropped simply.\n> > \n> > Yeah, arm64 post_load_cleanup function also has some extra stuff.\n> > See my patch #7/8.\n> \n> But the x86 cleanup was dropped silently, can you add it in x86\n> post_load_cleanup as well?\n\nSure, I will do.\n\n> > \n> > > Consider the above two issues, maybe you can keep the powerpc\n> > > version of _probe() and x86 version of _load(), and still copy the common code\n> > > to kexec_file.c weak functions.\n> > \n> > It was exactly what I made before submitting v3, but I changed\n> > my mind a bit. My intension is to prevent the code being duplicated\n> > even though it has only a few lines of code.\n> > \n> > I agree that '#ifndef arch_kexec_kernel_image_probe' in kexec.h would be\n> > quite ugly, but similar usages can be spotted in the kernel source.\n> > \n> > That said if you don't like it at all, I defer to you.\n> \n> I understand your concern, maybe still use a weak function for \n> arch_kexec_kernel_image_*, and they call the kexec_kernel_image_* in\n> kexec_file.c common code.\n> \n> Like in general code:\n> \n> int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,\n>                                          unsigned long buf_len)\n> {\n> \treturn kexec_kernel_image_probe(image, buf, buf_len);\n\nas you suggested,\n        \"return _kexec_kernel_image_probe(...);\n\nwould be fine.\n\n-Takahiro AKASHI\n\n\n> }\n> \n> In architechture code it can add other code and call\n> kexec_kernel_image_*\n> \n> It looks a bit better than the #ifdef way. \n> \n> [snip]\n> \n> > \n> > Thanks,\n> > -Takahiro AKASHI\n> > \n> \n> Thanks\n> Dave","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"R4Z8+HsA\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"FbKIzuNd\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1C2Q25Ghz9tXC\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 04:16:14 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwXvP-0004sl-D2; Mon, 25 Sep 2017 18:16:11 +0000","from mail-pg0-x22a.google.com ([2607:f8b0:400e:c05::22a])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwXvK-0004ol-AS for linux-arm-kernel@lists.infradead.org;\n\tMon, 25 Sep 2017 18:16:08 +0000","by mail-pg0-x22a.google.com with SMTP id b11so4430464pgn.12\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tMon, 25 Sep 2017 11:15:43 -0700 (PDT)","from dragonfly ([70.35.39.2]) by smtp.googlemail.com with ESMTPSA\n\tid h82sm16444008pfd.148.2017.09.25.11.15.36\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tMon, 25 Sep 2017 11:15:41 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=Sf0+T3dfo3z7nMqr3AJl0zZwc5vBkNqhMYSYCzX8pVw=;\n\tb=R4Z8+HsAE05b3N\n\tOcp5uVpThpAxYfVKA35Ki+Y6gTNQM/MlPqGHIQHUOG5V1UQweSL2cHSFNCvAHlJP62XR5j/eySUHn\n\tVDesf7s15ZlI3q3kM3EJI7AkIbtbRnnVg+MsjYsr3DqpPxxO+oeKI2puBdicX8gChmRdjmWO1lrP8\n\tgTWUMG4BgH1bmbEnn8xh4XDKm8EfCDKGWIUWAbEwKANem0nekwmUb/oRWy3R7sEbFWPH3q8OUSIVj\n\t9L0XStxW1/0IXqcSz/KVdMfceaxsVz6DpHbrec1LY+Cnyk4gm7Y/UqUvx1F6p6IrKmtGtMHh4JoZC\n\tvOxscjy7vaODibPs4rSg==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=date:from:to:cc:subject:message-id:mail-followup-to:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=EcRpGVbgZAs3JIDcvVsaJDwvM0MlcrTt06HQHMZhGb0=;\n\tb=FbKIzuNdrb1Fgwa2D4xYI5/++hXZfufoYKmab6FCKKvimXMbEQzpbziwLiCGCg/0Be\n\tS+EGLjXrcNfM9AuVkw8VQr4oeN6bV7Uvqe0A/sn+ADRWMA62MqZG35qk1JdhCiyYOvzt\n\t3+FVdt6gp5wKpphGDOXnhRSUpfEhbuwW6jlKI="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id\n\t:mail-followup-to:references:mime-version:content-disposition\n\t:in-reply-to:user-agent;\n\tbh=EcRpGVbgZAs3JIDcvVsaJDwvM0MlcrTt06HQHMZhGb0=;\n\tb=f/rxSdz8U57wotvvj1z9u8yNPCEG2FJOsRdTh/QzEHbIYUH9oIrQL+HGzOuXekzNY0\n\toUC/ejzOW+lD67sE1XaDjMfI2eFKel5fKJ3gLZZTPtQeG7BtRZlNjQsJAC3MwjhOSjmu\n\t7khYeDA3MYiipRVDoDAOsRqRt2GEItGPcaN2PHubEO/oKvTiRu0PFbNFy0L8OTAOAh8Z\n\t7K9ag3ZZ+Lrhy5bcS6j6E7nOdXoveoNu34Dp74ldXLTXnrfJyv9AT4nan35NC9vc8yet\n\tQewVPwi2Zwpe3eX9t1888ZJdrZlwdfpE6GrhmhEgzfa2PzoAFR2xOlu+aQaRlVWV8bIJ\n\tuGyg==","X-Gm-Message-State":"AHPjjUiRStMh8VeyxSf/4Lb9KxKgaeyrr6ql5MdPXf7mbl75HGKy0A+x\n\tyXRx9ZsKMwbRV8R4f0b4sMJMtw==","X-Google-Smtp-Source":"AOwi7QCXqIeCQGJOZbO1PgF2/JHE3/mrMbKhCQJO2s4lIibryld/5cP6DE1mAeTHz9RJpMw4KsQeWg==","X-Received":"by 10.99.67.193 with SMTP id q184mr8712476pga.210.1506363342642; \n\tMon, 25 Sep 2017 11:15:42 -0700 (PDT)","Date":"Mon, 25 Sep 2017 11:15:30 -0700","From":"AKASHI Takahiro <takahiro.akashi@linaro.org>","To":"Dave Young <dyoung@redhat.com>","Subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","Message-ID":"<20170925181524.75sknpadahf5wcqa@dragonfly>","Mail-Followup-To":"AKASHI Takahiro <takahiro.akashi@linaro.org>,\n\tDave Young <dyoung@redhat.com>, catalin.marinas@arm.com,\n\twill.deacon@arm.com, bauerman@linux.vnet.ibm.com,\n\tdhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, \n\tdavem@davemloft.net, akpm@linux-foundation.org, mpe@ellerman.id.au,\n\tbhe@redhat.com, arnd@arndb.de, ard.biesheuvel@linaro.org,\n\tkexec@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org","References":"<20170915105932.25338-1-takahiro.akashi@linaro.org>\n\t<20170915105932.25338-4-takahiro.akashi@linaro.org>\n\t<20170921073516.GA6643@dhcp-128-65.nay.redhat.com>\n\t<20170922075807.GM17186@linaro.org>\n\t<20170925080313.GA5970@dhcp-128-65.nay.redhat.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20170925080313.GA5970@dhcp-128-65.nay.redhat.com>","User-Agent":"NeoMutt/20170113 (1.7.2)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170925_111606_489489_F39BB971 ","X-CRM114-Status":"GOOD (  27.98  )","X-Spam-Score":"-2.0 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2607:f8b0:400e:c05:0:0:0:22a listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"herbert@gondor.apana.org.au, bhe@redhat.com, ard.biesheuvel@linaro.org, \n\tcatalin.marinas@arm.com, will.deacon@arm.com,\n\tlinux-kernel@vger.kernel.org, \n\tkexec@lists.infradead.org, dhowells@redhat.com, arnd@arndb.de,\n\tlinux-arm-kernel@lists.infradead.org, mpe@ellerman.id.au,\n\tbauerman@linux.vnet.ibm.com, akpm@linux-foundation.org,\n\tdavem@davemloft.net, vgoyal@redhat.com","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1774909,"web_url":"http://patchwork.ozlabs.org/comment/1774909/","msgid":"<20170925181806.kd567i4xpquueqw5@dragonfly>","list_archive_url":null,"date":"2017-09-25T18:18:08","subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","submitter":{"id":61166,"url":"http://patchwork.ozlabs.org/api/people/61166/","name":"AKASHI Takahiro","email":"takahiro.akashi@linaro.org"},"content":"On Mon, Sep 25, 2017 at 04:36:43PM +0100, David Howells wrote:\n> AKASHI Takahiro <takahiro.akashi@linaro.org> wrote:\n> \n> > > > -static struct kexec_file_ops *kexec_file_loaders[] = {\n> > > > +struct kexec_file_ops *kexec_file_loaders[] = {\n> > > >  \t&kexec_elf64_ops,\n> > > > +\tNULL\n> > > >  };\n> \n> const?\n\nYes, it makes sense.\n\n-Takahiro AKASHI\n\n> \n> David","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"QoyXjy0a\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"Jtb3IMGk\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1C5S6fjzz9t5c\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 04:18:52 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwXxt-0005ar-Ts; Mon, 25 Sep 2017 18:18:45 +0000","from mail-pg0-x233.google.com ([2607:f8b0:400e:c05::233])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwXxo-0005V9-Gk for linux-arm-kernel@lists.infradead.org;\n\tMon, 25 Sep 2017 18:18:42 +0000","by mail-pg0-x233.google.com with SMTP id b11so4434748pgn.12\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tMon, 25 Sep 2017 11:18:19 -0700 (PDT)","from dragonfly ([70.35.39.2])\n\tby smtp.googlemail.com with ESMTPSA id\n\tt19sm12688966pfa.73.2017.09.25.11.18.12\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tMon, 25 Sep 2017 11:18:17 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=k8crUT0nP4ITiye0//HUR4qxQzx6bpSgf3rdJUaH6pQ=;\n\tb=QoyXjy0a+cCPmO\n\t4tL/PdAxUXCnI/NIXOlBDjCfGjqu6FEOt/F/2FVH60RJmP+pFiCbsRn4TjWDgNAYYwGavAprqayOC\n\t5VFM/BjXKJfnqBrVHXdvdi6m2HkRlqsG5icEgTUOiUWxjG4A2U2yiG2OCabU2C2ZM6VrgMSKV9+mR\n\tijWv2bk833uWJwbDxIkey8Pgw9CJ+hMbqPRbT2tOX68HSgNWrUO3a/Tkqx/2O0EB4zzhqMr3Txl6C\n\tMDe8ul/ftZ2obEAeewXUYWQt0C1+RIIrWTKl/x5arLiQzT3mYen7HtK8MJ+R3qlm2TwsOL6Tksm7x\n\tgie1vPixuN9mIfUjdVMg==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=date:from:to:cc:subject:message-id:mail-followup-to:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=m/ebOyeRTenQODPppwChIFqIWakNo7eY7iGR55zOMIY=;\n\tb=Jtb3IMGkzsSIdIPWeJrSW6cUOCb2DoAM6nMXJOjbth4pZCbA6cTSTu+8H/qXIlAopv\n\t3Cj/ARuO5G0dNdtfvQzqJ1cdSBYP32uE+6Fuk/mfGuDwAYXPjXI/Nl+MBAQZWNTBPGZl\n\tko4F05HtGQI6PNPDJ/mCT0xt76KJcCZtSuNTk="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id\n\t:mail-followup-to:references:mime-version:content-disposition\n\t:in-reply-to:user-agent;\n\tbh=m/ebOyeRTenQODPppwChIFqIWakNo7eY7iGR55zOMIY=;\n\tb=n8s9ySZbYKBVzpSB4CmxKdLJOSKZbofr6Vkb09ZvkJ5mreleFVeTzQxNnhwKiOX24w\n\txvQHiiPhTMiGiTtujE9BuXsdlUrqUULCfqI8in8w6fhQzS4ryeGxT9qHLbYAnLVI+2uN\n\tFGFuEMzHXdTeSezMaPGIwrREelOXYTxIZUyJnNuDjr2UzFi6VhewnqQHhDOUJ36qpRkf\n\tnXTs0Y2TObdl9ei4D6C9PP1sJtTHjmUMH8ong/DzW+aUxSYN9LgMwSnqD1nAO/1vbmxY\n\t88Xf+5LuOJoXLuPMZQwML17LLfP5x7AOssY8XKbJpyHmc3yaLfx9gERvrUGwstJDvqxC\n\t8gaw==","X-Gm-Message-State":"AHPjjUhMI12SXSl6Rsho0tPSW0GTItaEFTKOK0VQt9PSsZDYZ+dv9g15\n\tJBHO27M830z38x+GpgBKb1KwtQ==","X-Google-Smtp-Source":"AOwi7QAbOGVQsPGfB0POk7LshjS+6dxkfxBibqfR7afLcr29kN3EST4gA5Xx6GMfaXTPW0faewMKdg==","X-Received":"by 10.99.133.66 with SMTP id u63mr8693331pgd.426.1506363499330; \n\tMon, 25 Sep 2017 11:18:19 -0700 (PDT)","Date":"Mon, 25 Sep 2017 11:18:08 -0700","From":"AKASHI Takahiro <takahiro.akashi@linaro.org>","To":"David Howells <dhowells@redhat.com>","Subject":"Re: [PATCH v3 03/10] kexec_file: factor out arch_kexec_kernel_*()\n\tfrom x86, powerpc","Message-ID":"<20170925181806.kd567i4xpquueqw5@dragonfly>","Mail-Followup-To":"AKASHI Takahiro <takahiro.akashi@linaro.org>,\n\tDavid Howells <dhowells@redhat.com>, Dave Young <dyoung@redhat.com>, \n\tcatalin.marinas@arm.com, will.deacon@arm.com,\n\tbauerman@linux.vnet.ibm.com, vgoyal@redhat.com,\n\therbert@gondor.apana.org.au, davem@davemloft.net,\n\takpm@linux-foundation.org, mpe@ellerman.id.au, bhe@redhat.com,\n\tarnd@arndb.de, ard.biesheuvel@linaro.org, kexec@lists.infradead.org, \n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org","References":"<20170922075807.GM17186@linaro.org>\n\t<20170915105932.25338-1-takahiro.akashi@linaro.org>\n\t<20170915105932.25338-4-takahiro.akashi@linaro.org>\n\t<20170921073516.GA6643@dhcp-128-65.nay.redhat.com>\n\t<1623.1506353803@warthog.procyon.org.uk>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<1623.1506353803@warthog.procyon.org.uk>","User-Agent":"NeoMutt/20170113 (1.7.2)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170925_111840_657689_23F285EC ","X-CRM114-Status":"UNSURE (   9.70  )","X-CRM114-Notice":"Please train this message.","X-Spam-Score":"-2.0 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2607:f8b0:400e:c05:0:0:0:233 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"herbert@gondor.apana.org.au, bhe@redhat.com, ard.biesheuvel@linaro.org, \n\tcatalin.marinas@arm.com, will.deacon@arm.com,\n\tlinux-kernel@vger.kernel.org, kexec@lists.infradead.org, arnd@arndb.de,\n\tlinux-arm-kernel@lists.infradead.org, \n\tmpe@ellerman.id.au, bauerman@linux.vnet.ibm.com,\n\takpm@linux-foundation.org, \n\tDave Young <dyoung@redhat.com>, davem@davemloft.net, vgoyal@redhat.com","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}}]