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=-16.0 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 E5169C433E0 for ; Wed, 10 Feb 2021 18:02: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 9359964ED0 for ; Wed, 10 Feb 2021 18:02:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9359964ED0 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=gMZEKChqkDHUo2P1p3sqRvkZ93lmtsL7izQ6WsQFa4M=; b=zEEkAyoipQ0vgkPlAn8AZ6B5S HqkF4QsDK0nUJ+vcC3zLYp6139p/Na4/rZLe9+pubX6m5IzD+8lFmnVTNQOTcgmuKGe6VaFj2JOg2 tLMqLOu18we8oMrZBHowzmkOPiWfOvb38/BhPmbEaomrsYMjB0kTI9P19UQFfmnqlVNG1gRGzOW9D fZd0iXySDdmCWshZ8MbPiDoGTTWJxOXRxse8OijrdsjFNVjS7kXWTI+lssULn3rsDMTVt4uwJzgyd yGh8cKHfB7EvkTGmzWM4A9W2AeflbfyiMUOOXyVMuGcNsyPAvhH3qAkeHPmNMuJLZSR5N1UwG7ILO enT01yh6w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9tnK-0001R6-Mk; Wed, 10 Feb 2021 18:00:54 +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 1l9tnH-0001QK-6q for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2021 18:00:52 +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 A95AE2078945; Wed, 10 Feb 2021 10:00:49 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A95AE2078945 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1612980050; bh=R9xpAEULLlRloLEZ3aDp0NwjBNcG/EJw+NYFrjbxovk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=iLPpwBjLdWwIRAhzbc9LVKfkXHca9jl+5BYxYtIL/Nw2utUjaWoz3J/q4Khaingxp 9g+ioSTJJfSpxELua3hENK89gsOkGTSQniJuV52oPiEB0xSN23m+EYsm2a7+KTq4dr 1Fl6I+Swrn54OePYZFnQpIO72FEz7BkMY+hiVBu0= Subject: Re: [PATCH v17 05/10] powerpc: Move ima buffer fields to struct kimage To: Rob Herring References: <20210209182200.30606-1-nramas@linux.microsoft.com> <20210209182200.30606-6-nramas@linux.microsoft.com> <20210210172018.GA2361245@robh.at.kernel.org> From: Lakshmi Ramasubramanian Message-ID: Date: Wed, 10 Feb 2021 10:00:49 -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: <20210210172018.GA2361245@robh.at.kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210210_130051_399767_F19F0517 X-CRM114-Status: GOOD ( 22.16 ) 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, tao.li@vivo.com, zohar@linux.ibm.com, paulus@samba.org, vincenzo.frascino@arm.com, frowand.list@gmail.com, sashal@kernel.org, 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, gregkh@linuxfoundation.org, joe@perches.com, linux-integrity@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, bauerman@linux.ibm.com 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 2/10/21 9:20 AM, Rob Herring wrote: > On Tue, Feb 09, 2021 at 10:21:55AM -0800, Lakshmi Ramasubramanian wrote: >> The fields ima_buffer_addr and ima_buffer_size in "struct kimage_arch" >> for powerpc are used to carry forward the IMA measurement list across >> kexec system call. These fields are not architecture specific, but are >> currently limited to powerpc. >> >> arch_ima_add_kexec_buffer() defined in "arch/powerpc/kexec/ima.c" >> sets ima_buffer_addr and ima_buffer_size for the kexec system call. >> This function does not have architecture specific code, but is >> currently limited to powerpc. >> >> Move ima_buffer_addr and ima_buffer_size to "struct kimage". >> Rename arch_ima_add_kexec_buffer() to of_ima_add_kexec_buffer() >> and move it in drivers/of/kexec.c. >> >> Co-developed-by: Prakhar Srivastava >> Signed-off-by: Prakhar Srivastava >> Signed-off-by: Lakshmi Ramasubramanian >> Suggested-by: Will Deacon >> --- >> arch/powerpc/include/asm/ima.h | 3 --- >> arch/powerpc/include/asm/kexec.h | 5 ----- >> arch/powerpc/kexec/ima.c | 29 ++++++----------------------- >> drivers/of/kexec.c | 23 +++++++++++++++++++++++ >> include/linux/kexec.h | 3 +++ >> include/linux/of.h | 5 +++++ >> security/integrity/ima/ima_kexec.c | 3 ++- >> 7 files changed, 39 insertions(+), 32 deletions(-) >> diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c >> index 469e09613cdd..9f33d215b9f2 100644 >> --- a/drivers/of/kexec.c >> +++ b/drivers/of/kexec.c >> @@ -63,6 +63,29 @@ static int fdt_find_and_del_mem_rsv(void *fdt, unsigned long start, unsigned lon >> return -ENOENT; >> } >> >> +#ifdef CONFIG_IMA_KEXEC >> +/** >> + * of_ima_add_kexec_buffer - Add IMA buffer for next kernel >> + * >> + * @image: kimage struct to set IMA buffer data >> + * @load_addr: Starting address where IMA buffer is loaded at >> + * @size: Number of bytes in the IMA buffer >> + * >> + * Use this function to pass on the IMA buffer information to >> + * the next kernel across kexec system call. >> + * >> + * Return: 0 on success, negative errno on error. >> + */ >> +int of_ima_add_kexec_buffer(struct kimage *image, >> + unsigned long load_addr, size_t size) >> +{ >> + image->ima_buffer_addr = load_addr; >> + image->ima_buffer_size = size; >> + > > There's nothing DT specific about this function, so this is the wrong > place for it. I would just remove it and directly set the members. Will do. -lakshmi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel