Skip to contentSkip to conversation

Schedule shutdown fix

PATCH In review Ben Guthro 2 participants 2 messages Mar 10, 2008

lore
Share & tools
lore

Ben Guthro

author
#0 lore raw

PATCH 1/1 Schedule shutdown fix

domain_shutdown() needs to call raise_softirq(SCHEDULE_SOFTIRQ). This forces the current vcpu to be rescheduled and paused. Without this, during live migrate, if another vcpu has defer_shutdown==1 then the current vcpu can return from domain_shutdown(),
do a vmenter, and continue running guest code, "resume" code that should only be running on the receiving node!

xen/common/domain.c +1 -0
diff -r 4674efa621d4 xen/common/domain.c
@@ -415,6 +415,7 @@ void domain_shutdown(struct domain *d, u
     __domain_finalise_shutdown(d);
 
     spin_unlock(&d->shutdown_lock);
+    raise_softirq(SCHEDULE_SOFTIRQ);
 }
 
 void domain_resume(struct domain *d)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Probably better fixed by calling vcpu_sleep_nosync() a bit more aggressively. I'll sort out a fix based around that. Nice catch!

-- Keir

Quoted 24 lines · Ben Guthro

domain_shutdown() needs to call raise_softirq(SCHEDULE_SOFTIRQ). This forces the current vcpu to be rescheduled and paused. Without this, during live migrate, if another vcpu has defer_shutdown==1 then the current vcpu can return from domain_shutdown(),
do a vmenter, and continue running guest code, "resume" code that should only be running on the receiving node!

diff -r 4674efa621d4 xen/common/domain.c

xen/common/domain.c +1 -0
@@ -415,6 +415,7 @@ void domain_shutdown(struct domain *d, u
     __domain_finalise_shutdown(d);
 
     spin_unlock(&d->shutdown_lock);
+    raise_softirq(SCHEDULE_SOFTIRQ);
 }
 
 void domain_resume(struct domain *d)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel