diff options
author | Reza Arbab <arbab@linux.vnet.ibm.com> | 2017-01-03 15:39:51 -0500 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-01-16 18:05:43 -0500 |
commit | 32b53c012e0bfe20b2745962a89db0dc72ef3270 (patch) | |
tree | 4f6d713c1b48f508bdfe0bd802204aba11a40ec5 | |
parent | 49def1853334396f948dcb4cedb9347abb318df5 (diff) |
powerpc/mm: Fix memory hotplug BUG() on radix
Memory hotplug is leading to hash page table calls, even on radix:
arch_add_memory
create_section_mapping
htab_bolt_mapping
BUG_ON(!ppc_md.hpte_insert);
To fix, refactor {create,remove}_section_mapping() into hash__ and
radix__ variants. Leave the radix versions stubbed for now.
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/include/asm/book3s/64/hash.h | 4 | ||||
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 4 | ||||
-rw-r--r-- | arch/powerpc/mm/pgtable-book3s64.c | 18 |
3 files changed, 24 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/book3s/64/hash.h b/arch/powerpc/include/asm/book3s/64/hash.h index f61cad3de4e6..4c935f7504f7 100644 --- a/arch/powerpc/include/asm/book3s/64/hash.h +++ b/arch/powerpc/include/asm/book3s/64/hash.h | |||
@@ -201,6 +201,10 @@ extern int __meminit hash__vmemmap_create_mapping(unsigned long start, | |||
201 | unsigned long phys); | 201 | unsigned long phys); |
202 | extern void hash__vmemmap_remove_mapping(unsigned long start, | 202 | extern void hash__vmemmap_remove_mapping(unsigned long start, |
203 | unsigned long page_size); | 203 | unsigned long page_size); |
204 | |||
205 | int hash__create_section_mapping(unsigned long start, unsigned long end); | ||
206 | int hash__remove_section_mapping(unsigned long start, unsigned long end); | ||
207 | |||
204 | #endif /* !__ASSEMBLY__ */ | 208 | #endif /* !__ASSEMBLY__ */ |
205 | #endif /* __KERNEL__ */ | 209 | #endif /* __KERNEL__ */ |
206 | #endif /* _ASM_POWERPC_BOOK3S_64_HASH_H */ | 210 | #endif /* _ASM_POWERPC_BOOK3S_64_HASH_H */ |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 80334937e14f..67e19a0821be 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -747,7 +747,7 @@ static unsigned long __init htab_get_table_size(void) | |||
747 | } | 747 | } |
748 | 748 | ||
749 | #ifdef CONFIG_MEMORY_HOTPLUG | 749 | #ifdef CONFIG_MEMORY_HOTPLUG |
750 | int create_section_mapping(unsigned long start, unsigned long end) | 750 | int hash__create_section_mapping(unsigned long start, unsigned long end) |
751 | { | 751 | { |
752 | int rc = htab_bolt_mapping(start, end, __pa(start), | 752 | int rc = htab_bolt_mapping(start, end, __pa(start), |
753 | pgprot_val(PAGE_KERNEL), mmu_linear_psize, | 753 | pgprot_val(PAGE_KERNEL), mmu_linear_psize, |
@@ -761,7 +761,7 @@ int create_section_mapping(unsigned long start, unsigned long end) | |||
761 | return rc; | 761 | return rc; |
762 | } | 762 | } |
763 | 763 | ||
764 | int remove_section_mapping(unsigned long start, unsigned long end) | 764 | int hash__remove_section_mapping(unsigned long start, unsigned long end) |
765 | { | 765 | { |
766 | int rc = htab_remove_mapping(start, end, mmu_linear_psize, | 766 | int rc = htab_remove_mapping(start, end, mmu_linear_psize, |
767 | mmu_kernel_ssize); | 767 | mmu_kernel_ssize); |
diff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c index ebf9782bacf9..653ff6c74ebe 100644 --- a/arch/powerpc/mm/pgtable-book3s64.c +++ b/arch/powerpc/mm/pgtable-book3s64.c | |||
@@ -126,3 +126,21 @@ void mmu_cleanup_all(void) | |||
126 | else if (mmu_hash_ops.hpte_clear_all) | 126 | else if (mmu_hash_ops.hpte_clear_all) |
127 | mmu_hash_ops.hpte_clear_all(); | 127 | mmu_hash_ops.hpte_clear_all(); |
128 | } | 128 | } |
129 | |||
130 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
131 | int create_section_mapping(unsigned long start, unsigned long end) | ||
132 | { | ||
133 | if (radix_enabled()) | ||
134 | return -ENODEV; | ||
135 | |||
136 | return hash__create_section_mapping(start, end); | ||
137 | } | ||
138 | |||
139 | int remove_section_mapping(unsigned long start, unsigned long end) | ||
140 | { | ||
141 | if (radix_enabled()) | ||
142 | return -ENODEV; | ||
143 | |||
144 | return hash__remove_section_mapping(start, end); | ||
145 | } | ||
146 | #endif /* CONFIG_MEMORY_HOTPLUG */ | ||