aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/smpboot.c
diff options
context:
space:
mode:
authorAndrew Cooper <andrew.cooper3@citrix.com>2013-08-27 11:28:26 +0200
committerJan Beulich <jbeulich@suse.com>2013-08-27 11:28:26 +0200
commit8a3c4acc9907cfec9aae9f1bc251fbf50af6828e (patch)
tree3e93a1da7124e4538579b65a894106e9ba0e01e0 /xen/arch/x86/smpboot.c
parent483814219bc4d47db8a56116290ec7878b794c09 (diff)
downloadxen-8a3c4acc9907cfec9aae9f1bc251fbf50af6828e.tar.gz
xen-8a3c4acc9907cfec9aae9f1bc251fbf50af6828e.tar.bz2
xen-8a3c4acc9907cfec9aae9f1bc251fbf50af6828e.zip
x86/boot: Explicitly clean pcpu stacks in debug builds
This reduces confusion when looking at a hexdump of the pcpu stacks and wondering were on earth some of the junk was coming from. Also leave some grep fodder for finding where the BSP switches stack (because it took me far longer to find than I care to admit to). Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Diffstat (limited to 'xen/arch/x86/smpboot.c')
-rw-r--r--xen/arch/x86/smpboot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 9f81c7ba62..8bfa151a40 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -659,6 +659,10 @@ static int cpu_smpboot_alloc(unsigned int cpu)
stack_base[cpu] = alloc_xenheap_pages(STACK_ORDER, 0);
if ( stack_base[cpu] == NULL )
goto oom;
+#ifndef NDEBUG
+ for ( order = 0 ; order < (1<<STACK_ORDER); ++order )
+ clear_page(stack_base[cpu] + order * PAGE_SIZE);
+#endif
memguard_guard_stack(stack_base[cpu]);
order = get_order_from_pages(NR_RESERVED_GDT_PAGES);