linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* omap-secure.c:undefined reference to `__arm_smccc_smc'
@ 2020-02-13 10:26 kbuild test robot
  2020-02-20 15:54 ` Tony Lindgren
  0 siblings, 1 reply; 13+ messages in thread
From: kbuild test robot @ 2020-02-13 10:26 UTC (permalink / raw)
  To: Andrew F. Davis; +Cc: kbuild-all, linux-kernel, Tony Lindgren

[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
date:   3 weeks ago
config: arm-randconfig-a001-20200213 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36610 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-13 10:26 omap-secure.c:undefined reference to `__arm_smccc_smc' kbuild test robot
@ 2020-02-20 15:54 ` Tony Lindgren
  2020-02-20 16:03   ` Andrew F. Davis
  0 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2020-02-20 15:54 UTC (permalink / raw)
  To: Andrew F. Davis; +Cc: kbuild-all, linux-kernel, kbuild test robot

Andrew,

* kbuild test robot <lkp@intel.com> [200213 10:27]:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
> date:   3 weeks ago
> config: arm-randconfig-a001-20200213 (attached as .config)
> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
>         # save the attached .config to linux build tree
>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
> >> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'

Have you looked at this one? Looks like there's still an unhandled
randconfig build case.

Regards,

Tony

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 15:54 ` Tony Lindgren
@ 2020-02-20 16:03   ` Andrew F. Davis
  2020-02-20 16:20     ` Tony Lindgren
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew F. Davis @ 2020-02-20 16:03 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: kbuild-all, linux-kernel, kbuild test robot

On 2/20/20 10:54 AM, Tony Lindgren wrote:
> Andrew,
> 
> * kbuild test robot <lkp@intel.com> [200213 10:27]:
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
>> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
>> date:   3 weeks ago
>> config: arm-randconfig-a001-20200213 (attached as .config)
>> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
>> reproduce:
>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>         chmod +x ~/bin/make.cross
>>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
>>         # save the attached .config to linux build tree
>>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
>>
>> If you fix the issue, kindly add following tag
>> Reported-by: kbuild test robot <lkp@intel.com>
>>
>> All errors (new ones prefixed by >>):
>>
>>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
>>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> 
> Have you looked at this one? Looks like there's still an unhandled
> randconfig build case.
> 


I've had a quick look, all the ARM config does:

select HAVE_ARM_SMCCC if CPU_V7

so I don't think this will happen in any real config, but if we want to
prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
on it.

Andrew


> Regards,
> 
> Tony
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 16:03   ` Andrew F. Davis
@ 2020-02-20 16:20     ` Tony Lindgren
  2020-02-20 16:23       ` Andrew F. Davis
  0 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2020-02-20 16:20 UTC (permalink / raw)
  To: Andrew F. Davis; +Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap

* Andrew F. Davis <afd@ti.com> [200220 16:04]:
> On 2/20/20 10:54 AM, Tony Lindgren wrote:
> > Andrew,
> > 
> > * kbuild test robot <lkp@intel.com> [200213 10:27]:
> >> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
> >> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
> >> date:   3 weeks ago
> >> config: arm-randconfig-a001-20200213 (attached as .config)
> >> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
> >> reproduce:
> >>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >>         chmod +x ~/bin/make.cross
> >>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
> >>         # save the attached .config to linux build tree
> >>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
> >>
> >> If you fix the issue, kindly add following tag
> >> Reported-by: kbuild test robot <lkp@intel.com>
> >>
> >> All errors (new ones prefixed by >>):
> >>
> >>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
> >>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> > 
> > Have you looked at this one? Looks like there's still an unhandled
> > randconfig build case.
> > 
> 
> 
> I've had a quick look, all the ARM config does:
> 
> select HAVE_ARM_SMCCC if CPU_V7
> 
> so I don't think this will happen in any real config, but if we want to
> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
> on it.

Seems to happen at least with omap2 only config where we don't have
CPU_V7. Something like below seems to fix it.

If that looks OK to you, I'll send out a proper fix.

Regards,

Tony

8< -----------------------
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,11 @@ 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)
+{
+}
+#endif
 
 void omap_smc1(u32 fn, u32 arg)
 {

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 16:20     ` Tony Lindgren
@ 2020-02-20 16:23       ` Andrew F. Davis
  2020-02-20 16:37         ` Tony Lindgren
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew F. Davis @ 2020-02-20 16:23 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap

On 2/20/20 11:20 AM, Tony Lindgren wrote:
> * Andrew F. Davis <afd@ti.com> [200220 16:04]:
>> On 2/20/20 10:54 AM, Tony Lindgren wrote:
>>> Andrew,
>>>
>>> * kbuild test robot <lkp@intel.com> [200213 10:27]:
>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
>>>> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
>>>> date:   3 weeks ago
>>>> config: arm-randconfig-a001-20200213 (attached as .config)
>>>> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
>>>> reproduce:
>>>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>>         chmod +x ~/bin/make.cross
>>>>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
>>>>         # save the attached .config to linux build tree
>>>>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
>>>>
>>>> If you fix the issue, kindly add following tag
>>>> Reported-by: kbuild test robot <lkp@intel.com>
>>>>
>>>> All errors (new ones prefixed by >>):
>>>>
>>>>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
>>>>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
>>>
>>> Have you looked at this one? Looks like there's still an unhandled
>>> randconfig build case.
>>>
>>
>>
>> I've had a quick look, all the ARM config does:
>>
>> select HAVE_ARM_SMCCC if CPU_V7
>>
>> so I don't think this will happen in any real config, but if we want to
>> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
>> on it.
> 
> Seems to happen at least with omap2 only config where we don't have
> CPU_V7. Something like below seems to fix it.
> 
> If that looks OK to you, I'll send out a proper fix.
> 


This looks fine to me.

A better later fix might be to later stub out the actual __arm_smccc_smc
in common code if CONFIG_HAVE_ARM_SMCCC is not set, so any platform will
get the fix.

Andrew


> Regards,
> 
> Tony
> 
> 8< -----------------------
> 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,11 @@ 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)
> +{
> +}
> +#endif
>  
>  void omap_smc1(u32 fn, u32 arg)
>  {
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 16:23       ` Andrew F. Davis
@ 2020-02-20 16:37         ` Tony Lindgren
  2020-02-20 17:13           ` Tony Lindgren
  0 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2020-02-20 16:37 UTC (permalink / raw)
  To: Andrew F. Davis
  Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap,
	Aaro Koskinen, Marc Zyngier, linux-arm-kernel

* Andrew F. Davis <afd@ti.com> [200220 16:24]:
> On 2/20/20 11:20 AM, Tony Lindgren wrote:
> > * Andrew F. Davis <afd@ti.com> [200220 16:04]:
> >> On 2/20/20 10:54 AM, Tony Lindgren wrote:
> >>> Andrew,
> >>>
> >>> * kbuild test robot <lkp@intel.com> [200213 10:27]:
> >>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >>>> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
> >>>> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
> >>>> date:   3 weeks ago
> >>>> config: arm-randconfig-a001-20200213 (attached as .config)
> >>>> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
> >>>> reproduce:
> >>>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >>>>         chmod +x ~/bin/make.cross
> >>>>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
> >>>>         # save the attached .config to linux build tree
> >>>>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
> >>>>
> >>>> If you fix the issue, kindly add following tag
> >>>> Reported-by: kbuild test robot <lkp@intel.com>
> >>>>
> >>>> All errors (new ones prefixed by >>):
> >>>>
> >>>>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
> >>>>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> >>>
> >>> Have you looked at this one? Looks like there's still an unhandled
> >>> randconfig build case.
> >>>
> >>
> >>
> >> I've had a quick look, all the ARM config does:
> >>
> >> select HAVE_ARM_SMCCC if CPU_V7
> >>
> >> so I don't think this will happen in any real config, but if we want to
> >> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
> >> on it.
> > 
> > Seems to happen at least with omap2 only config where we don't have
> > CPU_V7. Something like below seems to fix it.
> > 
> > If that looks OK to you, I'll send out a proper fix.
> > 
> 
> 
> This looks fine to me.
> 
> A better later fix might be to later stub out the actual __arm_smccc_smc
> in common code if CONFIG_HAVE_ARM_SMCCC is not set, so any platform will
> get the fix.

Yeah seems that might be better. Adding Aaro and Marc to Cc.

Regards,

Tony

> > 8< -----------------------
> > 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,11 @@ 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)
> > +{
> > +}
> > +#endif
> >  
> >  void omap_smc1(u32 fn, u32 arg)
> >  {
> > 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 16:37         ` Tony Lindgren
@ 2020-02-20 17:13           ` Tony Lindgren
  2020-02-20 17:39             ` Andrew F. Davis
  0 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2020-02-20 17:13 UTC (permalink / raw)
  To: Andrew F. Davis
  Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap,
	Aaro Koskinen, Marc Zyngier, linux-arm-kernel

* Tony Lindgren <tony@atomide.com> [200220 16:37]:
> * Andrew F. Davis <afd@ti.com> [200220 16:24]:
> > On 2/20/20 11:20 AM, Tony Lindgren wrote:
> > > * Andrew F. Davis <afd@ti.com> [200220 16:04]:
> > >> On 2/20/20 10:54 AM, Tony Lindgren wrote:
> > >>> Andrew,
> > >>>
> > >>> * kbuild test robot <lkp@intel.com> [200213 10:27]:
> > >>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > >>>> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
> > >>>> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
> > >>>> date:   3 weeks ago
> > >>>> config: arm-randconfig-a001-20200213 (attached as .config)
> > >>>> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
> > >>>> reproduce:
> > >>>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > >>>>         chmod +x ~/bin/make.cross
> > >>>>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
> > >>>>         # save the attached .config to linux build tree
> > >>>>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
> > >>>>
> > >>>> If you fix the issue, kindly add following tag
> > >>>> Reported-by: kbuild test robot <lkp@intel.com>
> > >>>>
> > >>>> All errors (new ones prefixed by >>):
> > >>>>
> > >>>>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
> > >>>>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> > >>>
> > >>> Have you looked at this one? Looks like there's still an unhandled
> > >>> randconfig build case.
> > >>>
> > >>
> > >>
> > >> I've had a quick look, all the ARM config does:
> > >>
> > >> select HAVE_ARM_SMCCC if CPU_V7
> > >>
> > >> so I don't think this will happen in any real config, but if we want to
> > >> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
> > >> on it.
> > > 
> > > Seems to happen at least with omap2 only config where we don't have
> > > CPU_V7. Something like below seems to fix it.
> > > 
> > > If that looks OK to you, I'll send out a proper fix.
> > > 
> > 
> > 
> > This looks fine to me.
> > 
> > A better later fix might be to later stub out the actual __arm_smccc_smc
> > in common code if CONFIG_HAVE_ARM_SMCCC is not set, so any platform will
> > get the fix.
> 
> Yeah seems that might be better. Adding Aaro and Marc to Cc.

But if we can in theory have some arm11 machine with smccc, then this
local ifdef below is probably the way to go.

Regards,

Tony

> > > 8< -----------------------
> > > 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,11 @@ 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)
> > > +{
> > > +}
> > > +#endif
> > >  
> > >  void omap_smc1(u32 fn, u32 arg)
> > >  {
> > > 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 17:13           ` Tony Lindgren
@ 2020-02-20 17:39             ` Andrew F. Davis
  2020-02-20 17:57               ` Tony Lindgren
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew F. Davis @ 2020-02-20 17:39 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap,
	Aaro Koskinen, Marc Zyngier, linux-arm-kernel

On 2/20/20 12:13 PM, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [200220 16:37]:
>> * Andrew F. Davis <afd@ti.com> [200220 16:24]:
>>> On 2/20/20 11:20 AM, Tony Lindgren wrote:
>>>> * Andrew F. Davis <afd@ti.com> [200220 16:04]:
>>>>> On 2/20/20 10:54 AM, Tony Lindgren wrote:
>>>>>> Andrew,
>>>>>>
>>>>>> * kbuild test robot <lkp@intel.com> [200213 10:27]:
>>>>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>>>>> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
>>>>>>> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
>>>>>>> date:   3 weeks ago
>>>>>>> config: arm-randconfig-a001-20200213 (attached as .config)
>>>>>>> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
>>>>>>> reproduce:
>>>>>>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>>>>>         chmod +x ~/bin/make.cross
>>>>>>>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
>>>>>>>         # save the attached .config to linux build tree
>>>>>>>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
>>>>>>>
>>>>>>> If you fix the issue, kindly add following tag
>>>>>>> Reported-by: kbuild test robot <lkp@intel.com>
>>>>>>>
>>>>>>> All errors (new ones prefixed by >>):
>>>>>>>
>>>>>>>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
>>>>>>>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
>>>>>>
>>>>>> Have you looked at this one? Looks like there's still an unhandled
>>>>>> randconfig build case.
>>>>>>
>>>>>
>>>>>
>>>>> I've had a quick look, all the ARM config does:
>>>>>
>>>>> select HAVE_ARM_SMCCC if CPU_V7
>>>>>
>>>>> so I don't think this will happen in any real config, but if we want to
>>>>> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
>>>>> on it.
>>>>
>>>> Seems to happen at least with omap2 only config where we don't have
>>>> CPU_V7. Something like below seems to fix it.
>>>>
>>>> If that looks OK to you, I'll send out a proper fix.
>>>>
>>>
>>>
>>> This looks fine to me.
>>>
>>> A better later fix might be to later stub out the actual __arm_smccc_smc
>>> in common code if CONFIG_HAVE_ARM_SMCCC is not set, so any platform will
>>> get the fix.
>>
>> Yeah seems that might be better. Adding Aaro and Marc to Cc.
> 
> But if we can in theory have some arm11 machine with smccc, then this
> local ifdef below is probably the way to go.
> 

If the machine has SMCCC then it will also have the
CONFIG_HAVE_ARM_SMCCC set and so nothing would change.

Andrew


> Regards,
> 
> Tony
> 
>>>> 8< -----------------------
>>>> 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,11 @@ 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)
>>>> +{
>>>> +}
>>>> +#endif
>>>>  
>>>>  void omap_smc1(u32 fn, u32 arg)
>>>>  {
>>>>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 17:39             ` Andrew F. Davis
@ 2020-02-20 17:57               ` Tony Lindgren
  2020-02-20 18:11                 ` Tony Lindgren
  0 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2020-02-20 17:57 UTC (permalink / raw)
  To: Andrew F. Davis
  Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap,
	Aaro Koskinen, Marc Zyngier, linux-arm-kernel

* Andrew F. Davis <afd@ti.com> [200220 17:39]:
> On 2/20/20 12:13 PM, Tony Lindgren wrote:
> > * Tony Lindgren <tony@atomide.com> [200220 16:37]:
> >> * Andrew F. Davis <afd@ti.com> [200220 16:24]:
> >>> On 2/20/20 11:20 AM, Tony Lindgren wrote:
> >>>> * Andrew F. Davis <afd@ti.com> [200220 16:04]:
> >>>>> On 2/20/20 10:54 AM, Tony Lindgren wrote:
> >>>>>> Andrew,
> >>>>>>
> >>>>>> * kbuild test robot <lkp@intel.com> [200213 10:27]:
> >>>>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >>>>>>> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
> >>>>>>> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
> >>>>>>> date:   3 weeks ago
> >>>>>>> config: arm-randconfig-a001-20200213 (attached as .config)
> >>>>>>> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
> >>>>>>> reproduce:
> >>>>>>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >>>>>>>         chmod +x ~/bin/make.cross
> >>>>>>>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
> >>>>>>>         # save the attached .config to linux build tree
> >>>>>>>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
> >>>>>>>
> >>>>>>> If you fix the issue, kindly add following tag
> >>>>>>> Reported-by: kbuild test robot <lkp@intel.com>
> >>>>>>>
> >>>>>>> All errors (new ones prefixed by >>):
> >>>>>>>
> >>>>>>>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
> >>>>>>>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> >>>>>>
> >>>>>> Have you looked at this one? Looks like there's still an unhandled
> >>>>>> randconfig build case.
> >>>>>>
> >>>>>
> >>>>>
> >>>>> I've had a quick look, all the ARM config does:
> >>>>>
> >>>>> select HAVE_ARM_SMCCC if CPU_V7
> >>>>>
> >>>>> so I don't think this will happen in any real config, but if we want to
> >>>>> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
> >>>>> on it.
> >>>>
> >>>> Seems to happen at least with omap2 only config where we don't have
> >>>> CPU_V7. Something like below seems to fix it.
> >>>>
> >>>> If that looks OK to you, I'll send out a proper fix.
> >>>>
> >>>
> >>>
> >>> This looks fine to me.
> >>>
> >>> A better later fix might be to later stub out the actual __arm_smccc_smc
> >>> in common code if CONFIG_HAVE_ARM_SMCCC is not set, so any platform will
> >>> get the fix.
> >>
> >> Yeah seems that might be better. Adding Aaro and Marc to Cc.
> > 
> > But if we can in theory have some arm11 machine with smccc, then this
> > local ifdef below is probably the way to go.
> > 
> 
> If the machine has SMCCC then it will also have the
> CONFIG_HAVE_ARM_SMCCC set and so nothing would change.

Hmm yeah good point.

Regards,

Tony


> >>>> 8< -----------------------
> >>>> 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,11 @@ 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)
> >>>> +{
> >>>> +}
> >>>> +#endif
> >>>>  
> >>>>  void omap_smc1(u32 fn, u32 arg)
> >>>>  {
> >>>>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 17:57               ` Tony Lindgren
@ 2020-02-20 18:11                 ` Tony Lindgren
  2020-02-20 18:22                   ` Andrew F. Davis
  0 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2020-02-20 18:11 UTC (permalink / raw)
  To: Andrew F. Davis
  Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap,
	Aaro Koskinen, Marc Zyngier, linux-arm-kernel, Arnd Bergmann,
	Rob Herring

* Tony Lindgren <tony@atomide.com> [200220 17:58]:
> * Andrew F. Davis <afd@ti.com> [200220 17:39]:
> > On 2/20/20 12:13 PM, Tony Lindgren wrote:
> > > * Tony Lindgren <tony@atomide.com> [200220 16:37]:
> > >> * Andrew F. Davis <afd@ti.com> [200220 16:24]:
> > >>> On 2/20/20 11:20 AM, Tony Lindgren wrote:
> > >>>> * Andrew F. Davis <afd@ti.com> [200220 16:04]:
> > >>>>> On 2/20/20 10:54 AM, Tony Lindgren wrote:
> > >>>>>> Andrew,
> > >>>>>>
> > >>>>>> * kbuild test robot <lkp@intel.com> [200213 10:27]:
> > >>>>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > >>>>>>> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
> > >>>>>>> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
> > >>>>>>> date:   3 weeks ago
> > >>>>>>> config: arm-randconfig-a001-20200213 (attached as .config)
> > >>>>>>> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
> > >>>>>>> reproduce:
> > >>>>>>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > >>>>>>>         chmod +x ~/bin/make.cross
> > >>>>>>>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
> > >>>>>>>         # save the attached .config to linux build tree
> > >>>>>>>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
> > >>>>>>>
> > >>>>>>> If you fix the issue, kindly add following tag
> > >>>>>>> Reported-by: kbuild test robot <lkp@intel.com>
> > >>>>>>>
> > >>>>>>> All errors (new ones prefixed by >>):
> > >>>>>>>
> > >>>>>>>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
> > >>>>>>>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> > >>>>>>
> > >>>>>> Have you looked at this one? Looks like there's still an unhandled
> > >>>>>> randconfig build case.
> > >>>>>>
> > >>>>>
> > >>>>>
> > >>>>> I've had a quick look, all the ARM config does:
> > >>>>>
> > >>>>> select HAVE_ARM_SMCCC if CPU_V7
> > >>>>>
> > >>>>> so I don't think this will happen in any real config, but if we want to
> > >>>>> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
> > >>>>> on it.
> > >>>>
> > >>>> Seems to happen at least with omap2 only config where we don't have
> > >>>> CPU_V7. Something like below seems to fix it.
> > >>>>
> > >>>> If that looks OK to you, I'll send out a proper fix.
> > >>>>
> > >>>
> > >>>
> > >>> This looks fine to me.
> > >>>
> > >>> A better later fix might be to later stub out the actual __arm_smccc_smc
> > >>> in common code if CONFIG_HAVE_ARM_SMCCC is not set, so any platform will
> > >>> get the fix.
> > >>
> > >> Yeah seems that might be better. Adding Aaro and Marc to Cc.
> > > 
> > > But if we can in theory have some arm11 machine with smccc, then this
> > > local ifdef below is probably the way to go.
> > > 
> > 
> > If the machine has SMCCC then it will also have the
> > CONFIG_HAVE_ARM_SMCCC set and so nothing would change.
> 
> Hmm yeah good point.

So the patch below seems like the way to go then. Anybody have issues
with the patch below?

Regards,

Tony

8< -------------------------
diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -121,6 +121,7 @@ struct arm_smccc_quirk {
 	} state;
 };
 
+#ifdef CONFIG_HAVE_ARM_SMCCC
 /**
  * __arm_smccc_smc() - make SMC calls
  * @a0-a7: arguments passed in registers 0 to 7
@@ -137,6 +138,14 @@ asmlinkage void __arm_smccc_smc(unsigned long a0, unsigned long a1,
 			unsigned long a2, unsigned long a3, unsigned long a4,
 			unsigned long a5, unsigned long a6, unsigned long a7,
 			struct arm_smccc_res *res, struct arm_smccc_quirk *quirk);
+#else
+static inline void __arm_smccc_smc(unsigned long a0, unsigned long a1,
+			unsigned long a2, unsigned long a3, unsigned long a4,
+			unsigned long a5, unsigned long a6, unsigned long a7,
+			struct arm_smccc_res *res, struct arm_smccc_quirk *quirk)
+{
+}
+#endif
 
 /**
  * __arm_smccc_hvc() - make HVC calls

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 18:11                 ` Tony Lindgren
@ 2020-02-20 18:22                   ` Andrew F. Davis
  2020-02-21 17:26                     ` Tony Lindgren
  2020-02-21 17:54                     ` Tony Lindgren
  0 siblings, 2 replies; 13+ messages in thread
From: Andrew F. Davis @ 2020-02-20 18:22 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap,
	Aaro Koskinen, Marc Zyngier, linux-arm-kernel, Arnd Bergmann,
	Rob Herring

On 2/20/20 1:11 PM, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [200220 17:58]:
>> * Andrew F. Davis <afd@ti.com> [200220 17:39]:
>>> On 2/20/20 12:13 PM, Tony Lindgren wrote:
>>>> * Tony Lindgren <tony@atomide.com> [200220 16:37]:
>>>>> * Andrew F. Davis <afd@ti.com> [200220 16:24]:
>>>>>> On 2/20/20 11:20 AM, Tony Lindgren wrote:
>>>>>>> * Andrew F. Davis <afd@ti.com> [200220 16:04]:
>>>>>>>> On 2/20/20 10:54 AM, Tony Lindgren wrote:
>>>>>>>>> Andrew,
>>>>>>>>>
>>>>>>>>> * kbuild test robot <lkp@intel.com> [200213 10:27]:
>>>>>>>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>>>>>>>> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
>>>>>>>>>> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
>>>>>>>>>> date:   3 weeks ago
>>>>>>>>>> config: arm-randconfig-a001-20200213 (attached as .config)
>>>>>>>>>> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
>>>>>>>>>> reproduce:
>>>>>>>>>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>>>>>>>>         chmod +x ~/bin/make.cross
>>>>>>>>>>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
>>>>>>>>>>         # save the attached .config to linux build tree
>>>>>>>>>>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
>>>>>>>>>>
>>>>>>>>>> If you fix the issue, kindly add following tag
>>>>>>>>>> Reported-by: kbuild test robot <lkp@intel.com>
>>>>>>>>>>
>>>>>>>>>> All errors (new ones prefixed by >>):
>>>>>>>>>>
>>>>>>>>>>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
>>>>>>>>>>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
>>>>>>>>>
>>>>>>>>> Have you looked at this one? Looks like there's still an unhandled
>>>>>>>>> randconfig build case.
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I've had a quick look, all the ARM config does:
>>>>>>>>
>>>>>>>> select HAVE_ARM_SMCCC if CPU_V7
>>>>>>>>
>>>>>>>> so I don't think this will happen in any real config, but if we want to
>>>>>>>> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
>>>>>>>> on it.
>>>>>>>
>>>>>>> Seems to happen at least with omap2 only config where we don't have
>>>>>>> CPU_V7. Something like below seems to fix it.
>>>>>>>
>>>>>>> If that looks OK to you, I'll send out a proper fix.
>>>>>>>
>>>>>>
>>>>>>
>>>>>> This looks fine to me.
>>>>>>
>>>>>> A better later fix might be to later stub out the actual __arm_smccc_smc
>>>>>> in common code if CONFIG_HAVE_ARM_SMCCC is not set, so any platform will
>>>>>> get the fix.
>>>>>
>>>>> Yeah seems that might be better. Adding Aaro and Marc to Cc.
>>>>
>>>> But if we can in theory have some arm11 machine with smccc, then this
>>>> local ifdef below is probably the way to go.
>>>>
>>>
>>> If the machine has SMCCC then it will also have the
>>> CONFIG_HAVE_ARM_SMCCC set and so nothing would change.
>>
>> Hmm yeah good point.
> 
> So the patch below seems like the way to go then. Anybody have issues
> with the patch below?
> 
> Regards,
> 
> Tony
> 
> 8< -------------------------
> diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
> --- a/include/linux/arm-smccc.h
> +++ b/include/linux/arm-smccc.h
> @@ -121,6 +121,7 @@ struct arm_smccc_quirk {
>  	} state;
>  };
>  
> +#ifdef CONFIG_HAVE_ARM_SMCCC
>  /**
>   * __arm_smccc_smc() - make SMC calls
>   * @a0-a7: arguments passed in registers 0 to 7
> @@ -137,6 +138,14 @@ asmlinkage void __arm_smccc_smc(unsigned long a0, unsigned long a1,
>  			unsigned long a2, unsigned long a3, unsigned long a4,
>  			unsigned long a5, unsigned long a6, unsigned long a7,
>  			struct arm_smccc_res *res, struct arm_smccc_quirk *quirk);
> +#else
> +static inline void __arm_smccc_smc(unsigned long a0, unsigned long a1,
> +			unsigned long a2, unsigned long a3, unsigned long a4,
> +			unsigned long a5, unsigned long a6, unsigned long a7,
> +			struct arm_smccc_res *res, struct arm_smccc_quirk *quirk)
> +{


Maybe a warning? If you do not have SMC on your platform but are still
making SMC calls then something is broken and it looks like it would
fail silently here.

Andrew


> +}
> +#endif
>  
>  /**
>   * __arm_smccc_hvc() - make HVC calls
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 18:22                   ` Andrew F. Davis
@ 2020-02-21 17:26                     ` Tony Lindgren
  2020-02-21 17:54                     ` Tony Lindgren
  1 sibling, 0 replies; 13+ messages in thread
From: Tony Lindgren @ 2020-02-21 17:26 UTC (permalink / raw)
  To: Andrew F. Davis
  Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap,
	Aaro Koskinen, Marc Zyngier, linux-arm-kernel, Arnd Bergmann,
	Rob Herring

* Andrew F. Davis <afd@ti.com> [200220 10:23]:
> On 2/20/20 1:11 PM, Tony Lindgren wrote:
> > * Tony Lindgren <tony@atomide.com> [200220 17:58]:
> >> * Andrew F. Davis <afd@ti.com> [200220 17:39]:
> >>> If the machine has SMCCC then it will also have the
> >>> CONFIG_HAVE_ARM_SMCCC set and so nothing would change.
> >>
> >> Hmm yeah good point.
> > 
> > So the patch below seems like the way to go then. Anybody have issues
> > with the patch below?
> > 
> > Regards,
> > 
> > Tony
> > 
> > 8< -------------------------
> > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
> > --- a/include/linux/arm-smccc.h
> > +++ b/include/linux/arm-smccc.h
> > @@ -121,6 +121,7 @@ struct arm_smccc_quirk {
> >  	} state;
> >  };
> >  
> > +#ifdef CONFIG_HAVE_ARM_SMCCC
> >  /**
> >   * __arm_smccc_smc() - make SMC calls
> >   * @a0-a7: arguments passed in registers 0 to 7
> > @@ -137,6 +138,14 @@ asmlinkage void __arm_smccc_smc(unsigned long a0, unsigned long a1,
> >  			unsigned long a2, unsigned long a3, unsigned long a4,
> >  			unsigned long a5, unsigned long a6, unsigned long a7,
> >  			struct arm_smccc_res *res, struct arm_smccc_quirk *quirk);
> > +#else
> > +static inline void __arm_smccc_smc(unsigned long a0, unsigned long a1,
> > +			unsigned long a2, unsigned long a3, unsigned long a4,
> > +			unsigned long a5, unsigned long a6, unsigned long a7,
> > +			struct arm_smccc_res *res, struct arm_smccc_quirk *quirk)
> > +{
> 
> 
> Maybe a warning? If you do not have SMC on your platform but are still
> making SMC calls then something is broken and it looks like it would
> fail silently here.

OK I'll add that and send out a  proper patch.

Thanks,

Tony

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
  2020-02-20 18:22                   ` Andrew F. Davis
  2020-02-21 17:26                     ` Tony Lindgren
@ 2020-02-21 17:54                     ` Tony Lindgren
  1 sibling, 0 replies; 13+ messages in thread
From: Tony Lindgren @ 2020-02-21 17:54 UTC (permalink / raw)
  To: Andrew F. Davis
  Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap,
	Aaro Koskinen, Marc Zyngier, linux-arm-kernel, Arnd Bergmann,
	Rob Herring

* Andrew F. Davis <afd@ti.com> [200220 10:23]:
> On 2/20/20 1:11 PM, Tony Lindgren wrote:
> > * Tony Lindgren <tony@atomide.com> [200220 17:58]:
> >> * Andrew F. Davis <afd@ti.com> [200220 17:39]:
> >>> On 2/20/20 12:13 PM, Tony Lindgren wrote:
> >>>> * Tony Lindgren <tony@atomide.com> [200220 16:37]:
> >>>>> * Andrew F. Davis <afd@ti.com> [200220 16:24]:
> >>>>>> On 2/20/20 11:20 AM, Tony Lindgren wrote:
> >>>>>>> * Andrew F. Davis <afd@ti.com> [200220 16:04]:
> >>>>>>>> On 2/20/20 10:54 AM, Tony Lindgren wrote:
> >>>>>>>>> Andrew,
> >>>>>>>>>
> >>>>>>>>> * kbuild test robot <lkp@intel.com> [200213 10:27]:
> >>>>>>>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >>>>>>>>>> head:   0bf999f9c5e74c7ecf9dafb527146601e5c848b9
> >>>>>>>>>> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
> >>>>>>>>>> date:   3 weeks ago
> >>>>>>>>>> config: arm-randconfig-a001-20200213 (attached as .config)
> >>>>>>>>>> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
> >>>>>>>>>> reproduce:
> >>>>>>>>>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >>>>>>>>>>         chmod +x ~/bin/make.cross
> >>>>>>>>>>         git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
> >>>>>>>>>>         # save the attached .config to linux build tree
> >>>>>>>>>>         GCC_VERSION=7.5.0 make.cross ARCH=arm 
> >>>>>>>>>>
> >>>>>>>>>> If you fix the issue, kindly add following tag
> >>>>>>>>>> Reported-by: kbuild test robot <lkp@intel.com>
> >>>>>>>>>>
> >>>>>>>>>> All errors (new ones prefixed by >>):
> >>>>>>>>>>
> >>>>>>>>>>    arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
> >>>>>>>>>>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> >>>>>>>>>
> >>>>>>>>> Have you looked at this one? Looks like there's still an unhandled
> >>>>>>>>> randconfig build case.
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> I've had a quick look, all the ARM config does:
> >>>>>>>>
> >>>>>>>> select HAVE_ARM_SMCCC if CPU_V7
> >>>>>>>>
> >>>>>>>> so I don't think this will happen in any real config, but if we want to
> >>>>>>>> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
> >>>>>>>> on it.
> >>>>>>>
> >>>>>>> Seems to happen at least with omap2 only config where we don't have
> >>>>>>> CPU_V7. Something like below seems to fix it.
> >>>>>>>
> >>>>>>> If that looks OK to you, I'll send out a proper fix.
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>> This looks fine to me.
> >>>>>>
> >>>>>> A better later fix might be to later stub out the actual __arm_smccc_smc
> >>>>>> in common code if CONFIG_HAVE_ARM_SMCCC is not set, so any platform will
> >>>>>> get the fix.
> >>>>>
> >>>>> Yeah seems that might be better. Adding Aaro and Marc to Cc.
> >>>>
> >>>> But if we can in theory have some arm11 machine with smccc, then this
> >>>> local ifdef below is probably the way to go.
> >>>>
> >>>
> >>> If the machine has SMCCC then it will also have the
> >>> CONFIG_HAVE_ARM_SMCCC set and so nothing would change.
> >>
> >> Hmm yeah good point.
> > 
> > So the patch below seems like the way to go then. Anybody have issues
> > with the patch below?
> > 
> > Regards,
> > 
> > Tony
> > 
> > 8< -------------------------
> > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
> > --- a/include/linux/arm-smccc.h
> > +++ b/include/linux/arm-smccc.h
> > @@ -121,6 +121,7 @@ struct arm_smccc_quirk {
> >  	} state;
> >  };
> >  
> > +#ifdef CONFIG_HAVE_ARM_SMCCC
> >  /**
> >   * __arm_smccc_smc() - make SMC calls
> >   * @a0-a7: arguments passed in registers 0 to 7
> > @@ -137,6 +138,14 @@ asmlinkage void __arm_smccc_smc(unsigned long a0, unsigned long a1,
> >  			unsigned long a2, unsigned long a3, unsigned long a4,
> >  			unsigned long a5, unsigned long a6, unsigned long a7,
> >  			struct arm_smccc_res *res, struct arm_smccc_quirk *quirk);
> > +#else
> > +static inline void __arm_smccc_smc(unsigned long a0, unsigned long a1,
> > +			unsigned long a2, unsigned long a3, unsigned long a4,
> > +			unsigned long a5, unsigned long a6, unsigned long a7,
> > +			struct arm_smccc_res *res, struct arm_smccc_quirk *quirk)
> > +{
> 
> 
> Maybe a warning? If you do not have SMC on your platform but are still
> making SMC calls then something is broken and it looks like it would
> fail silently here.

Actually I'll go back to the earlier local fix. With above changes,
we now start getting uninitialized struct arm_smccc_res res warning
in omap_smccc_smc(). And it's a bit unclear if and with what value
a0 should be initialized. Probably should be SMCCC_RET_NOT_SUPPORTED,
but that then requires moving defines around too. And if it turns
out being version specific define, then we keep piling up more code.

My guess is that it's only few SoCs that might have ARMv6 and v7
both built, so it's not like we'd have to patch all over the place
anyways.

Regards,

Tony

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-02-21 17:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13 10:26 omap-secure.c:undefined reference to `__arm_smccc_smc' kbuild test robot
2020-02-20 15:54 ` Tony Lindgren
2020-02-20 16:03   ` Andrew F. Davis
2020-02-20 16:20     ` Tony Lindgren
2020-02-20 16:23       ` Andrew F. Davis
2020-02-20 16:37         ` Tony Lindgren
2020-02-20 17:13           ` Tony Lindgren
2020-02-20 17:39             ` Andrew F. Davis
2020-02-20 17:57               ` Tony Lindgren
2020-02-20 18:11                 ` Tony Lindgren
2020-02-20 18:22                   ` Andrew F. Davis
2020-02-21 17:26                     ` Tony Lindgren
2020-02-21 17:54                     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).