From: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
To: Rob Herring <robh@kernel.org>
Cc: Mimi Zohar <zohar@linux.ibm.com>,
Thiago Jung Bauermann <bauerman@linux.ibm.com>,
"AKASHI, Takahiro" <takahiro.akashi@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Will Deacon <will@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
James Morse <james.morse@arm.com>,
Sasha Levin <sashal@kernel.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Frank Rowand <frowand.list@gmail.com>,
vincenzo.frascino@arm.com, Mark Rutland <mark.rutland@arm.com>,
dmitry.kasatkin@gmail.com, James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
Pavel Tatashin <pasha.tatashin@soleen.com>,
Allison Randal <allison@lohutok.net>,
Masahiro Yamada <masahiroy@kernel.org>,
Bhupesh Sharma <bhsharma@redhat.com>,
Matthias Brugger <mbrugger@suse.com>,
Hsin-Yi Wang <hsinyi@chromium.org>,
tao.li@vivo.com, Christophe Leroy <christophe.leroy@c-s.fr>,
Prakhar Srivastava <prsriva@linux.microsoft.com>,
balajib@linux.microsoft.com, linux-integrity@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
devicetree@vger.kernel.org
Subject: Re: [PATCH v12 2/4] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c
Date: Thu, 17 Dec 2020 22:25:33 -0800 [thread overview]
Message-ID: <5dda6968-ca14-1695-3058-7c12653521ba@linux.microsoft.com> (raw)
In-Reply-To: <CAL_Jsq+-HOkxtxOO=zyRbDuGVNZoMy589qoVANciNionsdsGCw@mail.gmail.com>
On 12/17/20 2:01 PM, Rob Herring wrote:
>
> [...]
>
>>>> +#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.
>
Since "struct kimage" definition is not available in "asm/kexec.h",
defining arch_ima_add_kexec_buffer() in this header file results in the
following build error:
./arch/powerpc/include/asm/kexec.h: In function 'arch_ima_add_kexec_buffer':
./arch/powerpc/include/asm/kexec.h:139:7: error: 'struct kimage' has no
member named 'arch'
139 | image->arch.ima_buffer_addr = load_addr;
I think it would be appropriate to make arch_ima_add_kexec_buffer() a
static inline function in "security/integrity/ima/ima_kexec.c" - the
only file where this function is used.
This will also enable sharing this function for powerpc and arm64
architectures.
thanks,
-lakshmi
next prev parent reply other threads:[~2020-12-18 6:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-17 17:37 [PATCH v12 0/4] Carry forward IMA measurement log on kexec on ARM64 Lakshmi Ramasubramanian
2020-12-17 17:37 ` [PATCH v12 1/4] powerpc: Use fdt_appendprop_addrrange() to add ima buffer to FDT Lakshmi Ramasubramanian
2020-12-17 18:29 ` Lakshmi Ramasubramanian
2020-12-17 17:37 ` [PATCH v12 2/4] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c Lakshmi Ramasubramanian
2020-12-17 18:30 ` Lakshmi Ramasubramanian
2020-12-17 20:05 ` Rob Herring
2020-12-17 20:52 ` Lakshmi Ramasubramanian
2020-12-17 22:01 ` Rob Herring
2020-12-17 22:11 ` Lakshmi Ramasubramanian
2020-12-18 6:25 ` Lakshmi Ramasubramanian [this message]
2020-12-18 14:03 ` Rob Herring
2020-12-17 17:37 ` [PATCH v12 3/4] arm64: Free DTB buffer if fdt_open_into() fails Lakshmi Ramasubramanian
2020-12-17 18:30 ` Lakshmi Ramasubramanian
2020-12-17 17:37 ` [PATCH v12 4/4] arm64: Add IMA log information in kimage used for kexec Lakshmi Ramasubramanian
2020-12-17 18:31 ` Lakshmi Ramasubramanian
2020-12-17 18:12 ` [PATCH v12 0/4] Carry forward IMA measurement log on kexec on ARM64 Lakshmi Ramasubramanian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5dda6968-ca14-1695-3058-7c12653521ba@linux.microsoft.com \
--to=nramas@linux.microsoft.com \
--cc=allison@lohutok.net \
--cc=balajib@linux.microsoft.com \
--cc=bauerman@linux.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=bhsharma@redhat.com \
--cc=catalin.marinas@arm.com \
--cc=christophe.leroy@c-s.fr \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.kasatkin@gmail.com \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hsinyi@chromium.org \
--cc=james.morse@arm.com \
--cc=jmorris@namei.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=masahiroy@kernel.org \
--cc=mbrugger@suse.com \
--cc=mpe@ellerman.id.au \
--cc=pasha.tatashin@soleen.com \
--cc=paulus@samba.org \
--cc=prsriva@linux.microsoft.com \
--cc=robh@kernel.org \
--cc=sashal@kernel.org \
--cc=serge@hallyn.com \
--cc=takahiro.akashi@linaro.org \
--cc=tao.li@vivo.com \
--cc=vincenzo.frascino@arm.com \
--cc=will@kernel.org \
--cc=zohar@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®