Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Sep 2013 13:33:07 -0700
From:      John-Mark Gurney <jmg@funkthat.com>
To:        "Bjoern A. Zeeb" <bz@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r255187 - in head/sys: conf crypto/aesni modules/aesni
Message-ID:  <20130917203307.GP68682@funkthat.com>
In-Reply-To: <alpine.BSF.2.00.1309171923510.4210@ai.fobar.qr>
References:  <201309031831.r83IVNkh026523@svn.freebsd.org> <alpine.BSF.2.00.1309171923510.4210@ai.fobar.qr>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <jmg@FreeBSD.org>
> >+ * 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 <wmmintrin.h>
> >+
> 
> 
> 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 <wmmintrin.h> ^
> 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."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130917203307.GP68682>