The attached patch fixes a Xen panic when a domain is shutdown before
oprofile is stopped. Without this patch, free_xenoprof_pages() is
called before the domain is destroyed and that, in turn, prevents
oprofile from cleaning up pages shared with guests. Shutting down a
domain without terminating oprofile therefore causes a Xen panic at a
later point in time.
Signed-off-by: Niraj Tolia <niraj.tolia@hp.com>
if (is_hvm_domain(d) && d->arch.sal_data)
xfree(d->arch.sal_data);
- /* Free page used by xen oprofile buffer */
- free_xenoprof_pages(d);
-
return 0;
}
BUG();
}
- /* Free page used by xen oprofile buffer. */
- free_xenoprof_pages(d);
-
if ( is_hvm_domain(d) )
hvm_domain_relinquish_resources(d);
sched_destroy_domain(d);
+ /* Free page used by xen oprofile buffer. */
+ free_xenoprof_pages(d);
+
for ( i = MAX_VIRT_CPUS-1; i >= 0; i-- )
if ( (v = d->vcpu[i]) != NULL )
free_vcpu_struct(v);