powerpc/prom_init: Move ibm_arch_vec to __prombss
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 15 Oct 2018 02:49:55 +0000 (13:49 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 18 Oct 2018 13:56:17 +0000 (00:56 +1100)
Make the existing initialized definition constant and copy
it to a __prombss copy

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/prom_init.c

index 7a5eb019256203aed0c6cc012be51e5e4ce7c6f2..dec8f7f689a2e068cefbeb71fa5d0c377fa0b7bb 100644 (file)
@@ -788,7 +788,7 @@ struct ibm_arch_vec {
        struct option_vector6 vec6;
 } __packed;
 
-struct ibm_arch_vec __cacheline_aligned ibm_architecture_vec = {
+static const struct ibm_arch_vec ibm_architecture_vec_template = {
        .pvrs = {
                {
                        .mask = cpu_to_be32(0xfffe0000), /* POWER5/POWER5+ */
@@ -926,6 +926,8 @@ struct ibm_arch_vec __cacheline_aligned ibm_architecture_vec = {
        },
 };
 
+static struct ibm_arch_vec __prombss ibm_architecture_vec  ____cacheline_aligned;
+
 /* Old method - ELF header with PT_NOTE sections only works on BE */
 #ifdef __BIG_ENDIAN__
 static const struct fake_elf {
@@ -1135,6 +1137,10 @@ static void __init prom_check_platform_support(void)
        };
        int prop_len = prom_getproplen(prom.chosen,
                                       "ibm,arch-vec-5-platform-support");
+
+       /* First copy the architecture vec template */
+       ibm_architecture_vec = ibm_architecture_vec_template;
+
        if (prop_len > 1) {
                int i;
                u8 vec[8];