diff options
Diffstat (limited to 'arch/powerpc/mm/init_64.c')
-rw-r--r-- | arch/powerpc/mm/init_64.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index 6aa3b76aa0d6..9be992083d2a 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
@@ -356,18 +356,42 @@ static void early_check_vec5(void) | |||
356 | unsigned long root, chosen; | 356 | unsigned long root, chosen; |
357 | int size; | 357 | int size; |
358 | const u8 *vec5; | 358 | const u8 *vec5; |
359 | u8 mmu_supported; | ||
359 | 360 | ||
360 | root = of_get_flat_dt_root(); | 361 | root = of_get_flat_dt_root(); |
361 | chosen = of_get_flat_dt_subnode_by_name(root, "chosen"); | 362 | chosen = of_get_flat_dt_subnode_by_name(root, "chosen"); |
362 | if (chosen == -FDT_ERR_NOTFOUND) | 363 | if (chosen == -FDT_ERR_NOTFOUND) { |
364 | cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX; | ||
363 | return; | 365 | return; |
366 | } | ||
364 | vec5 = of_get_flat_dt_prop(chosen, "ibm,architecture-vec-5", &size); | 367 | vec5 = of_get_flat_dt_prop(chosen, "ibm,architecture-vec-5", &size); |
365 | if (!vec5) | 368 | if (!vec5) { |
369 | cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX; | ||
366 | return; | 370 | return; |
367 | if (size <= OV5_INDX(OV5_MMU_RADIX_300) || | 371 | } |
368 | !(vec5[OV5_INDX(OV5_MMU_RADIX_300)] & OV5_FEAT(OV5_MMU_RADIX_300))) | 372 | if (size <= OV5_INDX(OV5_MMU_SUPPORT)) { |
369 | /* Hypervisor doesn't support radix */ | ||
370 | cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX; | 373 | cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX; |
374 | return; | ||
375 | } | ||
376 | |||
377 | /* Check for supported configuration */ | ||
378 | mmu_supported = vec5[OV5_INDX(OV5_MMU_SUPPORT)] & | ||
379 | OV5_FEAT(OV5_MMU_SUPPORT); | ||
380 | if (mmu_supported == OV5_FEAT(OV5_MMU_RADIX)) { | ||
381 | /* Hypervisor only supports radix - check enabled && GTSE */ | ||
382 | if (!early_radix_enabled()) { | ||
383 | pr_warn("WARNING: Ignoring cmdline option disable_radix\n"); | ||
384 | } | ||
385 | if (!(vec5[OV5_INDX(OV5_RADIX_GTSE)] & | ||
386 | OV5_FEAT(OV5_RADIX_GTSE))) { | ||
387 | pr_warn("WARNING: Hypervisor doesn't support RADIX with GTSE\n"); | ||
388 | } | ||
389 | /* Do radix anyway - the hypervisor said we had to */ | ||
390 | cur_cpu_spec->mmu_features |= MMU_FTR_TYPE_RADIX; | ||
391 | } else if (mmu_supported == OV5_FEAT(OV5_MMU_HASH)) { | ||
392 | /* Hypervisor only supports hash - disable radix */ | ||
393 | cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX; | ||
394 | } | ||
371 | } | 395 | } |
372 | 396 | ||
373 | void __init mmu_early_init_devtree(void) | 397 | void __init mmu_early_init_devtree(void) |
@@ -383,7 +407,7 @@ void __init mmu_early_init_devtree(void) | |||
383 | * even though the ibm,architecture-vec-5 property created by | 407 | * even though the ibm,architecture-vec-5 property created by |
384 | * skiboot doesn't have the necessary bits set. | 408 | * skiboot doesn't have the necessary bits set. |
385 | */ | 409 | */ |
386 | if (early_radix_enabled() && !(mfmsr() & MSR_HV)) | 410 | if (!(mfmsr() & MSR_HV)) |
387 | early_check_vec5(); | 411 | early_check_vec5(); |
388 | 412 | ||
389 | if (early_radix_enabled()) | 413 | if (early_radix_enabled()) |