qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] e1000: make ICS write-only
@ 2013-01-09 10:51 Michael S. Tsirkin
  2013-01-09 14:14 ` Stefan Hajnoczi
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Michael S. Tsirkin @ 2013-01-09 10:51 UTC (permalink / raw)
  To: qemu-devel, wpaul, yan
  Cc: Paolo Bonzini, Anthony Liguori, Jason Wang, Stefan Hajnoczi,
	Michael S. Tsirkin

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);
 }
 
-- 
MST

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-01-09 22:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).