diff options
author | Mike Kravetz <kravetz@us.ibm.com> | 2005-11-07 19:25:48 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-07 23:17:13 -0500 |
commit | 54b79248b24610663298e122c6ba3804468271fe (patch) | |
tree | d8af884b602053ce2d2ed37cdcbfe461c2416b4f | |
parent | 76c8e25b905f99be5ddbe999597ba7c2c33ec64b (diff) |
[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: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 9 | ||||
-rw-r--r-- | arch/powerpc/mm/mem.c | 3 | ||||
-rw-r--r-- | include/asm-powerpc/sparsemem.h | 4 |
3 files changed, 16 insertions, 0 deletions
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 22e474876133..c8c9c2df97e9 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -386,6 +386,15 @@ static unsigned long __init htab_get_table_size(void) | |||
386 | return pteg_count << 7; | 386 | return pteg_count << 7; |
387 | } | 387 | } |
388 | 388 | ||
389 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
390 | void create_section_mapping(unsigned long start, unsigned long end) | ||
391 | { | ||
392 | BUG_ON(htab_bolt_mapping(start, end, start, | ||
393 | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX, | ||
394 | mmu_linear_psize)); | ||
395 | } | ||
396 | #endif /* CONFIG_MEMORY_HOTPLUG */ | ||
397 | |||
389 | void __init htab_initialize(void) | 398 | void __init htab_initialize(void) |
390 | { | 399 | { |
391 | unsigned long table, htab_size_bytes; | 400 | unsigned long table, htab_size_bytes; |
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 6f55efd9be95..2ead0951823a 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -127,6 +127,9 @@ int __devinit add_memory(u64 start, u64 size) | |||
127 | unsigned long start_pfn = start >> PAGE_SHIFT; | 127 | unsigned long start_pfn = start >> PAGE_SHIFT; |
128 | unsigned long nr_pages = size >> PAGE_SHIFT; | 128 | unsigned long nr_pages = size >> PAGE_SHIFT; |
129 | 129 | ||
130 | start += KERNELBASE; | ||
131 | create_section_mapping(start, start + size); | ||
132 | |||
130 | /* this should work for most non-highmem platforms */ | 133 | /* this should work for most non-highmem platforms */ |
131 | zone = pgdata->node_zones; | 134 | zone = pgdata->node_zones; |
132 | 135 | ||
diff --git a/include/asm-powerpc/sparsemem.h b/include/asm-powerpc/sparsemem.h index 1c95ab99deb3..58d2aab416f8 100644 --- a/include/asm-powerpc/sparsemem.h +++ b/include/asm-powerpc/sparsemem.h | |||
@@ -11,6 +11,10 @@ | |||
11 | #define MAX_PHYSADDR_BITS 38 | 11 | #define MAX_PHYSADDR_BITS 38 |
12 | #define MAX_PHYSMEM_BITS 36 | 12 | #define MAX_PHYSMEM_BITS 36 |
13 | 13 | ||
14 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
15 | extern void create_section_mapping(unsigned long start, unsigned long end); | ||
16 | #endif /* CONFIG_MEMORY_HOTPLUG */ | ||
17 | |||
14 | #endif /* CONFIG_SPARSEMEM */ | 18 | #endif /* CONFIG_SPARSEMEM */ |
15 | 19 | ||
16 | #endif /* _ASM_POWERPC_SPARSEMEM_H */ | 20 | #endif /* _ASM_POWERPC_SPARSEMEM_H */ |