From owner-svn-src-all@FreeBSD.ORG Tue Sep 17 20:33:15 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1DC7E6A4; Tue, 17 Sep 2013 20:33:15 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D59642166; Tue, 17 Sep 2013 20:33:14 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r8HKX7XP099334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Sep 2013 13:33:07 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r8HKX7Af099333; Tue, 17 Sep 2013 13:33:07 -0700 (PDT) (envelope-from jmg) Date: Tue, 17 Sep 2013 13:33:07 -0700 From: John-Mark Gurney To: "Bjoern A. Zeeb" Subject: Re: svn commit: r255187 - in head/sys: conf crypto/aesni modules/aesni Message-ID: <20130917203307.GP68682@funkthat.com> References: <201309031831.r83IVNkh026523@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 17 Sep 2013 13:33:08 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2013 20:33:15 -0000 Bjoern A. Zeeb wrote this message on Tue, Sep 17, 2013 at 19:26 +0000: > On Tue, 3 Sep 2013, John-Mark Gurney wrote: > > >Author: jmg > >Date: Tue Sep 3 18:31:23 2013 > >New Revision: 255187 > >URL: http://svnweb.freebsd.org/changeset/base/255187 > > > >Log: > > Use the fact that the AES-NI instructions can be pipelined to improve > > performance... Use SSE2 instructions for calculating the XTS tweek > > factor... Let the compiler do more work and handle register allocation > > by using intrinsics, now only the key schedule is in assembly... > > > > Replace .byte hard coded instructions w/ the proper instructions now > > that both clang and gcc support them... > > > > On my machine, pulling the code to userland I saw performance go from > > ~150MB/sec to 2GB/sec in XTS mode. GELI on GNOP saw a more modest > > increase of about 3x due to other system overhead (geom and > > opencrypto)... > > > > These changes allow almost full disk io rate w/ geli... > > > > Reviewed by: -current, -security > > Thanks to: Mike Hamburg for the XTS tweek algorithm > > > >Added: > > head/sys/crypto/aesni/aesencdec.h (contents, props changed) > >Deleted: > > head/sys/crypto/aesni/aesencdec_amd64.S > > head/sys/crypto/aesni/aesencdec_i386.S > >Modified: > > head/sys/conf/files.amd64 > > head/sys/conf/files.i386 > > head/sys/crypto/aesni/aeskeys_amd64.S > > head/sys/crypto/aesni/aesni.c > > head/sys/crypto/aesni/aesni.h > > head/sys/crypto/aesni/aesni_wrap.c > > head/sys/modules/aesni/Makefile > > > ... > >Added: head/sys/crypto/aesni/aesencdec.h > >============================================================================== > >--- /dev/null 00:00:00 1970 (empty, because file is newly added) > >+++ head/sys/crypto/aesni/aesencdec.h Tue Sep 3 18:31:23 2013 (r255187) > >@@ -0,0 +1,136 @@ > >+/*- > >+ * Copyright 2013 John-Mark Gurney > >+ * All rights reserved. > >+ * > >+ * Redistribution and use in source and binary forms, with or without > >+ * modification, are permitted provided that the following conditions > >+ * are met: > >+ * 1. Redistributions of source code must retain the above copyright > >+ * notice, this list of conditions and the following disclaimer. > >+ * 2. Redistributions in binary form must reproduce the above copyright > >+ * notice, this list of conditions and the following disclaimer in the > >+ * documentation and/or other materials provided with the distribution. > >+ * > >+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > >+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > >PURPOSE > >+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > >+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > >CONSEQUENTIAL > >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > >+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > >+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > >STRICT > >+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > >WAY > >+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > >+ * SUCH DAMAGE. > >+ * > >+ * $FreeBSD$ > >+ * > >+ */ > >+ > >+#include > >+ > > > This pulls in a header from user space, in fact from clang, and if > cross-building without building clang this header file is not > available and a buildkernel is failing. > > (paths shortend) > In file included from /sys/modules/aesni/../../crypto/aesni/aesni_wrap.c:40: > /sys/modules/aesni/../../crypto/aesni/aesencdec.h:30:10: fatal error: > 'wmmintrin.h' file not found > #include ^ > 1 error generated. > --- aesni_wrap.o --- More details please... cross building on what to what? I will admit I haven't tried to build from arm or other non-x86 platform to an x86.. but I am pretty sure I tested cross building i386 on an amd64 machine... Are you building w/ gcc? it isn't clear from your message... If you are, is your toolchain more recent than the 3rd? Also, all I did was turn off -nostdinc, I didn't add any other paths, which sounds like that the cross build environment isn't built properly if it can't access userland headers... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."