arm cortex-a53 errata on andoid
TRANSCRIPT
ARM Cortex-A53 errata on Android@hidenorly
Official ARM Cortex-A53 information
Summary of the errata ● There are critical errata on early verson of
Cortex-A53.○ The errata are only caused in AArch64.
■ Erratum 835769■ Erratum 843419
○ These are for A53 only, not on A57/Denver (nVIDIA).● The solution for the errata is workaround to
avoid the condition by changing the native code sequence.
Errata description from AOSP commit
Erratum 835769.● https://android-review.googlesource.
com/#/c/113144/● AArch64: Addressing Cortex-A53 erratum
835769.● Some early revisions of the Cortex-A53
have an erratum (835769) whereby● it is possible for a 64-bit multiply-
accumulate instruction in AArch64 state to generate an incorrect result.
Erratum 843419● https://android-review.googlesource.
com/#/c/144580/● [AArch64] Workaround for cortex-a53
erratum 843419● Some early revisions of the Cortex-A53
have an erratum (843419).● The details of the erratum are quite
complex and involve dynamic conditions. For the purposes of the workaround we have simplified the static conditions to an ADRP in the last two instructions of a 4KByte page, followed within four instructions by a load/store dependent on the ADRP.
Default 64bit Andoid device configuration brings the ARM errata problematic situation
● Most of 64bit Android devices configure with init.zygote64_32.rc
● And ABI list are configured as○ [ro.product.cpu.abilist]: [arm64-v8a,armeabi-v7a,
armeabi] (from Nexus 9)
Pure Java app will be executing in AArch64 with ART.
Execution mode on abilist=armv8, armeabiv7Executing mode 32bit native library 64bit native library Render Script
64bit none none none
32bit exist none none
32bit none none exist
32bit exist exist exist
64bit exist exist none
Currently, if the apk has 32bit only native libary or the app uses render script, the application will be executing in 32bit. But the RenderScript limitation might be changed future platform.
The errata might be affected to most of applications on 64bit ARM system.
Cases to hit the errataType of code Why? Workaround? Availablity @
25 April 2015
Pure Java code ART compiles dex to AArch64 machine code
Require to patch workaround for ART by device manufacture side
Depends on device
Native library for lib/arm64/
Old toolchain generates the problematic code for the errata
Recompile with workaround enabled toolchain (NDK) by app developer side.
Partially but not fully available on NDK
Java Script with ChromiumWebView
ChromiumWebView is executing in AArch64 mode if your app is running in AArch64.
Accept to use updated version of System WebView through Google Play
Not available
Java Script with Chrome
Chrome is executing in AArch64 on 64bit system
Accept to use updated version of Chrome through Google Play
Not available
Workaround on ART for device FWplatform/art
erratum 835769 https://android-review.googlesource.com/#/c/113144/https://android-review.googlesource.com/#/c/118930/
erratum 843419 https://android-review.googlesource.com/#/c/145099/https://android-review.googlesource.com/#/c/144632/
Please note that ADRP is not used on L MR0 / MR1.And then patches for 843419 are not needed.
Tool chain to build device FWbinutils
erratum 835769 https://android-review.googlesource.com/#/c/112784/https://android-review.googlesource.com/#/c/116841/https://android-review.googlesource.com/#/c/144561/https://android-review.googlesource.com/#/c/144568/https://android-review.googlesource.com/#/c/144574/https://android-review.googlesource.com/#/c/144576/
erratum 843419 https://android-review.googlesource.com/#/c/144580/https://android-review.googlesource.com/#/c/147414/
Basically we can expect them by prebuilt binaries.And it’s regarding ld.bfd.
Tool chain to build device FWplatform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
erratum 835769 https://android-review.googlesource.com/117420
erratum 843419 https://android-review.googlesource.com/145972
Please note that the option is NOT set as default (but will be enabled on NDK, not on platform build).(https://android-review.googlesource.com/#/c/145066/1/build/tools/toolchain-patches/gcc/0013-Modify-LINK_SPEC-to-pass-fix-cortex-a53-843419-as-de.patch)
ldflags:= ¥-Wl --fix-cortex-a53-835769 ¥-Wl --fix-cortex-a53-843419 ¥
Tool chain to build device FWclang, llvm
erratum 835769 https://android-review.googlesource.com/#/c/111240/ (clang)https://android-review.googlesource.com/#/c/111230/ (llvm)
erratum 843419 Not available...
Basically platform build is by gcc and then it should be optional.But NDK supports clang/LLVM. And then without the support, NDK will not be released...
NDK : Native libraries for AArch64
Workaround for 835769 is enabled as default on NDK10d.And then what application developers need to do is to ensure workaround for 843419.But the supported NDK is not released.
JavaScript Engine V8 in Chromiumhttps://code.google.com/p/chromium/issues/list?can=1&q=Cortex+53+errata&colspec=ID+Pri+M+Week+ReleaseBlock+Cr+Status+Owner+Summary+OS+Modified&cells=tileshttps://code.google.com/p/chromium/issues/list?can=1&q=Cortex+53+erratum&colspec=ID+Pri+M+Week+ReleaseBlock+Cr+Status+Owner+Summary+OS+Modified&x=m&y=releaseblock&cells=tiles
But “JavaScriptCore” used in WebKit has already the workaround for 835769 but not for 843419http://code.metager.de/source/xref/WebKit/Source/JavaScriptCore/offlineasm/arm64.rb
Based on my investigation, there is no workaround solution for the errata as of now.
Summary
● For manufacturers/custom ROM developers○ Build FW with the workaround enabled toolchain○ Don’t forget to ensure the binary released SW too.○ Please keep watching not only AOSP but also
chromium’s V8.● For application developers
○ Build your native library with workaround enabed NDK and re-release your app with the library.