Commit 02f7bf13 authored by noel's avatar noel Committed by Commit bot

Revert of Move the call to CRYPTO_set_NEON_capable up. (patchset #1 id:1 of...

Revert of Move the call to CRYPTO_set_NEON_capable up. (patchset #1 id:1 of https://codereview.chromium.org/899463002/)

Reason for revert:
Suspect this change upset the webkit ChromeOS Test 1, Mac 10.8, encrypted
media tests. Reverting to see if these builders turn green.

http://build.chromium.org/p/chromium.webkit/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/9563

Original issue's description:
> Move the call to CRYPTO_set_NEON_capable up.
>
> BoringSSL needs to probe for NEON support via SIGILL in cases where
> getauxval isn't provided and the application doesn't do explicit
> initialisation.
>
> However, Chromium might have gone multithreaded by the time that we
> initialise BoringSSL and, although it doesn't look like we'll race the
> disposition of SIGILL with anything, it's best not to test that hope.
>
> So this change causes CRYPTO_set_NEON_capable to always be called, and
> to be called before SSL_library_init. BoringSSL will take that as a
> signal that probing for NEON support isn't needed.
>
> BUG=none
>
> Committed: https://crrev.com/fa9063829e638aeb72ede79e5d0396a81a0211d1
> Cr-Commit-Position: refs/heads/master@{#314201}

TBR=davidben@chromium.org,agl@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=none

Review URL: https://codereview.chromium.org/895013002

Cr-Commit-Position: refs/heads/master@{#314301}
parent 6e808d16
......@@ -48,18 +48,6 @@ class OpenSSLInitSingleton {
private:
friend struct DefaultSingletonTraits<OpenSSLInitSingleton>;
OpenSSLInitSingleton() {
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
const bool has_neon =
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
// CRYPTO_set_NEON_capable is called before |SSL_library_init| because this
// stops BoringSSL from probing for NEON support via SIGILL in the case
// that getauxval isn't present.
CRYPTO_set_NEON_capable(has_neon);
// See https://code.google.com/p/chromium/issues/detail?id=341598
base::CPU cpu;
CRYPTO_set_NEON_functional(!cpu.has_broken_neon());
#endif
SSL_load_error_strings();
SSL_library_init();
int num_locks = CRYPTO_num_locks();
......@@ -68,6 +56,16 @@ class OpenSSLInitSingleton {
locks_.push_back(new base::Lock());
CRYPTO_set_locking_callback(LockingCallback);
CRYPTO_THREADID_set_callback(CurrentThreadId);
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
const bool has_neon =
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
if (has_neon)
CRYPTO_set_NEON_capable(1);
// See https://code.google.com/p/chromium/issues/detail?id=341598
base::CPU cpu;
CRYPTO_set_NEON_functional(!cpu.has_broken_neon());
#endif
}
~OpenSSLInitSingleton() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment