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=-14.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL autolearn=no 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 E7E2CC4361B for ; Thu, 17 Dec 2020 22:12:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB3FC23407 for ; Thu, 17 Dec 2020 22:12:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731867AbgLQWL4 (ORCPT ); Thu, 17 Dec 2020 17:11:56 -0500 Received: from linux.microsoft.com ([13.77.154.182]:34500 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726993AbgLQWLz (ORCPT ); Thu, 17 Dec 2020 17:11:55 -0500 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 E503220B717A; Thu, 17 Dec 2020 14:11:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E503220B717A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1608243074; bh=QSosWZwtVMTcMn62nBnRz7ClBx5R8L8Yz9ALkNCQps8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=iB98ytkLLq7AgvZAquE6qTkzmUDb+o+31aedBLPvq1Lmn/k0Com6XleZhRApsg7C1 ayIyKcrnJ/wTtkBYe/dMGz5HE7ODovuUGlX9iIqySfXrwGcwnXn//yeZFpd4DEijMZ Z1l2dVHjQXDjA0x9nUmy4J90J0ElUAKTEwzXT8Vk= Subject: Re: [PATCH v12 2/4] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c To: Rob Herring Cc: Mimi Zohar , Thiago Jung Bauermann , "AKASHI, Takahiro" , Greg Kroah-Hartman , Will Deacon , Catalin Marinas , Michael Ellerman , James Morse , Sasha Levin , Benjamin Herrenschmidt , Paul Mackerras , Frank Rowand , vincenzo.frascino@arm.com, Mark Rutland , dmitry.kasatkin@gmail.com, James Morris , "Serge E. Hallyn" , Pavel Tatashin , Allison Randal , Masahiro Yamada , Bhupesh Sharma , Matthias Brugger , Hsin-Yi Wang , tao.li@vivo.com, Christophe Leroy , Prakhar Srivastava , balajib@linux.microsoft.com, linux-integrity@vger.kernel.org, "linux-kernel@vger.kernel.org" , linux-arm-kernel , devicetree@vger.kernel.org References: <20201217173708.6940-1-nramas@linux.microsoft.com> <20201217173708.6940-3-nramas@linux.microsoft.com> <20201217200510.GA105447@robh.at.kernel.org> <0b17fbee-cfe9-8cb2-01d1-02b6a61a14f5@linux.microsoft.com> From: Lakshmi Ramasubramanian Message-ID: Date: Thu, 17 Dec 2020 14:11:13 -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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/17/20 2:01 PM, Rob Herring wrote: > On Thu, Dec 17, 2020 at 2:52 PM Lakshmi Ramasubramanian > wrote: >> >> On 12/17/20 12:05 PM, Rob Herring wrote: >>> On Thu, Dec 17, 2020 at 09:37:06AM -0800, Lakshmi Ramasubramanian wrote: >>>> The functions defined in "arch/powerpc/kexec/ima.c" handle setting up >>>> and freeing the resources required to carry over the IMA measurement >>>> list from the current kernel to the next kernel across kexec system call. >>>> These functions do not have architecture specific code, but are >>>> currently limited to powerpc. > > [...] > >>>> +#ifdef CONFIG_IMA_KEXEC >>>> +/** >>>> + * arch_ima_add_kexec_buffer - do arch-specific steps to add the IMA buffer >>>> + * >>>> + * @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 >>>> + * >>>> + * Architectures should use this function to pass on the IMA buffer >>>> + * information to the next kernel. >>>> + * >>>> + * Return: 0 on success, negative errno on error. >>>> + */ >>>> +int arch_ima_add_kexec_buffer(struct kimage *image, unsigned long load_addr, >>>> + size_t size) >>> >>> This should be a static inline in asm/kexec.h. >> >> arch_ima_add_kexec_buffer() is identical for powerpc and arm64. >> Would it be better to "static inline" this function in "of.h" instead of >> duplicating it in "asm/kexec.h" for powerpc and arm64? > > No, think about what it is specific to and place it there. It has > nothing to do with DT really. All it is is a wrapper to access the > struct members in kimage_arch. So it belongs where they are declared. > Now perhaps ima_buffer_addr and ima_buffer_size shouldn't be arch > specific, but that's a separate issue. > okay - I'll move arch_ima_add_kexec_buffer() to asm/kexec.h Please let me know if you have any other comments on the patches. If you are done reviewing, I'll post the updated patches shortly. Thanks for reviewing the changes. -lakshmi