From owner-freebsd-stable@FreeBSD.ORG Tue Nov 16 09:43:36 2010 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DC1C10656AA for ; Tue, 16 Nov 2010 09:43:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id BA5A18FC15 for ; Tue, 16 Nov 2010 09:43:35 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oAG9hVm2033053 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Nov 2010 11:43:31 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oAG9hVNg098306; Tue, 16 Nov 2010 11:43:31 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oAG9hUih098305; Tue, 16 Nov 2010 11:43:30 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 16 Nov 2010 11:43:30 +0200 From: Kostik Belousov To: Mike Tancsa Message-ID: <20101116094330.GH2392@deviant.kiev.zoral.com.ua> References: <20101115211350.GE2392@deviant.kiev.zoral.com.ua> <4CE1FDBA.9030403@sentex.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="o+NaKOy/ZgNfbXd2" Content-Disposition: inline In-Reply-To: <4CE1FDBA.9030403@sentex.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: stable@freebsd.org Subject: Re: Call for testers: FPU changes X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 09:43:36 -0000 --o+NaKOy/ZgNfbXd2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 15, 2010 at 10:42:50PM -0500, Mike Tancsa wrote: > On 11/15/2010 4:13 PM, Kostik Belousov wrote: > >=20 > > Patch is at > > http://people.freebsd.org/~kib/misc/releng_8_fpu.1.patch >=20 >=20 > Hi, > One small failure on the patch >=20 > The text leading up to this was: > -------------------------- > |Index: pc98/include/npx.h > |=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > |--- pc98/include/npx.h (revision 215253) > |+++ pc98/include/npx.h (working copy) > -------------------------- > Patching file pc98/include/npx.h using Plan A... > Hunk #1 failed at 1. > 1 out of 1 hunks failed--saving rejects to pc98/include/npx.h.rej This is because our patch(1) in base is somewhat old, I believe. The diff was generated by svn diff from the up to date stable/8 checkout, and the reason for failure is expanded $FreeBSD$ tags. Newer gnu patch, available in ports, handless this correctly, reporting about patches applied with "fuzz". >=20 >=20 > I tested with openssl and openvpn and all seems to work great on the via > board and my i5 board!! Simple test details at >=20 > http://www.tancsa.com/fpu.html >=20 > I will try out geli and some more extensive tests tomorrow >=20 > Thanks for porting this back to RELENG_8 ! This is actually somewhat puzzling. Does openssl in base automatically use crypto(4) ? Also, could you, please redo the speed tests for aesni(4) with the following patch applied over the driver sources ? Thank you ! diff --git a/sys/crypto/aesni/aesni_wrap.c b/sys/crypto/aesni/aesni_wrap.c index 36c66ea..3fd397c 100644 --- a/sys/crypto/aesni/aesni_wrap.c +++ b/sys/crypto/aesni/aesni_wrap.c @@ -246,14 +246,21 @@ int aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini) { struct thread *td; - int error; + int error, saved_ctx; =20 td =3D curthread; - error =3D fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + if (!is_fpu_kern_thread(0)) { + error =3D fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + saved_ctx =3D 1; + } else { + error =3D 0; + saved_ctx =3D 0; + } if (error =3D=3D 0) { error =3D aesni_cipher_setup_common(ses, encini->cri_key, encini->cri_klen); - fpu_kern_leave(td, &ses->fpu_ctx); + if (saved_ctx) + fpu_kern_leave(td, &ses->fpu_ctx); } return (error); } @@ -264,16 +271,22 @@ aesni_cipher_process(struct aesni_session *ses, struc= t cryptodesc *enccrd, { struct thread *td; uint8_t *buf; - int error, allocated; + int error, allocated, saved_ctx; =20 buf =3D aesni_cipher_alloc(enccrd, crp, &allocated); if (buf =3D=3D NULL) return (ENOMEM); =20 td =3D curthread; - error =3D fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); - if (error !=3D 0) - goto out; + if (!is_fpu_kern_thread(0)) { + error =3D fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + if (error !=3D 0) + goto out; + saved_ctx =3D 1; + } else { + saved_ctx =3D 0; + error =3D 0; + } =20 if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) !=3D 0) { error =3D aesni_cipher_setup_common(ses, enccrd->crd_key, @@ -311,7 +324,8 @@ aesni_cipher_process(struct aesni_session *ses, struct = cryptodesc *enccrd, ses->iv); } } - fpu_kern_leave(td, &ses->fpu_ctx); + if (saved_ctx) + fpu_kern_leave(td, &ses->fpu_ctx); if (allocated) crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, enccrd->crd_len, buf); --o+NaKOy/ZgNfbXd2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkziUkIACgkQC3+MBN1Mb4iI5QCdHlqsjEY2d4IPan9+5EcabUXb 0nIAoMyrnETGquYpttWzQ7lwQhAySMsL =T1Bt -----END PGP SIGNATURE----- --o+NaKOy/ZgNfbXd2--