imx_v6_v7_defconfig: use v7 optimized atomic64* instead of GENERIC_ATOMIC64?

Russell King - ARM Linux linux at arm.linux.org.uk
Fri Dec 14 05:00:07 EST 2012


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?



More information about the linux-arm-kernel mailing list