From: Michael Ellerman Date: Sat, 9 Jul 2022 09:29:34 +0000 (+1000) Subject: Merge branch 'fixes' into next X-Git-Tag: microblaze-v6.1~86^2~96 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=7e74dabc3daf0c217cb5e8e849a8f6c02927950f;hp=-c;p=linux-2.6-microblaze.git Merge branch 'fixes' into next Merge our fixes branch. In particular this brings in commit 986481618023 ("powerpc/book3e: Fix PUD allocation size in map_kernel_page()") which fixes a build failure in next, because commit 2db2008e6363 ("powerpc/64e: Rewrite p4d_populate() as a static inline function") depends on it. --- 7e74dabc3daf0c217cb5e8e849a8f6c02927950f diff --combined arch/powerpc/Kconfig index 02d040d1af85,7aa12e88c580..26331cdd3642 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@@ -11,7 -11,7 +11,7 @@@ config 64BI config LIVEPATCH_64 def_bool PPC64 - depends on LIVEPATCH + depends on LIVEPATCH config MMU bool @@@ -193,7 -193,6 +193,7 @@@ config PP select HAVE_ARCH_JUMP_LABEL_RELATIVE select HAVE_ARCH_KASAN if PPC32 && PPC_PAGE_SHIFT <= 14 select HAVE_ARCH_KASAN if PPC_RADIX_MMU + select HAVE_ARCH_KASAN if PPC_BOOK3E_64 select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN select HAVE_ARCH_KFENCE if PPC_BOOK3S_32 || PPC_8xx || 40x select HAVE_ARCH_KGDB @@@ -255,7 -254,6 +255,7 @@@ select IOMMU_HELPER if PPC64 select IRQ_DOMAIN select IRQ_FORCED_THREADING + select KASAN_VMALLOC if KASAN && MODULES select MMU_GATHER_PAGE_SIZE select MMU_GATHER_RCU_TABLE_FREE select MODULES_USE_ELF_RELA @@@ -360,6 -358,10 +360,10 @@@ config ARCH_SUSPEND_NONZERO_CP def_bool y depends on PPC_POWERNV || PPC_PSERIES + config ARCH_HAS_ADD_PAGES + def_bool y + depends on ARCH_ENABLE_MEMORY_HOTPLUG + config PPC_DCR_NATIVE bool @@@ -447,7 -449,7 +451,7 @@@ choic default MATH_EMULATION_FULL depends on MATH_EMULATION -config MATH_EMULATION_FULL +config MATH_EMULATION_FULL bool "Emulate all the floating point instructions" help Select this option will enable the kernel to support to emulate @@@ -1250,7 -1252,7 +1254,7 @@@ config PHYSICAL_STAR default "0x00000000" endif -config ARCH_RANDOM +config ARCH_RANDOM def_bool n config PPC_LIB_RHEAP diff --combined arch/powerpc/kernel/prom_init.c index 1939683e35ed,13d6cb188835..a6669c40c1db --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c @@@ -42,7 -42,7 +42,7 @@@ #include #include #include -#include +#include #include #include @@@ -2302,7 -2302,7 +2302,7 @@@ static void __init prom_init_stdout(voi static int __init prom_find_machine_type(void) { - char compat[256]; + static char compat[256] __prombss; int len, i = 0; #ifdef CONFIG_PPC64 phandle rtas; diff --combined arch/powerpc/mm/mem.c index 2cf6748755e1,a97128a48817..7b0d286bf9ba --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@@ -25,7 -25,6 +25,7 @@@ #include #include #include +#include #include @@@ -106,6 -105,37 +106,37 @@@ void __ref arch_remove_linear_mapping(u vm_unmap_aliases(); } + /* + * After memory hotplug the variables max_pfn, max_low_pfn and high_memory need + * updating. + */ + static void update_end_of_memory_vars(u64 start, u64 size) + { + unsigned long end_pfn = PFN_UP(start + size); + + if (end_pfn > max_pfn) { + max_pfn = end_pfn; + max_low_pfn = end_pfn; + high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1; + } + } + + int __ref add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages, + struct mhp_params *params) + { + int ret; + + ret = __add_pages(nid, start_pfn, nr_pages, params); + if (ret) + return ret; + + /* update max_pfn, max_low_pfn and high_memory */ + update_end_of_memory_vars(start_pfn << PAGE_SHIFT, + nr_pages << PAGE_SHIFT); + + return ret; + } + int __ref arch_add_memory(int nid, u64 start, u64 size, struct mhp_params *params) { @@@ -116,7 -146,7 +147,7 @@@ rc = arch_create_linear_mapping(nid, start, size, params); if (rc) return rc; - rc = __add_pages(nid, start_pfn, nr_pages, params); + rc = add_pages(nid, start_pfn, nr_pages, params); if (rc) arch_remove_linear_mapping(start, size); return rc; diff --combined arch/powerpc/platforms/pseries/setup.c index 4f08161f09b9,ee4f1db49515..a74c425be624 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@@ -72,7 -72,6 +72,7 @@@ #include #include #include +#include #include "pseries.h" @@@ -803,8 -802,9 +803,8 @@@ static void __init pSeries_setup_arch(v fwnmi_init(); pseries_setup_security_mitigations(); -#ifdef CONFIG_PPC_64S_HASH_MMU - pseries_lpar_read_hblkrm_characteristics(); -#endif + if (!radix_enabled()) + pseries_lpar_read_hblkrm_characteristics(); /* By default, only probe PCI (can be overridden by rtas_pci) */ pci_add_flags(PCI_PROBE_ONLY); @@@ -839,6 -839,7 +839,7 @@@ } ppc_md.pcibios_root_bridge_prepare = pseries_root_bridge_prepare; + pseries_rng_init(); } static void pseries_panic(char *str)