From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjbbU-0004Y8-CS for qemu-devel@nongnu.org; Thu, 21 Nov 2013 16:16:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjbbP-0003OD-FI for qemu-devel@nongnu.org; Thu, 21 Nov 2013 16:16:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjbbP-0003O9-7H for qemu-devel@nongnu.org; Thu, 21 Nov 2013 16:15:55 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rALLFrxR028318 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 21 Nov 2013 16:15:53 -0500 Message-ID: <528E7807.1080704@redhat.com> Date: Thu, 21 Nov 2013 14:15:51 -0700 From: Eric Blake MIME-Version: 1.0 References: <1385064260-20962-1-git-send-email-vyasevic@redhat.com> <1385064260-20962-2-git-send-email-vyasevic@redhat.com> In-Reply-To: <1385064260-20962-2-git-send-email-vyasevic@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wctcJdNl1vWpCpmkCg58iIEkESbaeUB0U" Subject: Re: [Qemu-devel] [RFC PATCH 1/2] e1000: Use Address_Available bit as HW latch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vlad Yasevich , qemu-devel@nongnu.org Cc: alex.williamson@redhat.com, akong@redhat.com, stefanha@redhat.com, mst@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wctcJdNl1vWpCpmkCg58iIEkESbaeUB0U Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/21/2013 01:04 PM, Vlad Yasevich wrote: > e1000 provides a E1000_RAH_AV bit on every complete write > to the Receive Address Register. We can use this bit > 2 ways: > 1) To trigger HMP notifications. When the bit is set the > mac address is fully set and we can update the HMP. >=20 > 2) We can turn off he bit on the write to low order bits of s/he/the/ > the Receive Address Register, so that we would not try > to match received traffic to this address when it is > not completely set. >=20 > Signed-off-by: Vlad Yasevich > --- > hw/net/e1000.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) >=20 > =20 > - if (index =3D=3D RA || index =3D=3D RA + 1) { > + switch (index) { > + case RA: > + /* Mask off AV bit on the write of the low dword. The write o= f > + * the high dword will set the bit. This way a half-written > + * mac address will not be used to filter on rx. > + */ > + s->mac_reg[RA+1] &=3D ~E1000_RAH_AV; Does real hardware also auto-clear this bit when writing the low word (thus forcing all drivers to write high word last to make a change take effect)? Or are we risking the case of a driver that writes high word first including the bit, and where real hardware just glitches over the temporary half-written address where our emulation locks the user out entirely? (Asked by someone that has not read the datasheet, so take with a grain of salt) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --wctcJdNl1vWpCpmkCg58iIEkESbaeUB0U Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSjngHAAoJEKeha0olJ0NqYWcH/AkoipDMj7tKoxlS2noIGyNU AOSPEn5UwUt+CJUTMjQB3JgjWFX4Y3HG2D20/KgC+XmqTutpGlh/F87udESD5EoD /IR8XcFwgxHfAH5obAcXd3RTmV7SO01fJURADDdOyALiZdP/IwNIQetPku3bt1dy nXTsYe8sQVyuwqpG3a/3uWL3tVfMqkvYBEULKZZCTHOQbWYrh39C1OcY+rDWyzJQ aTlbUkqTGDA/mEziRaVaR9kBfVR3twwgfTTPeAN56buKpBCVY05/VhwaXPLHkTZ5 i+dsD5gwwCY6fEKuWJ9PpEARLz3F7zdmW11sH21tCri1IAHb/xLAZpLggFQaB9g= =h+wW -----END PGP SIGNATURE----- --wctcJdNl1vWpCpmkCg58iIEkESbaeUB0U--