]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
vmcore: allocate per-cpu crash_notes objects on page-size boundary
authorHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Wed, 20 Mar 2013 04:08:36 +0000 (15:08 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Mar 2013 04:23:29 +0000 (15:23 +1100)
To satisfy mmap()'s page-size boundary requirement, allocate per-cpu
crash_notes objects on page-size boundary.

/proc/vmcore on the 2nd kernel checks if each note objects is allocated on
page-size boundary.  If there's some object not satisfying the page-size
boundary requirement, /proc/vmcore doesn't provide mmap() interface.

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/kexec.c

index 38f5fab4d5eb39330232c4c3084601eb5f3c0e3c..7627bd8620106a2dc745a0342a8992de7ad1b0e1 100644 (file)
@@ -1223,7 +1223,8 @@ void crash_save_cpu(struct pt_regs *regs, int cpu)
 static int __init crash_notes_memory_init(void)
 {
        /* Allocate memory for saving cpu registers. */
-       crash_notes = alloc_percpu(note_buf_t);
+       crash_notes = __alloc_percpu(roundup(sizeof(note_buf_t), PAGE_SIZE),
+                                    PAGE_SIZE);
        if (!crash_notes) {
                printk("Kexec: Memory allocation for saving cpu register"
                " states failed\n");