ia64/xen-unstable

changeset 11573:6e3223a69461

[XEN] Do not emulate user-mode updates to page tables.
Instead use as a hint that the page is no longer a page table.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Sep 21 19:51:10 2006 +0100 (2006-09-21)
parents 8c29bf7ede67
children 140dff9d90dc
files xen/arch/x86/mm/shadow/multi.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/multi.c	Thu Sep 21 19:34:45 2006 +0100
     1.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Thu Sep 21 19:51:10 2006 +0100
     1.3 @@ -3037,7 +3037,14 @@ static int sh_page_fault(struct vcpu *v,
     1.4      SHADOW_PRINTK("emulate: eip=%#lx\n", emul_regs.eip);
     1.5  
     1.6      v->arch.shadow.propagate_fault = 0;
     1.7 -    if ( x86_emulate_memop(&emul_ctxt, &shadow_emulator_ops) )
     1.8 +
     1.9 +    /*
    1.10 +     * We do not emulate user writes. Instead we use them as a hint that the
    1.11 +     * page is no longer a page table. This behaviour differs from native, but
    1.12 +     * it seems very unlikely that any OS grants user access to page tables.
    1.13 +     */
    1.14 +    if ( (regs->error_code & PFEC_user_mode) ||
    1.15 +         x86_emulate_memop(&emul_ctxt, &shadow_emulator_ops) )
    1.16      {
    1.17          SHADOW_PRINTK("emulator failure, unshadowing mfn %#lx\n", 
    1.18                         mfn_x(gmfn));
    1.19 @@ -3050,11 +3057,10 @@ static int sh_page_fault(struct vcpu *v,
    1.20           * guest to loop on the same page fault. */
    1.21          goto done;
    1.22      }
    1.23 +
    1.24 +    /* Emulation triggered another page fault? */
    1.25      if ( v->arch.shadow.propagate_fault )
    1.26 -    {
    1.27 -        /* Emulation triggered another page fault */
    1.28          goto not_a_shadow_fault;
    1.29 -    }
    1.30  
    1.31      /* Emulator has changed the user registers: write back */
    1.32      if ( hvm_guest(v) )