arm cortex-a53 errata on andoid

14
ARM Cortex-A53 errata on Android @hidenorly

Upload: hidenorly

Post on 15-Jul-2015

548 views

Category:

Software


6 download

TRANSCRIPT

Page 1: ARM Cortex-A53 Errata on Andoid

ARM Cortex-A53 errata on Android@hidenorly

Page 3: ARM Cortex-A53 Errata on Andoid

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.

Page 4: ARM Cortex-A53 Errata on Andoid

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.

Page 5: ARM Cortex-A53 Errata on Andoid

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.

Page 6: ARM Cortex-A53 Errata on Andoid

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.

Page 7: ARM Cortex-A53 Errata on Andoid

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

Page 8: ARM Cortex-A53 Errata on Andoid

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.

Page 9: ARM Cortex-A53 Errata on Andoid

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.

Page 10: ARM Cortex-A53 Errata on Andoid

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 ¥

Page 11: ARM Cortex-A53 Errata on Andoid

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...

Page 12: ARM Cortex-A53 Errata on Andoid

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.

Page 13: ARM Cortex-A53 Errata on Andoid

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.

Page 14: ARM Cortex-A53 Errata on Andoid

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.