From owner-svn-src-head@FreeBSD.ORG Mon Nov 10 19:12:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D05F0B5D; Mon, 10 Nov 2014 19:12:34 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D217D99; Mon, 10 Nov 2014 19:12:34 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::96f:bc74:b3c9:9d0e] (unknown [IPv6:2001:7b8:3a7:0:96f:bc74:b3c9:9d0e]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 93D78B80A; Mon, 10 Nov 2014 20:12:30 +0100 (CET) Subject: Re: svn commit: r274250 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: multipart/signed; boundary="Apple-Mail=_FCFBBE2C-D35C-43FE-9A1E-1955E2A75673"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b1 From: Dimitry Andric In-Reply-To: <201411072010.sA7KAAkp026433@svn.freebsd.org> Date: Mon, 10 Nov 2014 20:12:24 +0100 Message-Id: <2BDD3161-15BE-43FF-95CB-7DC6D01DAA58@FreeBSD.org> References: <201411072010.sA7KAAkp026433@svn.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.1990.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2014 19:12:34 -0000 --Apple-Mail=_FCFBBE2C-D35C-43FE-9A1E-1955E2A75673 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 07 Nov 2014, at 21:10, Konstantin Belousov wrote: >=20 > Author: kib > Date: Fri Nov 7 20:10:09 2014 > New Revision: 274250 > URL: https://svnweb.freebsd.org/changeset/base/274250 >=20 > Log: > Simplify assembler in ivy.c. Move the copying of the random bits = into > buffer from asm to C, which reduces amount of arguments for inline = asm > and simplifies constraints. Use unsigned types consistently. >=20 > Submitted by: bde > Approved by: secteam (delphij) > Reviewed by: markm > MFC after: 1 week >=20 > Modified: > head/sys/dev/random/ivy.c >=20 > Modified: head/sys/dev/random/ivy.c > = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/random/ivy.c Fri Nov 7 19:34:10 2014 = (r274249) > +++ head/sys/dev/random/ivy.c Fri Nov 7 20:10:09 2014 = (r274250) > @@ -61,42 +61,41 @@ static struct live_entropy_source random > }; >=20 > static inline int > -ivy_rng_store(long *buf) > +ivy_rng_store(u_long *buf) > { > #ifdef __GNUCLIKE_ASM > - long tmp; > + u_long rndval; > int retry; >=20 > retry =3D RETRY_COUNT; > __asm __volatile( > "1:\n\t" > - "rdrand %2\n\t" /* read randomness into tmp */ > - "jb 2f\n\t" /* CF is set on success, exit retry loop = */ > + "rdrand %1\n\t" /* read randomness into tmp */ > + "jc 2f\n\t" /* CF is set on success, exit retry loop = */ You might want to update the first comment to "read randomness into rndval", for consistency. -Dimitry --Apple-Mail=_FCFBBE2C-D35C-43FE-9A1E-1955E2A75673 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlRhDh0ACgkQsF6jCi4glqMzoACfX+b7r5HXj+5MV6XQIV5zG2E/ TbcAni1wvBIUgO3ptDNDliKhE1sc4NC8 =OgKx -----END PGP SIGNATURE----- --Apple-Mail=_FCFBBE2C-D35C-43FE-9A1E-1955E2A75673--