Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
static void play_dead(void)
{
+ /*
+ * NOTE: After cpu_exit_clear, per-cpu variables are no longer accessible,
+ * as they may be freed at any time. In this case, heap corruption or
+ * #PF can occur (when heap debugging is enabled). For example, even
+ * printk() can involve tasklet scheduling, which touches per-cpu vars.
+ *
+ * Consider very carefully when adding code to this path. Most hypervisor
+ * subsystems are unsafe to call.
+ */
cpu_exit_clear(smp_processor_id());
mb();
local_irq_disable();