Merge inbound to mozilla-central. a=merge
authorCiure Andrei <aciure@mozilla.com>
Wed, 10 Jul 2019 18:45:52 +0300
changeset 482134 241af4dbb96483e0b9371681d2f19e4f28e5d6ed
parent 482133 255f27d1127ecea0e70d663f39b2964e6781748c (current diff)
parent 482057 90e0236885939fd0f2e5de65807b613576e826cf (diff)
child 482135 84bdb98325f07ff5a2bfe2dd56e1906dab9889d2
child 482183 15c5f53a00653d0228a550ef4655bea567992cdc
child 482236 c4b20b18bf97c553095f7cb3b62bb1f73b10dd14
push id113650
push useraciure@mozilla.com
push dateWed, 10 Jul 2019 15:54:09 +0000
treeherdermozilla-inbound@241af4dbb964 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to mozilla-central. a=merge
gfx/webrender_bindings/RenderThread.cpp
gfx/webrender_bindings/src/bindings.rs
old-configure.in
--- a/old-configure.in
+++ b/old-configure.in
@@ -1532,17 +1532,17 @@ dnl = If NSS was not detected in the sys
 dnl = use the one in the source tree (mozilla/security/nss)
 dnl ========================================================
 
 MOZ_ARG_WITH_BOOL(system-nss,
 [  --with-system-nss       Use system installed NSS],
     _USE_SYSTEM_NSS=1 )
 
 if test -n "$_USE_SYSTEM_NSS"; then
-    AM_PATH_NSS(3.45, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
+    AM_PATH_NSS(3.46, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
 fi
 
 NSS_CFLAGS="$NSS_CFLAGS -I${DIST}/include/nss"
 if test -z "$MOZ_SYSTEM_NSS"; then
    case "${OS_ARCH}" in
         # Only few platforms have been tested with GYP
         WINNT|Darwin|Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|SunOS)
             ;;
--- a/security/nss/TAG-INFO
+++ b/security/nss/TAG-INFO
@@ -1,1 +1,1 @@
-NSS_3_45_RTM
+264f19e7ede7
--- a/security/nss/automation/abi-check/expected-report-libnss3.so.txt
+++ b/security/nss/automation/abi-check/expected-report-libnss3.so.txt
@@ -1,4 +0,0 @@
-
-1 Added function:
-
-  'function SECStatus PK11_FindRawCertsWithSubject(PK11SlotInfo*, SECItem*, CERTCertificateList**)'    {PK11_FindRawCertsWithSubject@@NSS_3.45}
--- a/security/nss/automation/abi-check/expected-report-libssl3.so.txt
+++ b/security/nss/automation/abi-check/expected-report-libssl3.so.txt
@@ -1,22 +0,0 @@
-
-2 functions with some indirect sub-type change:
-
-  [C]'function SECStatus SSL_ConfigServerCert(PRFileDesc*, CERTCertificate*, SECKEYPrivateKey*, const SSLExtraServerCertData*, unsigned int)' at sslcert.c:640:1 has some indirect sub-type changes:
-    parameter 4 of type 'const SSLExtraServerCertData*' has sub-type changes:
-      in pointed to type 'const SSLExtraServerCertData':
-        in unqualified underlying type 'typedef SSLExtraServerCertData' at sslt.h:291:1:
-          underlying type 'struct SSLExtraServerCertDataStr' at sslt.h:256:1 changed:
-            type size changed from 256 to 384 (in bits)
-            2 data member insertions:
-              'const SECItem* SSLExtraServerCertDataStr::delegCred', at offset 256 (in bits) at sslt.h:283:1
-              'const SECKEYPrivateKey* SSLExtraServerCertDataStr::delegCredPrivKey', at offset 320 (in bits) at sslt.h:290:1
-
-  [C]'function SECStatus SSL_GetChannelInfo(PRFileDesc*, SSLChannelInfo*, PRUintn)' at sslinfo.c:13:1 has some indirect sub-type changes:
-    parameter 2 of type 'SSLChannelInfo*' has sub-type changes:
-      in pointed to type 'typedef SSLChannelInfo' at sslt.h:357:1:
-        underlying type 'struct SSLChannelInfoStr' at sslt.h:272:1 changed:
-          type size hasn't changed
-          1 data member insertion:
-            'PRBool SSLChannelInfoStr::peerDelegCred', at offset 928 (in bits) at sslt.h:353:1
-
-
--- a/security/nss/automation/abi-check/previous-nss-release
+++ b/security/nss/automation/abi-check/previous-nss-release
@@ -1,1 +1,1 @@
-NSS_3_44_BRANCH
+NSS_3_45_BRANCH
--- a/security/nss/coreconf/coreconf.dep
+++ b/security/nss/coreconf/coreconf.dep
@@ -5,8 +5,9 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSS in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
+
--- a/security/nss/lib/freebl/Makefile
+++ b/security/nss/lib/freebl/Makefile
@@ -237,16 +237,19 @@ ifeq ($(CPU_ARCH),x86)
     DEFINES += -DMP_IS_LITTLE_ENDIAN
 endif
 ifeq ($(CPU_ARCH),arm)
     DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE 
     DEFINES += -DMP_USE_UINT_DIGIT
     DEFINES += -DSHA_NO_LONG_LONG # avoid 64-bit arithmetic in SHA512
     MPI_SRCS += mpi_arm.c
 endif
+ifeq ($(CPU_ARCH),aarch64)
+    EXTRA_SRCS += gcm-aarch64.c
+endif
 ifeq ($(CPU_ARCH),ppc)
 ifdef USE_64
     DEFINES += -DNSS_NO_INIT_SUPPORT
 endif # USE_64
 endif # ppc
 endif # Linux
 
 ifeq ($(OS_TARGET),AIX)
@@ -752,8 +755,12 @@ endif
 endif
 
 ifdef INTEL_GCM_CLANG_CL
 #
 # clang-cl needs -mssse3
 #
 $(OBJDIR)/$(PROG_PREFIX)intel-gcm-wrap$(OBJ_SUFFIX): CFLAGS += -mssse3
 endif
+
+ifeq ($(CPU_ARCH),aarch64)
+$(OBJDIR)/$(PROG_PREFIX)gcm-aarch64$(OBJ_SUFFIX): CFLAGS += -march=armv8-a+crypto
+endif
--- a/security/nss/lib/freebl/blinit.c
+++ b/security/nss/lib/freebl/blinit.c
@@ -132,20 +132,21 @@ static unsigned long (*getauxval)(unsign
 #define HWCAP_SHA2 (1 << 6)
 #endif
 
 void
 CheckARMSupport()
 {
     char *disable_arm_neon = PR_GetEnvSecure("NSS_DISABLE_ARM_NEON");
     char *disable_hw_aes = PR_GetEnvSecure("NSS_DISABLE_HW_AES");
+    char *disable_pmull = PR_GetEnvSecure("NSS_DISABLE_PMULL");
     if (getauxval) {
         long hwcaps = getauxval(AT_HWCAP);
         arm_aes_support_ = hwcaps & HWCAP_AES && disable_hw_aes == NULL;
-        arm_pmull_support_ = hwcaps & HWCAP_PMULL;
+        arm_pmull_support_ = hwcaps & HWCAP_PMULL && disable_pmull == NULL;
         arm_sha1_support_ = hwcaps & HWCAP_SHA1;
         arm_sha2_support_ = hwcaps & HWCAP_SHA2;
     }
     /* aarch64 must support NEON. */
     arm_neon_support_ = disable_arm_neon == NULL;
 }
 #endif /* defined(__aarch64__) */
 
--- a/security/nss/lib/freebl/freebl.gyp
+++ b/security/nss/lib/freebl/freebl.gyp
@@ -112,16 +112,32 @@
             'OTHER_CFLAGS': [
               '-mpclmul', '-maes'
             ],
           },
         }]
       ]
     },
     {
+      'target_name': 'gcm-aes-aarch64_c_lib',
+      'type': 'static_library',
+      'sources': [
+        'gcm-aarch64.c'
+      ],
+      'dependencies': [
+        '<(DEPTH)/exports.gyp:nss_exports'
+      ],
+      'cflags': [
+        '-march=armv8-a+crypto'
+      ],
+      'cflags_mozilla': [
+        '-march=armv8-a+crypto'
+      ]
+    },
+    {
       'target_name': 'freebl',
       'type': 'static_library',
       'sources': [
         'loader.c'
       ],
       'dependencies': [
         '<(DEPTH)/exports.gyp:nss_exports'
       ]
@@ -140,16 +156,21 @@
         'hw-acc-crypto',
       ],
       'conditions': [
         [ 'target_arch=="ia32" or target_arch=="x64"', {
           'dependencies': [
             'gcm-aes-x86_c_lib',
           ],
         }],
+        [ 'target_arch=="arm64" or target_arch=="aarch64"', {
+          'dependencies': [
+            'gcm-aes-aarch64_c_lib',
+          ],
+        }],
         [ 'OS=="linux"', {
           'defines!': [
             'FREEBL_NO_DEPEND',
             'FREEBL_LOWHASH',
             'USE_HW_AES',
             'INTEL_GCM',
           ],
           'conditions': [
@@ -177,16 +198,21 @@
         'hw-acc-crypto',
       ],
       'conditions': [
         [ 'target_arch=="ia32" or target_arch=="x64"', {
           'dependencies': [
             'gcm-aes-x86_c_lib',
           ]
         }],
+        [ 'target_arch=="arm64" or target_arch=="aarch64"', {
+          'dependencies': [
+            'gcm-aes-aarch64_c_lib',
+          ],
+        }],
         [ 'OS!="linux"', {
           'conditions': [
             [ 'moz_fold_libs==0', {
               'dependencies': [
                 '<(DEPTH)/lib/util/util.gyp:nssutil3',
               ],
             }, {
               'libraries': [
new file mode 100644
--- /dev/null
+++ b/security/nss/lib/freebl/gcm-aarch64.c
@@ -0,0 +1,95 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifdef FREEBL_NO_DEPEND
+#include "stubs.h"
+#endif
+#include "gcm.h"
+#include "secerr.h"
+
+/* old gcc doesn't support some poly64x2_t intrinsic */
+#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 6)
+
+#include <arm_neon.h>
+
+SECStatus
+gcm_HashWrite_hw(gcmHashContext *ghash, unsigned char *outbuf)
+{
+    uint8x16_t ci = vrbitq_u8(vreinterpretq_u8_u64(ghash->x));
+    vst1q_u8(outbuf, ci);
+    return SECSuccess;
+}
+
+SECStatus
+gcm_HashMult_hw(gcmHashContext *ghash, const unsigned char *buf,
+                unsigned int count)
+{
+    const poly64x2_t p = vdupq_n_p64(0x87);
+    const uint8x16_t zero = vdupq_n_u8(0);
+    const uint64x2_t h = ghash->h;
+    uint64x2_t ci = ghash->x;
+    unsigned int i;
+    uint8x16_t z_low, z_high;
+    uint8x16_t t_low, t_high;
+    poly64x2_t t1;
+    uint8x16_t t2;
+
+    for (i = 0; i < count; i++, buf += 16) {
+        ci = vreinterpretq_u64_u8(veorq_u8(vreinterpretq_u8_u64(ci),
+                                           vrbitq_u8(vld1q_u8(buf))));
+
+        /* Do binary mult ghash->X = Ci * ghash->H. */
+        z_low = vreinterpretq_u8_p128(
+            vmull_p64((poly64_t)vget_low_p64(vreinterpretq_p64_u64(ci)),
+                      (poly64_t)vget_low_p64(vreinterpretq_p64_u64(h))));
+        z_high = vreinterpretq_u8_p128(
+            vmull_high_p64(vreinterpretq_p64_u64(ci), vreinterpretq_p64_u64(h)));
+        t1 = vreinterpretq_p64_u8(
+            vextq_u8(vreinterpretq_u8_u64(h), vreinterpretq_u8_u64(h), 8));
+        t_low = vreinterpretq_u8_p128(
+            vmull_p64((poly64_t)vget_low_p64(vreinterpretq_p64_u64(ci)),
+                      (poly64_t)vget_low_p64(t1)));
+        t_high = vreinterpretq_u8_p128(vmull_high_p64(vreinterpretq_p64_u64(ci), t1));
+        t2 = veorq_u8(t_high, t_low);
+        z_low = veorq_u8(z_low, vextq_u8(zero, t2, 8));
+        z_high = veorq_u8(z_high, vextq_u8(t2, zero, 8));
+
+        /* polynomial reduction */
+        t2 = vreinterpretq_u8_p128(vmull_high_p64(vreinterpretq_p64_u8(z_high), p));
+        z_high = veorq_u8(z_high, vextq_u8(t2, zero, 8));
+        z_low = veorq_u8(z_low, vextq_u8(zero, t2, 8));
+        ci = veorq_u64(vreinterpretq_u64_u8(z_low),
+                       vreinterpretq_u64_p128(
+                           vmull_p64((poly64_t)vget_low_p64(vreinterpretq_p64_u8(z_high)),
+                                     (poly64_t)vget_low_p64(p))));
+    }
+
+    ghash->x = ci;
+    return SECSuccess;
+}
+
+SECStatus
+gcm_HashInit_hw(gcmHashContext *ghash)
+{
+    /* Workaround of "used uninitialized in this function" error */
+    uint64x2_t h = vdupq_n_u64(0);
+
+    ghash->ghash_mul = gcm_HashMult_hw;
+    ghash->x = vdupq_n_u64(0);
+    h = vsetq_lane_u64(__builtin_bswap64(ghash->h_low), h, 1);
+    h = vsetq_lane_u64(__builtin_bswap64(ghash->h_high), h, 0);
+    h = vreinterpretq_u64_u8(vrbitq_u8(vreinterpretq_u8_u64(h)));
+    ghash->h = h;
+    ghash->hw = PR_TRUE;
+    return SECSuccess;
+}
+
+SECStatus
+gcm_HashZeroX_hw(gcmHashContext *ghash)
+{
+    ghash->x = vdupq_n_u64(0);
+    return SECSuccess;
+}
+
+#endif /* defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 6) */
--- a/security/nss/lib/freebl/gcm.c
+++ b/security/nss/lib/freebl/gcm.c
@@ -12,30 +12,36 @@
 #include "gcm.h"
 #include "ctr.h"
 #include "secerr.h"
 #include "prtypes.h"
 #include "pkcs11t.h"
 
 #include <limits.h>
 
+/* old gcc doesn't support some poly64x2_t intrinsic */
+#if defined(__aarch64__) && defined(IS_LITTLE_ENDIAN) && \
+    (defined(__clang__) || defined(__GNUC__) && __GNUC__ > 6)
+#define USE_ARM_GCM
+#endif
+
 /* Forward declarations */
 SECStatus gcm_HashInit_hw(gcmHashContext *ghash);
 SECStatus gcm_HashWrite_hw(gcmHashContext *ghash, unsigned char *outbuf);
 SECStatus gcm_HashMult_hw(gcmHashContext *ghash, const unsigned char *buf,
                           unsigned int count);
 SECStatus gcm_HashZeroX_hw(gcmHashContext *ghash);
 SECStatus gcm_HashMult_sftw(gcmHashContext *ghash, const unsigned char *buf,
                             unsigned int count);
 SECStatus gcm_HashMult_sftw32(gcmHashContext *ghash, const unsigned char *buf,
                               unsigned int count);
 
 /* Stub definitions for the above *_hw functions, which shouldn't be
  * used unless NSS_X86_OR_X64 is defined */
-#ifndef NSS_X86_OR_X64
+#if !defined(NSS_X86_OR_X64) && !defined(USE_ARM_GCM)
 SECStatus
 gcm_HashWrite_hw(gcmHashContext *ghash, unsigned char *outbuf)
 {
     PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
     return SECFailure;
 }
 
 SECStatus
@@ -54,17 +60,17 @@ gcm_HashInit_hw(gcmHashContext *ghash)
 }
 
 SECStatus
 gcm_HashZeroX_hw(gcmHashContext *ghash)
 {
     PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
     return SECFailure;
 }
-#endif /* NSS_X86_OR_X64 */
+#endif /* !NSS_X86_OR_X64 && !USE_ARM_GCM */
 
 uint64_t
 get64(const unsigned char *bytes)
 {
     return ((uint64_t)bytes[0]) << 56 |
            ((uint64_t)bytes[1]) << 48 |
            ((uint64_t)bytes[2]) << 40 |
            ((uint64_t)bytes[3]) << 32 |
@@ -81,17 +87,21 @@ gcmHash_InitContext(gcmHashContext *ghas
     SECStatus rv = SECSuccess;
 
     ghash->cLen = 0;
     ghash->bufLen = 0;
     PORT_Memset(ghash->counterBuf, 0, sizeof(ghash->counterBuf));
 
     ghash->h_low = get64(H + 8);
     ghash->h_high = get64(H);
+#ifdef USE_ARM_GCM
+    if (arm_pmull_support() && !sw) {
+#else
     if (clmul_support() && !sw) {
+#endif
         rv = gcm_HashInit_hw(ghash);
     } else {
 /* We fall back to the software implementation if we can't use / don't
          * want to use pclmul. */
 #ifdef HAVE_INT128_SUPPORT
         ghash->ghash_mul = gcm_HashMult_sftw;
 #else
         ghash->ghash_mul = gcm_HashMult_sftw32;
--- a/security/nss/lib/freebl/gcm.h
+++ b/security/nss/lib/freebl/gcm.h
@@ -21,16 +21,20 @@
 #include <emmintrin.h> /* __m128i */
 
 #ifdef NSS_DISABLE_SSE2
 #undef NSS_DISABLE_SSE2
 #pragma GCC pop_options
 #endif /* NSS_DISABLE_SSE2 */
 #endif
 
+#ifdef __aarch64__
+#include <arm_neon.h>
+#endif
+
 SEC_BEGIN_PROTOS
 
 #ifdef HAVE_INT128_SUPPORT
 typedef unsigned __int128 uint128_t;
 #endif
 
 typedef struct GCMContextStr GCMContext;
 
@@ -56,16 +60,18 @@ SECStatus GCM_DecryptUpdate(GCMContext *
 /* These functions are here only so we can test them */
 #define GCM_HASH_LEN_LEN 8 /* gcm hash defines lengths to be 64 bits */
 typedef struct gcmHashContextStr gcmHashContext;
 typedef SECStatus (*ghash_t)(gcmHashContext *, const unsigned char *,
                              unsigned int);
 pre_align struct gcmHashContextStr {
 #ifdef NSS_X86_OR_X64
     __m128i x, h;
+#elif defined(__aarch64__)
+    uint64x2_t x, h;
 #endif
     uint64_t x_low, x_high, h_high, h_low;
     unsigned char buffer[MAX_BLOCK_SIZE];
     unsigned int bufLen;
     uint8_t counterBuf[16];
     uint64_t cLen;
     ghash_t ghash_mul;
     PRBool hw;
--- a/security/nss/lib/nss/nss.h
+++ b/security/nss/lib/nss/nss.h
@@ -17,22 +17,22 @@
 
 /*
  * NSS's major version, minor version, patch level, build number, and whether
  * this is a beta release.
  *
  * The format of the version string should be
  *     "<major version>.<minor version>[.<patch level>[.<build number>]][ <ECC>][ <Beta>]"
  */
-#define NSS_VERSION "3.45" _NSS_CUSTOMIZED
+#define NSS_VERSION "3.46" _NSS_CUSTOMIZED " Beta"
 #define NSS_VMAJOR 3
-#define NSS_VMINOR 45
+#define NSS_VMINOR 46
 #define NSS_VPATCH 0
 #define NSS_VBUILD 0
-#define NSS_BETA PR_FALSE
+#define NSS_BETA PR_TRUE
 
 #ifndef RC_INVOKED
 
 #include "seccomon.h"
 
 typedef struct NSSInitParametersStr NSSInitParameters;
 
 /*
--- a/security/nss/lib/softoken/softkver.h
+++ b/security/nss/lib/softoken/softkver.h
@@ -12,16 +12,16 @@
 
 /*
  * Softoken's major version, minor version, patch level, build number,
  * and whether this is a beta release.
  *
  * The format of the version string should be
  *     "<major version>.<minor version>[.<patch level>[.<build number>]][ <ECC>][ <Beta>]"
  */
-#define SOFTOKEN_VERSION "3.45" SOFTOKEN_ECC_STRING
+#define SOFTOKEN_VERSION "3.46" SOFTOKEN_ECC_STRING " Beta"
 #define SOFTOKEN_VMAJOR 3
-#define SOFTOKEN_VMINOR 45
+#define SOFTOKEN_VMINOR 46
 #define SOFTOKEN_VPATCH 0
 #define SOFTOKEN_VBUILD 0
-#define SOFTOKEN_BETA PR_FALSE
+#define SOFTOKEN_BETA PR_TRUE
 
 #endif /* _SOFTKVER_H_ */
--- a/security/nss/lib/util/nssutil.h
+++ b/security/nss/lib/util/nssutil.h
@@ -14,22 +14,22 @@
 
 /*
  * NSS utilities's major version, minor version, patch level, build number,
  * and whether this is a beta release.
  *
  * The format of the version string should be
  *     "<major version>.<minor version>[.<patch level>[.<build number>]][ <Beta>]"
  */
-#define NSSUTIL_VERSION "3.45"
+#define NSSUTIL_VERSION "3.46 Beta"
 #define NSSUTIL_VMAJOR 3
-#define NSSUTIL_VMINOR 45
+#define NSSUTIL_VMINOR 46
 #define NSSUTIL_VPATCH 0
 #define NSSUTIL_VBUILD 0
-#define NSSUTIL_BETA PR_FALSE
+#define NSSUTIL_BETA PR_TRUE
 
 SEC_BEGIN_PROTOS
 
 /*
  * Returns a const string of the UTIL library version.
  */
 extern const char *NSSUTIL_GetVersion(void);
 
--- a/testing/web-platform/meta/css/css-contain/contain-layout-baseline-005.html.ini
+++ b/testing/web-platform/meta/css/css-contain/contain-layout-baseline-005.html.ini
@@ -1,3 +1,3 @@
 [contain-layout-baseline-005.html]
-  expected:
-    if (os == "android"): FAIL # bug 1550895 (frequently fails on geckoview), bug 1554342
+  fuzzy:
+    if (os == "android"): maxDifference=9;totalPixels=2 # bug 1554342
--- a/testing/web-platform/meta/css/css-contain/contain-layout-button-001.html.ini
+++ b/testing/web-platform/meta/css/css-contain/contain-layout-button-001.html.ini
@@ -1,3 +1,3 @@
 [contain-layout-button-001.html]
-  expected:
-    if (os == "android"): FAIL # bug 1550895 (frequently fails on geckoview), bug 1556282
+  fuzzy:
+    if (os == "android"): maxDifference=191;totalPixels=12 # bug 1484841