Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- A fix for a CMA change that broke booting guests with > 2G RAM on
Power8 hosts.

- Fix the RTAS call filter to allow a special case that applications
rely on.

- A change to our execve path, to make the execve syscall exit
tracepoint work.

- Three fixes to wire up our various RNGs earlier in boot so they're
available for use in the initial seeding in random_init().

- A build fix for when KASAN is enabled along with
STRUCTLEAK_BYREF_ALL.

Thanks to Andrew Donnellan, Aneesh Kumar K.V, Christophe Leroy, Jason
Donenfeld, Nathan Lynch, Naveen N. Rao, Sathvika Vasireddy, Sumit
Dubey2, Tyrel Datwyler, and Zi Yan.

* tag 'powerpc-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/powernv: wire up rng during setup_arch
powerpc/prom_init: Fix build failure with GCC_PLUGIN_STRUCTLEAK_BYREF_ALL and KASAN
powerpc/rtas: Allow ibm,platform-dump RTAS call with null buffer address
powerpc: Enable execve syscall exit tracepoint
powerpc/pseries: wire up rng during setup_arch()
powerpc/microwatt: wire up rng during setup_arch()
powerpc/mm: Move CMA reservations after initmem_init()

+83 -40
+1 -1
arch/powerpc/kernel/process.c
··· 1855 1855 tm_reclaim_current(0); 1856 1856 #endif 1857 1857 1858 - memset(regs->gpr, 0, sizeof(regs->gpr)); 1858 + memset(&regs->gpr[1], 0, sizeof(regs->gpr) - sizeof(regs->gpr[0])); 1859 1859 regs->ctr = 0; 1860 1860 regs->link = 0; 1861 1861 regs->xer = 0;
+1 -1
arch/powerpc/kernel/prom_init.c
··· 2302 2302 2303 2303 static int __init prom_find_machine_type(void) 2304 2304 { 2305 - char compat[256]; 2305 + static char compat[256] __prombss; 2306 2306 int len, i = 0; 2307 2307 #ifdef CONFIG_PPC64 2308 2308 phandle rtas;
+10 -1
arch/powerpc/kernel/rtas.c
··· 1071 1071 { "get-time-of-day", -1, -1, -1, -1, -1 }, 1072 1072 { "ibm,get-vpd", -1, 0, -1, 1, 2 }, 1073 1073 { "ibm,lpar-perftools", -1, 2, 3, -1, -1 }, 1074 - { "ibm,platform-dump", -1, 4, 5, -1, -1 }, 1074 + { "ibm,platform-dump", -1, 4, 5, -1, -1 }, /* Special cased */ 1075 1075 { "ibm,read-slot-reset-state", -1, -1, -1, -1, -1 }, 1076 1076 { "ibm,scan-log-dump", -1, 0, 1, -1, -1 }, 1077 1077 { "ibm,set-dynamic-indicator", -1, 2, -1, -1, -1 }, ··· 1120 1120 size = 1; 1121 1121 1122 1122 end = base + size - 1; 1123 + 1124 + /* 1125 + * Special case for ibm,platform-dump - NULL buffer 1126 + * address is used to indicate end of dump processing 1127 + */ 1128 + if (!strcmp(f->name, "ibm,platform-dump") && 1129 + base == 0) 1130 + return false; 1131 + 1123 1132 if (!in_rmo_buf(base, end)) 1124 1133 goto err; 1125 1134 }
+7 -6
arch/powerpc/kernel/setup-common.c
··· 935 935 /* Print various info about the machine that has been gathered so far. */ 936 936 print_system_info(); 937 937 938 - /* Reserve large chunks of memory for use by CMA for KVM. */ 939 - kvm_cma_reserve(); 940 - 941 - /* Reserve large chunks of memory for us by CMA for hugetlb */ 942 - gigantic_hugetlb_cma_reserve(); 943 - 944 938 klp_init_thread_info(&init_task); 945 939 946 940 setup_initial_init_mm(_stext, _etext, _edata, _end); ··· 948 954 smp_release_cpus(); 949 955 950 956 initmem_init(); 957 + 958 + /* 959 + * Reserve large chunks of memory for use by CMA for KVM and hugetlb. These must 960 + * be called after initmem_init(), so that pageblock_order is initialised. 961 + */ 962 + kvm_cma_reserve(); 963 + gigantic_hugetlb_cma_reserve(); 951 964 952 965 early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT); 953 966
+7
arch/powerpc/platforms/microwatt/microwatt.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _MICROWATT_H 3 + #define _MICROWATT_H 4 + 5 + void microwatt_rng_init(void); 6 + 7 + #endif /* _MICROWATT_H */
+3 -7
arch/powerpc/platforms/microwatt/rng.c
··· 11 11 #include <asm/archrandom.h> 12 12 #include <asm/cputable.h> 13 13 #include <asm/machdep.h> 14 + #include "microwatt.h" 14 15 15 16 #define DARN_ERR 0xFFFFFFFFFFFFFFFFul 16 17 ··· 30 29 return 1; 31 30 } 32 31 33 - static __init int rng_init(void) 32 + void __init microwatt_rng_init(void) 34 33 { 35 34 unsigned long val; 36 35 int i; ··· 38 37 for (i = 0; i < 10; i++) { 39 38 if (microwatt_get_random_darn(&val)) { 40 39 ppc_md.get_random_seed = microwatt_get_random_darn; 41 - return 0; 40 + return; 42 41 } 43 42 } 44 - 45 - pr_warn("Unable to use DARN for get_random_seed()\n"); 46 - 47 - return -EIO; 48 43 } 49 - machine_subsys_initcall(, rng_init);
+8
arch/powerpc/platforms/microwatt/setup.c
··· 16 16 #include <asm/xics.h> 17 17 #include <asm/udbg.h> 18 18 19 + #include "microwatt.h" 20 + 19 21 static void __init microwatt_init_IRQ(void) 20 22 { 21 23 xics_init(); ··· 34 32 } 35 33 machine_arch_initcall(microwatt, microwatt_populate); 36 34 35 + static void __init microwatt_setup_arch(void) 36 + { 37 + microwatt_rng_init(); 38 + } 39 + 37 40 define_machine(microwatt) { 38 41 .name = "microwatt", 39 42 .probe = microwatt_probe, 40 43 .init_IRQ = microwatt_init_IRQ, 44 + .setup_arch = microwatt_setup_arch, 41 45 .progress = udbg_progress, 42 46 .calibrate_decr = generic_calibrate_decr, 43 47 };
+2
arch/powerpc/platforms/powernv/powernv.h
··· 42 42 u32 __init memcons_get_size(struct memcons *mc); 43 43 struct memcons *__init memcons_init(struct device_node *node, const char *mc_prop_name); 44 44 45 + void pnv_rng_init(void); 46 + 45 47 #endif /* _POWERNV_H */
+36 -16
arch/powerpc/platforms/powernv/rng.c
··· 17 17 #include <asm/prom.h> 18 18 #include <asm/machdep.h> 19 19 #include <asm/smp.h> 20 + #include "powernv.h" 20 21 21 22 #define DARN_ERR 0xFFFFFFFFFFFFFFFFul 22 23 ··· 28 27 }; 29 28 30 29 static DEFINE_PER_CPU(struct powernv_rng *, powernv_rng); 31 - 32 30 33 31 int powernv_hwrng_present(void) 34 32 { ··· 98 98 return 0; 99 99 } 100 100 } 101 - 102 - pr_warn("Unable to use DARN for get_random_seed()\n"); 103 - 104 101 return -EIO; 105 102 } 106 103 ··· 160 163 161 164 rng_init_per_cpu(rng, dn); 162 165 163 - pr_info_once("Registering arch random hook.\n"); 164 - 165 166 ppc_md.get_random_seed = powernv_get_random_long; 166 167 167 168 return 0; 168 169 } 169 170 170 - static __init int rng_init(void) 171 + static int __init pnv_get_random_long_early(unsigned long *v) 171 172 { 172 173 struct device_node *dn; 173 - int rc; 174 + 175 + if (!slab_is_available()) 176 + return 0; 177 + 178 + if (cmpxchg(&ppc_md.get_random_seed, pnv_get_random_long_early, 179 + NULL) != pnv_get_random_long_early) 180 + return 0; 174 181 175 182 for_each_compatible_node(dn, NULL, "ibm,power-rng") { 176 - rc = rng_create(dn); 177 - if (rc) { 178 - pr_err("Failed creating rng for %pOF (%d).\n", 179 - dn, rc); 183 + if (rng_create(dn)) 180 184 continue; 181 - } 182 - 183 185 /* Create devices for hwrng driver */ 184 186 of_platform_device_create(dn, NULL, NULL); 185 187 } 186 188 187 - initialise_darn(); 189 + if (!ppc_md.get_random_seed) 190 + return 0; 191 + return ppc_md.get_random_seed(v); 192 + } 188 193 194 + void __init pnv_rng_init(void) 195 + { 196 + struct device_node *dn; 197 + 198 + /* Prefer darn over the rest. */ 199 + if (!initialise_darn()) 200 + return; 201 + 202 + dn = of_find_compatible_node(NULL, NULL, "ibm,power-rng"); 203 + if (dn) 204 + ppc_md.get_random_seed = pnv_get_random_long_early; 205 + 206 + of_node_put(dn); 207 + } 208 + 209 + static int __init pnv_rng_late_init(void) 210 + { 211 + unsigned long v; 212 + /* In case it wasn't called during init for some other reason. */ 213 + if (ppc_md.get_random_seed == pnv_get_random_long_early) 214 + pnv_get_random_long_early(&v); 189 215 return 0; 190 216 } 191 - machine_subsys_initcall(powernv, rng_init); 217 + machine_subsys_initcall(powernv, pnv_rng_late_init);
+2
arch/powerpc/platforms/powernv/setup.c
··· 203 203 pnv_check_guarded_cores(); 204 204 205 205 /* XXX PMCS */ 206 + 207 + pnv_rng_init(); 206 208 } 207 209 208 210 static void __init pnv_init(void)
+2
arch/powerpc/platforms/pseries/pseries.h
··· 122 122 static inline void pseries_lpar_read_hblkrm_characteristics(void) { } 123 123 #endif 124 124 125 + void pseries_rng_init(void); 126 + 125 127 #endif /* _PSERIES_PSERIES_H */
+3 -8
arch/powerpc/platforms/pseries/rng.c
··· 10 10 #include <asm/archrandom.h> 11 11 #include <asm/machdep.h> 12 12 #include <asm/plpar_wrappers.h> 13 + #include "pseries.h" 13 14 14 15 15 16 static int pseries_get_random_long(unsigned long *v) ··· 25 24 return 0; 26 25 } 27 26 28 - static __init int rng_init(void) 27 + void __init pseries_rng_init(void) 29 28 { 30 29 struct device_node *dn; 31 30 32 31 dn = of_find_compatible_node(NULL, NULL, "ibm,random"); 33 32 if (!dn) 34 - return -ENODEV; 35 - 36 - pr_info("Registering arch random hook.\n"); 37 - 33 + return; 38 34 ppc_md.get_random_seed = pseries_get_random_long; 39 - 40 35 of_node_put(dn); 41 - return 0; 42 36 } 43 - machine_subsys_initcall(pseries, rng_init);
+1
arch/powerpc/platforms/pseries/setup.c
··· 839 839 } 840 840 841 841 ppc_md.pcibios_root_bridge_prepare = pseries_root_bridge_prepare; 842 + pseries_rng_init(); 842 843 } 843 844 844 845 static void pseries_panic(char *str)