All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Vlad Yasevich <vyasevic@redhat.com>, qemu-devel@nongnu.org
Cc: alex.williamson@redhat.com, akong@redhat.com,
	stefanha@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH 1/2] e1000: Use Address_Available bit as HW latch
Date: Thu, 21 Nov 2013 14:15:51 -0700	[thread overview]
Message-ID: <528E7807.1080704@redhat.com> (raw)
In-Reply-To: <1385064260-20962-2-git-send-email-vyasevic@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1620 bytes --]

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.
> 
>  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.
> 
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
> ---
>  hw/net/e1000.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 

>  
> -    if (index == RA || index == RA + 1) {
> +    switch (index) {
> +    case RA:
> +        /* Mask off AV bit on the write of the low dword.  The write of
> +         * 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] &= ~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)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  reply	other threads:[~2013-11-21 21:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21 20:04 [Qemu-devel] [RFC PATCH 0/2] Update HMP only upon mac change completion Vlad Yasevich
2013-11-21 20:04 ` [Qemu-devel] [RFC PATCH 1/2] e1000: Use Address_Available bit as HW latch Vlad Yasevich
2013-11-21 21:15   ` Eric Blake [this message]
2013-11-22  9:47   ` Jason Wang
2013-11-22 14:37     ` Vlad Yasevich
2013-11-25  9:23       ` Jason Wang
2013-11-21 20:04 ` [Qemu-devel] [RFC PATCH 2/2] rtl8139: update HMP only when the address is fully written Vlad Yasevich
2013-11-21 21:18   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=528E7807.1080704@redhat.com \
    --to=eblake@redhat.com \
    --cc=akong@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vyasevic@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.