aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom_init.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@ozlabs.org>2017-01-30 05:21:36 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2017-01-31 03:11:44 -0500
commitcc3d2940133d24000e2866b21e03ce32adfead0a (patch)
tree964b1a961e180ecd57ed96f3d3234d1472532090 /arch/powerpc/kernel/prom_init.c
parent3f4ab2f83b4e443c66549206eb88a9fa5a85d647 (diff)
powerpc/64: Enable use of radix MMU under hypervisor on POWER9
To use radix as a guest, we first need to tell the hypervisor via the ibm,client-architecture call first that we support POWER9 and architecture v3.00, and that we can do either radix or hash and that we would like to choose later using an hcall (the H_REGISTER_PROC_TBL hcall). Then we need to check whether the hypervisor agreed to us using radix. We need to do this very early on in the kernel boot process before any of the MMU initialization is done. If the hypervisor doesn't agree, we can't use radix and therefore clear the radix MMU feature bit. Later, when we have set up our process table, which points to the radix tree for each process, we need to install that using the H_REGISTER_PROC_TBL hcall. Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/prom_init.c')
-rw-r--r--arch/powerpc/kernel/prom_init.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index ec47a939cbdd..358d43f8f84f 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -649,6 +649,7 @@ static void __init early_cmdline_parse(void)
649struct option_vector1 { 649struct option_vector1 {
650 u8 byte1; 650 u8 byte1;
651 u8 arch_versions; 651 u8 arch_versions;
652 u8 arch_versions3;
652} __packed; 653} __packed;
653 654
654struct option_vector2 { 655struct option_vector2 {
@@ -691,6 +692,9 @@ struct option_vector5 {
691 u8 reserved2; 692 u8 reserved2;
692 __be16 reserved3; 693 __be16 reserved3;
693 u8 subprocessors; 694 u8 subprocessors;
695 u8 byte22;
696 u8 intarch;
697 u8 mmu;
694} __packed; 698} __packed;
695 699
696struct option_vector6 { 700struct option_vector6 {
@@ -700,7 +704,7 @@ struct option_vector6 {
700} __packed; 704} __packed;
701 705
702struct ibm_arch_vec { 706struct ibm_arch_vec {
703 struct { u32 mask, val; } pvrs[10]; 707 struct { u32 mask, val; } pvrs[12];
704 708
705 u8 num_vectors; 709 u8 num_vectors;
706 710
@@ -750,6 +754,14 @@ struct ibm_arch_vec __cacheline_aligned ibm_architecture_vec = {
750 .val = cpu_to_be32(0x004d0000), 754 .val = cpu_to_be32(0x004d0000),
751 }, 755 },
752 { 756 {
757 .mask = cpu_to_be32(0xffff0000), /* POWER9 */
758 .val = cpu_to_be32(0x004e0000),
759 },
760 {
761 .mask = cpu_to_be32(0xffffffff), /* all 3.00-compliant */
762 .val = cpu_to_be32(0x0f000005),
763 },
764 {
753 .mask = cpu_to_be32(0xffffffff), /* all 2.07-compliant */ 765 .mask = cpu_to_be32(0xffffffff), /* all 2.07-compliant */
754 .val = cpu_to_be32(0x0f000004), 766 .val = cpu_to_be32(0x0f000004),
755 }, 767 },
@@ -774,6 +786,7 @@ struct ibm_arch_vec __cacheline_aligned ibm_architecture_vec = {
774 .byte1 = 0, 786 .byte1 = 0,
775 .arch_versions = OV1_PPC_2_00 | OV1_PPC_2_01 | OV1_PPC_2_02 | OV1_PPC_2_03 | 787 .arch_versions = OV1_PPC_2_00 | OV1_PPC_2_01 | OV1_PPC_2_02 | OV1_PPC_2_03 |
776 OV1_PPC_2_04 | OV1_PPC_2_05 | OV1_PPC_2_06 | OV1_PPC_2_07, 788 OV1_PPC_2_04 | OV1_PPC_2_05 | OV1_PPC_2_06 | OV1_PPC_2_07,
789 .arch_versions3 = OV1_PPC_3_00,
777 }, 790 },
778 791
779 .vec2_len = VECTOR_LENGTH(sizeof(struct option_vector2)), 792 .vec2_len = VECTOR_LENGTH(sizeof(struct option_vector2)),
@@ -836,6 +849,9 @@ struct ibm_arch_vec __cacheline_aligned ibm_architecture_vec = {
836 .reserved2 = 0, 849 .reserved2 = 0,
837 .reserved3 = 0, 850 .reserved3 = 0,
838 .subprocessors = 1, 851 .subprocessors = 1,
852 .intarch = 0,
853 .mmu = OV5_FEAT(OV5_MMU_RADIX_300) | OV5_FEAT(OV5_MMU_HASH_300) |
854 OV5_FEAT(OV5_MMU_PROC_TBL) | OV5_FEAT(OV5_MMU_GTSE),
839 }, 855 },
840 856
841 /* option vector 6: IBM PAPR hints */ 857 /* option vector 6: IBM PAPR hints */