VIA/ACE PadLock integration with crypto(9).

Mike Tancsa mike at sentex.net
Fri Aug 12 17:50:23 GMT 2005


At 09:45 AM 12/08/2005, Pawel Jakub Dawidek wrote:
>Hi.
>
>This is a call for testers.
>I integrated VIA/ACE PadLock with our crypto(9) subsystem, so now it can
>be used with things like fast_ipsec(4) and geli(8).

Havent got to the FAST_IPSEC tests yet (will 
soon) but against CURRENT from this morning,

I get a lot of

Aug 12 13:07:47 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=470958080, length=131072)]
Aug 12 13:07:47 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=471089152, length=131072)]
Aug 12 13:07:47 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=471220224, length=131072)]
Aug 12 13:07:47 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=471351296, length=131072)]
Aug 12 13:07:47 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=472006656, length=131072)]
Aug 12 13:07:47 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=472137728, length=131072)]
Aug 12 13:07:47 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=472268800, length=131072)]
Aug 12 13:07:47 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=472399872, length=131072)]
Aug 12 13:07:47 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=472530944, length=131072)]
Aug 12 13:07:48 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=472530944, length=131072)]

with and without the padlock loaded.  This is just running
bonnie -s 500 -d /cryptedmnt against a normal 
ufs2 partition, and against the same partition 
with aes.  I was about to do the test with the 
padlock.ko loaded, but it cannot complete the test.


               -------Sequential Output-------- 
---Sequential Input-- --Random--
               -Per Char- --Block--- -Rewrite-- 
-Per Char- --Block--- --Seeks---
Machine    MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
70-raw    512 23589 94.5 30965 29.7 10836 12.3 16836 79.7 32200 26.3 189.7  2.1
7-s-crypt 500  5856 24.2  7014  7.6  1296  1.5  5923 28.6  6712  6.1 155.9  1.7

I detach and then load the kld, and attach the drive again

Aug 12 13:17:11 via-releng5 kernel: GEOM_ELI: Device ad0s1e.eli destroyed.
Aug 12 13:28:38 via-releng5 kernel: GEOM_ELI: Device ad0s1e.eli created.
Aug 12 13:28:38 via-releng5 kernel: GEOM_ELI:     Cipher: AES
Aug 12 13:28:38 via-releng5 kernel: GEOM_ELI: Key length: 128
Aug 12 13:28:38 via-releng5 kernel: GEOM_ELI:     Crypto: hardware
Aug 12 13:29:53 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=106971136, length=131072
)]
Aug 12 13:29:53 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=107757568, length=131072
)]
Aug 12 13:29:54 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=107757568, length=131072
)]
Aug 12 13:29:54 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=108937216, length=131072
)]
Aug 12 13:29:54 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=109592576, length=131072
)]
Aug 12 13:29:54 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=109592576, length=131072
)]
Aug 12 13:29:55 via-releng5 kernel: GEOM_ELI: 
g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=110641152, length=131072
)]

And then start up bonnie once more.  Its blasting 
along quite well (speed at least twice as fast)  and then crash.


[via-releng5]# bonnie -s 500 -d /mnt
File '/mnt/Bonnie.680', size: 524288000
Writing with putc()...done
Rewriting...



[via-releng5]# GEOM_ELI: Device ad0s1e.eli created.
GEOM_ELI:     Cipher: AES
GEOM_ELI: Key length: 128
GEOM_ELI:     Crypto: software
GEOM_ELI: Device ad0s1e.eli destroyed.
GEOM_ELI: Device ad0s1e.eli created.
GEOM_ELI:     Cipher: AES
GEOM_ELI: Key length: 128
GEOM_ELI:     Crypto: hardware

[via-releng5]# GEOM_ELI: g_eli_crypto_run() 
failed (error=12). ad0s1e.eli[WRITE(offset=6045696, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=7094272, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=8011776, length=131072)]


Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0xc1ad8004
fault code              = supervisor write, page not present
instruction pointer     = 0x20:0xc061909c
stack pointer           = 0x28:0xcb788cf4
frame pointer           = 0x28:0xcb788d10
code segment            = base 0x0, limit 0xfffff, type 0x1b
                         = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 6 (crypto returns)
trap number             = 12
panic: page fault
Uptime: 3m5s
Dumping 239 MB (2 chunks)
   chunk 0: 1MB (160 pages) ... ok
   chunk 1: 239MB (61168 pages) 223 207 191 175 
159 143 127 111 95 79 63 47 31 15 ... ok

Dump complete




(kgdb) bt
#0  doadump () at pcpu.h:165
#1  0xc053a90d in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:397
#2  0xc053aba0 in panic (fmt=0xc06e93bf "%s") at 
/usr/src/sys/kern/kern_shutdown.c:553
#3  0xc06a9ba4 in trap_fatal (frame=0xcb788cb4, 
eva=3249401860) at /usr/src/sys/i386/i386/trap.c:841
#4  0xc06a990f in trap_pfault (frame=0xcb788cb4, 
usermode=0, eva=3249401860) at /usr/src/sys/i386/i386/trap.c:752
#5  0xc06a9555 in trap (frame=
       {tf_fs = 8, tf_es = 40, tf_ds = 40, tf_edi 
= 0, tf_esi = -1045699744, tf_ebp = -881292016, 
tf_isp = -881292064, tf_ebx = -1051817936, tf_edx 
= -1045565440, tf_ecx = -1066090464, tf_eax = 
-1066009788, tf_trapno = 12, tf_err = 2, tf_eip = 
-1067347812, tf_cs = 32, tf_eflags = 66182, 
tf_esp = 0, tf_ss = 0}) at /usr/src/sys/i386/i386/trap.c:442
#6  0xc0698e0a in calltrap () at /usr/src/sys/i386/i386/exception.s:139
#7  0x00000008 in ?? ()
#8  0x00000028 in ?? ()
#9  0x00000028 in ?? ()
#10 0x00000000 in ?? ()
#11 0xc1abe360 in ?? ()
#12 0xcb788d10 in ?? ()
#13 0xcb788ce0 in ?? ()
#14 0xc14e8830 in ?? ()
#15 0xc1adf000 in ?? ()
#16 0xc074c020 in g_wither_work ()
#17 0xc075fb44 in crypto_q_mtx ()
#18 0x0000000c in ?? ()
#19 0x00000002 in ?? ()
#20 0xc061909c in crypto_ret_proc () at /usr/src/sys/opencrypto/crypto.c:1202
#21 0xc0525ad8 in fork_exit (callout=0xc061904c 
<crypto_ret_proc>, arg=0x0, frame=0xcb788d38) at 
/usr/src/sys/kern/kern_fork.c:789
#22 0xc0698e6c in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:208



This is on

Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
         The Regents of the University of California. All rights reserved.
FreeBSD 7.0-CURRENT #1: Fri Aug 12 12:07:13 EDT 2005
     mdtancsa at via-releng5.sentex.ca:/usr/obj/usr/src/sys/pioneer
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: VIA C3 Nehemiah+RNG+ACE (1199.79-MHz 686-class CPU)
   Orig




# kgdb /usr/obj/usr/src/sys/pioneer/kernel.debug vmcore.2
[GDB will not be able to debug user-mode threads: 
/usr/lib/libthread_db.so: Undefined symbol "ps_pglobal_lookup"]
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd".

Unread portion of the kernel message buffer:
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=8011776, length=131072)]


Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0xc1ad8004
fault code              = supervisor write, page not present
instruction pointer     = 0x20:0xc061909c
stack pointer           = 0x28:0xcb788cf4
frame pointer           = 0x28:0xcb788d10
code segment            = base 0x0, limit 0xfffff, type 0x1b
                         = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 6 (crypto returns)
trap number             = 12
panic: page fault
Uptime: 3m5s
Dumping 239 MB (2 chunks)
   chunk 0: 1MB (160 pages) ... ok
   chunk 1: 239MB (61168 pages) 223 207 191 175 
159 143 127 111 95 79 63 47 31 15

#0  doadump () at pcpu.h:165
165     pcpu.h: No such file or directory.
         in pcpu.h
(kgdb) bt
#0  doadump () at pcpu.h:165
#1  0xc053a90d in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:397
#2  0xc053aba0 in panic (fmt=0xc06e93bf "%s") at 
/usr/src/sys/kern/kern_shutdown.c:553
#3  0xc06a9ba4 in trap_fatal (frame=0xcb788cb4, 
eva=3249373188) at /usr/src/sys/i386/i386/trap.c:841
#4  0xc06a990f in trap_pfault (frame=0xcb788cb4, 
usermode=0, eva=3249373188) at /usr/src/sys/i386/i386/trap.c:752
#5  0xc06a9555 in trap (frame=
       {tf_fs = 8, tf_es = 40, tf_ds = 40, tf_edi 
= 0, tf_esi = -1045728416, tf_ebp = -881292016, 
tf_isp = -881292064, tf_ebx = -1051817936, tf_edx 
= -1045594112, tf_ecx = -1066090464, tf_eax = 
-1066009788, tf_trapno = 12, tf_err = 2, tf_eip = 
-1067347812, tf_cs = 32, tf_eflags = 66182, 
tf_esp = 0, tf_ss = 0}) at /usr/src/sys/i386/i386/trap.c:442
#6  0xc0698e0a in calltrap () at /usr/src/sys/i386/i386/exception.s:139
#7  0x00000008 in ?? ()
#8  0x00000028 in ?? ()
#9  0x00000028 in ?? ()
#10 0x00000000 in ?? ()
#11 0xc1ab7360 in ?? ()
#12 0xcb788d10 in ?? ()
#13 0xcb788ce0 in ?? ()
#14 0xc14e8830 in ?? ()
#15 0xc1ad8000 in ?? ()
#16 0xc074c020 in g_wither_work ()
#17 0xc075fb44 in crypto_q_mtx ()
#18 0x0000000c in ?? ()
#19 0x00000002 in ?? ()
#20 0xc061909c in crypto_ret_proc () at /usr/src/sys/opencrypto/crypto.c:1202
#21 0xc0525ad8 in fork_exit (callout=0xc061904c 
<crypto_ret_proc>, arg=0x0, frame=0xcb788d38) at 
/usr/src/sys/kern/kern_fork.c:789
#22 0xc0698e6c in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:208
(kgdb) bt full
#0  doadump () at pcpu.h:165
No locals.
#1  0xc053a90d in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:397
         first_buf_printf = 1
#2  0xc053aba0 in panic (fmt=0xc06e93bf "%s") at 
/usr/src/sys/kern/kern_shutdown.c:553
         td = (struct thread *) 0xc14c3780
         bootopt = 260
         newpanic = 0
         ap = 0xc14c3780 "0\210NÁ@HLÁ"
         buf = "page fault", '\0' <repeats 245 times>
#3  0xc06a9ba4 in trap_fatal (frame=0xcb788cb4, 
eva=3249373188) at /usr/src/sys/i386/i386/trap.c:841
         code = 40
         type = 12
         ss = 40
         esp = 0
         softseg = {ssd_base = 0, ssd_limit = 
1048575, ssd_type = 27, ssd_dpl = 0, ssd_p = 1, ssd_xx = 8, ssd_xx1 = 0,
   ssd_def32 = 1, ssd_gran = 1}
#4  0xc06a990f in trap_pfault (frame=0xcb788cb4, 
usermode=0, eva=3249373188) at /usr/src/sys/i386/i386/trap.c:752
         va = 3249373184
         vm = (struct vmspace *) 0x0
         map = 0xc1043000
         rv = 1
         ftype = 1 '\001'
         td = (struct thread *) 0xc14c3780
         p = (struct proc *) 0xc14e8830
#5  0xc06a9555 in trap (frame=
       {tf_fs = 8, tf_es = 40, tf_ds = 40, tf_edi 
= 0, tf_esi = -1045728416, tf_ebp = -881292016, 
tf_isp = -881292064, tf_ebx = -1051817936, tf_edx 
= -1045594112, tf_ecx = -1066090464, tf_eax = 
-1066009788, tf_trapno = 12, tf_err = 2, tf_eip = 
-1067347812, tf_cs = 32, tf_eflags = 66182, 
tf_esp = 0, tf_ss = 0}) at /usr/src/sys/i386/i386/trap.c:442
         td = (struct thread *) 0xc14c3780
         p = (struct proc *) 0xc14e8830
         sticks = 3226734063
         i = 0
         ucode = 0
         type = 12
         code = 2
         eva = 3249373188
#6  0xc0698e0a in calltrap () at /usr/src/sys/i386/i386/exception.s:139
No locals.
#7  0x00000008 in ?? ()
No symbol table info available.
#8  0x00000028 in ?? ()
---Type <return> to continue, or q <return> to quit---
No symbol table info available.
#9  0x00000028 in ?? ()
No symbol table info available.
#10 0x00000000 in ?? ()
No symbol table info available.
#11 0xc1ab7360 in ?? ()
No symbol table info available.
#12 0xcb788d10 in ?? ()
No symbol table info available.
#13 0xcb788ce0 in ?? ()
No symbol table info available.
#14 0xc14e8830 in ?? ()
No symbol table info available.
#15 0xc1ad8000 in ?? ()
No symbol table info available.
#16 0xc074c020 in g_wither_work ()
No symbol table info available.
#17 0xc075fb44 in crypto_q_mtx ()
No symbol table info available.
#18 0x0000000c in ?? ()
No symbol table info available.
#19 0x00000002 in ?? ()
No symbol table info available.
#20 0xc061909c in crypto_ret_proc () at /usr/src/sys/opencrypto/crypto.c:1202
         crpt = (struct cryptop *) 0xc1ab7360
         krpt = (struct cryptkop *) 0x0
#21 0xc0525ad8 in fork_exit (callout=0xc061904c 
<crypto_ret_proc>, arg=0x0, frame=0xcb788d38) at 
/usr/src/sys/kern/kern_fork.c:789
         p = (struct proc *) 0xc14e8830
         td = (struct thread *) 0x0
#22 0xc0698e6c in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:208
No locals.
(kgdb)








More information about the freebsd-current mailing list