ia64/xen-unstable

changeset 13547:a514ae6bc150

[HVM] Save/restore cleanups 06: Let dom0 change domU's paging mode

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Sat Jan 20 11:40:52 2007 +0000 (2007-01-20)
parents 5dc5e6ba42d2
children 7e28a8c150ed
files xen/arch/x86/mm/shadow/common.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/common.c	Sat Jan 20 11:21:08 2007 +0000
     1.2 +++ b/xen/arch/x86/mm/shadow/common.c	Sat Jan 20 11:40:52 2007 +0000
     1.3 @@ -2569,12 +2569,15 @@ static void sh_update_paging_modes(struc
     1.4                  /* Need to make a new monitor table for the new mode */
     1.5                  mfn_t new_mfn, old_mfn;
     1.6  
     1.7 -                if ( v != current ) 
     1.8 +                if ( v != current && vcpu_runnable(v) ) 
     1.9                  {
    1.10                      SHADOW_ERROR("Some third party (d=%u v=%u) is changing "
    1.11 -                                  "this HVM vcpu's (d=%u v=%u) paging mode!\n",
    1.12 -                                  current->domain->domain_id, current->vcpu_id,
    1.13 -                                  v->domain->domain_id, v->vcpu_id);
    1.14 +                                 "this HVM vcpu's (d=%u v=%u) paging mode "
    1.15 +                                 "while it is running.\n",
    1.16 +                                 current->domain->domain_id, current->vcpu_id,
    1.17 +                                 v->domain->domain_id, v->vcpu_id);
    1.18 +                    /* It's not safe to do that because we can't change
    1.19 +                     * the host CR£ for a running domain */
    1.20                      domain_crash(v->domain);
    1.21                      return;
    1.22                  }
    1.23 @@ -2590,7 +2593,8 @@ static void sh_update_paging_modes(struc
    1.24                   * pull it down!  Switch CR3, and warn the HVM code that
    1.25                   * its host cr3 has changed. */
    1.26                  make_cr3(v, mfn_x(new_mfn));
    1.27 -                write_ptbase(v);
    1.28 +                if ( v == current )
    1.29 +                    write_ptbase(v);
    1.30                  hvm_update_host_cr3(v);
    1.31                  old_mode->destroy_monitor_table(v, old_mfn);
    1.32              }