aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/kexec.c
diff options
context:
space:
mode:
authorAndrew Cooper <andrew.cooper3@citrix.com>2012-05-07 13:32:28 +0100
committerAndrew Cooper <andrew.cooper3@citrix.com>2012-05-07 13:32:28 +0100
commit090e7cbafdd67fe933ee8674b76d91103d8f858e (patch)
treeed9eba09ccf7674dfe1a9f5eb0ff5287c4cfa646 /xen/common/kexec.c
parent68e6f038a42cad1a75d219b94df9ddbb3a713709 (diff)
downloadxen-090e7cbafdd67fe933ee8674b76d91103d8f858e.tar.gz
xen-090e7cbafdd67fe933ee8674b76d91103d8f858e.tar.bz2
xen-090e7cbafdd67fe933ee8674b76d91103d8f858e.zip
kexec: clear notes during setup
Explicity zero the memory backing the crash notes during setup. This allows the crash environment to be rather more certain whether the crash notes were actually written, rather than trusting that the memory was clear beforehand. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/kexec.c')
-rw-r--r--xen/common/kexec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 444cae1b03..09a56249e2 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -401,7 +401,7 @@ static int kexec_init_cpu_notes(const unsigned long cpu)
/* If we dont care about the position of allocation, malloc. */
if ( low_crashinfo_mode == LOW_CRASHINFO_NONE )
- note = xmalloc_bytes(nr_bytes);
+ note = xzalloc_bytes(nr_bytes);
/* Protect the write into crash_notes[] with a spinlock, as this function
* is on a hotplug path and a hypercall path. */
@@ -520,6 +520,8 @@ static int __init kexec_init(void)
if ( ! crash_heap_current )
return -ENOMEM;
+ memset(crash_heap_current, 0, crash_heap_size);
+
crash_heap_end = crash_heap_current + crash_heap_size;
}