Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp512662ybi; Thu, 30 May 2019 02:13:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxiac3dgLT38kAiqcus4qIpCMdeRIpKHL8TJmg3bAthJ5JWNwtsGkPyGb8Yvfk5T8gAAUc X-Received: by 2002:a17:90a:33e2:: with SMTP id n89mr2785526pjb.18.1559207594104; Thu, 30 May 2019 02:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559207594; cv=none; d=google.com; s=arc-20160816; b=s7FlltGLj8eQoJcrfgYaiLnU9CpJ59DwfLZ/K9hOL4QAG+ivG+1/4h/YlaQ2GVrXsh laQl3siV76VZuDs08uin9UbVqtkbrSjKVV73qaXQu8c2SGHH/cYEuJ+RnQN0FYWCTYRo sUzQFl90cHewS1H6z2yH8ffQHf5ZZg1P12jPSA1PKo/6S32XBN7TSendbHHC0X4IpH4f tPHGhoBXuAz9YE+8oCzPmfa2XqvH31EosAHISAAMefE8d0QsMV3IMDqLdwpYnayEptZq ffqgMT77cSH/T1L7gVmbbDtUvx9lPI/RGVw8hRu3ilbqABBzGTggsz0ctPS0C0/EzO0n ZtUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=SkOH+2aVMTTrn2aPrwV+avRtSnS97B7YiqC7EyHZCRc=; b=E7U4ELjU6Yz5wiFSJUchGmd29gcyyNIjrrfYDqoC7IW0sCa9NSdQ+vSRLeqNTH5rus A8DpjjpRXKDYp0FTCqDRDevzaXGsVx4YzdKD++fimwbJB/yhVcdzNex3ytJ9KKAXZMFE RuMWN1fW9tQSFhlS9nKjXCuwvpbeiFUJ1pNZ6T1E46+XYTK6yCHkZmWV1JMjrckYZxcY OfGPMNiL5XPHEuSNFJzwWG8Xm478PS98DTG/cfv+ZlyU/z/W1gIKy1OQ2t8LybUTEVKt eUK3SRioCPwYPf5327TvtnAD8aAQvb6pGO+Q773af6RhVxu/308vgLlakyrOWtDzD335 PunA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TCI9NGbo; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24si2744508pgk.106.2019.05.30.02.12.51; Thu, 30 May 2019 02:13:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TCI9NGbo; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727057AbfE3JMr (ORCPT + 99 others); Thu, 30 May 2019 05:12:47 -0400 Received: from mail-it1-f173.google.com ([209.85.166.173]:52198 "EHLO mail-it1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfE3JMr (ORCPT ); Thu, 30 May 2019 05:12:47 -0400 Received: by mail-it1-f173.google.com with SMTP id m3so8735166itl.1 for ; Thu, 30 May 2019 02:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=SkOH+2aVMTTrn2aPrwV+avRtSnS97B7YiqC7EyHZCRc=; b=TCI9NGbogYuqDno5cy65AIc2Y5JkjdFNJqV71CEsJJCAon6miJH79zy2P40eKudu/2 EPQlgKlXXMSHo1FV26GklmDadqYqsfaYRfm6LLksyfGgJFH35XArEI4wRdByueS18Lgd LQX7bwaAPZIAlvv0YuQT6jOodxaxii0HNhI0MWflYISsEjFtw8gCkNkvVFeYiHqVg9iO DX05D0ZvNy2VxeIGXsov9Nn5nokbN4emZAYYdsp9kk46fPr28fPkeykZW4ucNRnHR8H4 iryO1Gnt65DueE3Qh3UiDcMd3aD0kkrvLpPPov9+9qgx7cQ39z88lu6v46QPrsuZO91O KUpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=SkOH+2aVMTTrn2aPrwV+avRtSnS97B7YiqC7EyHZCRc=; b=NWqCw8qQF0wv7WIbthg2hiOmVzRwAClkBJA7KFjJnZyWXR75G4pTj/T8Ga4nABLRbe I7NsPaU5oBP1Xy3d5JM5tXp91Zacx2IqZxJKEjUwwPwttbojOqtrnkZy02HWo583rh6d r0GbW0AeDTsHgxgKQPennA4QD53CVkr82VMSPQQKBEq6v5VxsXtEArastpBEzCp3D7ir drhyMopvODy/UFlGaTeUMal/jyESVQU3PX5Rw9Bt+sqRbJz2SIA4oHxD63dn8yrPWH0C 7vGcBq0KTZHYd2dHmFoR/0y5koulc8g8V5DIOW5KjE4d5H7Fo+hUxxYXMyPcEY+wp56A TT9Q== X-Gm-Message-State: APjAAAWcQwhnHtpMw5vhSjtRDpnw8ifbvaBf1ZGA/D5kBdtx5SkJOSmf DqMjF02clPbi5ZLpk5HpwoTm874tK6FsEgnd9zNWi/dZ X-Received: by 2002:a02:b47:: with SMTP id 68mr1549165jad.66.1559207566318; Thu, 30 May 2019 02:12:46 -0700 (PDT) MIME-Version: 1.0 From: Peter Robinson Date: Thu, 30 May 2019 10:12:34 +0100 Message-ID: Subject: Issues with initialising generic crypto implementations earlier on ARMv7 To: Eric Biggers , Herbert Xu Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Eric, I'm seeing the crash below on ARMv7 devices, at least the Raspberry Pi and UDoo Neo (i.MX6SX), with your "crypto: run initcalls for generic implementations earlier" patch. It's causing the boot to fail very early on across the ARMv7 devices I've tested on Fedora (I'm the Arm lead for Fedora. Reverting the patch makes the problem go away. I'm unsure why initialising it earlier in the boot would cause issues, any chance you could assist in sorting the issue out? Tested on 5.2 rc1 and rc2. Regards, Peter [1] c4741b23059794bd99beef0f700103b0d983b3fd [ 2.239276] cryptd: max_cpu_qlen set to 1000 [ 2.257316] alg: No test for lzo-rle (lzo-rle-generic) [ 2.262883] alg: No test for lzo-rle (lzo-rle-scomp) [ 2.268303] alg: No test for 842 (842-generic) [ 2.273154] alg: No test for 842 (842-scomp) [ 2.299763] Unhandled fault: alignment fault (0x221) at 0xc0eb987e [ 2.306015] pgd = (ptrval) [ 2.308746] [c0eb987e] *pgd=80000000207003, *pmd=00e0071d(bad) [ 2.314650] Internal error: : 221 [#1] SMP ARM [ 2.319137] Modules linked in: [ 2.322228] CPU: 0 PID: 142 Comm: cryptomgr_test Not tainted 5.2.0-0.rc2.git0.1.fc31.armv7hl+lpae #1 [ 2.331455] Hardware name: BCM2835 [ 2.334902] PC is at gf128mul_init_4k_lle+0x2c/0xa0 [ 2.339834] LR is at kmem_cache_alloc_trace+0xc0/0x14c [ 2.345024] pc : [] lr : [] psr: a0000013 [ 2.351355] sp : eafcfcf8 ip : ead04000 fp : ead71dc0 [ 2.356632] r10: 00000000 r9 : 00000000 r8 : c0eb987e [ 2.361910] r7 : c0eb987e r6 : c12576c0 r5 : c0eb987e r4 : ead03000 [ 2.368506] r3 : 00001000 r2 : 00001000 r1 : ead03000 r0 : ead03000 [ 2.375103] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user [ 2.382313] Control: 30c5383d Table: 00203000 DAC: fffffffd [ 2.388118] Process cryptomgr_test (pid: 142, stack limit = 0x(ptrval)) [ 2.394801] Stack: (0xeafcfcf8 to 0xeafd0000) [ 2.399203] fce0: ead71600 c0eb987e [ 2.407472] fd00: c12576c0 c0eb987e c0eb987e 00000000 00000000 c0729434 00000010 ead71600 [ 2.415742] fd20: c12576c0 c0713f90 ead71d80 00000010 c0bf55c4 c0eb987e 00000000 00000010 [ 2.424012] fd40: 00000000 c07134a4 00000000 ead71540 c0bf55c4 eaef5400 eafcfe80 c071aa1c [ 2.432282] fd60: 00000000 00000001 eaef5400 ead71d80 c0c1a89c ffffffff 00000073 00000400 [ 2.440550] fd80: 00000000 00000000 00000000 00000014 00000000 00000000 00000cc0 00000000 [ 2.448820] fda0: 00000000 eafcfda4 eafcfda4 00000000 eac01c00 00000000 00000000 eac01c00 [ 2.457090] fdc0: 00000084 c070d15c eafcfd30 c05d0824 00000dc0 00000dc0 00000004 c0bf4a14 [ 2.465360] fde0: 00000040 eafcfe5c eafcfe80 eafcfe58 ffffffff eafcfe80 eafcfe18 1503017f [ 2.473630] fe00: c0f3bf27 c0bb9d5c ffffff0f ffff0a00 eac01e00 eadcb180 ffffff0f ffff0a00 [ 2.481901] fe20: 00000024 00000000 eae96c00 ead71540 eaef5400 ead71d80 eadcb180 00000000 [ 2.490171] fe40: eae96c00 ead71540 eaef5400 ead71d80 eadcb180 00000000 00000000 c071b144 [ 2.498441] fe60: ead71540 eae96c00 eadcb180 87c8332f ead71dc0 c0c1a89c c0c1a89c 00000006 [ 2.506710] fe80: eafc0030 c0483f9c 0000407f c048610c 0000407f 00000006 eaef5400 0000000e [ 2.514980] fea0: 00000400 c0c1a89c c071b1a0 ffffffff 00000073 c071b250 00000400 eaef5400 [ 2.523250] fec0: eaef5400 0000000e eaef5480 c137ae08 00000400 c071a0a4 00000000 eb3c8704 [ 2.531519] fee0: 00000001 eafcff50 00000004 c0bbe504 00000009 c121d158 eafcff0c c047aaf0 [ 2.539790] ff00: c120a000 eafacb00 eafcff3c c047ac74 c1200018 eafacb00 c120a000 24854451 [ 2.548061] ff20: eb3d3140 eafacb00 c120a000 c1236200 eb3d3140 eafacf68 eafcff7c c0bbe3d8 [ 2.556331] ff40: ead0de24 00000000 00000001 ead0de20 ead0de24 00000004 ead0de20 eafacb00 [ 2.564602] ff60: eafce000 eaef5400 eaeea4c0 eafce000 ead0de20 eaef5400 c0716c34 eadcb35c [ 2.572871] ff80: 00000000 c0716c60 eadcb340 c0473000 eaeea4c0 c0472ef4 00000000 00000000 [ 2.581140] ffa0: 00000000 00000000 00000000 c04011f8 00000000 00000000 00000000 00000000 [ 2.589408] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 2.597676] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [ 2.605961] [] (gf128mul_init_4k_lle) from [] (ghash_setkey+0x48/0x5c) [ 2.614325] [] (ghash_setkey) from [] (crypto_shash_setkey+0xbc/0xd8) [ 2.622599] [] (crypto_shash_setkey) from [] (crypto_ahash_setkey+0xbc/0xd8) [ 2.631486] [] (crypto_ahash_setkey) from [] (test_hash_vec_cfg+0x74/0x60c) [ 2.640286] [] (test_hash_vec_cfg) from [] (__alg_test_hash.constprop.0+0x190/0x1ec) [ 2.649875] [] (__alg_test_hash.constprop.0) from [] (alg_test_hash+0xb0/0xf8) [ 2.658936] [] (alg_test_hash) from [] (alg_test+0x330/0x3f8) [ 2.666504] [] (alg_test) from [] (cryptomgr_test+0x2c/0x4c) [ 2.673988] [] (cryptomgr_test) from [] (kthread+0x10c/0x118) [ 2.681559] [] (kthread) from [] (ret_from_fork+0x14/0x3c) [ 2.688856] Exception stack(0xeafcffb0 to 0xeafcfff8) [ 2.693960] ffa0: 00000000 00000000 00000000 00000000 [ 2.702228] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 2.710494] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 2.717185] Code: e5930030 ebfac75a e2504000 0a000019 (e895000f) [ 2.723350] ---[ end trace 9839f43693f21333 ]---