linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] ARCv2: Add explcit unaligned access support (and ability to disable too)
@ 2019-02-28 17:47 Guenter Roeck
  2019-02-28 18:12 ` Vineet Gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2019-02-28 17:47 UTC (permalink / raw)
  To: Eugeniy Paltsev; +Cc: Vineet Gupta, linux-snps-arc, linux-kernel

On Wed, Jan 30, 2019 at 07:32:41PM +0300, Eugeniy Paltsev wrote:
> As of today we enable unaligned access unconditionally on ARCv2.
> Do this under a Kconfig option to allow disable it for test, benchmarking
> etc. Also while at it
> 
>   - Select HAVE_EFFICIENT_UNALIGNED_ACCESS
>   - Although gcc defaults to unaligned access (since GNU 2018.03), add the
>     right toggles for enabling or disabling as appropriate
>   - update bootlog to prints both HW feature status (exists, enabled/disabled)
>     and SW status (used / not used).
>   - wire up the relaxed memcpy for unaligned access
> 
> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> [vgupta: squashed patches, handle gcc -mno-unaligned-access quick]

Hi,

with my brand-new gcc-8.3.0, built from upstream gcc, this patch
results in

arch/arc/kernel/setup.c: In function 'arc_cpu_mumbojumbo.constprop':
include/linux/compiler.h:348:38: error:
	call to '__compiletime_assert_326' declared with attribute error: gcc doesn't support -mno-unaligned-access

when trying to build allnoconfig or tinyconfig. I get the same results
with gcc-8.2.0.

Do I need some special compiler configuration flag when building the
arcv2 toolchain ? Or am I simply out of luck for using upstream gcc ?

Thanks,
Guenter

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

* Re: [PATCH] ARCv2: Add explcit unaligned access support (and ability to disable too)
  2019-02-28 17:47 [PATCH] ARCv2: Add explcit unaligned access support (and ability to disable too) Guenter Roeck
@ 2019-02-28 18:12 ` Vineet Gupta
  2019-02-28 18:59   ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Vineet Gupta @ 2019-02-28 18:12 UTC (permalink / raw)
  To: Guenter Roeck, Eugeniy Paltsev
  Cc: Claudiu Zissulescu, linux-snps-arc, linux-kernel

On 2/28/19 9:47 AM, Guenter Roeck wrote:
> On Wed, Jan 30, 2019 at 07:32:41PM +0300, Eugeniy Paltsev wrote:
>> As of today we enable unaligned access unconditionally on ARCv2.
>> Do this under a Kconfig option to allow disable it for test, benchmarking
>> etc. Also while at it
>>
>>   - Select HAVE_EFFICIENT_UNALIGNED_ACCESS
>>   - Although gcc defaults to unaligned access (since GNU 2018.03), add the
>>     right toggles for enabling or disabling as appropriate
>>   - update bootlog to prints both HW feature status (exists, enabled/disabled)
>>     and SW status (used / not used).
>>   - wire up the relaxed memcpy for unaligned access
>>
>> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
>> [vgupta: squashed patches, handle gcc -mno-unaligned-access quick]
> Hi,
>
> with my brand-new gcc-8.3.0, built from upstream gcc, this patch
> results in
>
> arch/arc/kernel/setup.c: In function 'arc_cpu_mumbojumbo.constprop':
> include/linux/compiler.h:348:38: error:
> 	call to '__compiletime_assert_326' declared with attribute error: gcc doesn't support -mno-unaligned-access

Sorry it broke ur build - but it did catch a deficiency in compiler as intended -
yay !

> when trying to build allnoconfig or tinyconfig. I get the same results
> with gcc-8.2.0.

Unaligned access code gen was enabled by default in 7.x actually, but us OS folks
were late to find that which led to the recent patch to disable it which was
broken in gcc.
Claudiu fixed gcc promptly but that patch didn't make it to upstream, which I've
posted now.

http://lists.infradead.org/pipermail/linux-snps-arc/2019-February/005522.html

> Do I need some special compiler configuration flag when building the
> arcv2 toolchain ? Or am I simply out of luck for using upstream gcc ?

Once the patch hits mainline you could use that. In the mean time I'll back out
the "detector" as it might trip other people too.

Many Thx for your testing service.
-Vineet

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

* Re: [PATCH] ARCv2: Add explcit unaligned access support (and ability to disable too)
  2019-02-28 18:12 ` Vineet Gupta
@ 2019-02-28 18:59   ` Guenter Roeck
  2019-02-28 19:24     ` Vineet Gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2019-02-28 18:59 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Eugeniy Paltsev, Claudiu Zissulescu, linux-snps-arc, linux-kernel

On Thu, Feb 28, 2019 at 06:12:33PM +0000, Vineet Gupta wrote:
> On 2/28/19 9:47 AM, Guenter Roeck wrote:
> > On Wed, Jan 30, 2019 at 07:32:41PM +0300, Eugeniy Paltsev wrote:
> >> As of today we enable unaligned access unconditionally on ARCv2.
> >> Do this under a Kconfig option to allow disable it for test, benchmarking
> >> etc. Also while at it
> >>
> >>   - Select HAVE_EFFICIENT_UNALIGNED_ACCESS
> >>   - Although gcc defaults to unaligned access (since GNU 2018.03), add the
> >>     right toggles for enabling or disabling as appropriate
> >>   - update bootlog to prints both HW feature status (exists, enabled/disabled)
> >>     and SW status (used / not used).
> >>   - wire up the relaxed memcpy for unaligned access
> >>
> >> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
> >> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> >> [vgupta: squashed patches, handle gcc -mno-unaligned-access quick]
> > Hi,
> >
> > with my brand-new gcc-8.3.0, built from upstream gcc, this patch
> > results in
> >
> > arch/arc/kernel/setup.c: In function 'arc_cpu_mumbojumbo.constprop':
> > include/linux/compiler.h:348:38: error:
> > 	call to '__compiletime_assert_326' declared with attribute error: gcc doesn't support -mno-unaligned-access
> 
> Sorry it broke ur build - but it did catch a deficiency in compiler as intended -
> yay !
> 
> > when trying to build allnoconfig or tinyconfig. I get the same results
> > with gcc-8.2.0.
> 
> Unaligned access code gen was enabled by default in 7.x actually, but us OS folks
> were late to find that which led to the recent patch to disable it which was
> broken in gcc.
> Claudiu fixed gcc promptly but that patch didn't make it to upstream, which I've
> posted now.
> 
> http://lists.infradead.org/pipermail/linux-snps-arc/2019-February/005522.html
> 
> > Do I need some special compiler configuration flag when building the
> > arcv2 toolchain ? Or am I simply out of luck for using upstream gcc ?
> 
> Once the patch hits mainline you could use that. In the mean time I'll back out
> the "detector" as it might trip other people too.
> 

Can you possibly use $(cc-option,-mno-unaligned-access), or would that
defeat the purpose ?

> Many Thx for your testing service.

My pleasure.

Thanks,
Guenter

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

* Re: [PATCH] ARCv2: Add explcit unaligned access support (and ability to disable too)
  2019-02-28 18:59   ` Guenter Roeck
@ 2019-02-28 19:24     ` Vineet Gupta
  2019-03-04 22:32       ` Vineet Gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Vineet Gupta @ 2019-02-28 19:24 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Eugeniy Paltsev, Claudiu Zissulescu, linux-snps-arc, linux-kernel

On 2/28/19 10:59 AM, Guenter Roeck wrote:
>> Once the patch hits mainline you could use that. In the mean time I'll back out
>> the "detector" as it might trip other people too.
>>
> Can you possibly use $(cc-option,-mno-unaligned-access), or would that
> defeat the purpose ?
>

Indeed I was looking into Kconfig documentation and found something similar.
However there's an anti-dependency. It is enabled by default and can only be
disabled with $(cc-option,-mno-unaligned-access)
So guess we will have to change  ARC_USE_UNALIGNED_MEM_ACCESS to
ARC_*LACKS*_UNALIGNED_MEM_ACCESS

I'll tinker a bit and post an update soon.

-Vineet

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

* Re: [PATCH] ARCv2: Add explcit unaligned access support (and ability to disable too)
  2019-02-28 19:24     ` Vineet Gupta
@ 2019-03-04 22:32       ` Vineet Gupta
  0 siblings, 0 replies; 5+ messages in thread
From: Vineet Gupta @ 2019-03-04 22:32 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-snps-arc, Eugeniy Paltsev, linux-kernel, Claudiu Zissulescu

On 2/28/19 11:24 AM, Vineet Gupta wrote:
> On 2/28/19 10:59 AM, Guenter Roeck wrote:
>>> Once the patch hits mainline you could use that. In the mean time I'll back out
>>> the "detector" as it might trip other people too.
>>>
>> Can you possibly use $(cc-option,-mno-unaligned-access), or would that
>> defeat the purpose ?
>>
> Indeed I was looking into Kconfig documentation and found something similar.
> However there's an anti-dependency. It is enabled by default and can only be
> disabled with $(cc-option,-mno-unaligned-access)
> So guess we will have to change  ARC_USE_UNALIGNED_MEM_ACCESS to
> ARC_*LACKS*_UNALIGNED_MEM_ACCESS
>
> I'll tinker a bit and post an update soon.

I got around to testing a patch with inverted option, unaligned access is default
and ARC_UNALIGNED_ACCESS_NONE disables it. This option can depend on
$(cc-option,-mno-unaligned-access). The issue however is "broken" gcc silently
ignoring -mno-unaligned-access. So this option can't be auto disable with affected
gcc. So this approach won't work. The only way out is remove the stringent check
and just wait for upstream gcc to be fixed.


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

end of thread, other threads:[~2019-03-04 22:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 17:47 [PATCH] ARCv2: Add explcit unaligned access support (and ability to disable too) Guenter Roeck
2019-02-28 18:12 ` Vineet Gupta
2019-02-28 18:59   ` Guenter Roeck
2019-02-28 19:24     ` Vineet Gupta
2019-03-04 22:32       ` Vineet Gupta

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).