direct-io.hg

changeset 6487:d481d2776e89

Add a hook to support CPU migration for VMX domains

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author adsharma@los-vmm.sc.intel.com
date Tue Aug 09 11:06:44 2005 -0800 (2005-08-09)
parents 6a87d79f9ee0
children b370beb3e107
files xen/arch/x86/domain.c xen/common/dom0_ops.c xen/include/xen/domain.h
line diff
     1.1 --- a/xen/arch/x86/domain.c	Tue Aug 09 11:06:44 2005 -0800
     1.2 +++ b/xen/arch/x86/domain.c	Tue Aug 09 11:06:44 2005 -0800
     1.3 @@ -297,6 +297,15 @@ void arch_do_boot_vcpu(struct vcpu *v)
     1.4          l1e_from_page(virt_to_page(gdt_table), PAGE_HYPERVISOR);
     1.5  }
     1.6  
     1.7 +void
     1.8 +arch_migrate_cpu(struct vcpu *v, int newcpu)
     1.9 +{
    1.10 +    if ( VMX_DOMAIN(v) && (v->processor != newcpu) ){
    1.11 +        u64 vmcs_phys_ptr = (u64) virt_to_phys(v->arch.arch_vmx.vmcs);
    1.12 +        __vmpclear(vmcs_phys_ptr);
    1.13 +    }
    1.14 +}
    1.15 +
    1.16  #ifdef CONFIG_VMX
    1.17  static int vmx_switch_on;
    1.18  
     2.1 --- a/xen/common/dom0_ops.c	Tue Aug 09 11:06:44 2005 -0800
     2.2 +++ b/xen/common/dom0_ops.c	Tue Aug 09 11:06:44 2005 -0800
     2.3 @@ -300,8 +300,10 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     2.4              int new_cpu = (int)find_first_set_bit(cpumap) % num_online_cpus();
     2.5  
     2.6              vcpu_pause(v);
     2.7 -            if ( v->processor != new_cpu )
     2.8 +            if ( v->processor != new_cpu ){
     2.9                  set_bit(_VCPUF_cpu_migrated, &v->vcpu_flags);
    2.10 +                arch_migrate_cpu(v, new_cpu);
    2.11 +            }
    2.12              set_bit(_VCPUF_cpu_pinned, &v->vcpu_flags);
    2.13              v->processor = new_cpu;
    2.14              vcpu_unpause(v);
     3.1 --- a/xen/include/xen/domain.h	Tue Aug 09 11:06:44 2005 -0800
     3.2 +++ b/xen/include/xen/domain.h	Tue Aug 09 11:06:44 2005 -0800
     3.3 @@ -14,6 +14,8 @@ extern void arch_do_createdomain(struct 
     3.4  
     3.5  extern void arch_do_boot_vcpu(struct vcpu *v);
     3.6  
     3.7 +void arch_migrate_cpu(struct vcpu *v, int newcpu);
     3.8 +
     3.9  extern int  arch_set_info_guest(
    3.10      struct vcpu *d, struct vcpu_guest_context *c);
    3.11