diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2016-05-31 02:26:29 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-05-31 23:47:34 -0400 |
commit | d6c886006c948141f24e84acebfb757d3200f20c (patch) | |
tree | 12ace3bdd5713186183d5d4dbf4b630abe603199 | |
parent | 8dd75ccb571f3c92c48014b3dabd3d51a115ab41 (diff) |
powerpc/mm/radix: Update LPCR only if it is powernv
LPCR cannot be updated when running in guest mode.
Fixes: 2bfd65e45e87 ("powerpc/mm/radix: Add radix callbacks for early init routines")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/mm/pgtable-radix.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c index 18b2c11604fa..c939e6e57a9e 100644 --- a/arch/powerpc/mm/pgtable-radix.c +++ b/arch/powerpc/mm/pgtable-radix.c | |||
@@ -296,11 +296,6 @@ found: | |||
296 | void __init radix__early_init_mmu(void) | 296 | void __init radix__early_init_mmu(void) |
297 | { | 297 | { |
298 | unsigned long lpcr; | 298 | unsigned long lpcr; |
299 | /* | ||
300 | * setup LPCR UPRT based on mmu_features | ||
301 | */ | ||
302 | lpcr = mfspr(SPRN_LPCR); | ||
303 | mtspr(SPRN_LPCR, lpcr | LPCR_UPRT); | ||
304 | 299 | ||
305 | #ifdef CONFIG_PPC_64K_PAGES | 300 | #ifdef CONFIG_PPC_64K_PAGES |
306 | /* PAGE_SIZE mappings */ | 301 | /* PAGE_SIZE mappings */ |
@@ -343,8 +338,11 @@ void __init radix__early_init_mmu(void) | |||
343 | __pte_frag_size_shift = H_PTE_FRAG_SIZE_SHIFT; | 338 | __pte_frag_size_shift = H_PTE_FRAG_SIZE_SHIFT; |
344 | 339 | ||
345 | radix_init_page_sizes(); | 340 | radix_init_page_sizes(); |
346 | if (!firmware_has_feature(FW_FEATURE_LPAR)) | 341 | if (!firmware_has_feature(FW_FEATURE_LPAR)) { |
342 | lpcr = mfspr(SPRN_LPCR); | ||
343 | mtspr(SPRN_LPCR, lpcr | LPCR_UPRT); | ||
347 | radix_init_partition_table(); | 344 | radix_init_partition_table(); |
345 | } | ||
348 | 346 | ||
349 | radix_init_pgtable(); | 347 | radix_init_pgtable(); |
350 | } | 348 | } |
@@ -353,16 +351,15 @@ void radix__early_init_mmu_secondary(void) | |||
353 | { | 351 | { |
354 | unsigned long lpcr; | 352 | unsigned long lpcr; |
355 | /* | 353 | /* |
356 | * setup LPCR UPRT based on mmu_features | 354 | * update partition table control register and UPRT |
357 | */ | 355 | */ |
358 | lpcr = mfspr(SPRN_LPCR); | 356 | if (!firmware_has_feature(FW_FEATURE_LPAR)) { |
359 | mtspr(SPRN_LPCR, lpcr | LPCR_UPRT); | 357 | lpcr = mfspr(SPRN_LPCR); |
360 | /* | 358 | mtspr(SPRN_LPCR, lpcr | LPCR_UPRT); |
361 | * update partition table control register, 64 K size. | 359 | |
362 | */ | ||
363 | if (!firmware_has_feature(FW_FEATURE_LPAR)) | ||
364 | mtspr(SPRN_PTCR, | 360 | mtspr(SPRN_PTCR, |
365 | __pa(partition_tb) | (PATB_SIZE_SHIFT - 12)); | 361 | __pa(partition_tb) | (PATB_SIZE_SHIFT - 12)); |
362 | } | ||
366 | } | 363 | } |
367 | 364 | ||
368 | void radix__setup_initial_memory_limit(phys_addr_t first_memblock_base, | 365 | void radix__setup_initial_memory_limit(phys_addr_t first_memblock_base, |