]> err.no Git - linux-2.6/commitdiff
[PATCH] revised Memory Add Fixes for ppc64
authorMike Kravetz <kravetz@us.ibm.com>
Tue, 8 Nov 2005 00:25:48 +0000 (16:25 -0800)
committerPaul Mackerras <paulus@samba.org>
Tue, 8 Nov 2005 04:17:13 +0000 (15:17 +1100)
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>
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/mem.c
include/asm-powerpc/sparsemem.h

index 22e474876133b334724d053a3e2434c06481acca..c8c9c2df97e948533995ad2880e6177a2909b653 100644 (file)
@@ -386,6 +386,15 @@ static unsigned long __init htab_get_table_size(void)
        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)
 {
        unsigned long table, htab_size_bytes;
index 6f55efd9be957debe2c1522bda11ca50cb174a17..2ead0951823acccdf52a1eb55246db60a4651ebf 100644 (file)
@@ -127,6 +127,9 @@ int __devinit add_memory(u64 start, u64 size)
        unsigned long start_pfn = start >> 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 */
        zone = pgdata->node_zones;
 
index 1c95ab99deb361615522e453268d4ddedc49a489..58d2aab416f8f21f7574acedeefaeffcf43878b8 100644 (file)
 #define MAX_PHYSADDR_BITS       38
 #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 /* _ASM_POWERPC_SPARSEMEM_H */