[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Do not allow an uninitialised VCPU to be brought up. Also



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 56d05708736ab4c8249627d25edfd0849f1a05fb
# Parent  378e1c58bcd20a1622977796af39dcf8030e1588
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@xxxxxxxxxxxxx>

diff -r 378e1c58bcd2 -r 56d05708736a 
linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c    Fri Nov 18 16:54:23 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c    Fri Nov 18 18:25:17 2005
@@ -410,7 +410,8 @@
 
        xen_smp_intr_init(cpu);
        cpu_set(cpu, cpu_online_map);
-       HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
+       if (HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL) != 0)
+               BUG();
 
        return 0;
 }
diff -r 378e1c58bcd2 -r 56d05708736a xen/common/domain.c
--- a/xen/common/domain.c       Fri Nov 18 16:54:23 2005
+++ b/xen/common/domain.c       Fri Nov 18 18:25:17 2005
@@ -425,7 +425,9 @@
         break;
 
     case VCPUOP_up:
-        if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
+        if ( !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
+            rc = -EINVAL;
+        else if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
             vcpu_wake(v);
         break;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.