From b8dc154e6bc1586aa1d1aae78d4cc00a25408718 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Tue, 6 Nov 2007 11:33:52 -0800 Subject: [PATCH] cpu alloc: crash_notes conversion Signed-off-by: Christoph Lameter --- arch/ia64/kernel/crash.c | 2 +- drivers/base/cpu.c | 3 ++- kernel/kexec.c | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c index f1cf2df..d9c1d79 100644 --- a/arch/ia64/kernel/crash.c +++ b/arch/ia64/kernel/crash.c @@ -71,7 +71,7 @@ crash_save_this_cpu(void) dst[46] = (unsigned long)ia64_rse_skip_regs((unsigned long *)dst[46], sof - sol); - buf = (u64 *) per_cpu_ptr(crash_notes, cpu); + buf = (u64 *) CPU_PTR(crash_notes, cpu); if (!buf) return; buf = append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS, prstatus, diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 4054507..7783d49 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "base.h" @@ -95,7 +96,7 @@ static ssize_t show_crash_notes(struct sys_device *dev, char *buf) * boot up and this data does not change there after. Hence this * operation should be safe. No locking required. */ - addr = __pa(per_cpu_ptr(crash_notes, cpunum)); + addr = __pa(CPU_PTR(crash_notes, cpunum)); rc = sprintf(buf, "%Lx\n", addr); return rc; } diff --git a/kernel/kexec.c b/kernel/kexec.c index aa74a1e..c3583a0 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -1122,7 +1123,7 @@ void crash_save_cpu(struct pt_regs *regs, int cpu) * squirrelled away. ELF notes happen to provide * all of that, so there is no need to invent something new. */ - buf = (u32*)per_cpu_ptr(crash_notes, cpu); + buf = (u32*)CPU_PTR(crash_notes, cpu); if (!buf) return; memset(&prstatus, 0, sizeof(prstatus)); @@ -1136,7 +1137,7 @@ 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 = CPU_ALLOC(note_buf_t, GFP_KERNEL|__GFP_ZERO); if (!crash_notes) { printk("Kexec: Memory allocation for saving cpu register" " states failed\n"); -- 1.5.3.4