diff options
author | Shan Haitao <haitao.shan@intel.com> | 2011-03-02 10:01:55 +0000 |
---|---|---|
committer | Shan Haitao <haitao.shan@intel.com> | 2011-03-02 10:01:55 +0000 |
commit | b0dc112d76191eb17aa053f6c56c2f56be214460 (patch) | |
tree | 17954957712a1239239bb23235c84d77324776b8 | |
parent | 2bbea265aaafcd2cc72d0507404ea837bcc99f2d (diff) | |
download | xen-b0dc112d76191eb17aa053f6c56c2f56be214460.tar.gz xen-b0dc112d76191eb17aa053f6c56c2f56be214460.tar.bz2 xen-b0dc112d76191eb17aa053f6c56c2f56be214460.zip |
x86: Add warning comment explaining restrictions to play_dead().
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
-rw-r--r-- | xen/arch/x86/domain.c | 9 |
1 files changed, 9 insertions, 0 deletions
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(); |