From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: RE: [Xen-changelog] Fix MOVS instruction emulation for HVM MMIO. Date: Wed, 17 May 2006 08:42:39 +0200 Message-ID: <446AC5DF.6020409@suse.de> References: <907625E08839C4409CE5768403633E0BA7FC80@sefsexmb1.amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <907625E08839C4409CE5768403633E0BA7FC80@sefsexmb1.amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Petersson, Mats" Cc: xen-devel@lists.xensource.com, xen-changelog@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Petersson, Mats wrote: >> Subject: [Xen-changelog] Fix MOVS instruction emulation for HVM MMIO. >> >> diff -r aab3cd33d2ba -r 7fdc4a8b782b xen/arch/x86/hvm/platform.c >> --- a/xen/arch/x86/hvm/platform.c Tue May 16 16:34:27 2006 +0100 >> +++ b/xen/arch/x86/hvm/platform.c Tue May 16 19:50:23 2006 +0100 >> @@ -865,7 +865,7 @@ void handle_mmio(unsigned long va, unsig >> * copy ourself. After this copy succeeds, "rep=20 >> movs" is executed >> * again. >> */ >> - if ((addr & PAGE_MASK) !=3D ((addr + size - 1) & PAGE_MASK)) = { >> + if ((addr & PAGE_MASK) !=3D ((addr + sign * (size - 1)) &=20 >> + PAGE_MASK)) { >=20 > With the risk of being wrong (again), I'd say this is incorrect: The > MOVS instruction will start reading at ESI, and write at the address > indicated by EDI and write with size bytes, even when it's copying > backwards. So there should be no multiplication of sign on this line.=20 I still think this is correct. If I understand things correctly the point of the test is to figure whenever the _next_ repz movs interation will access another page (and if so copy just one data word and let the emulator kick in again for the remaining data on the page above/below). cheers, Gerd --=20 Gerd Hoffmann Erst mal heiraten, ein, zwei Kinder, und wenn alles l=E4uft geh' ich nach drei Jahren mit der Familie an die B=F6rse. http://www.suse.de/~kraxel/julika-dora.jpeg