Received: by 10.223.185.116 with SMTP id b49csp433667wrg; Fri, 23 Feb 2018 00:50:42 -0800 (PST) X-Google-Smtp-Source: AH8x227IlRZzrmIRsdEm7u+WYFYo42lf01xAMXVuKqfmGtr28JH/J4SaemaVR+sV1s6WUsmHqMaQ X-Received: by 10.98.130.72 with SMTP id w69mr1026048pfd.69.1519375842402; Fri, 23 Feb 2018 00:50:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519375842; cv=none; d=google.com; s=arc-20160816; b=PhqkSZOjx+Tf7tQ0iN2ZW8OkKhCOW/HfnjbLK2rk8UMNh3QELAN3Vh7G8BGPMVwXte A9Gje2q+l2yQ7st8O3XE6QFtG3j3urvXm72H4+0jOBvck4BYNIMTTkbnK2tLb2wcX10m yq8WxA+MYAHrcNLZ1t0G6BjIzgLKqqHbt68c0rOrWgaLlFCTsQS0F1tPdHKGG8Xkq3kZ SExibo8vgY5JW0a8Gn46vTxT/C5xbn88+RCj/ptqw0/YzaNMI4zmiBNkFeE97VcZqYrK sYOfU9FwjZT0Emh8XZdqS+d6P1dOTuGYW91osRcYX43AC4hOOn3yb8vaAQnq7y9CMU/l iqGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=9IF/G6BRM40fTRGvaXLWGkv1IzgBO3kVKdb5jRueSfI=; b=EIhmLZ0kKva+JdbvwllvO6DUMtIyJtEWpHOesn9RHoUoSVgNP1k9JB75Js5QDWmeBg DNvmnvOectpld/RognnZa7N78t5HM949B1RE6NcXFSP1UWQ4exYgo1zBmyCnDykQo6Rw KazDp/AkAz5zBiABIyxyqMgQJEO9MpYq8KKzKZZI9Ak+UELk6EbqmJuvgtDAtM1pOowm VgDt5kwRX+fqf+mBbNvrrhdJsf4W583PD6JrS+FVQdeaTUrffpya0PmBEzZS/f1EeCSl f9Dz8t2qdRmHSvsjt1t/aLKD9Ie0STTAHHEc/gCFhZmjuBVrK43PU6mhl6nD8gnrVNwF B1tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4si1238908pgc.586.2018.02.23.00.50.25; Fri, 23 Feb 2018 00:50:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751366AbeBWItp (ORCPT + 99 others); Fri, 23 Feb 2018 03:49:45 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42812 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750879AbeBWIto (ORCPT ); Fri, 23 Feb 2018 03:49:44 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0BF78D6BE; Fri, 23 Feb 2018 08:49:43 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-55.pek2.redhat.com [10.72.12.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF87D2166BAE; Fri, 23 Feb 2018 08:49:37 +0000 (UTC) Date: Fri, 23 Feb 2018 16:49:34 +0800 From: Dave Young To: AKASHI Takahiro 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, julien.thierry@arm.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 02/13] kexec_file: make an use of purgatory optional Message-ID: <20180223084934.GB4433@dhcp-128-65.nay.redhat.com> References: <20180222111732.23051-1-takahiro.akashi@linaro.org> <20180222111732.23051-3-takahiro.akashi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180222111732.23051-3-takahiro.akashi@linaro.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 23 Feb 2018 08:49:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 23 Feb 2018 08:49:44 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dyoung@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi AKASHI, On 02/22/18 at 08:17pm, AKASHI Takahiro wrote: > On arm64, no trampline code between old kernel and new kernel will be > required in kexec_file implementation. This patch introduces a new > configuration, ARCH_HAS_KEXEC_PURGATORY, and allows related code to be > compiled in only if necessary. Here also need the explanation about why no purgatory is needed, it would be required for kexec if no strong reason. > > Signed-off-by: AKASHI Takahiro > Cc: Dave Young > Cc: Vivek Goyal > Cc: Baoquan He > --- > arch/powerpc/Kconfig | 3 +++ > arch/x86/Kconfig | 3 +++ > kernel/kexec_file.c | 6 ++++++ > 3 files changed, 12 insertions(+) > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index 73ce5dd07642..c32a181a7cbb 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -552,6 +552,9 @@ config KEXEC_FILE > for kernel and initramfs as opposed to a list of segments as is the > case for the older kexec call. > > +config ARCH_HAS_KEXEC_PURGATORY > + def_bool KEXEC_FILE > + > config RELOCATABLE > bool "Build a relocatable kernel" > depends on PPC64 || (FLATMEM && (44x || FSL_BOOKE)) > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index c1236b187824..f031c3efe47e 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -2019,6 +2019,9 @@ config KEXEC_FILE > for kernel and initramfs as opposed to list of segments as > accepted by previous system call. > > +config ARCH_HAS_KEXEC_PURGATORY > + def_bool KEXEC_FILE > + > config KEXEC_VERIFY_SIG > bool "Verify kernel signature during kexec_file_load() syscall" > depends on KEXEC_FILE > diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c > index e5bcd94c1efb..990adae52151 100644 > --- a/kernel/kexec_file.c > +++ b/kernel/kexec_file.c > @@ -26,7 +26,11 @@ > #include > #include "kexec_internal.h" > > +#ifdef CONFIG_ARCH_HAS_KEXEC_PURGATORY > static int kexec_calculate_store_digests(struct kimage *image); > +#else > +static int kexec_calculate_store_digests(struct kimage *image) { return 0; }; > +#endif > > /* Architectures can provide this probe function */ > int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf, > @@ -520,6 +524,7 @@ int kexec_add_buffer(struct kexec_buf *kbuf) > return 0; > } > > +#ifdef CONFIG_ARCH_HAS_KEXEC_PURGATORY > /* Calculate and store the digest of segments */ > static int kexec_calculate_store_digests(struct kimage *image) > { > @@ -1022,3 +1027,4 @@ int kexec_purgatory_get_set_symbol(struct kimage *image, const char *name, > > return 0; > } > +#endif /* CONFIG_ARCH_HAS_KEXEC_PURGATORY */ > -- > 2.16.2 > Thanks Dave