marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

Re: marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

Postby swass » Sat Sep 05, 2015 4:34 am

Just completed testing.

1. It does have slightly slower throughput, but this is not entirely clear and I'd need to do more testing; but
2. Enabling -DUSE_CRYPTODEV_DIGESTS did not change the behavior of aes-ecb.

Some initial looking makes it seem like maybe the issue is cryptodev itself not supporting it. Oh well. No big deal, I guess. We just use cbc for anything that uses OpenSSL and we'll benefit from marvell_cesa. Technically cbc is better anyway.

Also worth noting that OpenSSH does not, by default, use a supported cipher. Therefore anyone wanting to use OpenSSH with openssl-cryptodev supported ciphers with marvell_cesa should add the following line to their sshd_config. (Also add this to ssh_config, as any SSH sessions originating from this host to others will only negotiate a supported cipher)

$this->bbcode_second_pass_code('', 'Ciphers aes128-cbc,aes256-cbc,3des-cbc')

Once added, sshd needs to be restarted. Then just toss on the -v and ssh to loopback to see the aes128-cbc cipher being used. I verified the hardware crypto engine is working properly when the supported cipher is used.

Moonman -- Are you planning (or did you) make the kirkwood dtsi change to linux-kirkwood-dt?
swass
 
Posts: 27
Joined: Mon Aug 11, 2014 3:43 pm

Re: marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

Postby moonman » Sun Sep 06, 2015 4:03 am

Yes, I will add the patch soon or at 4.2.1 release at latest (if they it isn't fixed upstream by then)
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

Postby Kabbone » Sun Sep 06, 2015 11:05 am

Nice work swass and moonman. The patched dtb files are working here on a NSA325, too
Kabbone
 
Posts: 153
Joined: Thu Jul 25, 2013 9:20 am

Re: marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

Postby swass » Wed Sep 09, 2015 5:48 pm

Truth be told, I was kind of hoping it (DMA, specifically) would provide a better than 30% performance bump, but 30% is still pretty good! Taken together with the crypto engine itself, it is a pretty huge gain.
swass
 
Posts: 27
Joined: Mon Aug 11, 2014 3:43 pm

Re: marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

Postby Kabbone » Thu Sep 10, 2015 9:39 pm

I did just a little bit of testing with my NSA325v2, but if I compare the results my local write performance doubled with the use of DMA. Also cryptsetup benchmark reported a 50% higher transfer rate. Unfortunately I don't really have that high improvement with the NFS share

EDIT: btw. is there a possibility to mount a LUKS with EXt4 partition with Direct I/O option? dio istn't working.
Kabbone
 
Posts: 153
Joined: Thu Jul 25, 2013 9:20 am

Re: marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

Postby Kabbone » Thu Oct 08, 2015 2:40 pm

I recognized a bug with marvel_cesa these days. If I use rsync from my webspace to my encrypted harddrive I get a kernel panic, which can be reproduced. It seems like it's present since the 4.2.0-2 update up to the newest kernel 4.2.3-2. I haven't tested the kernels in between.
Can anyone confirm this behaviour?

linux-kirkwood-dt-4.2.0-2
$this->bbcode_second_pass_code('', '[ 159.824248] Unable to handle kernel NULL pointer dereference at virtual address 00000010
[ 159.832417] pgd = c0004000
[ 159.835150] [00000010] *pgd=00000000
[ 159.838777] Internal error: Oops: 5 [#1] PREEMPT ARM
[ 159.843768] Modules linked in: dm_crypt algif_skcipher af_alg dm_mod blowfish_generic blowfish_common rtc_pcf8563 xt_tcpudp iptable_filter i2c_mv64xxx marvell_cesa nfsd nfs auth_rpcgss oid_registry lockd cryptodev(O) grace sunrpc ip_tables x_tables ipv6
[ 159.866496] CPU: 0 PID: 248 Comm: irq/18-f1030000 Tainted: G O 4.2.0-2-ARCH #1
[ 159.874882] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[ 159.881179] task: ddd450a0 ti: ddf2a000 task.ti: ddf2a000
[ 159.886620] PC is at mv_cesa_dma_step+0x44/0x58 [marvell_cesa]
[ 159.892483] LR is at mv_cesa_int+0xb4/0x120 [marvell_cesa]
[ 159.897991] pc : [<bf19c380>] lr : [<bf199158>] psr: 60000013
[ 159.897991] sp : ddf2bf18 ip : 00000080 fp : d4c80000
[ 159.909517] r10: cf84d000 r9 : ddd94d90 r8 : 00000000
[ 159.914767] r7 : bf199140 r6 : bf199140 r5 : bf1990c4 r4 : 00000000
[ 159.921328] r3 : e0f4de00 r2 : e0f40000 r1 : 00000000 r0 : cf84d240
[ 159.927883] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 159.935225] Control: 0005397f Table: 11a8c000 DAC: 00000017
[ 159.940996] Process irq/18-f1030000 (pid: 248, stack limit = 0xddf2a190)
[ 159.947728] Stack: (0xddf2bf18 to 0xddf2c000)
[ 159.952107] bf00: bf1990a4 dde0a280
[ 159.960323] bf20: df4d1900 00000001 df4d1900 c005aa40 00000000 00000000 00000000 c005aa5c
[ 159.968538] bf40: dde0a280 ddf2a000 00000001 c005acd0 00000000 c005ab0c deee08e0 00000000
[ 159.976752] bf60: dde0a280 c005abdc 00000000 c003af5c 00000000 00000000 00000000 dde0a280
[ 159.984967] bf80: 00000000 ddf2bf84 ddf2bf84 00000000 ddf2bf90 ddf2bf90 ddf2bfac deee08e0
[ 159.993181] bfa0: c003ae9c 00000000 00000000 c000a560 00000000 00000000 00000000 00000000
[ 160.001395] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 160.009609] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 1fffd831 1fffdc31
[ 160.017843] [<bf19c380>] (mv_cesa_dma_step [marvell_cesa]) from [<bf199158>] (mv_cesa_int+0xb4/0x120 [marvell_cesa])
[ 160.028428] [<bf199158>] (mv_cesa_int [marvell_cesa]) from [<c005aa5c>] (irq_thread_fn+0x1c/0x40)
[ 160.037341] [<c005aa5c>] (irq_thread_fn) from [<c005acd0>] (irq_thread+0xf4/0x140)
[ 160.044955] [<c005acd0>] (irq_thread) from [<c003af5c>] (kthread+0xc0/0xdc)
[ 160.051957] [<c003af5c>] (kthread) from [<c000a560>] (ret_from_fork+0x14/0x34)
[ 160.059219] Code: e5821840 e3a01daa e5831008 e5901008 (e5911010)
[ 160.065399] ---[ end trace 3d54db49dbe4f851 ]---
[ 160.070052] Kernel panic - not syncing: Fatal exception in interrupt
[ 160.076444] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
[ 161.945489] sched: RT throttling activated')

linux-kirkwood-dt-4.2.3-2
$this->bbcode_second_pass_code('', '[ 450.352346] Unable to handle kernel NULL pointer dereference at virtual address 00000010
[ 450.360516] pgd = c0004000
[ 450.363243] [00000010] *pgd=00000000
[ 450.366866] Internal error: Oops: 5 [#1] PREEMPT ARM
[ 450.371856] Modules linked in: dm_crypt algif_skcipher af_alg dm_mod blowfish_generic blowfish_common rtc_pcf8563 xt_tcpudp iptable_filter i2c_mv64xxx marvell_cesa nfsd auth_rpcgss nfs oid_registry lockd grace sunrpc cryptodev(O) ip_tables x_tables ipv6
[ 450.394584] CPU: 0 PID: 247 Comm: irq/18-f1030000 Tainted: G O 4.2.3-2-ARCH #1
[ 450.402968] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[ 450.409267] task: dde150a0 ti: ddfc4000 task.ti: ddfc4000
[ 450.414713] PC is at mv_cesa_dma_step+0x44/0x58 [marvell_cesa]
[ 450.420580] LR is at mv_cesa_int+0xb4/0x120 [marvell_cesa]
[ 450.426096] pc : [<bf19e380>] lr : [<bf19b158>] psr: 60000013
[ 450.426096] sp : ddfc5f18 ip : 00000080 fp : db7abc00
[ 450.437622] r10: ca734a00 r9 : ddd0d7d0 r8 : 00000000
[ 450.442871] r7 : bf19b140 r6 : bf19b140 r5 : bf19b0c4 r4 : 00000000
[ 450.449429] r3 : e0e6de00 r2 : e0e60000 r1 : 00000000 r0 : ca734c40
[ 450.455987] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 450.463330] Control: 0005397f Table: 0a5d4000 DAC: 00000017
[ 450.469101] Process irq/18-f1030000 (pid: 247, stack limit = 0xddfc4190)
[ 450.475833] Stack: (0xddfc5f18 to 0xddfc6000)
[ 450.480212] 5f00: bf19b0a4 dee66c00
[ 450.488428] 5f20: df4d1900 00000001 df4d1900 c005aa80 00000000 00000000 00000000 c005aa9c
[ 450.496643] 5f40: dee66c00 ddfc4000 00000001 c005ad10 00000000 c005ab4c ddf5bce0 00000000
[ 450.504857] 5f60: dee66c00 c005ac1c 00000000 c003af9c 00000040 00000000 00040000 dee66c00
[ 450.513072] 5f80: 00000000 ddfc5f84 ddfc5f84 00000000 ddfc5f90 ddfc5f90 ddfc5fac ddf5bce0
[ 450.521286] 5fa0: c003aedc 00000000 00000000 c000a560 00000000 00000000 00000000 00000000
[ 450.529499] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 450.537714] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 02000000 00000000
[ 450.545949] [<bf19e380>] (mv_cesa_dma_step [marvell_cesa]) from [<bf19b158>] (mv_cesa_int+0xb4/0x120 [marvell_cesa])
[ 450.556533] [<bf19b158>] (mv_cesa_int [marvell_cesa]) from [<c005aa9c>] (irq_thread_fn+0x1c/0x40)
[ 450.565455] [<c005aa9c>] (irq_thread_fn) from [<c005ad10>] (irq_thread+0xf4/0x140)
[ 450.573071] [<c005ad10>] (irq_thread) from [<c003af9c>] (kthread+0xc0/0xdc)
[ 450.580072] [<c003af9c>] (kthread) from [<c000a560>] (ret_from_fork+0x14/0x34)
[ 450.587332] Code: e5821840 e3a01daa e5831008 e5901008 (e5911010)
[ 450.593485] ---[ end trace cc5018fe6cbcbac6 ]---
[ 450.598137] Kernel panic - not syncing: Fatal exception in interrupt
[ 450.604527] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
[ 451.945138] sched: RT throttling activated
')
Kabbone
 
Posts: 153
Joined: Thu Jul 25, 2013 9:20 am

Re: marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

Postby CapJo » Fri Oct 09, 2015 5:46 am

I have not tested it myself, but I found this.

http://pastebin.com/YixRMMk0

$this->bbcode_second_pass_code('', '
[ 34.303331] Unable to handle kernel NULL pointer dereference at virtual address 00000010
[ 34.311460] pgd = c0004000
[ 34.314202] [00000010] *pgd=00000000
[ 34.317814] Internal error: Oops: 17 [#1] SMP ARM
[ 34.322540] Modules linked in:
[ 34.325625] CPU: 0 PID: 1074 Comm: irq/41-f1090000 Not tainted 4.2.0-00080-g114fb81-dirty #644
[ 34.334274] Hardware name: Marvell Armada 370/XP (Device Tree)
[ 34.340133] task: df6b9a40 ti: dec5e000 task.ti: dec5e000
[ 34.345565] PC is at mv_cesa_dma_step+0xdc/0x138
[ 34.350204] LR is at mv_cesa_dma_step+0xd4/0x138
[ 34.354844] pc : [<c039ea88>] lr : [<c039ea80>] psr: a0010013
[ 34.354844] sp : dec5fee0 ip : 00000000 fp : 00000000
[ 34.366372] r10: c039bb74 r9 : 00000000 r8 : df52f800
[ 34.371620] r7 : c07471f4 r6 : deef6040 r5 : c06e2484 r4 : df7f9ad0
[ 34.378176] r3 : e0aa0000 r2 : 00000000 r1 : 60010013 r0 : 0000001b
[ 34.384733] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 34.392074] Control: 10c5387d Table: 1eeb8019 DAC: 00000015
[ 34.397846] Process irq/41-f1090000 (pid: 1074, stack limit = 0xdec5e220)
[ 34.404664] Stack: (0xdec5fee0 to 0xdec60000)
[ 34.409047] fee0: deef6000 df7f9ad0 df52f800 c039baa4 0000009b df7f9ad0 deef6200 df7f9ae0
[ 34.417265] ff00: c06e2484 c039bb88 c039bab0 df7f5580 df4bae80 df7f5580 c005c41c 00000000
[ 34.425482] ff20: df4baedc 00000001 00000000 c005c438 df7f55a0 df4bae80 df7f5580 c005c204
[ 34.433699] ff40: 00000000 c005c358 df7f5540 00000000 df7f5580 c005c0d8 00000000 00000000
[ 34.441916] ff60: 00000000 c003cf5c 00000000 00000000 df5bc880 df7f5580 00000000 00000000
[ 34.450133] ff80: dec5ff80 dec5ff80 00000000 00000000 dec5ff90 dec5ff90 dec5ffac df7f5540
[ 34.458349] ffa0: c003ce84 00000000 00000000 c000f4e8 00000000 00000000 00000000 00000000
[ 34.466564] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 34.474781] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 1fffd821 1fffdc21
[ 34.483019] [<c039ea88>] (mv_cesa_dma_step) from [<c039baa4>] (mv_cesa_dequeue_req_unlocked+0x90/0x9c)
[ 34.492376] [<c039baa4>] (mv_cesa_dequeue_req_unlocked) from [<c039bb88>] (mv_cesa_int+0xd8/0x14c)
[ 34.501386] [<c039bb88>] (mv_cesa_int) from [<c005c438>] (irq_thread_fn+0x1c/0x44)
[ 34.508995] [<c005c438>] (irq_thread_fn) from [<c005c204>] (irq_thread+0x12c/0x178)
[ 34.516694] [<c005c204>] (irq_thread) from [<c003cf5c>] (kthread+0xd8/0xf4)
[ 34.523700] [<c003cf5c>] (kthread) from [<c000f4e8>] (ret_from_fork+0x14/0x2c)
[ 34.530960] Code: 0a000000 e12fff33 e5962008 e5943004 (e5922010)
[ 34.537120] ---[ end trace 9686d46238ce17d0 ]---
')
CapJo
 
Posts: 9
Joined: Tue Apr 14, 2015 10:21 pm

Re: marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

Postby CapJo » Fri Oct 09, 2015 9:12 am

There is an issue with the driver right now.

The author of the driver pointed me to a patch, that is not yet applied to the stable tree. I don't know why.

https://git.kernel.org/cgit/linux/kerne ... d48acccffe
CapJo
 
Posts: 9
Joined: Tue Apr 14, 2015 10:21 pm

Re: marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

Postby Kabbone » Fri Oct 09, 2015 9:29 am

Ah, thanks for your further investigation. So it should only be a matter of time until it's fixed :)
Kabbone
 
Posts: 153
Joined: Thu Jul 25, 2013 9:20 am

Re: marvell_cesa (mv_cesa) crypto issues in Linux 4.2 kernel

Postby CapJo » Sun Oct 25, 2015 4:35 pm

The issue is now fixed in Linux Kernel 4.2.4.
CapJo
 
Posts: 9
Joined: Tue Apr 14, 2015 10:21 pm

PreviousNext

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 11 guests