提交 54b79248 编写于 作者: M Mike Kravetz 提交者: Paul Mackerras

[PATCH] revised Memory Add Fixes for ppc64

Add the create_section_mapping() routine to create hptes for memory
sections dynamically added after system boot.
Signed-off-by: NMike Kravetz <kravetz@us.ibm.com>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 76c8e25b
...@@ -386,6 +386,15 @@ static unsigned long __init htab_get_table_size(void) ...@@ -386,6 +386,15 @@ static unsigned long __init htab_get_table_size(void)
return pteg_count << 7; return pteg_count << 7;
} }
#ifdef CONFIG_MEMORY_HOTPLUG
void create_section_mapping(unsigned long start, unsigned long end)
{
BUG_ON(htab_bolt_mapping(start, end, start,
_PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX,
mmu_linear_psize));
}
#endif /* CONFIG_MEMORY_HOTPLUG */
void __init htab_initialize(void) void __init htab_initialize(void)
{ {
unsigned long table, htab_size_bytes; unsigned long table, htab_size_bytes;
......
...@@ -127,6 +127,9 @@ int __devinit add_memory(u64 start, u64 size) ...@@ -127,6 +127,9 @@ int __devinit add_memory(u64 start, u64 size)
unsigned long start_pfn = start >> PAGE_SHIFT; unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT; unsigned long nr_pages = size >> PAGE_SHIFT;
start += KERNELBASE;
create_section_mapping(start, start + size);
/* this should work for most non-highmem platforms */ /* this should work for most non-highmem platforms */
zone = pgdata->node_zones; zone = pgdata->node_zones;
......
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
#define MAX_PHYSADDR_BITS 38 #define MAX_PHYSADDR_BITS 38
#define MAX_PHYSMEM_BITS 36 #define MAX_PHYSMEM_BITS 36
#ifdef CONFIG_MEMORY_HOTPLUG
extern void create_section_mapping(unsigned long start, unsigned long end);
#endif /* CONFIG_MEMORY_HOTPLUG */
#endif /* CONFIG_SPARSEMEM */ #endif /* CONFIG_SPARSEMEM */
#endif /* _ASM_POWERPC_SPARSEMEM_H */ #endif /* _ASM_POWERPC_SPARSEMEM_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册