linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* imx_v6_v7_defconfig: use v7 optimized atomic64* instead of GENERIC_ATOMIC64?
@ 2012-12-12 13:21 Dirk Behme
  2012-12-14  3:33 ` Shawn Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Dirk Behme @ 2012-12-12 13:21 UTC (permalink / raw)
  To: linux-arm-kernel


Working mainly with the i.MX6 using the imx_v6_v7_defconfig, we get 
CONFIG_GENERIC_ATOMIC64=y due to

CONFIG_CPU_V6=y
CONFIG_CPU_V6K=y
CONFIG_CPU_V7=y

and

select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)

in arch/arm/Kconfig.

With this, on the V7 i.MX6 we use the (non-optimized) generic atomic64* 
implementation from lib/atomic64.c instead of the V7 optimized ones from 
arch/arm/include/asm/atomic.h.

Is this intended using imx_v6_v7_defconfig on V7 devices?

Is there any chance to use the optimized atomic64* functionality on V7 
with imx_v6_v7_defconfig? Or is this only possible by disabling 
CONFIG_CPU_V6 and CONFIG_CPU_V6K in the imx_v6_v7_defconfig?

Many thanks and best regards

Dirk

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

* imx_v6_v7_defconfig: use v7 optimized atomic64* instead of GENERIC_ATOMIC64?
  2012-12-12 13:21 imx_v6_v7_defconfig: use v7 optimized atomic64* instead of GENERIC_ATOMIC64? Dirk Behme
@ 2012-12-14  3:33 ` Shawn Guo
  2012-12-14 10:00   ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Guo @ 2012-12-14  3:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 12, 2012 at 02:21:23PM +0100, Dirk Behme wrote:
> 
> Working mainly with the i.MX6 using the imx_v6_v7_defconfig, we get
> CONFIG_GENERIC_ATOMIC64=y due to
> 
> CONFIG_CPU_V6=y
> CONFIG_CPU_V6K=y
> CONFIG_CPU_V7=y
> 
> and
> 
> select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
> 
> in arch/arm/Kconfig.
> 
> With this, on the V7 i.MX6 we use the (non-optimized) generic
> atomic64* implementation from lib/atomic64.c instead of the V7
> optimized ones from arch/arm/include/asm/atomic.h.
> 
Yes, that's how single zImage for v6 and v7 works.

> Is this intended using imx_v6_v7_defconfig on V7 devices?
> 
To maintain the compatibility between v6 and v7 build, we have to live
with that.  Actually, there are much more than just this atomic64
optimization losing.  For example, compiler has some level of
optimization for Cortex-A series cpus with -march=armv7-a flag, but
arch/arm/Makefile will force it to be -march=armv6k when you build
the kernel for you v7 device using imx_v6_v7_defconfig.

> Is there any chance to use the optimized atomic64* functionality on
> V7 with imx_v6_v7_defconfig? Or is this only possible by disabling
> CONFIG_CPU_V6 and CONFIG_CPU_V6K in the imx_v6_v7_defconfig?
> 
If you are running a kernel with imx multiplatform support (will hit
v3.8-rc1 if everything goes well), uncheck System Type --> Multiple
platform selection --> ARMv6 based platforms, otherwise uncheck all
imx31 and imx35 platforms under System Type --> Freescale MXC
Implementations will allow you build a v7 only kernel to have all
those v7 specific optimizations back.

Shawn 

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

* imx_v6_v7_defconfig: use v7 optimized atomic64* instead of GENERIC_ATOMIC64?
  2012-12-14  3:33 ` Shawn Guo
@ 2012-12-14 10:00   ` Russell King - ARM Linux
  0 siblings, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux @ 2012-12-14 10:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Dec 14, 2012 at 11:33:16AM +0800, Shawn Guo wrote:
> To maintain the compatibility between v6 and v7 build, we have to live
> with that.  Actually, there are much more than just this atomic64
> optimization losing.  For example, compiler has some level of
> optimization for Cortex-A series cpus with -march=armv7-a flag, but
> arch/arm/Makefile will force it to be -march=armv6k when you build
> the kernel for you v7 device using imx_v6_v7_defconfig.

Well, the way this stuff is supposed to work is that -march is used to
select the instructions to be used, and -mtune is used to control the
optimization of those instructions.

We're doing mostly the right thing - in that if we have a v6+v7 kernel, we
build for v6 (because a v6 CPU won't have the additional v7 instructions).
However, what we're completely missing is any -mtune for v7 CPUs, which
means the optimizer will schedule instructions for some v6 CPU rather
than v7.  Whether there's much difference or not I don't know, but maybe
that's something which should be looked at?

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

end of thread, other threads:[~2012-12-14 10:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 13:21 imx_v6_v7_defconfig: use v7 optimized atomic64* instead of GENERIC_ATOMIC64? Dirk Behme
2012-12-14  3:33 ` Shawn Guo
2012-12-14 10:00   ` Russell King - ARM Linux

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