Android and compatibility with deprecated armv7 instructions

Olof Johansson olof at lixom.net
Tue Jul 1 16:42:01 PDT 2014


On Tue, Jul 1, 2014 at 4:06 PM, Colin Cross <ccross at google.com> wrote:
> I know this has been discussed before (for example:
> http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/210309.html),
> but I thought I'd bring it up again before the Android ABI diverges
> from the upstream kernel.
>
> Android armv8 devices expect to have compatibility with existing
> native apps, many of which contain deprecated instructions.  For
> example, the Unity gaming engine used SWP until Unity 3.5, and many
> apps compiled against older versions are still in the app store.
> These apps have been running fine with SWP emulation on all recent
> Android devices with SMP v7 cpus, so they are obviously fine with the
> slowdown of emulation, and they haven't recompiled against a newer
> Unity version for 2 years so it is unrealistic to expect them to be
> updated.  I've also been told Unity used CP15 barriers.
>
> ffmpeg is widely used in popular Android apps and uses the SETEND
> instruction: https://ffmpeg.org/pipermail/ffmpeg-cvslog/2013-August/067252.html
>
> We can carry patches to enable the deprecated armv7 instructions in a
> tree shared by all Android vendors, but it seems like a silly reason
> to diverge from the upstream kernel.  To maintain a consistent ABI for
> all devices we're going to have to test for these instructions in the
> Android compatibility test suite, and the upstream kernel wouldn't
> pass.
>
> Would you consider taking support for SWP emulation, enabling CP15
> barriers (CP15BEN bit only until there's a real device that needs
> emulation, also requires clearing COMPAT_PSR_E_BIT in
> compat_setup_return) and enabling SETEND, all behind a default-off
> CONFIG_DEPRECATED_ARMV7_COMPAT?

It sounds really silly to push back against this, since it's actually
needed by so many platforms out there.

One thing that powerpc did was to add a warning when emulated
instructions are used (with ratelimiting to avoid DoS). See
arch/powerpc/kernel/traps.c, ppc_warn_emulated etc. It gives the best
of both worlds: Lets current software run, but also gives a warning
that someone should probably try to get it recompiled for best
performance at some point (for someone who cares about the logs, which
isn't everybody).


-Olof



More information about the linux-arm-kernel mailing list