ia64/xen-unstable

changeset 7203:f13b4b730605

Rename VCPUOP_craete to VCPUOP_initialise. It is likely that
VCPU creation will actually be moved to domain-build time.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Oct 04 15:02:35 2005 +0100 (2005-10-04)
parents 34d251183985
children ec84b119e4ed
files linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smpboot.c xen/common/domain.c xen/include/public/vcpu.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c	Tue Oct 04 15:02:18 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c	Tue Oct 04 15:02:35 2005 +0100
     1.3 @@ -883,7 +883,7 @@ static int __init do_boot_cpu(int apicid
     1.4  
     1.5  	ctxt.ctrlreg[3] = virt_to_mfn(swapper_pg_dir) << PAGE_SHIFT;
     1.6  
     1.7 -	boot_error = HYPERVISOR_vcpu_op(VCPUOP_create, cpu, &ctxt);
     1.8 +	boot_error = HYPERVISOR_vcpu_op(VCPUOP_initialise, cpu, &ctxt);
     1.9  	if (boot_error)
    1.10  		printk("boot error: %ld\n", boot_error);
    1.11  
    1.12 @@ -1624,6 +1624,6 @@ void vcpu_prepare(int vcpu)
    1.13  
    1.14  	ctxt.ctrlreg[3] = virt_to_mfn(swapper_pg_dir) << PAGE_SHIFT;
    1.15  
    1.16 -	(void)HYPERVISOR_vcpu_op(VCPUOP_create, vcpu, &ctxt);
    1.17 +	(void)HYPERVISOR_vcpu_op(VCPUOP_initialise, vcpu, &ctxt);
    1.18  	(void)HYPERVISOR_vcpu_op(VCPUOP_up, vcpu, NULL);
    1.19  }
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smpboot.c	Tue Oct 04 15:02:18 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smpboot.c	Tue Oct 04 15:02:35 2005 +0100
     2.3 @@ -771,7 +771,7 @@ static int __cpuinit do_boot_cpu(int cpu
     2.4  
     2.5  	ctxt.ctrlreg[3] = virt_to_mfn(init_level4_pgt) << PAGE_SHIFT;
     2.6  
     2.7 -	boot_error  = HYPERVISOR_vcpu_op(VCPUOP_create, cpu, &ctxt);
     2.8 +	boot_error  = HYPERVISOR_vcpu_op(VCPUOP_initialise, cpu, &ctxt);
     2.9  	if (boot_error)
    2.10  		printk("boot error: %ld\n", boot_error);
    2.11  
     3.1 --- a/xen/common/domain.c	Tue Oct 04 15:02:18 2005 +0100
     3.2 +++ b/xen/common/domain.c	Tue Oct 04 15:02:35 2005 +0100
     3.3 @@ -412,12 +412,12 @@ long do_vcpu_op(int cmd, int vcpuid, voi
     3.4      if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
     3.5          return -EINVAL;
     3.6  
     3.7 -    if ( ((v = d->vcpu[vcpuid]) == NULL) && (cmd != VCPUOP_create) )
     3.8 +    if ( ((v = d->vcpu[vcpuid]) == NULL) && (cmd != VCPUOP_initialise) )
     3.9          return -ENOENT;
    3.10  
    3.11      switch ( cmd )
    3.12      {
    3.13 -    case VCPUOP_create:
    3.14 +    case VCPUOP_initialise:
    3.15          if ( (ctxt = xmalloc(struct vcpu_guest_context)) == NULL )
    3.16          {
    3.17              rc = -ENOMEM;
     4.1 --- a/xen/include/public/vcpu.h	Tue Oct 04 15:02:18 2005 +0100
     4.2 +++ b/xen/include/public/vcpu.h	Tue Oct 04 15:02:35 2005 +0100
     4.3 @@ -1,7 +1,7 @@
     4.4  /******************************************************************************
     4.5   * vcpu.h
     4.6   * 
     4.7 - * VCPU creation and hotplug.
     4.8 + * VCPU initialisation, query, and hotplug.
     4.9   * 
    4.10   * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
    4.11   */
    4.12 @@ -18,18 +18,17 @@
    4.13   */
    4.14  
    4.15  /*
    4.16 - * Create a new VCPU. This must be called before a VCPU can be referred to
    4.17 - * in any other hypercall (e.g., to bind event channels). The new VCPU
    4.18 - * will not run until it is brought up by VCPUOP_up.
    4.19 + * Initialise a VCPU. Each VCPU can be initialised only once. A 
    4.20 + * newly-initialised VCPU will not run until it is brought up by VCPUOP_up.
    4.21   * 
    4.22   * @extra_arg == pointer to vcpu_guest_context structure containing initial
    4.23 - *               state for the new VCPU.
    4.24 + *               state for the VCPU.
    4.25   */
    4.26 -#define VCPUOP_create               0
    4.27 +#define VCPUOP_initialise           0
    4.28  
    4.29  /*
    4.30 - * Bring up a newly-created or previously brought-down VCPU. This makes the
    4.31 - * VCPU runnable.
    4.32 + * Bring up a VCPU. This makes the VCPU runnable. This operation will fail
    4.33 + * if the VCPU has not been initialised (VCPUOP_initialise).
    4.34   */
    4.35  #define VCPUOP_up                   1
    4.36  
    4.37 @@ -41,7 +40,7 @@
    4.38   *     idea to ensure that the VCPU has entered a non-critical loop before
    4.39   *     bringing it down. Alternatively, this operation is guaranteed
    4.40   *     synchronous if invoked by the VCPU itself.
    4.41 - *  2. After a VCPU is created, there is currently no way to drop all its
    4.42 + *  2. After a VCPU is initialised, there is currently no way to drop all its
    4.43   *     references to domain memory. Even a VCPU that is down still holds
    4.44   *     memory references via its pagetable base pointer and GDT. It is good
    4.45   *     practise to move a VCPU onto an 'idle' or default page table, LDT and