From: Alex Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Russell King - ARM Linux
<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>,
Dave Martin <Dave.Martin-5wv7dgnIgG8@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
Kevin Hilman <khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
Mark Rutland <Mark.Rutland-5wv7dgnIgG8@public.gmane.org>,
Ian Campbell
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v8 1/5] ARM: add basic support for Trusted Foundations
Date: Tue, 15 Oct 2013 10:20:41 -0700 [thread overview]
Message-ID: <525D7969.5060908@nvidia.com> (raw)
In-Reply-To: <20131015110725.GZ25034-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
On 10/15/2013 04:07 AM, Russell King - ARM Linux wrote:
> On Fri, Oct 11, 2013 at 02:45:34PM -0700, Alexandre Courbot wrote:
>> Trusted Foundations is a TrustZone-based secure monitor for ARM that
>> can be invoked using the same SMC-based API on all supported
>> platforms. This patch adds initial basic support for Trusted
>> Foundations using the ARM firmware API. Current features are limited
>> to the ability to boot secondary processors.
>>
>> Note: The API followed by Trusted Foundations does *not* follow the SMC
>> calling conventions. It has nothing to do with PSCI neither and is only
>> relevant to devices that use Trusted Foundations (like most Tegra-based
>> retail devices).
>>
>> Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> Reviewed-by: Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Reviewed-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> ---
>> .../arm/firmware/tl,trusted-foundations.txt | 20 ++++++
>> .../devicetree/bindings/vendor-prefixes.txt | 1 +
>> arch/arm/Kconfig | 2 +
>> arch/arm/Makefile | 1 +
>> arch/arm/firmware/Kconfig | 28 ++++++++
>> arch/arm/firmware/Makefile | 1 +
>> arch/arm/firmware/trusted_foundations.c | 79 ++++++++++++++++++++++
>> arch/arm/include/asm/trusted_foundations.h | 68 +++++++++++++++++++
>> 8 files changed, 200 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/arm/firmware/tl,trusted-foundations.txt
>> create mode 100644 arch/arm/firmware/Kconfig
>> create mode 100644 arch/arm/firmware/Makefile
>> create mode 100644 arch/arm/firmware/trusted_foundations.c
>> create mode 100644 arch/arm/include/asm/trusted_foundations.h
>
> Is having this under arch/arm appropriate? What happens if the API
> gets re-used on ARM64 for example? Would drivers/firmware be a better
> cross-arch location for this?
The reason why this has been put into arch/arm is that the firmware_ops
feature this patch depends also resides there
(arch/arm/include/asm/firmware.h).
On the other hand it might also make sense to move firmware_ops out of
ARM since I don't see anything ARM-specific with it. Tomasz, could we
have your thoughts on this?
>> diff --git a/arch/arm/include/asm/trusted_foundations.h b/arch/arm/include/asm/trusted_foundations.h
>> new file mode 100644
>> index 0000000..c6f20bd
>> --- /dev/null
>> +++ b/arch/arm/include/asm/trusted_foundations.h
>> @@ -0,0 +1,68 @@
>> +/*
>> + * Copyright (c) 2013, NVIDIA Corporation.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful, but WITHOUT
>> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
>> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
>> + * more details.
>> + */
>> +
>> +/*
>> + * Support for the Trusted Foundations secure monitor.
>> + *
>> + * Trusted Foundation comes active on some ARM consumer devices (most
>> + * Tegra-based devices sold on the market are concerned). Such devices can only
>> + * perform some basic operations, like setting the CPU reset vector, through
>> + * SMC calls to the secure monitor. The calls are completely specific to
>> + * Trusted Foundations, and do *not* follow the SMC calling convention or the
>> + * PSCI standard.
>> + */
>> +
>> +#ifndef __ASM_ARM_TRUSTED_FOUNDATIONS_H
>> +#define __ASM_ARM_TRUSTED_FOUNDATIONS_H
>> +
>> +#include <linux/kconfig.h>
>> +
>> +struct trusted_foundations_platform_data {
>> + unsigned int version_major;
>> + unsigned int version_minor;
>> +};
>> +
>> +#if IS_ENABLED(CONFIG_TRUSTED_FOUNDATIONS)
>> +
>> +void register_trusted_foundations(struct trusted_foundations_platform_data *pd);
>> +void of_register_trusted_foundations(void);
>> +
>> +#else /* CONFIG_TRUSTED_FOUNDATIONS */
>> +
>> +#include <linux/printk.h>
>> +#include <linux/of.h>
>> +#include <asm/bug.h>
>
> Please move these up along side the other #include - having includes depend
> on config symbols is an additional unnecessary source of fragility.
>
> Secondly, please use linux/*.h includes in preference to asm/*.h where the
> linux/*.h include picks up the corresponding asm/*.h include. In this case,
> that should be linux/bug.h, not asm/bug.h.
Will do, thanks!
Alex.
WARNING: multiple messages have this Message-ID (diff)
From: acourbot@nvidia.com (Alex Courbot)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v8 1/5] ARM: add basic support for Trusted Foundations
Date: Tue, 15 Oct 2013 10:20:41 -0700 [thread overview]
Message-ID: <525D7969.5060908@nvidia.com> (raw)
In-Reply-To: <20131015110725.GZ25034@n2100.arm.linux.org.uk>
On 10/15/2013 04:07 AM, Russell King - ARM Linux wrote:
> On Fri, Oct 11, 2013 at 02:45:34PM -0700, Alexandre Courbot wrote:
>> Trusted Foundations is a TrustZone-based secure monitor for ARM that
>> can be invoked using the same SMC-based API on all supported
>> platforms. This patch adds initial basic support for Trusted
>> Foundations using the ARM firmware API. Current features are limited
>> to the ability to boot secondary processors.
>>
>> Note: The API followed by Trusted Foundations does *not* follow the SMC
>> calling conventions. It has nothing to do with PSCI neither and is only
>> relevant to devices that use Trusted Foundations (like most Tegra-based
>> retail devices).
>>
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>> Reviewed-by: Tomasz Figa <t.figa@samsung.com>
>> Reviewed-by: Stephen Warren <swarren@nvidia.com>
>> ---
>> .../arm/firmware/tl,trusted-foundations.txt | 20 ++++++
>> .../devicetree/bindings/vendor-prefixes.txt | 1 +
>> arch/arm/Kconfig | 2 +
>> arch/arm/Makefile | 1 +
>> arch/arm/firmware/Kconfig | 28 ++++++++
>> arch/arm/firmware/Makefile | 1 +
>> arch/arm/firmware/trusted_foundations.c | 79 ++++++++++++++++++++++
>> arch/arm/include/asm/trusted_foundations.h | 68 +++++++++++++++++++
>> 8 files changed, 200 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/arm/firmware/tl,trusted-foundations.txt
>> create mode 100644 arch/arm/firmware/Kconfig
>> create mode 100644 arch/arm/firmware/Makefile
>> create mode 100644 arch/arm/firmware/trusted_foundations.c
>> create mode 100644 arch/arm/include/asm/trusted_foundations.h
>
> Is having this under arch/arm appropriate? What happens if the API
> gets re-used on ARM64 for example? Would drivers/firmware be a better
> cross-arch location for this?
The reason why this has been put into arch/arm is that the firmware_ops
feature this patch depends also resides there
(arch/arm/include/asm/firmware.h).
On the other hand it might also make sense to move firmware_ops out of
ARM since I don't see anything ARM-specific with it. Tomasz, could we
have your thoughts on this?
>> diff --git a/arch/arm/include/asm/trusted_foundations.h b/arch/arm/include/asm/trusted_foundations.h
>> new file mode 100644
>> index 0000000..c6f20bd
>> --- /dev/null
>> +++ b/arch/arm/include/asm/trusted_foundations.h
>> @@ -0,0 +1,68 @@
>> +/*
>> + * Copyright (c) 2013, NVIDIA Corporation.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful, but WITHOUT
>> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
>> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
>> + * more details.
>> + */
>> +
>> +/*
>> + * Support for the Trusted Foundations secure monitor.
>> + *
>> + * Trusted Foundation comes active on some ARM consumer devices (most
>> + * Tegra-based devices sold on the market are concerned). Such devices can only
>> + * perform some basic operations, like setting the CPU reset vector, through
>> + * SMC calls to the secure monitor. The calls are completely specific to
>> + * Trusted Foundations, and do *not* follow the SMC calling convention or the
>> + * PSCI standard.
>> + */
>> +
>> +#ifndef __ASM_ARM_TRUSTED_FOUNDATIONS_H
>> +#define __ASM_ARM_TRUSTED_FOUNDATIONS_H
>> +
>> +#include <linux/kconfig.h>
>> +
>> +struct trusted_foundations_platform_data {
>> + unsigned int version_major;
>> + unsigned int version_minor;
>> +};
>> +
>> +#if IS_ENABLED(CONFIG_TRUSTED_FOUNDATIONS)
>> +
>> +void register_trusted_foundations(struct trusted_foundations_platform_data *pd);
>> +void of_register_trusted_foundations(void);
>> +
>> +#else /* CONFIG_TRUSTED_FOUNDATIONS */
>> +
>> +#include <linux/printk.h>
>> +#include <linux/of.h>
>> +#include <asm/bug.h>
>
> Please move these up along side the other #include - having includes depend
> on config symbols is an additional unnecessary source of fragility.
>
> Secondly, please use linux/*.h includes in preference to asm/*.h where the
> linux/*.h include picks up the corresponding asm/*.h include. In this case,
> that should be linux/bug.h, not asm/bug.h.
Will do, thanks!
Alex.
WARNING: multiple messages have this Message-ID (diff)
From: Alex Courbot <acourbot@nvidia.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>,
Stephen Warren <swarren@wwwdotorg.org>,
Tomasz Figa <t.figa@samsung.com>
Cc: Olof Johansson <olof@lixom.net>,
Dave Martin <Dave.Martin@arm.com>, Arnd Bergmann <arnd@arndb.de>,
Kevin Hilman <khilman@linaro.org>,
Rob Herring <rob.herring@calxeda.com>,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <Mark.Rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v8 1/5] ARM: add basic support for Trusted Foundations
Date: Tue, 15 Oct 2013 10:20:41 -0700 [thread overview]
Message-ID: <525D7969.5060908@nvidia.com> (raw)
In-Reply-To: <20131015110725.GZ25034@n2100.arm.linux.org.uk>
On 10/15/2013 04:07 AM, Russell King - ARM Linux wrote:
> On Fri, Oct 11, 2013 at 02:45:34PM -0700, Alexandre Courbot wrote:
>> Trusted Foundations is a TrustZone-based secure monitor for ARM that
>> can be invoked using the same SMC-based API on all supported
>> platforms. This patch adds initial basic support for Trusted
>> Foundations using the ARM firmware API. Current features are limited
>> to the ability to boot secondary processors.
>>
>> Note: The API followed by Trusted Foundations does *not* follow the SMC
>> calling conventions. It has nothing to do with PSCI neither and is only
>> relevant to devices that use Trusted Foundations (like most Tegra-based
>> retail devices).
>>
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>> Reviewed-by: Tomasz Figa <t.figa@samsung.com>
>> Reviewed-by: Stephen Warren <swarren@nvidia.com>
>> ---
>> .../arm/firmware/tl,trusted-foundations.txt | 20 ++++++
>> .../devicetree/bindings/vendor-prefixes.txt | 1 +
>> arch/arm/Kconfig | 2 +
>> arch/arm/Makefile | 1 +
>> arch/arm/firmware/Kconfig | 28 ++++++++
>> arch/arm/firmware/Makefile | 1 +
>> arch/arm/firmware/trusted_foundations.c | 79 ++++++++++++++++++++++
>> arch/arm/include/asm/trusted_foundations.h | 68 +++++++++++++++++++
>> 8 files changed, 200 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/arm/firmware/tl,trusted-foundations.txt
>> create mode 100644 arch/arm/firmware/Kconfig
>> create mode 100644 arch/arm/firmware/Makefile
>> create mode 100644 arch/arm/firmware/trusted_foundations.c
>> create mode 100644 arch/arm/include/asm/trusted_foundations.h
>
> Is having this under arch/arm appropriate? What happens if the API
> gets re-used on ARM64 for example? Would drivers/firmware be a better
> cross-arch location for this?
The reason why this has been put into arch/arm is that the firmware_ops
feature this patch depends also resides there
(arch/arm/include/asm/firmware.h).
On the other hand it might also make sense to move firmware_ops out of
ARM since I don't see anything ARM-specific with it. Tomasz, could we
have your thoughts on this?
>> diff --git a/arch/arm/include/asm/trusted_foundations.h b/arch/arm/include/asm/trusted_foundations.h
>> new file mode 100644
>> index 0000000..c6f20bd
>> --- /dev/null
>> +++ b/arch/arm/include/asm/trusted_foundations.h
>> @@ -0,0 +1,68 @@
>> +/*
>> + * Copyright (c) 2013, NVIDIA Corporation.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful, but WITHOUT
>> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
>> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
>> + * more details.
>> + */
>> +
>> +/*
>> + * Support for the Trusted Foundations secure monitor.
>> + *
>> + * Trusted Foundation comes active on some ARM consumer devices (most
>> + * Tegra-based devices sold on the market are concerned). Such devices can only
>> + * perform some basic operations, like setting the CPU reset vector, through
>> + * SMC calls to the secure monitor. The calls are completely specific to
>> + * Trusted Foundations, and do *not* follow the SMC calling convention or the
>> + * PSCI standard.
>> + */
>> +
>> +#ifndef __ASM_ARM_TRUSTED_FOUNDATIONS_H
>> +#define __ASM_ARM_TRUSTED_FOUNDATIONS_H
>> +
>> +#include <linux/kconfig.h>
>> +
>> +struct trusted_foundations_platform_data {
>> + unsigned int version_major;
>> + unsigned int version_minor;
>> +};
>> +
>> +#if IS_ENABLED(CONFIG_TRUSTED_FOUNDATIONS)
>> +
>> +void register_trusted_foundations(struct trusted_foundations_platform_data *pd);
>> +void of_register_trusted_foundations(void);
>> +
>> +#else /* CONFIG_TRUSTED_FOUNDATIONS */
>> +
>> +#include <linux/printk.h>
>> +#include <linux/of.h>
>> +#include <asm/bug.h>
>
> Please move these up along side the other #include - having includes depend
> on config symbols is an additional unnecessary source of fragility.
>
> Secondly, please use linux/*.h includes in preference to asm/*.h where the
> linux/*.h include picks up the corresponding asm/*.h include. In this case,
> that should be linux/bug.h, not asm/bug.h.
Will do, thanks!
Alex.
next prev parent reply other threads:[~2013-10-15 17:20 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 21:45 [PATCH v8 0/5] ARM: support for Trusted Foundations secure monitor Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
[not found] ` <1381527938-22840-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-10-11 21:45 ` [PATCH v8 1/5] ARM: add basic support for Trusted Foundations Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
[not found] ` <1381527938-22840-2-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-10-14 22:12 ` Stephen Warren
2013-10-14 22:12 ` Stephen Warren
2013-10-14 22:12 ` Stephen Warren
2013-10-15 11:07 ` Russell King - ARM Linux
2013-10-15 11:07 ` Russell King - ARM Linux
2013-10-15 11:07 ` Russell King - ARM Linux
[not found] ` <20131015110725.GZ25034-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-10-15 16:11 ` Stephen Warren
2013-10-15 16:11 ` Stephen Warren
2013-10-15 16:11 ` Stephen Warren
2013-10-15 17:20 ` Alex Courbot [this message]
2013-10-15 17:20 ` Alex Courbot
2013-10-15 17:20 ` Alex Courbot
[not found] ` <525D7969.5060908-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-10-28 11:04 ` Tomasz Figa
2013-10-28 11:04 ` Tomasz Figa
2013-10-28 11:04 ` Tomasz Figa
[not found] ` <CA+Ln22FdkcxOfq-yxVVQ7vTLWC3TYRBbAOZ=e3WmpSKkgk_DRg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-28 21:55 ` Olof Johansson
2013-10-28 21:55 ` Olof Johansson
2013-10-28 21:55 ` Olof Johansson
2013-10-11 21:45 ` [PATCH v8 2/5] ARM: tegra: add " Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
2013-10-11 21:45 ` [PATCH v8 3/5] ARM: tegra: split setting of CPU reset handler Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
2013-10-11 21:45 ` [PATCH v8 4/5] ARM: tegra: set CPU reset handler with firmware op Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
2013-10-11 21:45 ` [PATCH v8 5/5] ARM: tegra: support Trusted Foundations by default Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
2013-10-11 21:45 ` Alexandre Courbot
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=525D7969.5060908@nvidia.com \
--to=acourbot-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=Dave.Martin-5wv7dgnIgG8@public.gmane.org \
--cc=Mark.Rutland-5wv7dgnIgG8@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.