From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MR3JF-0008EU-GC for qemu-devel@nongnu.org; Wed, 15 Jul 2009 08:10:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MR3JA-0008BE-Qx for qemu-devel@nongnu.org; Wed, 15 Jul 2009 08:10:04 -0400 Received: from [199.232.76.173] (port=60366 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MR3JA-0008B4-IK for qemu-devel@nongnu.org; Wed, 15 Jul 2009 08:10:00 -0400 Received: from mx2.redhat.com ([66.187.237.31]:35700) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MR3J8-0008IK-Ob for qemu-devel@nongnu.org; Wed, 15 Jul 2009 08:10:00 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6FC9rYD021949 for ; Wed, 15 Jul 2009 08:09:53 -0400 Date: Wed, 15 Jul 2009 15:09:06 +0300 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver Message-ID: <20090715120906.GB3434@redhat.com> References: <4A5DAA81.2000105@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A5DAA81.2000105@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Naphtali Sprei Cc: qemu-devel@nongnu.org On Wed, Jul 15, 2009 at 01:08:01PM +0300, Naphtali Sprei wrote: > The sequence of reading from eeprom is "offset by one" moved because of > a false detection > of a clock cycle after an eeprom reset. Keeping the last clock value > after a reset keeps it in sync. > --- > hw/e1000.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/hw/e1000.c b/hw/e1000.c > index 4ac8918..7d7cc2e 100644 > --- a/hw/e1000.c > +++ b/hw/e1000.c > @@ -261,7 +261,10 @@ set_eecd(E1000State *s, int index, uint32_t val) > return; > } > if (!(val & E1000_EECD_CS)) { // rising, no CS (EEPROM > reset) > + // save/restore old_eecd to avoid false detection of a clock edge > + uint32_t keep = s->eecd_state.old_eecd; > memset(&s->eecd_state, 0, sizeof s->eecd_state); > + s->eecd_state.old_eecd = keep; Would it be safer to only restore the SK bit? > return; > } > s->eecd_state.val_in <<= 1; > -- > 1.5.5.6 > >