* [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
@ 2020-02-21 18:09 ` Tony Lindgren
0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2020-02-21 18:09 UTC (permalink / raw)
To: linux-omap
Cc: linux-arm-kernel, kbuild test robot, Aaro Koskinen,
Andrew F . Davis, Arnd Bergmann, Catalin Marinas, Marc Zyngier,
Rob Herring, Russell King, Steven Price, Will Deacon
Recent omap changes added runtime checks to use omap_smccc_smc()
when optee is configured in dts. As the omap-secure code can be
built for ARMv6 only without ARMv7 and use custom smc calls, we
now get a build error:
omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
Let's just ifdef out omap_smccc_smc() unless the CPU has selected
CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
inline function to arm-smccc.h, but we'd still also have to add
ifdef around omap_smccc_smc() to avoid a warning for uninitialized
value for struct arm_smccc_res in omap_smccc_smc(). And we probably
should not start initializing values in arm-smccc.h if disabled.
Let's also warn on trying to use omap_smccc_smc() if disabled as
suggested by Andrew F. Davis <afd@ti.com>.
Fixes: 48840e16c299 ("ARM: OMAP2+: Use ARM SMC Calling Convention when OP-TEE is available")
Reported-by: kbuild test robot <lkp@intel.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Steven Price <steven.price@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/omap-secure.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
--- a/arch/arm/mach-omap2/omap-secure.c
+++ b/arch/arm/mach-omap2/omap-secure.c
@@ -77,6 +77,7 @@ u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
return ret;
}
+#ifdef CONFIG_HAVE_ARM_SMCCC
void omap_smccc_smc(u32 fn, u32 arg)
{
struct arm_smccc_res res;
@@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
0, 0, 0, 0, 0, 0, &res);
WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
}
+#else
+void omap_smccc_smc(u32 fn, u32 arg)
+{
+ WARN_ONCE(1, "smccc is disabled\n");
+}
+#endif
void omap_smc1(u32 fn, u32 arg)
{
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
@ 2020-02-21 18:09 ` Tony Lindgren
0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2020-02-21 18:09 UTC (permalink / raw)
To: linux-omap
Cc: Rob Herring, kbuild test robot, Arnd Bergmann, Aaro Koskinen,
Catalin Marinas, Andrew F . Davis, Marc Zyngier, Russell King,
Steven Price, Will Deacon, linux-arm-kernel
Recent omap changes added runtime checks to use omap_smccc_smc()
when optee is configured in dts. As the omap-secure code can be
built for ARMv6 only without ARMv7 and use custom smc calls, we
now get a build error:
omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
Let's just ifdef out omap_smccc_smc() unless the CPU has selected
CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
inline function to arm-smccc.h, but we'd still also have to add
ifdef around omap_smccc_smc() to avoid a warning for uninitialized
value for struct arm_smccc_res in omap_smccc_smc(). And we probably
should not start initializing values in arm-smccc.h if disabled.
Let's also warn on trying to use omap_smccc_smc() if disabled as
suggested by Andrew F. Davis <afd@ti.com>.
Fixes: 48840e16c299 ("ARM: OMAP2+: Use ARM SMC Calling Convention when OP-TEE is available")
Reported-by: kbuild test robot <lkp@intel.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Steven Price <steven.price@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/omap-secure.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
--- a/arch/arm/mach-omap2/omap-secure.c
+++ b/arch/arm/mach-omap2/omap-secure.c
@@ -77,6 +77,7 @@ u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
return ret;
}
+#ifdef CONFIG_HAVE_ARM_SMCCC
void omap_smccc_smc(u32 fn, u32 arg)
{
struct arm_smccc_res res;
@@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
0, 0, 0, 0, 0, 0, &res);
WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
}
+#else
+void omap_smccc_smc(u32 fn, u32 arg)
+{
+ WARN_ONCE(1, "smccc is disabled\n");
+}
+#endif
void omap_smc1(u32 fn, u32 arg)
{
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
2020-02-21 18:09 ` Tony Lindgren
@ 2020-02-21 18:23 ` Andrew F. Davis
-1 siblings, 0 replies; 12+ messages in thread
From: Andrew F. Davis @ 2020-02-21 18:23 UTC (permalink / raw)
To: Tony Lindgren, linux-omap
Cc: linux-arm-kernel, kbuild test robot, Aaro Koskinen,
Arnd Bergmann, Catalin Marinas, Marc Zyngier, Rob Herring,
Russell King, Steven Price, Will Deacon
On 2/21/20 1:09 PM, Tony Lindgren wrote:
> Recent omap changes added runtime checks to use omap_smccc_smc()
> when optee is configured in dts. As the omap-secure code can be
> built for ARMv6 only without ARMv7 and use custom smc calls, we
> now get a build error:
>
> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
>
> Let's just ifdef out omap_smccc_smc() unless the CPU has selected
> CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
> inline function to arm-smccc.h, but we'd still also have to add
> ifdef around omap_smccc_smc() to avoid a warning for uninitialized
> value for struct arm_smccc_res in omap_smccc_smc(). And we probably
> should not start initializing values in arm-smccc.h if disabled.
>
> Let's also warn on trying to use omap_smccc_smc() if disabled as
> suggested by Andrew F. Davis <afd@ti.com>.
>
> Fixes: 48840e16c299 ("ARM: OMAP2+: Use ARM SMC Calling Convention when OP-TEE is available")
> Reported-by: kbuild test robot <lkp@intel.com>
> Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
> Cc: Andrew F. Davis <afd@ti.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Steven Price <steven.price@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
Looks good to me,
Acked-by: Andrew F. Davis <afd@ti.com>
> arch/arm/mach-omap2/omap-secure.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
> --- a/arch/arm/mach-omap2/omap-secure.c
> +++ b/arch/arm/mach-omap2/omap-secure.c
> @@ -77,6 +77,7 @@ u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
> return ret;
> }
>
> +#ifdef CONFIG_HAVE_ARM_SMCCC
> void omap_smccc_smc(u32 fn, u32 arg)
> {
> struct arm_smccc_res res;
> @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
> 0, 0, 0, 0, 0, 0, &res);
> WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
> }
> +#else
> +void omap_smccc_smc(u32 fn, u32 arg)
> +{
> + WARN_ONCE(1, "smccc is disabled\n");
> +}
> +#endif
>
> void omap_smc1(u32 fn, u32 arg)
> {
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
@ 2020-02-21 18:23 ` Andrew F. Davis
0 siblings, 0 replies; 12+ messages in thread
From: Andrew F. Davis @ 2020-02-21 18:23 UTC (permalink / raw)
To: Tony Lindgren, linux-omap
Cc: Rob Herring, kbuild test robot, Arnd Bergmann, Aaro Koskinen,
Marc Zyngier, Steven Price, Catalin Marinas, Russell King,
Will Deacon, linux-arm-kernel
On 2/21/20 1:09 PM, Tony Lindgren wrote:
> Recent omap changes added runtime checks to use omap_smccc_smc()
> when optee is configured in dts. As the omap-secure code can be
> built for ARMv6 only without ARMv7 and use custom smc calls, we
> now get a build error:
>
> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
>
> Let's just ifdef out omap_smccc_smc() unless the CPU has selected
> CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
> inline function to arm-smccc.h, but we'd still also have to add
> ifdef around omap_smccc_smc() to avoid a warning for uninitialized
> value for struct arm_smccc_res in omap_smccc_smc(). And we probably
> should not start initializing values in arm-smccc.h if disabled.
>
> Let's also warn on trying to use omap_smccc_smc() if disabled as
> suggested by Andrew F. Davis <afd@ti.com>.
>
> Fixes: 48840e16c299 ("ARM: OMAP2+: Use ARM SMC Calling Convention when OP-TEE is available")
> Reported-by: kbuild test robot <lkp@intel.com>
> Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
> Cc: Andrew F. Davis <afd@ti.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Steven Price <steven.price@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
Looks good to me,
Acked-by: Andrew F. Davis <afd@ti.com>
> arch/arm/mach-omap2/omap-secure.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
> --- a/arch/arm/mach-omap2/omap-secure.c
> +++ b/arch/arm/mach-omap2/omap-secure.c
> @@ -77,6 +77,7 @@ u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
> return ret;
> }
>
> +#ifdef CONFIG_HAVE_ARM_SMCCC
> void omap_smccc_smc(u32 fn, u32 arg)
> {
> struct arm_smccc_res res;
> @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
> 0, 0, 0, 0, 0, 0, &res);
> WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
> }
> +#else
> +void omap_smccc_smc(u32 fn, u32 arg)
> +{
> + WARN_ONCE(1, "smccc is disabled\n");
> +}
> +#endif
>
> void omap_smc1(u32 fn, u32 arg)
> {
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
2020-02-21 18:09 ` Tony Lindgren
@ 2020-02-21 20:05 ` Arnd Bergmann
-1 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2020-02-21 20:05 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-omap, Linux ARM, kbuild test robot, Aaro Koskinen,
Andrew F . Davis, Catalin Marinas, Marc Zyngier, Rob Herring,
Russell King, Steven Price, Will Deacon
On Fri, Feb 21, 2020 at 7:09 PM Tony Lindgren <tony@atomide.com> wrote:
>
> Recent omap changes added runtime checks to use omap_smccc_smc()
> when optee is configured in dts. As the omap-secure code can be
> built for ARMv6 only without ARMv7 and use custom smc calls, we
> now get a build error:
>
> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
>
> Let's just ifdef out omap_smccc_smc() unless the CPU has selected
> CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
> inline function to arm-smccc.h, but we'd still also have to add
> ifdef around omap_smccc_smc() to avoid a warning for uninitialized
> value for struct arm_smccc_res in omap_smccc_smc(). And we probably
> should not start initializing values in arm-smccc.h if disabled.
>
> Let's also warn on trying to use omap_smccc_smc() if disabled as
> suggested by Andrew F. Davis <afd@ti.com>.
>
> +#ifdef CONFIG_HAVE_ARM_SMCCC
> void omap_smccc_smc(u32 fn, u32 arg)
> {
> struct arm_smccc_res res;
> @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
> 0, 0, 0, 0, 0, 0, &res);
> WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
> }
> +#else
Looking through the callers again, this can and is only called
for ARMv7 CPUs, so can't you just avoid the #else path and
turn it into a link error if we ever get callers on ARMv6-only builds?
Arnd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
@ 2020-02-21 20:05 ` Arnd Bergmann
0 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2020-02-21 20:05 UTC (permalink / raw)
To: Tony Lindgren
Cc: Rob Herring, kbuild test robot, Aaro Koskinen, Catalin Marinas,
Andrew F . Davis, Marc Zyngier, Russell King, linux-omap,
Will Deacon, Steven Price, Linux ARM
On Fri, Feb 21, 2020 at 7:09 PM Tony Lindgren <tony@atomide.com> wrote:
>
> Recent omap changes added runtime checks to use omap_smccc_smc()
> when optee is configured in dts. As the omap-secure code can be
> built for ARMv6 only without ARMv7 and use custom smc calls, we
> now get a build error:
>
> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
>
> Let's just ifdef out omap_smccc_smc() unless the CPU has selected
> CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
> inline function to arm-smccc.h, but we'd still also have to add
> ifdef around omap_smccc_smc() to avoid a warning for uninitialized
> value for struct arm_smccc_res in omap_smccc_smc(). And we probably
> should not start initializing values in arm-smccc.h if disabled.
>
> Let's also warn on trying to use omap_smccc_smc() if disabled as
> suggested by Andrew F. Davis <afd@ti.com>.
>
> +#ifdef CONFIG_HAVE_ARM_SMCCC
> void omap_smccc_smc(u32 fn, u32 arg)
> {
> struct arm_smccc_res res;
> @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
> 0, 0, 0, 0, 0, 0, &res);
> WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
> }
> +#else
Looking through the callers again, this can and is only called
for ARMv7 CPUs, so can't you just avoid the #else path and
turn it into a link error if we ever get callers on ARMv6-only builds?
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
2020-02-21 20:05 ` Arnd Bergmann
@ 2020-02-21 20:15 ` Tony Lindgren
-1 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2020-02-21 20:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-omap, Linux ARM, kbuild test robot, Aaro Koskinen,
Andrew F . Davis, Catalin Marinas, Marc Zyngier, Rob Herring,
Russell King, Steven Price, Will Deacon
* Arnd Bergmann <arnd@arndb.de> [200221 20:06]:
> On Fri, Feb 21, 2020 at 7:09 PM Tony Lindgren <tony@atomide.com> wrote:
> >
> > Recent omap changes added runtime checks to use omap_smccc_smc()
> > when optee is configured in dts. As the omap-secure code can be
> > built for ARMv6 only without ARMv7 and use custom smc calls, we
> > now get a build error:
> >
> > omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> >
> > Let's just ifdef out omap_smccc_smc() unless the CPU has selected
> > CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
> > inline function to arm-smccc.h, but we'd still also have to add
> > ifdef around omap_smccc_smc() to avoid a warning for uninitialized
> > value for struct arm_smccc_res in omap_smccc_smc(). And we probably
> > should not start initializing values in arm-smccc.h if disabled.
> >
> > Let's also warn on trying to use omap_smccc_smc() if disabled as
> > suggested by Andrew F. Davis <afd@ti.com>.
> >
> > +#ifdef CONFIG_HAVE_ARM_SMCCC
> > void omap_smccc_smc(u32 fn, u32 arg)
> > {
> > struct arm_smccc_res res;
> > @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
> > 0, 0, 0, 0, 0, 0, &res);
> > WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
> > }
> > +#else
>
> Looking through the callers again, this can and is only called
> for ARMv7 CPUs, so can't you just avoid the #else path and
> turn it into a link error if we ever get callers on ARMv6-only builds?
Hmm yeah maybe. If ARMv6 machines (basically n8x0) is not using
omap-smc.S at all, it's unlike it would need omap-secure.c either.
Regards,
Tony
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
@ 2020-02-21 20:15 ` Tony Lindgren
0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2020-02-21 20:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Rob Herring, kbuild test robot, Aaro Koskinen, Catalin Marinas,
Andrew F . Davis, Marc Zyngier, Russell King, linux-omap,
Will Deacon, Steven Price, Linux ARM
* Arnd Bergmann <arnd@arndb.de> [200221 20:06]:
> On Fri, Feb 21, 2020 at 7:09 PM Tony Lindgren <tony@atomide.com> wrote:
> >
> > Recent omap changes added runtime checks to use omap_smccc_smc()
> > when optee is configured in dts. As the omap-secure code can be
> > built for ARMv6 only without ARMv7 and use custom smc calls, we
> > now get a build error:
> >
> > omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> >
> > Let's just ifdef out omap_smccc_smc() unless the CPU has selected
> > CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
> > inline function to arm-smccc.h, but we'd still also have to add
> > ifdef around omap_smccc_smc() to avoid a warning for uninitialized
> > value for struct arm_smccc_res in omap_smccc_smc(). And we probably
> > should not start initializing values in arm-smccc.h if disabled.
> >
> > Let's also warn on trying to use omap_smccc_smc() if disabled as
> > suggested by Andrew F. Davis <afd@ti.com>.
> >
> > +#ifdef CONFIG_HAVE_ARM_SMCCC
> > void omap_smccc_smc(u32 fn, u32 arg)
> > {
> > struct arm_smccc_res res;
> > @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
> > 0, 0, 0, 0, 0, 0, &res);
> > WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
> > }
> > +#else
>
> Looking through the callers again, this can and is only called
> for ARMv7 CPUs, so can't you just avoid the #else path and
> turn it into a link error if we ever get callers on ARMv6-only builds?
Hmm yeah maybe. If ARMv6 machines (basically n8x0) is not using
omap-smc.S at all, it's unlike it would need omap-secure.c either.
Regards,
Tony
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
2020-02-21 20:15 ` Tony Lindgren
@ 2020-02-26 15:57 ` Tony Lindgren
-1 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2020-02-26 15:57 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-omap, Linux ARM, kbuild test robot, Aaro Koskinen,
Andrew F . Davis, Catalin Marinas, Marc Zyngier, Rob Herring,
Russell King, Steven Price, Will Deacon
* Tony Lindgren <tony@atomide.com> [200221 20:16]:
> * Arnd Bergmann <arnd@arndb.de> [200221 20:06]:
> > On Fri, Feb 21, 2020 at 7:09 PM Tony Lindgren <tony@atomide.com> wrote:
> > >
> > > Recent omap changes added runtime checks to use omap_smccc_smc()
> > > when optee is configured in dts. As the omap-secure code can be
> > > built for ARMv6 only without ARMv7 and use custom smc calls, we
> > > now get a build error:
> > >
> > > omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> > >
> > > Let's just ifdef out omap_smccc_smc() unless the CPU has selected
> > > CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
> > > inline function to arm-smccc.h, but we'd still also have to add
> > > ifdef around omap_smccc_smc() to avoid a warning for uninitialized
> > > value for struct arm_smccc_res in omap_smccc_smc(). And we probably
> > > should not start initializing values in arm-smccc.h if disabled.
> > >
> > > Let's also warn on trying to use omap_smccc_smc() if disabled as
> > > suggested by Andrew F. Davis <afd@ti.com>.
> > >
> > > +#ifdef CONFIG_HAVE_ARM_SMCCC
> > > void omap_smccc_smc(u32 fn, u32 arg)
> > > {
> > > struct arm_smccc_res res;
> > > @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
> > > 0, 0, 0, 0, 0, 0, &res);
> > > WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
> > > }
> > > +#else
> >
> > Looking through the callers again, this can and is only called
> > for ARMv7 CPUs, so can't you just avoid the #else path and
> > turn it into a link error if we ever get callers on ARMv6-only builds?
>
> Hmm yeah maybe. If ARMv6 machines (basically n8x0) is not using
> omap-smc.S at all, it's unlike it would need omap-secure.c either.
Yeah we never built secure-common for omap2 earlier, this got
recently added. My guess is that n8x0 only has a signed bootloader
and no smc calls at all, or at least we don't use any smc calls
for n8x0 in the kernel.
I'll send out v2 of the patch.
Regards,
Tony
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
@ 2020-02-26 15:57 ` Tony Lindgren
0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2020-02-26 15:57 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Rob Herring, kbuild test robot, Aaro Koskinen, Catalin Marinas,
Andrew F . Davis, Marc Zyngier, Russell King, linux-omap,
Will Deacon, Steven Price, Linux ARM
* Tony Lindgren <tony@atomide.com> [200221 20:16]:
> * Arnd Bergmann <arnd@arndb.de> [200221 20:06]:
> > On Fri, Feb 21, 2020 at 7:09 PM Tony Lindgren <tony@atomide.com> wrote:
> > >
> > > Recent omap changes added runtime checks to use omap_smccc_smc()
> > > when optee is configured in dts. As the omap-secure code can be
> > > built for ARMv6 only without ARMv7 and use custom smc calls, we
> > > now get a build error:
> > >
> > > omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> > >
> > > Let's just ifdef out omap_smccc_smc() unless the CPU has selected
> > > CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
> > > inline function to arm-smccc.h, but we'd still also have to add
> > > ifdef around omap_smccc_smc() to avoid a warning for uninitialized
> > > value for struct arm_smccc_res in omap_smccc_smc(). And we probably
> > > should not start initializing values in arm-smccc.h if disabled.
> > >
> > > Let's also warn on trying to use omap_smccc_smc() if disabled as
> > > suggested by Andrew F. Davis <afd@ti.com>.
> > >
> > > +#ifdef CONFIG_HAVE_ARM_SMCCC
> > > void omap_smccc_smc(u32 fn, u32 arg)
> > > {
> > > struct arm_smccc_res res;
> > > @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
> > > 0, 0, 0, 0, 0, 0, &res);
> > > WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
> > > }
> > > +#else
> >
> > Looking through the callers again, this can and is only called
> > for ARMv7 CPUs, so can't you just avoid the #else path and
> > turn it into a link error if we ever get callers on ARMv6-only builds?
>
> Hmm yeah maybe. If ARMv6 machines (basically n8x0) is not using
> omap-smc.S at all, it's unlike it would need omap-secure.c either.
Yeah we never built secure-common for omap2 earlier, this got
recently added. My guess is that n8x0 only has a signed bootloader
and no smc calls at all, or at least we don't use any smc calls
for n8x0 in the kernel.
I'll send out v2 of the patch.
Regards,
Tony
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
@ 2020-02-26 15:57 ` Tony Lindgren
0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2020-02-26 15:57 UTC (permalink / raw)
To: linux-omap
Cc: linux-arm-kernel, kbuild test robot, Aaro Koskinen,
Andrew F . Davis, Arnd Bergmann, Catalin Marinas, Marc Zyngier,
Rob Herring, Russell King, Steven Price, Will Deacon
Recent omap changes added runtime checks to use omap_smccc_smc()
when optee is configured in dts. As the omap-secure code can be
built for ARMv6 only without ARMv7 and use custom smc calls, we
now get a build error:
omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
As there secure calls are not used for ARMv6, we should not build
secure-common, and not call omap_secure_init() for omap2.
Fixes: c37baa06f8a9 ("ARM: OMAP2+: Fix undefined reference to omap_secure_init")
Reported-by: kbuild test robot <lkp@intel.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Steven Price <steven.price@arm.com>
Cc: Will Deacon <will@kernel.org>
Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/Makefile | 2 +-
arch/arm/mach-omap2/io.c | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -16,7 +16,7 @@ hwmod-common = omap_hwmod.o omap_hwmod_reset.o \
clock-common = clock.o
secure-common = omap-smc.o omap-secure.o
-obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
+obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
obj-$(CONFIG_ARCH_OMAP4) += $(hwmod-common) $(secure-common)
obj-$(CONFIG_SOC_AM33XX) += $(hwmod-common) $(secure-common)
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -431,7 +431,6 @@ void __init omap2420_init_early(void)
omap_hwmod_init_postsetup();
omap_clk_soc_init = omap2420_dt_clk_init;
rate_table = omap2420_rate_table;
- omap_secure_init();
}
void __init omap2420_init_late(void)
@@ -456,7 +455,6 @@ void __init omap2430_init_early(void)
omap_hwmod_init_postsetup();
omap_clk_soc_init = omap2430_dt_clk_init;
rate_table = omap2430_rate_table;
- omap_secure_init();
}
void __init omap2430_init_late(void)
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
@ 2020-02-26 15:57 ` Tony Lindgren
0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2020-02-26 15:57 UTC (permalink / raw)
To: linux-omap
Cc: Rob Herring, kbuild test robot, Arnd Bergmann, Aaro Koskinen,
Catalin Marinas, Andrew F . Davis, Marc Zyngier, Russell King,
Steven Price, Will Deacon, linux-arm-kernel
Recent omap changes added runtime checks to use omap_smccc_smc()
when optee is configured in dts. As the omap-secure code can be
built for ARMv6 only without ARMv7 and use custom smc calls, we
now get a build error:
omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
As there secure calls are not used for ARMv6, we should not build
secure-common, and not call omap_secure_init() for omap2.
Fixes: c37baa06f8a9 ("ARM: OMAP2+: Fix undefined reference to omap_secure_init")
Reported-by: kbuild test robot <lkp@intel.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Steven Price <steven.price@arm.com>
Cc: Will Deacon <will@kernel.org>
Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/Makefile | 2 +-
arch/arm/mach-omap2/io.c | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -16,7 +16,7 @@ hwmod-common = omap_hwmod.o omap_hwmod_reset.o \
clock-common = clock.o
secure-common = omap-smc.o omap-secure.o
-obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
+obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
obj-$(CONFIG_ARCH_OMAP4) += $(hwmod-common) $(secure-common)
obj-$(CONFIG_SOC_AM33XX) += $(hwmod-common) $(secure-common)
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -431,7 +431,6 @@ void __init omap2420_init_early(void)
omap_hwmod_init_postsetup();
omap_clk_soc_init = omap2420_dt_clk_init;
rate_table = omap2420_rate_table;
- omap_secure_init();
}
void __init omap2420_init_late(void)
@@ -456,7 +455,6 @@ void __init omap2430_init_early(void)
omap_hwmod_init_postsetup();
omap_clk_soc_init = omap2430_dt_clk_init;
rate_table = omap2430_rate_table;
- omap_secure_init();
}
void __init omap2430_init_late(void)
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2020-02-26 16:01 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-21 18:09 [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set Tony Lindgren
2020-02-21 18:09 ` Tony Lindgren
2020-02-21 18:23 ` Andrew F. Davis
2020-02-21 18:23 ` Andrew F. Davis
2020-02-21 20:05 ` Arnd Bergmann
2020-02-21 20:05 ` Arnd Bergmann
2020-02-21 20:15 ` Tony Lindgren
2020-02-21 20:15 ` Tony Lindgren
2020-02-26 15:57 ` Tony Lindgren
2020-02-26 15:57 ` Tony Lindgren
2020-02-26 15:57 Tony Lindgren
2020-02-26 15:57 ` Tony Lindgren
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.