ia64/xen-unstable
changeset 10071:7fdc4a8b782b
Fix MOVS instruction emulation for HVM MMIO.
From: Gerd Hoffman
Signed-off-by: Keir Fraser <keir@xensource.com>
From: Gerd Hoffman
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Tue May 16 19:50:23 2006 +0100 (2006-05-16) |
parents | aab3cd33d2ba |
children | 7cbc1fc8dbea |
files | xen/arch/x86/hvm/platform.c |
line diff
1.1 --- a/xen/arch/x86/hvm/platform.c Tue May 16 16:34:27 2006 +0100 1.2 +++ b/xen/arch/x86/hvm/platform.c Tue May 16 19:50:23 2006 +0100 1.3 @@ -865,7 +865,7 @@ void handle_mmio(unsigned long va, unsig 1.4 * copy ourself. After this copy succeeds, "rep movs" is executed 1.5 * again. 1.6 */ 1.7 - if ((addr & PAGE_MASK) != ((addr + size - 1) & PAGE_MASK)) { 1.8 + if ((addr & PAGE_MASK) != ((addr + sign * (size - 1)) & PAGE_MASK)) { 1.9 unsigned long value = 0; 1.10 1.11 mmio_opp->flags |= OVERLAP; 1.12 @@ -876,7 +876,7 @@ void handle_mmio(unsigned long va, unsig 1.13 hvm_copy(&value, addr, size, HVM_COPY_IN); 1.14 send_mmio_req(IOREQ_TYPE_COPY, gpa, 1, size, value, dir, 0); 1.15 } else { 1.16 - if ((addr & PAGE_MASK) != ((addr + count * size - 1) & PAGE_MASK)) { 1.17 + if ((addr & PAGE_MASK) != ((addr + sign * (count * size - 1)) & PAGE_MASK)) { 1.18 regs->eip -= inst_len; /* do not advance %eip */ 1.19 1.20 if (sign > 0)