From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ME7EC-0002kG-5x for qemu-devel@nongnu.org; Tue, 09 Jun 2009 15:43:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ME7E6-0002UO-Oa for qemu-devel@nongnu.org; Tue, 09 Jun 2009 15:43:23 -0400 Received: from [199.232.76.173] (port=36661 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ME7E6-0002U1-I2 for qemu-devel@nongnu.org; Tue, 09 Jun 2009 15:43:18 -0400 Received: from mail.windriver.com ([147.11.1.11]:35738 helo=mail.wrs.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ME7E5-0003jX-Um for qemu-devel@nongnu.org; Tue, 09 Jun 2009 15:43:18 -0400 From: Bill Paul Subject: Re: [Qemu-devel] bug report + fix: e1000.c in 0.10.5 does not properly emulate real hardware Date: Tue, 9 Jun 2009 12:42:56 -0700 References: <200906081848.39468.wpaul@windriver.com> <200906082039.26935.wpaul@windriver.com> <20090609145906.GA9134@amd.home.annexia.org> In-Reply-To: <20090609145906.GA9134@amd.home.annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906091243.09093.wpaul@windriver.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: qemu-devel@nongnu.org Of all the gin joints in all the towns in all the world, Richard W.M. Jones had to walk into mine and say: > On Mon, Jun 08, 2009 at 08:39:26PM -0700, Bill Paul wrote: > > I can generate a unified diff, but I'm not sure I understand what is > > meant by "Signed-off-by." Can you elaborate? (Sorry, I'm not familiar > > with the QEMU development process. I just wanted to send a bug report. :) > > It's just a convention started on the Linux kernel mailing lists a > few years back. Just put this in your email with the patch: > > Signed-off-by: Your Name > > See also: http://kerneltrap.org/node/3929 > > Rich. Ah, ok. Will do. Note: this diff is against the 0.10.5 released sources. not the latest code in the repository (though the same bugs are still there, I'm sure). -Bill -- ============================================================================= -Bill Paul (510) 749-2329 | Senior Engineer, Master of Unix-Fu wpaul@windriver.com | Wind River Systems ============================================================================= "I put a dollar in a change machine. Nothing changed." - George Carlin ============================================================================= Signed-off-by: Bill Paul --- --- e1000.c.orig 2009-05-20 13:46:59.000000000 -0700 +++ e1000.c 2009-06-08 14:23:24.000000000 -0700 @@ -155,6 +155,7 @@ if (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); } @@ -275,10 +276,14 @@ { unsigned int index, r = s->mac_reg[EERD] & ~E1000_EEPROM_RW_REG_START; + if ((s->mac_reg[EERD] & E1000_EEPROM_RW_REG_START) == 0) + return (s->mac_reg[EERD]); + if ((index = r >> E1000_EEPROM_RW_ADDR_SHIFT) > EEPROM_CHECKSUM_REG) - return 0; - return (s->eeprom_data[index] << E1000_EEPROM_RW_REG_DATA) | - E1000_EEPROM_RW_REG_DONE | r; + return (E1000_EEPROM_RW_REG_DONE | r); + + return ((s->eeprom_data[index] << E1000_EEPROM_RW_REG_DATA) | + E1000_EEPROM_RW_REG_DONE | r); } static void @@ -767,7 +772,7 @@ getreg(WUFC), getreg(TDT), getreg(CTRL), getreg(LEDCTL), getreg(MANC), getreg(MDIC), getreg(SWSM), getreg(STATUS), getreg(TORL), getreg(TOTL), getreg(IMS), getreg(TCTL), - getreg(RDH), getreg(RDT), getreg(VET), + getreg(RDH), getreg(RDT), getreg(VET), getreg(ICS), [TOTH] = mac_read_clr8, [TORH] = mac_read_clr8, [GPRC] = mac_read_clr4, [GPTC] = mac_read_clr4, [TPR] = mac_read_clr4, [TPT] = mac_read_clr4,