Android and compatibility with deprecated armv7 instructions

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Jul 3 11:52:43 PDT 2014


On Thu, Jul 03, 2014 at 07:37:39PM +0100, Will Deacon wrote:
> On Thu, Jul 03, 2014 at 07:30:55PM +0100, Russell King - ARM Linux wrote:
> > which produces the correct answer of 5.  SWP_EMULATE is off.  HWCAP_SWP
> > is set (as it always has been).  There's no warning in the kernel
> > message log.
> 
> Even more worrying, that swp you just executed probably wasn't atomic. Try
> it with a multithreaded program...
> 
> > Now look at the situation on ARMv8.  Executing the above suddenly fails
> > with SIGILL.
> > 
> > This means that from the developer and user point of view, there has
> > been *no* visible deprecation of this instruction.  There's only
> > "it used to work on ARMv7 but doesn't on ARMv8".
> > 
> > Yes, SWP_EMULATE was introduced.  Great, that has the power to issue
> > warnings, except it doesn't because they're at DEBUG level, which
> > normally gets compiled out.  So that doesn't help warn people.
> > 
> > Even with SWP_EMULATE enabled and with the debug problem fixed... does
> > it help warn people?  Only if you're running on a CPU with virtualisation
> > extensions, because it silently continues to work on CPUs without.
> 
> Not *quite* true; SWP_EMULATE=y disables the h/w SWP instruction by
> configuring the sctlr accordingly. So even without virtualisation
> extensions (more specifically, on cores with MP extensions), you would
> still see the warning if it was fixed.

Well, does anyone have SWP_EMULATE enabled?

arch/arm/configs/spear13xx_defconfig:# CONFIG_SWP_EMULATE is not set
arch/arm/configs/mvebu_v7_defconfig:# CONFIG_SWP_EMULATE is not set
arch/arm/configs/prima2_defconfig:# CONFIG_SWP_EMULATE is not set
arch/arm/configs/marzen_defconfig:# CONFIG_SWP_EMULATE is not set
arch/arm/configs/shmobile_defconfig:# CONFIG_SWP_EMULATE is not set
arch/arm/configs/koelsch_defconfig:# CONFIG_SWP_EMULATE is not set
arch/arm/configs/vexpress_defconfig:# CONFIG_SWP_EMULATE is not set

I think not.  Even with SWP_EMULATE set, HWCAP_SWP is still
advertised, which you must admit is a very contradictory situation.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.



More information about the linux-arm-kernel mailing list