Commit 20f937be authored by Anton Blanchard's avatar Anton Blanchard

ppc64: kcore support

parent e69dbde5
......@@ -36,6 +36,7 @@
#include <linux/delay.h>
#include <linux/bootmem.h>
#include <linux/highmem.h>
#include <linux/proc_fs.h>
#ifdef CONFIG_BLK_DEV_INITRD
#include <linux/blk.h> /* for initrd_* */
#endif
......@@ -509,6 +510,34 @@ void __init paging_init(void)
}
#endif
static struct kcore_list kcore_vmem;
static void setup_kcore(void)
{
int i;
for (i=0; i < lmb.memory.cnt; i++) {
unsigned long physbase, size;
unsigned long type = lmb.memory.region[i].type;
struct kcore_list *kcore_mem;
if (type != LMB_MEMORY_AREA)
continue;
physbase = lmb.memory.region[i].physbase;
size = lmb.memory.region[i].size;
/* GFP_ATOMIC to avoid might_sleep warnings during boot */
kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
if (!kcore_mem)
panic("mem_init: kmalloc failed\n");
kclist_add(kcore_mem, __va(physbase), size);
}
kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
}
void initialize_paca_hardware_interrupt_stack(void);
void __init mem_init(void)
......@@ -577,6 +606,8 @@ void __init mem_init(void)
#endif
mem_init_done = 1;
setup_kcore();
/* set the last page of each hardware interrupt stack to be protected */
initialize_paca_hardware_interrupt_stack();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment