WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] RE: [Xen-changelog] Fix MOVS instruction emulation for H

To: "Gerd Hoffmann" <kraxel@xxxxxxx>
Subject: RE: [Xen-devel] RE: [Xen-changelog] Fix MOVS instruction emulation for HVM MMIO.
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Wed, 17 May 2006 14:26:07 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-changelog@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 17 May 2006 06:29:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcZ5fjW5KKKk1c4US0+E4bSt1AGy/wALk0Rw
Thread-topic: [Xen-devel] RE: [Xen-changelog] Fix MOVS instruction emulation for HVM MMIO.
> -----Original Message-----
> From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Gerd Hoffmann
> Sent: 17 May 2006 07:43
> To: Petersson, Mats
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxx; xen-changelog@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [Xen-devel] RE: [Xen-changelog] Fix MOVS 
> instruction emulation for HVM MMIO.
> 
> 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 movs" is 
> >> executed
> >>           * again.
> >>           */
> >> -        if ((addr & PAGE_MASK) != ((addr + size - 1) & 
> PAGE_MASK)) {
> >> +        if ((addr & PAGE_MASK) != ((addr + sign * (size - 1)) &
> >> + PAGE_MASK)) {
> > 
> > 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.
> 
> 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).

No, the test is for if the first (current) operation is crossing a page 
boundary, not if the NEXT one is... That's why the code in this condition is 
using hvm_copy to fetch the data that is being accessed... 

But leave it as is right now, I'm still working on getting a piece of test-code 
to do MOVS in various ways... 

--
Mats
> 
> cheers,
> 
>   Gerd
> 
> --
> Gerd Hoffmann <kraxel@xxxxxxx>
> Erst mal heiraten, ein, zwei Kinder, und wenn alles läuft 
> geh' ich nach drei Jahren mit der Familie an die Börse.
> http://www.suse.de/~kraxel/julika-dora.jpeg
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>