From owner-freebsd-questions@freebsd.org Sun Jul 12 14:10:33 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BB46999876 for ; Sun, 12 Jul 2015 14:10:33 +0000 (UTC) (envelope-from me@rvijay.me) Received: from mail11.rvijay.me (mail11.rvijay.me [107.6.164.87]) by mx1.freebsd.org (Postfix) with ESMTP id F27271C58 for ; Sun, 12 Jul 2015 14:10:32 +0000 (UTC) (envelope-from me@rvijay.me) Received: from mail10.rvijay.me (mail10.rvijay.me [89.233.108.53]) by mail11.rvijay.me (Postfix) with ESMTP id B9E131E61163 for ; Sun, 12 Jul 2015 19:38:46 +0530 (IST) Received: from localhost (localhost [127.0.0.1]) by mail10.rvijay.me (Postfix) with ESMTP id 33C3D241AB for ; Sun, 12 Jul 2015 14:08:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rvijay.me; h= content-type:content-type:subject:subject:to:mime-version :user-agent:from:from:date:date:message-id; s=20130919; t= 1436710120; x=1437574121; bh=jFeDZIzgG3V9t//HIl1nzEgydj9B6wxqsLy nLuTtgpo=; b=dpiSRZ33NfeeTtpavvfXvUC08q07Tzy6+97ZxRC12abeeBmrbOV 9gGg9Gv3kEUiod3+bcD4nD5Q4mRflDI+7F2ctKPR5rdmi4zNWMEi7og8tpbnNvAI 8VORUQ2b+OBvcz60yekK0sGyE06d6chgPse0U7/h9dVjxC8GLSoA3hao= Received: from mail10.rvijay.me ([127.0.0.1]) by localhost (mail10.rvijay.me [127.0.0.1]) (amavisd-new, port 10026) with LMTP id U42JJF3m9CqQ for ; Sun, 12 Jul 2015 14:08:40 +0000 (UTC) Received: from Vijays-MacBook-Pro.local (unknown [49.207.184.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail10.rvijay.me (Postfix) with ESMTPSA id 8C31D2405F for ; Sun, 12 Jul 2015 14:08:39 +0000 (UTC) Message-ID: <55A274E5.50903@rvijay.me> Date: Sun, 12 Jul 2015 19:38:37 +0530 From: Vijay Rajah User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: FreeBSD questions Subject: Openssl + Via Padlock Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jul 2015 14:10:33 -0000 Hello List, I have a system with VIA chipset. I want to compile openssl with padlock support. I'm getting "Illegal instruction" error, when I try to use the sha256library root@my-host:~ # dd if=/dev/zero bs=1M count=512 | /usr/local/bin/openssl sha256 Illegal instruction (core dumped) This is a dedicated server. This is a fresh install of FreeBSD 10.1. I installed Openssl from ports Here are the details.. root@my-host:~ # uname -a FreeBSD my-host 10.1-RELEASE-p10 FreeBSD 10.1-RELEASE-p10 #0: Wed May 13 06:54:13 UTC 2015 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 root@my-host:~ # freebsd-version 10.1-RELEASE-p14 root@my-host:~ # /usr/local/bin/openssl version OpenSSL 1.0.2d 9 Jul 2015 root@my-host:~ # /usr/local/bin/openssl engine (dynamic) Dynamic engine loading support (padlock) VIA PadLock: RNG ACE2 PHE NANO root@my-host:~ # dmesg | grep -i via CPU: VIA Nano processor U2250 (1.6GHz Capable) (1596.04-MHz K8-class CPU) VIA Padlock Features=0x70dcc . . . root@my-host:~ # kldstat Id Refs Address Size Name 1 10 0xffffffff80200000 1756638 kernel 2 1 0xffffffff81a11000 26c7 pflog.ko 3 1 0xffffffff81a14000 32339 pf.ko 4 1 0xffffffff81a47000 2b1d padlock.ko 5 1 0xffffffff81a4a000 1f565 crypto.ko Examining the core file with GDB give me the following # gdb /usr/local/bin/openssl openssl.core . . (gdb) bt #0 0x00000008014f2c7e in padlock_sha256_update () from /usr/local/lib/engines/libpadlock.so #1 0x0000000800c3499f in md_read () from /usr/local/lib/libcrypto.so.8 #2 0x0000000800c1c724 in BIO_read () from /usr/local/lib/libcrypto.so.8 #3 0x00000000004228d0 in do_fp () #4 0x0000000000422683 in dgst_main () #5 0x000000000041b77d in do_cmd () #6 0x000000000041b606 in main () (gdb) disassemble 0x00000008014f2c7e . . . 0x00000008014f2c7b : mov %rdx,%rcx *0x00000008014f2c7e : xsha256 * 0x00000008014f2c81 : shl $0x6,%rdx . . . Hence, it appears that the openssl command fails at the "xsha256" instruction. This appears to be VIA chip's instruction?? Any ideas as to why this is failing? -Thanks in advance Vijay