diff options
-rw-r--r-- | arch/powerpc/include/asm/machdep.h | 2 | ||||
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 15 | ||||
-rw-r--r-- | arch/powerpc/mm/init_64.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/lpar.c | 9 |
4 files changed, 24 insertions, 11 deletions
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 5c38e49ddd42..fd22442d30a9 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
@@ -54,7 +54,7 @@ struct machdep_calls { | |||
54 | int psize, int apsize, | 54 | int psize, int apsize, |
55 | int ssize); | 55 | int ssize); |
56 | long (*hpte_remove)(unsigned long hpte_group); | 56 | long (*hpte_remove)(unsigned long hpte_group); |
57 | void (*hpte_removebolted)(unsigned long ea, | 57 | int (*hpte_removebolted)(unsigned long ea, |
58 | int psize, int ssize); | 58 | int psize, int ssize); |
59 | void (*flush_hash_range)(unsigned long number, int local); | 59 | void (*flush_hash_range)(unsigned long number, int local); |
60 | void (*hugepage_invalidate)(unsigned long vsid, | 60 | void (*hugepage_invalidate)(unsigned long vsid, |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 70490c41e14e..44f145a66578 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -269,6 +269,8 @@ int htab_remove_mapping(unsigned long vstart, unsigned long vend, | |||
269 | { | 269 | { |
270 | unsigned long vaddr; | 270 | unsigned long vaddr; |
271 | unsigned int step, shift; | 271 | unsigned int step, shift; |
272 | int rc; | ||
273 | int ret = 0; | ||
272 | 274 | ||
273 | shift = mmu_psize_defs[psize].shift; | 275 | shift = mmu_psize_defs[psize].shift; |
274 | step = 1 << shift; | 276 | step = 1 << shift; |
@@ -276,10 +278,17 @@ int htab_remove_mapping(unsigned long vstart, unsigned long vend, | |||
276 | if (!ppc_md.hpte_removebolted) | 278 | if (!ppc_md.hpte_removebolted) |
277 | return -ENODEV; | 279 | return -ENODEV; |
278 | 280 | ||
279 | for (vaddr = vstart; vaddr < vend; vaddr += step) | 281 | for (vaddr = vstart; vaddr < vend; vaddr += step) { |
280 | ppc_md.hpte_removebolted(vaddr, psize, ssize); | 282 | rc = ppc_md.hpte_removebolted(vaddr, psize, ssize); |
283 | if (rc == -ENOENT) { | ||
284 | ret = -ENOENT; | ||
285 | continue; | ||
286 | } | ||
287 | if (rc < 0) | ||
288 | return rc; | ||
289 | } | ||
281 | 290 | ||
282 | return 0; | 291 | return ret; |
283 | } | 292 | } |
284 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 293 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
285 | 294 | ||
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index 379a6a90644b..baa1a23488d3 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
@@ -232,10 +232,11 @@ static void __meminit vmemmap_create_mapping(unsigned long start, | |||
232 | static void vmemmap_remove_mapping(unsigned long start, | 232 | static void vmemmap_remove_mapping(unsigned long start, |
233 | unsigned long page_size) | 233 | unsigned long page_size) |
234 | { | 234 | { |
235 | int mapped = htab_remove_mapping(start, start + page_size, | 235 | int rc = htab_remove_mapping(start, start + page_size, |
236 | mmu_vmemmap_psize, | 236 | mmu_vmemmap_psize, |
237 | mmu_kernel_ssize); | 237 | mmu_kernel_ssize); |
238 | BUG_ON(mapped < 0); | 238 | BUG_ON((rc < 0) && (rc != -ENOENT)); |
239 | WARN_ON(rc == -ENOENT); | ||
239 | } | 240 | } |
240 | #endif | 241 | #endif |
241 | 242 | ||
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 477290ad855e..2415a0d31f8f 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
@@ -505,8 +505,8 @@ static void pSeries_lpar_hugepage_invalidate(unsigned long vsid, | |||
505 | } | 505 | } |
506 | #endif | 506 | #endif |
507 | 507 | ||
508 | static void pSeries_lpar_hpte_removebolted(unsigned long ea, | 508 | static int pSeries_lpar_hpte_removebolted(unsigned long ea, |
509 | int psize, int ssize) | 509 | int psize, int ssize) |
510 | { | 510 | { |
511 | unsigned long vpn; | 511 | unsigned long vpn; |
512 | unsigned long slot, vsid; | 512 | unsigned long slot, vsid; |
@@ -515,11 +515,14 @@ static void pSeries_lpar_hpte_removebolted(unsigned long ea, | |||
515 | vpn = hpt_vpn(ea, vsid, ssize); | 515 | vpn = hpt_vpn(ea, vsid, ssize); |
516 | 516 | ||
517 | slot = pSeries_lpar_hpte_find(vpn, psize, ssize); | 517 | slot = pSeries_lpar_hpte_find(vpn, psize, ssize); |
518 | BUG_ON(slot == -1); | 518 | if (slot == -1) |
519 | return -ENOENT; | ||
520 | |||
519 | /* | 521 | /* |
520 | * lpar doesn't use the passed actual page size | 522 | * lpar doesn't use the passed actual page size |
521 | */ | 523 | */ |
522 | pSeries_lpar_hpte_invalidate(slot, vpn, psize, 0, ssize, 0); | 524 | pSeries_lpar_hpte_invalidate(slot, vpn, psize, 0, ssize, 0); |
525 | return 0; | ||
523 | } | 526 | } |
524 | 527 | ||
525 | /* | 528 | /* |