ia64/xen-unstable

changeset 7910:56d05708736a

Do not allow an uninitialised VCPU to be brought up. Also
check VCPUOP_up return code in the guest and BUG() on
failure.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Nov 18 19:25:17 2005 +0100 (2005-11-18)
parents 378e1c58bcd2
children 94d39d9acc8e
files linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c xen/common/domain.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Fri Nov 18 17:54:23 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Fri Nov 18 19:25:17 2005 +0100
     1.3 @@ -410,7 +410,8 @@ int __devinit __cpu_up(unsigned int cpu)
     1.4  
     1.5  	xen_smp_intr_init(cpu);
     1.6  	cpu_set(cpu, cpu_online_map);
     1.7 -	HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
     1.8 +	if (HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL) != 0)
     1.9 +		BUG();
    1.10  
    1.11  	return 0;
    1.12  }
     2.1 --- a/xen/common/domain.c	Fri Nov 18 17:54:23 2005 +0100
     2.2 +++ b/xen/common/domain.c	Fri Nov 18 19:25:17 2005 +0100
     2.3 @@ -425,7 +425,9 @@ long do_vcpu_op(int cmd, int vcpuid, voi
     2.4          break;
     2.5  
     2.6      case VCPUOP_up:
     2.7 -        if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
     2.8 +        if ( !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
     2.9 +            rc = -EINVAL;
    2.10 +        else if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
    2.11              vcpu_wake(v);
    2.12          break;
    2.13