ia64/xen-unstable

changeset 14032:f48553000369

[HVM] Another unchecked caller of hvm_copy_to_guest_virt()
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Tue Feb 20 16:18:56 2007 +0000 (2007-02-20)
parents 92a4aafb8cbc
children b5ee25f50861
files xen/arch/x86/hvm/io.c
line diff
     1.1 --- a/xen/arch/x86/hvm/io.c	Tue Feb 20 15:37:28 2007 +0000
     1.2 +++ b/xen/arch/x86/hvm/io.c	Tue Feb 20 16:18:56 2007 +0000
     1.3 @@ -715,7 +715,18 @@ static void hvm_mmio_assist(struct cpu_u
     1.4  
     1.5      case INSTR_PUSH:
     1.6          mmio_opp->addr += hvm_get_segment_base(current, x86_seg_ss);
     1.7 -        hvm_copy_to_guest_virt(mmio_opp->addr, &p->data, size);
     1.8 +        { 
     1.9 +            unsigned long addr = mmio_opp->addr;
    1.10 +            int rv = hvm_copy_to_guest_virt(addr, &p->data, size);
    1.11 +            if ( rv != 0 ) 
    1.12 +            {
    1.13 +                addr += p->size - rv;
    1.14 +                gdprintk(XENLOG_DEBUG, "Pagefault emulating PUSH from MMIO: "
    1.15 +                         "va=%#lx\n", addr);
    1.16 +                hvm_inject_exception(TRAP_page_fault, PFEC_write_access, addr);
    1.17 +                return;
    1.18 +            }
    1.19 +        }
    1.20          break;
    1.21      }
    1.22  }