From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B6C2C4361B for ; Sat, 12 Dec 2020 05:48:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C0D02313B for ; Sat, 12 Dec 2020 05:48:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C0D02313B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qaKjWuOBJom1z0yyP2ELQQEXsBUB6C29HLTC27Lpi9w=; b=Scqp67Q1eVr8un1nchp44ImI/ eFqUfF2TWvNh8mWuNA25HQJPwxzZ2EbUKhFBI3sSSAUdWHDWU9nauYfeVl4YZsknxr6MdZodxH4/B uJpbqAmPl0mp8FHAuHj2jrmA2Sbo/FJ6k32sZGUoDKbGR8EK5cKtgRLyrhqFAIgn2tnnxJ6gjTpHv ldVpyNQ6ZwSSMKqDw/jSgK0EdnbkXGx5U2Z6VYJUAx+P7dJzsW62ehMzfoGVdwFzR/imbzhVLV8am RKgexsS44tSkjBIZ1/0SQyTyzf75h49Y0JfLeMhy2kS0UqXqY3f0NB9lk1uQnCS/aSROPlgGlwvGN o3+2wjRbQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1knxjl-0002O2-EY; Sat, 12 Dec 2020 05:46:33 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1knxji-0002Nf-Ll for linux-arm-kernel@lists.infradead.org; Sat, 12 Dec 2020 05:46:31 +0000 Received: from [192.168.0.104] (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id 195E420B717A; Fri, 11 Dec 2020 21:46:28 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 195E420B717A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1607751988; bh=V31bOChnr8lat3WNyoEvadwinYKZ3Pm3p29JNFXDyvc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=m5okTUXaQpr9BxPcQD+AKL1HBqahIUQGwQy5M0QXxtaObm3u3cP5aGmBF8SCtyZD8 bhl8wETUf6c/N0ncRmptKshSMM9lvyRPf4QzEyml8m4gB/CXc0Op/ss2tR6CZyTbJs X2wjf4djHP4LKy9fbUokPuvcVqOMy4Nho/T8tqMk= Subject: Re: [RFC PATCH 2/4] of: Add a common kexec FDT setup function To: Thiago Jung Bauermann References: <20201211221006.1052453-1-robh@kernel.org> <20201211221006.1052453-3-robh@kernel.org> <6934c005-d848-314d-cfee-23f2273c119d@linux.microsoft.com> <87360bahup.fsf@manicouagan.localdomain> From: Lakshmi Ramasubramanian Message-ID: <49579baf-6159-0eac-fa36-6fdb618c2320@linux.microsoft.com> Date: Fri, 11 Dec 2020 21:46:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87360bahup.fsf@manicouagan.localdomain> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201212_004631_030642_7B991869 X-CRM114-Status: GOOD ( 20.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, benh@kernel.crashing.org, bhsharma@redhat.com, tao.li@vivo.com, zohar@linux.ibm.com, paulus@samba.org, vincenzo.frascino@arm.com, frowand.list@gmail.com, sashal@kernel.org, Rob Herring , mpe@ellerman.id.au, masahiroy@kernel.org, jmorris@namei.org, takahiro.akashi@linaro.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, serge@hallyn.com, devicetree@vger.kernel.org, pasha.tatashin@soleen.com, will@kernel.org, prsriva@linux.microsoft.com, hsinyi@chromium.org, allison@lohutok.net, christophe.leroy@c-s.fr, mbrugger@suse.com, balajib@linux.microsoft.com, dmitry.kasatkin@gmail.com, linux-kernel@vger.kernel.org, james.morse@arm.com, linux-integrity@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 12/11/20 6:17 PM, Thiago Jung Bauermann wrote: > > Lakshmi Ramasubramanian writes: > >> On 12/11/20 2:10 PM, Rob Herring wrote: >> >> Hi Rob, >> >>> Both arm64 and powerpc do essentially the same FDT /chosen setup for >>> kexec. We can simply combine everything each arch does. The differences >>> are either omissions that arm64 should have or additional properties >>> that will be ignored. >>> The differences relative to the arm64 version: >>> - If /chosen doesn't exist, it will be created (should never happen). >>> - Any old dtb and initrd reserved memory will be released. >>> - The new initrd and elfcorehdr are marked reserved. >>> - "linux,booted-from-kexec" is set. >>> The differences relative to the powerpc version: >>> - "kaslr-seed" and "rng-seed" may be set. >>> - "linux,elfcorehdr" is set. >>> - Any existing "linux,usable-memory-range" is removed. >>> Signed-off-by: Rob Herring >>> --- >>> This could be taken a step further and do the allocation of the new >>> FDT. The difference is arm64 uses vmalloc and powerpc uses kmalloc. The >>> arm64 version also retries with a bigger allocation. That seems >>> unnecessary. >>> --- >>> drivers/of/Makefile | 1 + >>> drivers/of/kexec.c | 228 ++++++++++++++++++++++++++++++++++++++++++++ >>> include/linux/of.h | 5 + >>> 3 files changed, 234 insertions(+) >>> create mode 100644 drivers/of/kexec.c >>> diff --git a/drivers/of/Makefile b/drivers/of/Makefile >>> index 6e1e5212f058..8ce11955afde 100644 >>> --- a/drivers/of/Makefile >>> +++ b/drivers/of/Makefile >>> @@ -13,5 +13,6 @@ obj-$(CONFIG_OF_RESERVED_MEM) += of_reserved_mem.o >>> obj-$(CONFIG_OF_RESOLVE) += resolver.o >>> obj-$(CONFIG_OF_OVERLAY) += overlay.o >>> obj-$(CONFIG_OF_NUMA) += of_numa.o >>> +obj-$(CONFIG_KEXEC_FILE) += kexec.o >> >> For the functions moved from powerpc & arm64 to "drivers/of/kexec.c" in this >> patch, compiling kexec.c when CONFIG_KEXEC_FILE is enabled is fine. But when >> more functions (such as remove_ima_buffer()) are moved to this file, Makefile >> needs to be updated for other ima kexec related CONFIGs. > > IMA kexec is only available if CONFIG_KEXEC_FILE is enabled, so I don't > understand what problem you are seeing. > delete_fdt_mem_rsv() and setup_fdt() functions are defined when CONFIG_KEXEC_FILE is enabled. So there is no problem with this patch as such. I was thinking when other arch independent functions such as do_get_kexec_buffer() and remove_ima_buffer() are moved to "drivers/of/kexec.c", they need to be defined only when CONFIG_HAVE_IMA_KEXEC is enabled. If CONFIG_HAVE_IMA_KEXEC is enabled, CONFIG_KEXEC_FILE is also enabled. So there shouldn't be a problem moving those functions to "drivers/of/kexec.c". You are right Thiago. Thanks. -lakshmi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel