Re: [PATCHv3 4/4] ARM: kprobes: make more tests conditional

From: Will Deacon
Date: Thu Aug 23 2012 - 08:26:01 EST


On Thu, Aug 23, 2012 at 12:51:01AM +0100, Tixy wrote:
> On Wed, 2012-08-22 at 18:41 +0000, Arnd Bergmann wrote:
> > On Wednesday 22 August 2012, Nicolas Pitre wrote:
> > > On Wed, 22 Aug 2012, Arnd Bergmann wrote:
> > > > >
> > > > > The ldrex/strex instructions are available on ARMv6. It's only the d
> > > > > variants (strexd/ldrexd) which are only available from ARMv6k.
> > > >
> > > > Ok. How is the version below then? I haven't tested this one yet.
> > >
> > > In fact, I think the b variants are ARMv6k+ as well. Only the plain
> > > (non b non d) variants are available on ARMv6.
> >
> > Ok, third attempt then. This leaves ldrex for ARMv6 but marks
> > {st,ld}rex{b,h,d} as V6K specific (which includes ARMv7).
>
> ARMv7 does set CPU_32v6K, because arch/arm/mm/Kconfig has
>
> config CPU_V7
> bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
> select CPU_32v6K
> select CPU_32v7
>
> but this seems more for peripheral reasons not because all the various
> CPU configs systematically select the earlier architecture variants,
> e.g. CPU_V7 doesn't select CPU_32v6.
>
> So I would have been inclined to test for
>
> #if defined(CONFIG_CPU_32v6K) || (__LINUX_ARM_ARCH__ >= 7)

FWIW, the selection of the optimised atomic64 implementation for ARM (which
uses the double-word exclusive instructions) boils down to CONFIG_CPU_32v6K,
so I think the additional __LINUX_ARM_ARCH__ check is probably overkill.

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/