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-changelog

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] RE: [Xen-changelog] Fix MOVS instruction emulation for HVM MMIO.
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Tue, 16 May 2006 23:41:43 +0200
Delivery-date: Tue, 16 May 2006 14:41:17 -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: AcZ5MEz/zNygFy3NTKO/+FJ2JMcHegAAIrUg
Thread-topic: [Xen-changelog] Fix MOVS instruction emulation for HVM MMIO.
> -----Original Message-----
> From: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf 
> Of Xen patchbot-unstable
> Sent: 16 May 2006 22:30
> To: xen-changelog@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-changelog] Fix MOVS instruction emulation for HVM MMIO.
> 
> # HG changeset patch
> # User kaf24@xxxxxxxxxxxxxxxxxxxx
> # Node ID 7fdc4a8b782b1e17fc473d418236ab44cc31b35f
> # Parent  aab3cd33d2ba65340d355ffbfc859ef6e7b64df3
> Fix MOVS instruction emulation for HVM MMIO.
> From: Gerd Hoffman
> Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
> ---
>  xen/arch/x86/hvm/platform.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> 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'm sorry I missed this the first time I looked at the patch the first
time and said "That looks right". 

The rest of the patch looks fine to me.

--
Mats
>              unsigned long value = 0;
>  
>              mmio_opp->flags |= OVERLAP; @@ -876,7 +876,7 @@ 
> void handle_mmio(unsigned long va, unsig
>                  hvm_copy(&value, addr, size, HVM_COPY_IN);
>              send_mmio_req(IOREQ_TYPE_COPY, gpa, 1, size, 
> value, dir, 0);
>          } else {
> -            if ((addr & PAGE_MASK) != ((addr + count * size 
> - 1) & PAGE_MASK)) {
> +            if ((addr & PAGE_MASK) != ((addr + sign * (count 
> * size - 
> + 1)) & PAGE_MASK)) {
>                  regs->eip -= inst_len; /* do not advance %eip */
>  
>                  if (sign > 0)
> 
> _______________________________________________
> Xen-changelog mailing list
> Xen-changelog@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-changelog
> 
> 


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

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