From: Shan Haitao Date: Wed, 2 Mar 2011 10:01:55 +0000 (+0000) Subject: x86: Add warning comment explaining restrictions to play_dead(). X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b0dc112d76191eb17aa053f6c56c2f56be214460;p=xen.git x86: Add warning comment explaining restrictions to play_dead(). Signed-off-by: Shan Haitao Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index d432eb8990..b91adfb5a4 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -99,6 +99,15 @@ static void default_dead_idle(void) 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();