qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	wpaul@windriver.com, qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	yan@daynix.com, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] e1000: make ICS write-only
Date: Wed, 9 Jan 2013 17:34:07 +0200	[thread overview]
Message-ID: <20130109153407.GB7726@redhat.com> (raw)
In-Reply-To: <50ED8C9D.1060109@redhat.com>

On Wed, Jan 09, 2013 at 11:28:29PM +0800, Jason Wang wrote:
> On 01/09/2013 06:51 PM, Michael S. Tsirkin wrote:
> > Since commit b1332393cdd7d023de8f1f8aa136ee7866a18968,
> > qemu started updating ICS register when interrupt
> > is sent, with the intent to match spec better
> > (guests do not actually read this register).
> > However, the function set_interrupt_cause where ICS
> > is updated is often called internally by
> > device emulation so reading it does not produce the last value
> > written by driver.  Looking closer at the spec,
> > it documents ICS as write-only, so there's no need
> > to update it at all. I conclude that while harmless this line is useless
> > code so removing it is a bit cleaner than keeping it in.
> >
> > Tested with windows and linux guests.
> >
> > Cc: Bill Paul <wpaul@windriver.com>
> > Reported-by: Yan Vugenfirer <yan@daynix.com>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> >  hw/e1000.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/hw/e1000.c b/hw/e1000.c
> > index 92fb00a..928d804 100644
> > --- a/hw/e1000.c
> > +++ b/hw/e1000.c
> > @@ -230,7 +230,6 @@ set_interrupt_cause(E1000State *s, int index, uint32_t val)
> >          val |= E1000_ICR_INT_ASSERTED;
> >      }
> >      s->mac_reg[ICR] = val;
> > -    s->mac_reg[ICS] = val;
> >      qemu_set_irq(s->dev.irq[0], (s->mac_reg[IMS] & s->mac_reg[ICR]) != 0);
> >  }
> >  
> 
> If my memory is correct, though ICS is marked as read only in the spec,
> we do can read it when I'm examining a real e1000 card.

Interesting, this was not Bill's motivation.
I haven't seen any reads with linux or windows guests -
which guest did trigger them for you?
Also, what's the value one would expect?

-- 
MST

  reply	other threads:[~2013-01-09 15:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09 10:51 [Qemu-devel] [PATCH] e1000: make ICS write-only Michael S. Tsirkin
2013-01-09 14:14 ` Stefan Hajnoczi
2013-01-09 14:45 ` Anthony Liguori
2013-01-09 15:28 ` Jason Wang
2013-01-09 15:34   ` Michael S. Tsirkin [this message]
2013-01-09 15:36     ` Jason Wang
2013-01-09 15:48       ` Michael S. Tsirkin
2013-01-09 17:30 ` Bill Paul
2013-01-09 17:51   ` Michael S. Tsirkin
2013-01-09 19:50   ` Anthony Liguori
2013-01-09 22:07     ` Michael S. Tsirkin
2013-01-09 22:21       ` Bill Paul
2013-01-09 22:48         ` Michael S. Tsirkin
2013-01-09 21:44   ` Michael S. Tsirkin
2013-01-09 22:05     ` Bill Paul

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=20130109153407.GB7726@redhat.com \
    --to=mst@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wpaul@windriver.com \
    --cc=yan@daynix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).