ia64/xen-unstable

changeset 14311:0e08d98dfd57

[XEN] Shadow: fix mark_dirty invocation to use gfn, not mfn
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Thu Mar 08 16:20:01 2007 +0000 (2007-03-08)
parents f78b4aad353e
children 59abe5204ca8 eedbddf55e51
files xen/arch/x86/hvm/hvm.c
line diff
     1.1 --- a/xen/arch/x86/hvm/hvm.c	Thu Mar 08 16:18:50 2007 +0000
     1.2 +++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 08 16:20:01 2007 +0000
     1.3 @@ -380,7 +380,7 @@ void hvm_triple_fault(void)
     1.4   */
     1.5  static int __hvm_copy(void *buf, paddr_t addr, int size, int dir, int virt)
     1.6  {
     1.7 -    unsigned long mfn;
     1.8 +    unsigned long gfn, mfn;
     1.9      char *p;
    1.10      int count, todo;
    1.11  
    1.12 @@ -390,9 +390,11 @@ static int __hvm_copy(void *buf, paddr_t
    1.13          count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);
    1.14  
    1.15          if ( virt )
    1.16 -            mfn = get_mfn_from_gpfn(paging_gva_to_gfn(current, addr));
    1.17 +            gfn = paging_gva_to_gfn(current, addr);
    1.18          else
    1.19 -            mfn = get_mfn_from_gpfn(addr >> PAGE_SHIFT);
    1.20 +            gfn = addr >> PAGE_SHIFT;
    1.21 +        
    1.22 +        mfn = get_mfn_from_gpfn(gfn);
    1.23  
    1.24          if ( mfn == INVALID_MFN )
    1.25              return todo;
    1.26 @@ -400,14 +402,15 @@ static int __hvm_copy(void *buf, paddr_t
    1.27          p = (char *)map_domain_page(mfn) + (addr & ~PAGE_MASK);
    1.28  
    1.29          if ( dir )
    1.30 +        {
    1.31              memcpy(p, buf, count); /* dir == TRUE:  *to* guest */
    1.32 +            mark_dirty(current->domain, gfn);
    1.33 +        }
    1.34          else
    1.35              memcpy(buf, p, count); /* dir == FALSE: *from guest */
    1.36  
    1.37          unmap_domain_page(p);
    1.38          
    1.39 -        mark_dirty(current->domain, mfn);
    1.40 -
    1.41          addr += count;
    1.42          buf  += count;
    1.43          todo -= count;