diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2006-03-21 04:45:51 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-21 23:04:09 -0500 |
commit | caf80e579b5fc0048681a47c5a55487116e56a88 (patch) | |
tree | a5da9d218c0f98a7881cfc601f67cd619579d441 /arch | |
parent | 2b2612272c77288b2bd53d5831df737cd669cd93 (diff) |
[PATCH] powerpc: Unconfuse htab_bolt_mapping() callers
htab_bolt_mapping() takes a vstart and pstart parameter, but all but one of
its callers actually pass it vstart and vstart. Luckily before it passes
paddr (calculated from paddr) to the hpte_insert routines it calls
virt_to_abs() (aka. __pa()) on the address, so there isn't actually a bug.
map_io_page() however does pass pstart properly, so currently it's broken
AFAICT because we're calling __pa(paddr) which will get us something very
large. Presumably no one's calling map_io_page() in the right context.
Anyway, change htab_bolt_mapping() callers to properly pass pstart, and then
use it properly in htab_bolt_mapping(), ie. don't call __pa() on it again.
Booted on p5 LPAR, iSeries and Power3.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 7d9ce9a48219..7b4eccffd002 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -169,7 +169,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
169 | #ifdef CONFIG_PPC_ISERIES | 169 | #ifdef CONFIG_PPC_ISERIES |
170 | if (_machine == PLATFORM_ISERIES_LPAR) | 170 | if (_machine == PLATFORM_ISERIES_LPAR) |
171 | ret = iSeries_hpte_insert(hpteg, va, | 171 | ret = iSeries_hpte_insert(hpteg, va, |
172 | __pa(vaddr), | 172 | paddr, |
173 | tmp_mode, | 173 | tmp_mode, |
174 | HPTE_V_BOLTED, | 174 | HPTE_V_BOLTED, |
175 | psize); | 175 | psize); |
@@ -178,7 +178,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
178 | #ifdef CONFIG_PPC_PSERIES | 178 | #ifdef CONFIG_PPC_PSERIES |
179 | if (_machine & PLATFORM_LPAR) | 179 | if (_machine & PLATFORM_LPAR) |
180 | ret = pSeries_lpar_hpte_insert(hpteg, va, | 180 | ret = pSeries_lpar_hpte_insert(hpteg, va, |
181 | virt_to_abs(paddr), | 181 | paddr, |
182 | tmp_mode, | 182 | tmp_mode, |
183 | HPTE_V_BOLTED, | 183 | HPTE_V_BOLTED, |
184 | psize); | 184 | psize); |
@@ -186,7 +186,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
186 | #endif | 186 | #endif |
187 | #ifdef CONFIG_PPC_MULTIPLATFORM | 187 | #ifdef CONFIG_PPC_MULTIPLATFORM |
188 | ret = native_hpte_insert(hpteg, va, | 188 | ret = native_hpte_insert(hpteg, va, |
189 | virt_to_abs(paddr), | 189 | paddr, |
190 | tmp_mode, HPTE_V_BOLTED, | 190 | tmp_mode, HPTE_V_BOLTED, |
191 | psize); | 191 | psize); |
192 | #endif | 192 | #endif |
@@ -392,7 +392,7 @@ static unsigned long __init htab_get_table_size(void) | |||
392 | #ifdef CONFIG_MEMORY_HOTPLUG | 392 | #ifdef CONFIG_MEMORY_HOTPLUG |
393 | void create_section_mapping(unsigned long start, unsigned long end) | 393 | void create_section_mapping(unsigned long start, unsigned long end) |
394 | { | 394 | { |
395 | BUG_ON(htab_bolt_mapping(start, end, start, | 395 | BUG_ON(htab_bolt_mapping(start, end, __pa(start), |
396 | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX, | 396 | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX, |
397 | mmu_linear_psize)); | 397 | mmu_linear_psize)); |
398 | } | 398 | } |
@@ -473,21 +473,22 @@ void __init htab_initialize(void) | |||
473 | 473 | ||
474 | if (dart_tablebase != 0 && dart_tablebase >= base | 474 | if (dart_tablebase != 0 && dart_tablebase >= base |
475 | && dart_tablebase < (base + size)) { | 475 | && dart_tablebase < (base + size)) { |
476 | unsigned long dart_table_end = dart_tablebase + 16 * MB; | ||
476 | if (base != dart_tablebase) | 477 | if (base != dart_tablebase) |
477 | BUG_ON(htab_bolt_mapping(base, dart_tablebase, | 478 | BUG_ON(htab_bolt_mapping(base, dart_tablebase, |
478 | base, mode_rw, | 479 | __pa(base), mode_rw, |
479 | mmu_linear_psize)); | 480 | mmu_linear_psize)); |
480 | if ((base + size) > (dart_tablebase + 16*MB)) | 481 | if ((base + size) > dart_table_end) |
481 | BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, | 482 | BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, |
482 | base + size, | 483 | base + size, |
483 | dart_tablebase+16*MB, | 484 | __pa(dart_table_end), |
484 | mode_rw, | 485 | mode_rw, |
485 | mmu_linear_psize)); | 486 | mmu_linear_psize)); |
486 | continue; | 487 | continue; |
487 | } | 488 | } |
488 | #endif /* CONFIG_U3_DART */ | 489 | #endif /* CONFIG_U3_DART */ |
489 | BUG_ON(htab_bolt_mapping(base, base + size, base, | 490 | BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), |
490 | mode_rw, mmu_linear_psize)); | 491 | mode_rw, mmu_linear_psize)); |
491 | } | 492 | } |
492 | 493 | ||
493 | /* | 494 | /* |
@@ -504,8 +505,8 @@ void __init htab_initialize(void) | |||
504 | if (base + size >= tce_alloc_start) | 505 | if (base + size >= tce_alloc_start) |
505 | tce_alloc_start = base + size + 1; | 506 | tce_alloc_start = base + size + 1; |
506 | 507 | ||
507 | BUG_ON(htab_bolt_mapping(tce_alloc_start, tce_alloc_end, | 508 | BUG_ON(htab_bolt_mapping(tce_alloc_start, tce_alloc_end, |
508 | tce_alloc_start, mode_rw, | 509 | __pa(tce_alloc_start), mode_rw, |
509 | mmu_linear_psize)); | 510 | mmu_linear_psize)); |
510 | } | 511 | } |
511 | 512 | ||