From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36646 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwHzk-0004if-KZ for qemu-devel@nongnu.org; Sun, 06 Mar 2011 12:43:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwHzj-0004OP-7A for qemu-devel@nongnu.org; Sun, 06 Mar 2011 12:43:52 -0500 Received: from hall.aurel32.net ([88.191.126.93]:40782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwHzj-0004MB-1T for qemu-devel@nongnu.org; Sun, 06 Mar 2011 12:43:51 -0500 Date: Sun, 6 Mar 2011 18:43:33 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] lsi53c895a: Update dnad when skipping MSGOUT bytes Message-ID: <20110306174332.GA32068@volta.aurel32.net> References: <1296045060-27382-1-git-send-email-stefanha@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1296045060-27382-1-git-send-email-stefanha@linux.vnet.ibm.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, "Nicholas A. Bellinger" , Paul Brook On Wed, Jan 26, 2011 at 12:31:00PM +0000, Stefan Hajnoczi wrote: > Update not only dbc but also dnad when skipping bytes during the MSGOUT > phase. Previously only dbc was updated which is probably wrong and > could lead to bogus message codes being read. > > Tested on Linux and Windows Server 2003. > > Signed-off-by: Stefan Hajnoczi > --- > hw/lsi53c895a.c | 11 +++++++++-- > 1 files changed, 9 insertions(+), 2 deletions(-) Thanks, applied. > diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c > index 9c761cd..84a4992 100644 > --- a/hw/lsi53c895a.c > +++ b/hw/lsi53c895a.c > @@ -842,6 +842,13 @@ static uint8_t lsi_get_msgbyte(LSIState *s) > return data; > } > > +/* Skip the next n bytes during a MSGOUT phase. */ > +static void lsi_skip_msgbytes(LSIState *s, unsigned int n) > +{ > + s->dnad += n; > + s->dbc -= n; > +} > + > static void lsi_do_msgout(LSIState *s) > { > uint8_t msg; > @@ -869,11 +876,11 @@ static void lsi_do_msgout(LSIState *s) > switch (msg) { > case 1: > DPRINTF("SDTR (ignored)\n"); > - s->dbc -= 2; > + lsi_skip_msgbytes(s, 2); > break; > case 3: > DPRINTF("WDTR (ignored)\n"); > - s->dbc -= 1; > + lsi_skip_msgbytes(s, 1); > break; > default: > goto bad; > -- > 1.7.2.3 > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net