Re: VIA/ACE PadLock integration with crypto(9).

From: Mike Tancsa <mike_at_sentex.net>
Date: Tue, 16 Aug 2005 15:39:13 -0400
At 02:20 PM 12/08/2005, Pawel Jakub Dawidek wrote:
>On Fri, Aug 12, 2005 at 08:18:02PM +0200, Pawel Jakub Dawidek wrote:
>+> This is known problem iv pagedaemon.
>+> You need sys/vm/vm_pageout.c rev1.269. It should work also in RELENG_6.
>+> Could you try again with this fix?
>
>It was just MFCed, so for RELENG_6 you need sys/vm/vm_pageout.c
>rev. 1.268.2.1.

Still no luck as with RELENG_6 as of this AM. It 
seems to die in the same location-- when bonnie 
starts into its re-writing test.  It seems to 
make it through without the padlock.ko module loaded.


# kgdb  /usr/obj/usr/src/sys/pioneer/kernel.debug vmcore.4
[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   = 0xc1ac7004
fault code              = supervisor write, page not present
instruction pointer     = 0x20:0xc0617b6c
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: 17m0s
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  0xc0539e0d in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:397
#2  0xc053a0a0 in panic (fmt=0xc06e7b63 "%s") at 
/usr/src/sys/kern/kern_shutdown.c:553
#3  0xc06a8374 in trap_fatal (frame=0xcb788cb4, 
eva=3249303556) at /usr/src/sys/i386/i386/trap.c:841
#4  0xc06a80df in trap_pfault (frame=0xcb788cb4, 
usermode=0, eva=3249303556) at /usr/src/sys/i386/i386/trap.c:752
#5  0xc06a7d25 in trap (frame=
       {tf_fs = 8, tf_es = 40, tf_ds = 40, tf_edi 
= 0, tf_esi = -1045798048, tf_ebp = -881292016, 
tf_isp = -881292064, tf_ebx = -1051817936, tf_edx 
= -1045663744, tf_ecx = -1066097312, tf_eax = 
-1066016732, tf_trapno = 12, tf_err = 2, tf_eip = 
-1067353236, tf_cs = 32, tf_eflags = 66182, 
tf_esp = 0, tf_ss = 0}) at /usr/src/sys/i386/i386/trap.c:442
#6  0xc06975da in calltrap () at /usr/src/sys/i386/i386/exception.s:139
#7  0x00000008 in ?? ()
#8  0x00000028 in ?? ()
#9  0x00000028 in ?? ()
#10 0x00000000 in ?? ()
#11 0xc1aa6360 in ?? ()
#12 0xcb788d10 in ?? ()
#13 0xcb788ce0 in ?? ()
#14 0xc14e8830 in ?? ()
#15 0xc1ac7000 in ?? ()
#16 0xc074a560 in g_wither_work ()
#17 0xc075e024 in crypto_q_mtx ()
#18 0x0000000c in ?? ()
#19 0x00000002 in ?? ()
#20 0xc0617b6c in crypto_ret_proc () at /usr/src/sys/opencrypto/crypto.c:1202
#21 0xc0524fd8 in fork_exit (callout=0xc0617b1c 
<crypto_ret_proc>, arg=0x0, frame=0xcb788d38) at 
/usr/src/sys/kern/kern_fork.c:789
#22 0xc069763c in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:208
(kgdb) bt full
#0  doadump () at pcpu.h:165
No locals.
#1  0xc0539e0d in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:397
         first_buf_printf = 1
#2  0xc053a0a0 in panic (fmt=0xc06e7b63 "%s") at 
/usr/src/sys/kern/kern_shutdown.c:553
         td = (struct thread *) 0xc14c3780
         bootopt = 260
         newpanic = 0
         ap = 0xc14c3780 "0\210NÁ_at_HLÁ"
         buf = "page fault", '\0' <repeats 245 times>
#3  0xc06a8374 in trap_fatal (frame=0xcb788cb4, 
eva=3249303556) 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  0xc06a80df in trap_pfault (frame=0xcb788cb4, 
usermode=0, eva=3249303556) at /usr/src/sys/i386/i386/trap.c:752
         va = 3249303552
         vm = (struct vmspace *) 0x0
         map = 0xc1043000
         rv = 1
         ftype = 1 '\001'
         td = (struct thread *) 0xc14c3780
         p = (struct proc *) 0xc14e8830
#5  0xc06a7d25 in trap (frame=
       {tf_fs = 8, tf_es = 40, tf_ds = 40, tf_edi 
= 0, tf_esi = -1045798048, tf_ebp = -881292016, 
tf_isp = -881292064, tf_ebx = -1051817936, tf_edx 
= -1045663744, tf_ecx = -1066097312, tf_eax = 
-1066016732, tf_trapno = 12, tf_err = 2, tf_eip = 
-1067353236, 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 = 3413675188
         i = 0
         ucode = 0
         type = 12
         code = 2
         eva = 3249303556
#6  0xc06975da 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 0xc1aa6360 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 0xc1ac7000 in ?? ()
No symbol table info available.
#16 0xc074a560 in g_wither_work ()
No symbol table info available.
#17 0xc075e024 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 0xc0617b6c in crypto_ret_proc () at /usr/src/sys/opencrypto/crypto.c:1202
         crpt = (struct cryptop *) 0xc1aa6360
         krpt = (struct cryptkop *) 0x0
#21 0xc0524fd8 in fork_exit (callout=0xc0617b1c 
<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 0xc069763c in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:208
No locals.
(kgdb)



and with a 192 bit key

# kgdb /usr/obj/usr/src/sys/pioneer/kernel.debug /var/crash/vmcore.5
[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:
Cannot access memory at address 0xc101e2b3
(kgdb) bt
#0  doadump () at pcpu.h:165
#1  0xc0539e0d in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:397
#2  0xc053a0a0 in panic (fmt=0xc06e7b63 "%s") at 
/usr/src/sys/kern/kern_shutdown.c:553
#3  0xc06a8374 in trap_fatal (frame=0xcb788cb4, 
eva=3249524740) at /usr/src/sys/i386/i386/trap.c:841
#4  0xc06a80df in trap_pfault (frame=0xcb788cb4, 
usermode=0, eva=3249524740) at /usr/src/sys/i386/i386/trap.c:752
#5  0xc06a7d25 in trap (frame=
       {tf_fs = 8, tf_es = 40, tf_ds = 40, tf_edi 
= 0, tf_esi = -1045576864, tf_ebp = -881292016, 
tf_isp = -881292064, tf_ebx = -1051817936, tf_edx 
= -1045442560, tf_ecx = -1066097312, tf_eax = 
-1066016732, tf_trapno = 12, tf_err = 2, tf_eip = 
-1067353236, tf_cs = 32, tf_eflags = 66182, 
tf_esp = 0, tf_ss = 0}) at /usr/src/sys/i386/i386/trap.c:442
#6  0xc06975da in calltrap () at /usr/src/sys/i386/i386/exception.s:139
#7  0x00000008 in ?? ()
#8  0x00000028 in ?? ()
#9  0x00000028 in ?? ()
#10 0x00000000 in ?? ()
#11 0xc1adc360 in ?? ()
#12 0xcb788d10 in ?? ()
#13 0xcb788ce0 in ?? ()
#14 0xc14e8830 in ?? ()
#15 0xc1afd000 in ?? ()
#16 0xc074a560 in g_wither_work ()
#17 0xc075e024 in crypto_q_mtx ()
#18 0x0000000c in ?? ()
#19 0x00000002 in ?? ()
#20 0xc0617b6c in crypto_ret_proc () at /usr/src/sys/opencrypto/crypto.c:1202
#21 0xc0524fd8 in fork_exit (callout=0xc0617b1c 
<crypto_ret_proc>, arg=0x0, frame=0xcb788d38) at 
/usr/src/sys/kern/kern_fork.c:789
#22 0xc069763c in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:208
(kgdb) bt full
#0  doadump () at pcpu.h:165
No locals.
#1  0xc0539e0d in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:397
         first_buf_printf = 1
#2  0xc053a0a0 in panic (fmt=0xc06e7b63 "%s") at 
/usr/src/sys/kern/kern_shutdown.c:553
         td = (struct thread *) 0xc14c3780
         bootopt = 260
         newpanic = 0
         ap = 0xc14c3780 "0\210NÁ_at_HLÁ"
         buf = "page fault", '\0' <repeats 245 times>
#3  0xc06a8374 in trap_fatal (frame=0xcb788cb4, 
eva=3249524740) 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  0xc06a80df in trap_pfault (frame=0xcb788cb4, 
usermode=0, eva=3249524740) at /usr/src/sys/i386/i386/trap.c:752
         va = 3249524736
         vm = (struct vmspace *) 0x0
         map = 0xc1043000
         rv = 1
         ftype = 1 '\001'
         td = (struct thread *) 0xc14c3780
         p = (struct proc *) 0xc14e8830
#5  0xc06a7d25 in trap (frame=
       {tf_fs = 8, tf_es = 40, tf_ds = 40, tf_edi 
= 0, tf_esi = -1045576864, tf_ebp = -881292016, 
tf_isp = -881292064, tf_ebx = -1051817936, tf_edx 
= -1045442560, tf_ecx = -1066097312, tf_eax = 
-1066016732, tf_trapno = 12, tf_err = 2, tf_eip = 
-1067353236, 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 = 3413675188
         i = 0
         ucode = 0
         type = 12
         code = 2
         eva = 3249524740
#6  0xc06975da 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 0xc1adc360 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 0xc1afd000 in ?? ()
No symbol table info available.
#16 0xc074a560 in g_wither_work ()
No symbol table info available.
#17 0xc075e024 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 0xc0617b6c in crypto_ret_proc () at /usr/src/sys/opencrypto/crypto.c:1202
         crpt = (struct cryptop *) 0xc1adc360
         krpt = (struct cryptkop *) 0x0
#21 0xc0524fd8 in fork_exit (callout=0xc0617b1c 
<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 0xc069763c in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:208
No locals.
(kgdb)


Without the padlock.ko, it does seem to make it through OK.

but I am still seeing lots of

GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=17842176, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=18366464, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=18497536, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=18628608, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=18759680, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=19283968, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=19415040, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=19546112, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=19677184, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=20201472, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=20332544, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=20463616, length=131072)]
GEOM_ELI: g_eli_crypto_run() failed (error=12). 
ad0s1e.eli[WRITE(offset=20594688, length=131072)]

even with RELENG_6 as of this morning (including your latest MFCs)

         ---Mike 
Received on Tue Aug 16 2005 - 17:39:12 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:41 UTC