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

Merge tag 'powerpc-6.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc updates from Michael Ellerman:

- Restore clearing of MSR[RI] at interrupt/syscall exit on 32-bit

- Fix unpaired stwcx on interrupt exit on 32-bit

- Fix race condition leading to double list-add in
mac_hid_toggle_emumouse()

- Fix mprotect on book3s 32-bit

- Fix SLB multihit issue during SLB preload with 64-bit hash MMU

- Add support for crashkernel CMA reservation

- Add die_id and die_cpumask for Power10 & later to expose chip
hemispheres

- A series of minor fixes and improvements to the hash SLB code

Thanks to Antonio Alvarez Feijoo, Ben Collins, Bhaskar Chowdhury,
Christophe Leroy, Daniel Thompson, Dave Vasilevsky, Donet Tom,
J. Neuschäfer, Kunwu Chan, Long Li, Naresh Kamboju, Nathan Chancellor,
Ritesh Harjani (IBM), Shirisha G, Shrikanth Hegde, Sourabh Jain, Srikar
Dronamraju, Stephen Rothwell, Thomas Zimmermann, Venkat Rao Bagalkote,
and Vishal Chourasia.

* tag 'powerpc-6.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (32 commits)
macintosh/via-pmu-backlight: Include <linux/fb.h> and <linux/of.h>
powerpc/powermac: backlight: Include <linux/of.h>
powerpc/64s/slb: Add no_slb_preload early cmdline param
powerpc/64s/slb: Make preload_add return type as void
powerpc/ptdump: Dump PXX level info for kernel_page_tables
powerpc/64s/pgtable: Enable directMap counters in meminfo for Hash
powerpc/64s/hash: Update directMap page counters for Hash
powerpc/64s/hash: Hash hpt_order should be only available with Hash MMU
powerpc/64s/hash: Improve hash mmu printk messages
powerpc/64s/hash: Fix phys_addr_t printf format in htab_initialize()
powerpc/64s/ptdump: Fix kernel_hash_pagetable dump for ISA v3.00 HPTE format
powerpc/64s/hash: Restrict stress_hpt_struct memblock region to within RMA limit
powerpc/64s/slb: Fix SLB multihit issue during SLB preload
powerpc, mm: Fix mprotect on book3s 32-bit
powerpc/smp: Expose die_id and die_cpumask
powerpc/83xx: Add a null pointer check to mcu_gpiochip_add
arch:powerpc:tools This file was missing shebang line, so added it
kexec: Include kernel-end even without crashkernel
powerpc: p2020: Rename wdt@ nodes to watchdog@
powerpc: 86xx: Rename wdt@ nodes to watchdog@
...

+270 -197
+4 -1
Documentation/admin-guide/kernel-parameters.txt
··· 1111 1111 It will be ignored when crashkernel=X,high is not used 1112 1112 or memory reserved is below 4G. 1113 1113 crashkernel=size[KMG],cma 1114 - [KNL, X86] Reserve additional crash kernel memory from 1114 + [KNL, X86, ppc] Reserve additional crash kernel memory from 1115 1115 CMA. This reservation is usable by the first system's 1116 1116 userspace memory and kernel movable allocations (memory 1117 1117 balloon, zswap). Pages allocated from this memory range ··· 7303 7303 Limits the number of kernel SLB entries, and flushes 7304 7304 them frequently to increase the rate of SLB faults 7305 7305 on kernel addresses. 7306 + 7307 + no_slb_preload [PPC,EARLY] 7308 + Disables slb preloading for userspace. 7306 7309 7307 7310 sunrpc.min_resvport= 7308 7311 sunrpc.max_resvport=
+4 -3
arch/powerpc/boot/addnote.c
··· 68 68 #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \ 69 69 buf[(off) + 1] = (v) & 0xff) 70 70 #define PUT_32BE(off, v)(PUT_16BE((off), (v) >> 16L), PUT_16BE((off) + 2, (v))) 71 - #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \ 72 - PUT_32BE((off) + 4, (v)))) 71 + #define PUT_64BE(off, v)((PUT_32BE((off), (unsigned long long)(v) >> 32L), \ 72 + PUT_32BE((off) + 4, (unsigned long long)(v)))) 73 73 74 74 #define GET_16LE(off) ((buf[off]) + (buf[(off)+1] << 8)) 75 75 #define GET_32LE(off) (GET_16LE(off) + (GET_16LE((off)+2U) << 16U)) ··· 78 78 #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \ 79 79 buf[(off) + 1] = ((v) >> 8) & 0xff) 80 80 #define PUT_32LE(off, v) (PUT_16LE((off), (v)), PUT_16LE((off) + 2, (v) >> 16L)) 81 - #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L)) 81 + #define PUT_64LE(off, v) (PUT_32LE((off), (unsigned long long)(v)), \ 82 + PUT_32LE((off) + 4, (unsigned long long)(v) >> 32L)) 82 83 83 84 #define GET_16(off) (e_data == ELFDATA2MSB ? GET_16BE(off) : GET_16LE(off)) 84 85 #define GET_32(off) (e_data == ELFDATA2MSB ? GET_32BE(off) : GET_32LE(off))
+1 -1
arch/powerpc/boot/dts/asp834x-redboot.dts
··· 72 72 reg = <0xff000000 0x00000200>; 73 73 bus-frequency = <0>; 74 74 75 - wdt@200 { 75 + watchdog@200 { 76 76 device_type = "watchdog"; 77 77 compatible = "mpc83xx_wdt"; 78 78 reg = <0x200 0x100>;
+2 -2
arch/powerpc/boot/dts/fsl/ge_imp3a.dts
··· 94 94 gpio-controller; 95 95 }; 96 96 97 - wdt@4,800 { 97 + watchdog@4,800 { 98 98 compatible = "ge,imp3a-fpga-wdt", "gef,fpga-wdt-1.00", 99 99 "gef,fpga-wdt"; 100 100 reg = <0x4 0x800 0x8>; ··· 103 103 }; 104 104 105 105 /* Second watchdog available, driver currently supports one. 106 - wdt@4,808 { 106 + watchdog@4,808 { 107 107 compatible = "gef,imp3a-fpga-wdt", "gef,fpga-wdt-1.00", 108 108 "gef,fpga-wdt"; 109 109 reg = <0x4 0x808 0x8>;
+2 -2
arch/powerpc/boot/dts/fsl/gef_ppc9a.dts
··· 82 82 reg = <0x4 0x0 0x40>; 83 83 }; 84 84 85 - wdt@4,2000 { 85 + watchdog@4,2000 { 86 86 compatible = "gef,ppc9a-fpga-wdt", "gef,fpga-wdt-1.00", 87 87 "gef,fpga-wdt"; 88 88 reg = <0x4 0x2000 0x8>; ··· 90 90 interrupt-parent = <&gef_pic>; 91 91 }; 92 92 /* Second watchdog available, driver currently supports one. 93 - wdt@4,2010 { 93 + watchdog@4,2010 { 94 94 compatible = "gef,ppc9a-fpga-wdt", "gef,fpga-wdt-1.00", 95 95 "gef,fpga-wdt"; 96 96 reg = <0x4 0x2010 0x8>;
+2 -2
arch/powerpc/boot/dts/fsl/gef_sbc310.dts
··· 79 79 reg = <0x4 0x0 0x40>; 80 80 }; 81 81 82 - wdt@4,2000 { 82 + watchdog@4,2000 { 83 83 compatible = "gef,sbc310-fpga-wdt", "gef,fpga-wdt-1.00", 84 84 "gef,fpga-wdt"; 85 85 reg = <0x4 0x2000 0x8>; ··· 87 87 interrupt-parent = <&gef_pic>; 88 88 }; 89 89 /* 90 - wdt@4,2010 { 90 + watchdog@4,2010 { 91 91 compatible = "gef,sbc310-fpga-wdt", "gef,fpga-wdt-1.00", 92 92 "gef,fpga-wdt"; 93 93 reg = <0x4 0x2010 0x8>;
+2 -2
arch/powerpc/boot/dts/fsl/gef_sbc610.dts
··· 82 82 reg = <0x4 0x0 0x40>; 83 83 }; 84 84 85 - wdt@4,2000 { 85 + watchdog@4,2000 { 86 86 compatible = "gef,fpga-wdt"; 87 87 reg = <0x4 0x2000 0x8>; 88 88 interrupts = <0x1a 0x4>; 89 89 interrupt-parent = <&gef_pic>; 90 90 }; 91 91 /* Second watchdog available, driver currently supports one. 92 - wdt@4,2010 { 92 + watchdog@4,2010 { 93 93 compatible = "gef,fpga-wdt"; 94 94 reg = <0x4 0x2010 0x8>; 95 95 interrupts = <0x1b 0x4>;
+1 -1
arch/powerpc/boot/dts/mpc5121.dtsi
··· 112 112 }; 113 113 114 114 /* Watchdog timer */ 115 - wdt@900 { 115 + watchdog@900 { 116 116 compatible = "fsl,mpc5121-wdt"; 117 117 reg = <0x900 0x100>; 118 118 };
+1 -1
arch/powerpc/boot/dts/mpc8313erdb.dts
··· 99 99 reg = <0xe0000000 0x00000200>; 100 100 bus-frequency = <0>; 101 101 102 - wdt@200 { 102 + watchdog@200 { 103 103 device_type = "watchdog"; 104 104 compatible = "mpc83xx_wdt"; 105 105 reg = <0x200 0x100>;
+1 -1
arch/powerpc/boot/dts/mpc8315erdb.dts
··· 100 100 reg = <0xe0000000 0x00000200>; 101 101 bus-frequency = <0>; 102 102 103 - wdt@200 { 103 + watchdog@200 { 104 104 device_type = "watchdog"; 105 105 compatible = "mpc83xx_wdt"; 106 106 reg = <0x200 0x100>;
+1 -1
arch/powerpc/boot/dts/mpc832x_rdb.dts
··· 52 52 reg = <0xe0000000 0x00000200>; 53 53 bus-frequency = <0>; 54 54 55 - wdt@200 { 55 + watchdog@200 { 56 56 device_type = "watchdog"; 57 57 compatible = "mpc83xx_wdt"; 58 58 reg = <0x200 0x100>;
+1 -1
arch/powerpc/boot/dts/mpc8349emitx.dts
··· 53 53 reg = <0xe0000000 0x00000200>; 54 54 bus-frequency = <0>; // from bootloader 55 55 56 - wdt@200 { 56 + watchdog@200 { 57 57 device_type = "watchdog"; 58 58 compatible = "mpc83xx_wdt"; 59 59 reg = <0x200 0x100>;
+1 -1
arch/powerpc/boot/dts/mpc8349emitxgp.dts
··· 51 51 reg = <0xe0000000 0x00000200>; 52 52 bus-frequency = <0>; // from bootloader 53 53 54 - wdt@200 { 54 + watchdog@200 { 55 55 device_type = "watchdog"; 56 56 compatible = "mpc83xx_wdt"; 57 57 reg = <0x200 0x100>;
+1 -1
arch/powerpc/boot/dts/mpc836x_rdk.dts
··· 62 62 /* filled by u-boot */ 63 63 bus-frequency = <0>; 64 64 65 - wdt@200 { 65 + watchdog@200 { 66 66 compatible = "mpc83xx_wdt"; 67 67 reg = <0x200 0x100>; 68 68 };
+1 -1
arch/powerpc/boot/dts/mpc8377_rdb.dts
··· 99 99 reg = <0xe0000000 0x00000200>; 100 100 bus-frequency = <0>; 101 101 102 - wdt@200 { 102 + watchdog@200 { 103 103 device_type = "watchdog"; 104 104 compatible = "mpc83xx_wdt"; 105 105 reg = <0x200 0x100>;
+1 -1
arch/powerpc/boot/dts/mpc8377_wlan.dts
··· 89 89 reg = <0xe0000000 0x00000200>; 90 90 bus-frequency = <0>; 91 91 92 - wdt@200 { 92 + watchdog@200 { 93 93 device_type = "watchdog"; 94 94 compatible = "mpc83xx_wdt"; 95 95 reg = <0x200 0x100>;
+1 -1
arch/powerpc/boot/dts/mpc8378_rdb.dts
··· 99 99 reg = <0xe0000000 0x00000200>; 100 100 bus-frequency = <0>; 101 101 102 - wdt@200 { 102 + watchdog@200 { 103 103 device_type = "watchdog"; 104 104 compatible = "mpc83xx_wdt"; 105 105 reg = <0x200 0x100>;
+1 -1
arch/powerpc/boot/dts/mpc8379_rdb.dts
··· 97 97 reg = <0xe0000000 0x00000200>; 98 98 bus-frequency = <0>; 99 99 100 - wdt@200 { 100 + watchdog@200 { 101 101 device_type = "watchdog"; 102 102 compatible = "mpc83xx_wdt"; 103 103 reg = <0x200 0x100>;
+2 -2
arch/powerpc/boot/wrapper
··· 21 21 # (default ./arch/powerpc/boot) 22 22 # -W dir specify working directory for temporary files (default .) 23 23 # -z use gzip (legacy) 24 - # -Z zsuffix compression to use (gz, xz or none) 24 + # -Z zsuffix compression to use (gz, xz, lzma, lzo or none) 25 25 26 26 # Stop execution if any command fails 27 27 set -e ··· 69 69 echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2 70 70 echo ' [-d devtree] [-s tree.dts] [-e esm_blob]' >&2 71 71 echo ' [-c] [-C cross-prefix] [-D datadir] [-W workingdir]' >&2 72 - echo ' [-Z (gz|xz|none)] [--no-compression] [vmlinux]' >&2 72 + echo ' [-Z (gz|xz|lzma|lzo|none)] [--no-compression] [vmlinux]' >&2 73 73 exit 1 74 74 } 75 75
+4 -1
arch/powerpc/include/asm/book3s/32/tlbflush.h
··· 11 11 void hash__flush_tlb_mm(struct mm_struct *mm); 12 12 void hash__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); 13 13 void hash__flush_range(struct mm_struct *mm, unsigned long start, unsigned long end); 14 + void hash__flush_gather(struct mmu_gather *tlb); 14 15 15 16 #ifdef CONFIG_SMP 16 17 void _tlbie(unsigned long address); ··· 30 29 static inline void tlb_flush(struct mmu_gather *tlb) 31 30 { 32 31 /* 603 needs to flush the whole TLB here since it doesn't use a hash table. */ 33 - if (!mmu_has_feature(MMU_FTR_HPTE_TABLE)) 32 + if (mmu_has_feature(MMU_FTR_HPTE_TABLE)) 33 + hash__flush_gather(tlb); 34 + else 34 35 _tlbia(); 35 36 } 36 37
-1
arch/powerpc/include/asm/book3s/64/mmu-hash.h
··· 524 524 void slb_dump_contents(struct slb_entry *slb_ptr); 525 525 526 526 extern void slb_vmalloc_update(void); 527 - void preload_new_slb_context(unsigned long start, unsigned long sp); 528 527 529 528 #ifdef CONFIG_PPC_64S_HASH_MMU 530 529 void slb_set_size(u16 size);
+2
arch/powerpc/include/asm/kexec.h
··· 115 115 #ifdef CONFIG_CRASH_RESERVE 116 116 int __init overlaps_crashkernel(unsigned long start, unsigned long size); 117 117 extern void arch_reserve_crashkernel(void); 118 + extern void kdump_cma_reserve(void); 118 119 #else 119 120 static inline void arch_reserve_crashkernel(void) {} 120 121 static inline int overlaps_crashkernel(unsigned long start, unsigned long size) { return 0; } 122 + static inline void kdump_cma_reserve(void) { } 121 123 #endif 122 124 123 125 #if defined(CONFIG_CRASH_DUMP)
+7 -4
arch/powerpc/include/asm/topology.h
··· 132 132 #include <asm/cputable.h> 133 133 134 134 struct cpumask *cpu_coregroup_mask(int cpu); 135 + const struct cpumask *cpu_die_mask(int cpu); 136 + int cpu_die_id(int cpu); 135 137 136 138 #ifdef CONFIG_PPC64 137 139 #include <asm/smp.h> 138 140 139 141 #define topology_physical_package_id(cpu) (cpu_to_chip_id(cpu)) 140 - 141 - #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) 142 - #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) 143 - #define topology_core_id(cpu) (cpu_to_core_id(cpu)) 142 + #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) 143 + #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) 144 + #define topology_core_id(cpu) (cpu_to_core_id(cpu)) 145 + #define topology_die_id(cpu) (cpu_die_id(cpu)) 146 + #define topology_die_cpumask(cpu) (cpu_die_mask(cpu)) 144 147 145 148 #endif 146 149 #endif
+22 -11
arch/powerpc/kernel/entry_32.S
··· 101 101 .endm 102 102 #endif 103 103 104 + .macro clr_ri trash 105 + #ifndef CONFIG_BOOKE 106 + #ifdef CONFIG_PPC_8xx 107 + mtspr SPRN_NRI, \trash 108 + #else 109 + li \trash, MSR_KERNEL & ~MSR_RI 110 + mtmsr \trash 111 + #endif 112 + #endif 113 + .endm 114 + 104 115 .globl transfer_to_syscall 105 116 transfer_to_syscall: 106 117 stw r3, ORIG_GPR3(r1) ··· 160 149 cmpwi r3,0 161 150 REST_GPR(3, r1) 162 151 syscall_exit_finish: 152 + clr_ri r4 163 153 mtspr SPRN_SRR0,r7 164 154 mtspr SPRN_SRR1,r8 165 155 ··· 180 168 REST_GPR(0, r1) 181 169 REST_GPRS(3, 12, r1) 182 170 b 1b 171 + _ASM_NOKPROBE_SYMBOL(syscall_exit_finish) 183 172 184 173 #ifdef CONFIG_44x 185 174 .L44x_icache_flush: ··· 229 216 beq 3f /* if not, we've got problems */ 230 217 #endif 231 218 232 - 2: lwz r10,_CCR(r11) 219 + lwz r10,_CCR(r11) 233 220 REST_GPRS(1, 6, r11) 234 221 mtcr r10 235 222 lwz r10,_LINK(r11) ··· 237 224 /* Clear the exception marker on the stack to avoid confusing stacktrace */ 238 225 li r10, 0 239 226 stw r10, 8(r11) 240 - REST_GPR(10, r11) 241 - #if defined(CONFIG_PPC_8xx) && defined(CONFIG_PERF_EVENTS) 242 - mtspr SPRN_NRI, r0 243 - #endif 227 + clr_ri r10 244 228 mtspr SPRN_SRR1,r9 245 229 mtspr SPRN_SRR0,r12 246 230 REST_GPR(9, r11) 231 + REST_GPR(10, r11) 247 232 REST_GPR(12, r11) 248 233 REST_GPR(11, r11) 249 234 rfi ··· 270 259 .Lfast_user_interrupt_return: 271 260 lwz r11,_NIP(r1) 272 261 lwz r12,_MSR(r1) 262 + clr_ri r4 273 263 mtspr SPRN_SRR0,r11 274 264 mtspr SPRN_SRR1,r12 275 265 276 266 BEGIN_FTR_SECTION 267 + lwarx r0,0,r1 268 + END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX) 277 269 stwcx. r0,0,r1 /* to clear the reservation */ 278 - FTR_SECTION_ELSE 279 - lwarx r0,0,r1 280 - ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) 281 270 282 271 lwz r3,_CCR(r1) 283 272 lwz r4,_LINK(r1) ··· 313 302 cmpwi cr1,r3,0 314 303 lwz r11,_NIP(r1) 315 304 lwz r12,_MSR(r1) 305 + clr_ri r4 316 306 mtspr SPRN_SRR0,r11 317 307 mtspr SPRN_SRR1,r12 318 308 319 309 BEGIN_FTR_SECTION 310 + lwarx r0,0,r1 311 + END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX) 320 312 stwcx. r0,0,r1 /* to clear the reservation */ 321 - FTR_SECTION_ELSE 322 - lwarx r0,0,r1 323 - ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) 324 313 325 314 lwz r3,_LINK(r1) 326 315 lwz r4,_CTR(r1)
+1 -1
arch/powerpc/kernel/interrupt.c
··· 38 38 #else 39 39 static inline bool exit_must_hard_disable(void) 40 40 { 41 - return true; 41 + return false; 42 42 } 43 43 #endif 44 44
-5
arch/powerpc/kernel/process.c
··· 1897 1897 return 0; 1898 1898 } 1899 1899 1900 - void preload_new_slb_context(unsigned long start, unsigned long sp); 1901 - 1902 1900 /* 1903 1901 * Set up a thread for executing a new program 1904 1902 */ ··· 1904 1906 { 1905 1907 #ifdef CONFIG_PPC64 1906 1908 unsigned long load_addr = regs->gpr[2]; /* saved by ELF_PLAT_INIT */ 1907 - 1908 - if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && !radix_enabled()) 1909 - preload_new_slb_context(start, sp); 1910 1909 #endif 1911 1910 1912 1911 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+3 -1
arch/powerpc/kernel/setup-common.c
··· 35 35 #include <linux/of_irq.h> 36 36 #include <linux/hugetlb.h> 37 37 #include <linux/pgtable.h> 38 + #include <asm/kexec.h> 38 39 #include <asm/io.h> 39 40 #include <asm/paca.h> 40 41 #include <asm/processor.h> ··· 996 995 initmem_init(); 997 996 998 997 /* 999 - * Reserve large chunks of memory for use by CMA for fadump, KVM and 998 + * Reserve large chunks of memory for use by CMA for kdump, fadump, KVM and 1000 999 * hugetlb. These must be called after initmem_init(), so that 1001 1000 * pageblock_order is initialised. 1002 1001 */ 1003 1002 fadump_cma_init(); 1003 + kdump_cma_reserve(); 1004 1004 kvm_cma_reserve(); 1005 1005 gigantic_hugetlb_cma_reserve(); 1006 1006
+23
arch/powerpc/kernel/smp.c
··· 1085 1085 return 0; 1086 1086 } 1087 1087 1088 + /* 1089 + * die_mask and die_id are only available on systems which support 1090 + * multiple coregroups within a same package. On all other systems, die_mask 1091 + * would be same as package mask and die_id would be set to -1. 1092 + */ 1093 + const struct cpumask *cpu_die_mask(int cpu) 1094 + { 1095 + if (has_coregroup_support()) 1096 + return per_cpu(cpu_coregroup_map, cpu); 1097 + else 1098 + return cpu_node_mask(cpu); 1099 + } 1100 + EXPORT_SYMBOL_GPL(cpu_die_mask); 1101 + 1102 + int cpu_die_id(int cpu) 1103 + { 1104 + if (has_coregroup_support()) 1105 + return cpu_to_coregroup_id(cpu); 1106 + else 1107 + return -1; 1108 + } 1109 + EXPORT_SYMBOL_GPL(cpu_die_id); 1110 + 1088 1111 void __init smp_prepare_cpus(unsigned int max_cpus) 1089 1112 { 1090 1113 unsigned int cpu, num_threads;
-1
arch/powerpc/kernel/vmlinux.lds.S
··· 330 330 } 331 331 .hash : AT(ADDR(.hash) - LOAD_OFFSET) { *(.hash) } 332 332 .gnu.hash : AT(ADDR(.gnu.hash) - LOAD_OFFSET) { *(.gnu.hash) } 333 - .interp : AT(ADDR(.interp) - LOAD_OFFSET) { *(.interp) } 334 333 .rela.dyn : AT(ADDR(.rela.dyn) - LOAD_OFFSET) 335 334 { 336 335 __rela_dyn_start = .;
+24 -13
arch/powerpc/kexec/core.c
··· 22 22 #include <asm/setup.h> 23 23 #include <asm/firmware.h> 24 24 25 + #define cpu_to_be_ulong __PASTE(cpu_to_be, BITS_PER_LONG) 26 + 25 27 #ifdef CONFIG_CRASH_DUMP 26 28 void machine_crash_shutdown(struct pt_regs *regs) 27 29 { ··· 60 58 } 61 59 62 60 #ifdef CONFIG_CRASH_RESERVE 61 + 62 + static unsigned long long crashk_cma_size; 63 63 64 64 static unsigned long long __init get_crash_base(unsigned long long crash_base) 65 65 { ··· 114 110 115 111 /* use common parsing */ 116 112 ret = parse_crashkernel(boot_command_line, total_mem_sz, &crash_size, 117 - &crash_base, NULL, NULL, NULL); 113 + &crash_base, NULL, &crashk_cma_size, NULL); 118 114 119 115 if (ret) 120 116 return; ··· 134 130 reserve_crashkernel_generic(crash_size, crash_base, 0, false); 135 131 } 136 132 133 + void __init kdump_cma_reserve(void) 134 + { 135 + if (crashk_cma_size) 136 + reserve_crashkernel_cma(crashk_cma_size); 137 + } 138 + 137 139 int __init overlaps_crashkernel(unsigned long start, unsigned long size) 138 140 { 139 141 return (start + size) > crashk_res.start && start <= crashk_res.end; 140 142 } 141 143 142 144 /* Values we need to export to the second kernel via the device tree. */ 143 - static phys_addr_t kernel_end; 144 145 static phys_addr_t crashk_base; 145 146 static phys_addr_t crashk_size; 146 147 static unsigned long long mem_limit; 147 - 148 - static struct property kernel_end_prop = { 149 - .name = "linux,kernel-end", 150 - .length = sizeof(phys_addr_t), 151 - .value = &kernel_end, 152 - }; 153 148 154 149 static struct property crashk_base_prop = { 155 150 .name = "linux,crashkernel-base", ··· 167 164 .length = sizeof(unsigned long long), 168 165 .value = &mem_limit, 169 166 }; 170 - 171 - #define cpu_to_be_ulong __PASTE(cpu_to_be, BITS_PER_LONG) 172 167 173 168 static void __init export_crashk_values(struct device_node *node) 174 169 { ··· 191 190 mem_limit = cpu_to_be_ulong(memory_limit); 192 191 of_update_property(node, &memory_limit_prop); 193 192 } 193 + #endif /* CONFIG_CRASH_RESERVE */ 194 + 195 + static phys_addr_t kernel_end; 196 + 197 + static struct property kernel_end_prop = { 198 + .name = "linux,kernel-end", 199 + .length = sizeof(phys_addr_t), 200 + .value = &kernel_end, 201 + }; 194 202 195 203 static int __init kexec_setup(void) 196 204 { ··· 210 200 return -ENOENT; 211 201 212 202 /* remove any stale properties so ours can be found */ 213 - of_remove_property(node, of_find_property(node, kernel_end_prop.name, NULL)); 203 + of_remove_property(node, of_find_property(node, kernel_end_prop.name, 204 + NULL)); 214 205 215 206 /* information needed by userspace when using default_machine_kexec */ 216 207 kernel_end = cpu_to_be_ulong(__pa(_end)); 217 208 of_add_property(node, &kernel_end_prop); 218 209 210 + #ifdef CONFIG_CRASH_RESERVE 219 211 export_crashk_values(node); 220 - 212 + #endif 221 213 of_node_put(node); 222 214 return 0; 223 215 } 224 216 late_initcall(kexec_setup); 225 - #endif /* CONFIG_CRASH_RESERVE */
+33 -12
arch/powerpc/kexec/ranges.c
··· 515 515 */ 516 516 int get_usable_memory_ranges(struct crash_mem **mem_ranges) 517 517 { 518 - int ret; 518 + int ret, i; 519 519 520 520 /* 521 521 * Early boot failure observed on guests when low memory (first memory ··· 527 527 ret = add_mem_range(mem_ranges, 0, crashk_res.end + 1); 528 528 if (ret) 529 529 goto out; 530 + 531 + for (i = 0; i < crashk_cma_cnt; i++) { 532 + ret = add_mem_range(mem_ranges, crashk_cma_ranges[i].start, 533 + crashk_cma_ranges[i].end - crashk_cma_ranges[i].start + 1); 534 + if (ret) 535 + goto out; 536 + } 530 537 531 538 ret = add_rtas_mem_range(mem_ranges); 532 539 if (ret) ··· 553 546 #endif /* CONFIG_KEXEC_FILE */ 554 547 555 548 #ifdef CONFIG_CRASH_DUMP 549 + static int crash_exclude_mem_range_guarded(struct crash_mem **mem_ranges, 550 + unsigned long long mstart, 551 + unsigned long long mend) 552 + { 553 + struct crash_mem *tmem = *mem_ranges; 554 + 555 + /* Reallocate memory ranges if there is no space to split ranges */ 556 + if (tmem && (tmem->nr_ranges == tmem->max_nr_ranges)) { 557 + tmem = realloc_mem_ranges(mem_ranges); 558 + if (!tmem) 559 + return -ENOMEM; 560 + } 561 + 562 + return crash_exclude_mem_range(tmem, mstart, mend); 563 + } 564 + 556 565 /** 557 566 * get_crash_memory_ranges - Get crash memory ranges. This list includes 558 567 * first/crashing kernel's memory regions that ··· 580 557 int get_crash_memory_ranges(struct crash_mem **mem_ranges) 581 558 { 582 559 phys_addr_t base, end; 583 - struct crash_mem *tmem; 584 560 u64 i; 585 561 int ret; 586 562 ··· 604 582 sort_memory_ranges(*mem_ranges, true); 605 583 } 606 584 607 - /* Reallocate memory ranges if there is no space to split ranges */ 608 - tmem = *mem_ranges; 609 - if (tmem && (tmem->nr_ranges == tmem->max_nr_ranges)) { 610 - tmem = realloc_mem_ranges(mem_ranges); 611 - if (!tmem) 612 - goto out; 613 - } 614 - 615 585 /* Exclude crashkernel region */ 616 - ret = crash_exclude_mem_range(tmem, crashk_res.start, crashk_res.end); 586 + ret = crash_exclude_mem_range_guarded(mem_ranges, crashk_res.start, crashk_res.end); 617 587 if (ret) 618 588 goto out; 589 + 590 + for (i = 0; i < crashk_cma_cnt; ++i) { 591 + ret = crash_exclude_mem_range_guarded(mem_ranges, crashk_cma_ranges[i].start, 592 + crashk_cma_ranges[i].end); 593 + if (ret) 594 + goto out; 595 + } 619 596 620 597 /* 621 598 * FIXME: For now, stay in parity with kexec-tools but if RTAS/OPAL ··· 718 697 * two half. 719 698 */ 720 699 else { 700 + size = mem_rngs->ranges[i].end - end + 1; 721 701 mem_rngs->ranges[i].end = base - 1; 722 - size = mem_rngs->ranges[i].end - end; 723 702 ret = add_mem_range(mem_ranges, end + 1, size); 724 703 } 725 704 }
+9
arch/powerpc/mm/book3s32/tlb.c
··· 105 105 flush_hash_pages(mm->context.id, vmaddr, pmd_val(*pmd), 1); 106 106 } 107 107 EXPORT_SYMBOL(hash__flush_tlb_page); 108 + 109 + void hash__flush_gather(struct mmu_gather *tlb) 110 + { 111 + if (tlb->fullmm || tlb->need_flush_all) 112 + hash__flush_tlb_mm(tlb->mm); 113 + else 114 + hash__flush_range(tlb->mm, tlb->start, tlb->end); 115 + } 116 + EXPORT_SYMBOL(hash__flush_gather);
+31 -10
arch/powerpc/mm/book3s64/hash_utils.c
··· 47 47 #include <asm/mmu.h> 48 48 #include <asm/mmu_context.h> 49 49 #include <asm/page.h> 50 + #include <asm/pgalloc.h> 50 51 #include <asm/types.h> 51 52 #include <linux/uaccess.h> 52 53 #include <asm/machdep.h> ··· 450 449 { 451 450 unsigned long kfence_pool_start, kfence_pool_end; 452 451 unsigned long prot = pgprot_val(PAGE_KERNEL); 452 + unsigned int pshift = mmu_psize_defs[mmu_linear_psize].shift; 453 453 454 454 if (!kfence_pool) 455 455 return; ··· 461 459 BUG_ON(htab_bolt_mapping(kfence_pool_start, kfence_pool_end, 462 460 kfence_pool, prot, mmu_linear_psize, 463 461 mmu_kernel_ssize)); 462 + update_page_count(mmu_linear_psize, KFENCE_POOL_SIZE >> pshift); 464 463 memblock_clear_nomap(kfence_pool, KFENCE_POOL_SIZE); 465 464 } 466 465 ··· 955 952 block_size = be64_to_cpu(addr_prop[1]); 956 953 if (block_size != (16 * GB)) 957 954 return 0; 958 - printk(KERN_INFO "Huge page(16GB) memory: " 955 + pr_info("Huge page(16GB) memory: " 959 956 "addr = 0x%lX size = 0x%lX pages = %d\n", 960 957 phys_addr, block_size, expected_pages); 961 958 if (phys_addr + block_size * expected_pages <= memblock_end_of_DRAM()) { ··· 1138 1135 mmu_vmemmap_psize = mmu_virtual_psize; 1139 1136 #endif /* CONFIG_SPARSEMEM_VMEMMAP */ 1140 1137 1141 - printk(KERN_DEBUG "Page orders: linear mapping = %d, " 1138 + pr_info("Page orders: linear mapping = %d, " 1142 1139 "virtual = %d, io = %d" 1143 1140 #ifdef CONFIG_SPARSEMEM_VMEMMAP 1144 1141 ", vmemmap = %d" ··· 1237 1234 int nid, pgprot_t prot) 1238 1235 { 1239 1236 int rc; 1237 + unsigned int pshift = mmu_psize_defs[mmu_linear_psize].shift; 1240 1238 1241 1239 if (end >= H_VMALLOC_START) { 1242 1240 pr_warn("Outside the supported range\n"); ··· 1255 1251 mmu_kernel_ssize); 1256 1252 BUG_ON(rc2 && (rc2 != -ENOENT)); 1257 1253 } 1254 + update_page_count(mmu_linear_psize, (end - start) >> pshift); 1258 1255 return rc; 1259 1256 } 1260 1257 1261 1258 int hash__remove_section_mapping(unsigned long start, unsigned long end) 1262 1259 { 1260 + unsigned int pshift = mmu_psize_defs[mmu_linear_psize].shift; 1261 + 1263 1262 int rc = htab_remove_mapping(start, end, mmu_linear_psize, 1264 1263 mmu_kernel_ssize); 1265 1264 1266 1265 if (resize_hpt_for_hotplug(memblock_phys_mem_size()) == -ENOSPC) 1267 1266 pr_warn("Hash collision while resizing HPT\n"); 1268 1267 1268 + if (!rc) 1269 + update_page_count(mmu_linear_psize, -((end - start) >> pshift)); 1269 1270 return rc; 1270 1271 } 1271 1272 #endif /* CONFIG_MEMORY_HOTPLUG */ ··· 1311 1302 unsigned long table; 1312 1303 unsigned long pteg_count; 1313 1304 unsigned long prot; 1314 - phys_addr_t base = 0, size = 0, end; 1305 + phys_addr_t base = 0, size = 0, end, limit = MEMBLOCK_ALLOC_ANYWHERE; 1315 1306 u64 i; 1307 + unsigned int pshift = mmu_psize_defs[mmu_linear_psize].shift; 1316 1308 1317 1309 DBG(" -> htab_initialize()\n"); 1310 + 1311 + if (firmware_has_feature(FW_FEATURE_LPAR)) 1312 + limit = ppc64_rma_size; 1318 1313 1319 1314 if (mmu_has_feature(MMU_FTR_1T_SEGMENT)) { 1320 1315 mmu_kernel_ssize = MMU_SEGSIZE_1T; 1321 1316 mmu_highuser_ssize = MMU_SEGSIZE_1T; 1322 - printk(KERN_INFO "Using 1TB segments\n"); 1317 + pr_info("Using 1TB segments\n"); 1323 1318 } 1324 1319 1325 1320 if (stress_slb_enabled) 1326 1321 static_branch_enable(&stress_slb_key); 1322 + 1323 + if (no_slb_preload) 1324 + static_branch_enable(&no_slb_preload_key); 1327 1325 1328 1326 if (stress_hpt_enabled) { 1329 1327 unsigned long tmp; ··· 1338 1322 // Too early to use nr_cpu_ids, so use NR_CPUS 1339 1323 tmp = memblock_phys_alloc_range(sizeof(struct stress_hpt_struct) * NR_CPUS, 1340 1324 __alignof__(struct stress_hpt_struct), 1341 - 0, MEMBLOCK_ALLOC_ANYWHERE); 1325 + MEMBLOCK_LOW_LIMIT, limit); 1342 1326 memset((void *)tmp, 0xff, sizeof(struct stress_hpt_struct) * NR_CPUS); 1343 1327 stress_hpt_struct = __va(tmp); 1344 1328 ··· 1372 1356 mmu_hash_ops.hpte_clear_all(); 1373 1357 #endif 1374 1358 } else { 1375 - unsigned long limit = MEMBLOCK_ALLOC_ANYWHERE; 1376 1359 1377 1360 table = memblock_phys_alloc_range(htab_size_bytes, 1378 1361 htab_size_bytes, 1379 - 0, limit); 1362 + MEMBLOCK_LOW_LIMIT, limit); 1380 1363 if (!table) 1381 1364 panic("ERROR: Failed to allocate %pa bytes below %pa\n", 1382 1365 &htab_size_bytes, &limit); ··· 1407 1392 size = end - base; 1408 1393 base = (unsigned long)__va(base); 1409 1394 1410 - DBG("creating mapping for region: %lx..%lx (prot: %lx)\n", 1411 - base, size, prot); 1395 + pr_debug("creating mapping for region: 0x%pa..0x%pa (prot: %lx)\n", 1396 + &base, &size, prot); 1412 1397 1413 1398 if ((base + size) >= H_VMALLOC_START) { 1414 1399 pr_warn("Outside the supported range\n"); ··· 1417 1402 1418 1403 BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), 1419 1404 prot, mmu_linear_psize, mmu_kernel_ssize)); 1405 + 1406 + update_page_count(mmu_linear_psize, size >> pshift); 1420 1407 } 1421 1408 hash_kfence_map_pool(); 1422 1409 memblock_set_current_limit(MEMBLOCK_ALLOC_ANYWHERE); ··· 1440 1423 BUG_ON(htab_bolt_mapping(tce_alloc_start, tce_alloc_end, 1441 1424 __pa(tce_alloc_start), prot, 1442 1425 mmu_linear_psize, mmu_kernel_ssize)); 1426 + update_page_count(mmu_linear_psize, 1427 + (tce_alloc_end - tce_alloc_start) >> pshift); 1443 1428 } 1444 1429 1445 1430 ··· 1886 1867 * in vmalloc space, so switch vmalloc 1887 1868 * to 4k pages 1888 1869 */ 1889 - printk(KERN_ALERT "Reducing vmalloc segment " 1870 + pr_alert("Reducing vmalloc segment " 1890 1871 "to 4kB pages because of " 1891 1872 "non-cacheable mapping\n"); 1892 1873 psize = mmu_vmalloc_psize = MMU_PAGE_4K; ··· 2451 2432 2452 2433 static int __init hash64_debugfs(void) 2453 2434 { 2435 + if (radix_enabled()) 2436 + return 0; 2454 2437 debugfs_create_file("hpt_order", 0600, arch_debugfs_dir, NULL, 2455 2438 &fops_hpt_order); 2456 2439 return 0;
+7 -2
arch/powerpc/mm/book3s64/internal.h
··· 22 22 return static_branch_unlikely(&stress_hpt_key); 23 23 } 24 24 25 - void hpt_do_stress(unsigned long ea, unsigned long hpte_group); 25 + extern bool no_slb_preload; 26 + DECLARE_STATIC_KEY_FALSE(no_slb_preload_key); 27 + static inline bool slb_preload_disabled(void) 28 + { 29 + return static_branch_unlikely(&no_slb_preload_key); 30 + } 26 31 27 - void slb_setup_new_exec(void); 32 + void hpt_do_stress(unsigned long ea, unsigned long hpte_group); 28 33 29 34 void exit_lazy_flush_tlb(struct mm_struct *mm, bool always_flush); 30 35
-2
arch/powerpc/mm/book3s64/mmu_context.c
··· 150 150 void hash__setup_new_exec(void) 151 151 { 152 152 slice_setup_new_exec(); 153 - 154 - slb_setup_new_exec(); 155 153 } 156 154 #else 157 155 static inline int hash__init_new_context(struct mm_struct *mm)
+12 -11
arch/powerpc/mm/book3s64/pgtable.c
··· 510 510 511 511 void arch_report_meminfo(struct seq_file *m) 512 512 { 513 - /* 514 - * Hash maps the memory with one size mmu_linear_psize. 515 - * So don't bother to print these on hash 516 - */ 517 - if (!radix_enabled()) 518 - return; 519 513 seq_printf(m, "DirectMap4k: %8lu kB\n", 520 514 atomic_long_read(&direct_pages_count[MMU_PAGE_4K]) << 2); 521 - seq_printf(m, "DirectMap64k: %8lu kB\n", 515 + seq_printf(m, "DirectMap64k: %8lu kB\n", 522 516 atomic_long_read(&direct_pages_count[MMU_PAGE_64K]) << 6); 523 - seq_printf(m, "DirectMap2M: %8lu kB\n", 524 - atomic_long_read(&direct_pages_count[MMU_PAGE_2M]) << 11); 525 - seq_printf(m, "DirectMap1G: %8lu kB\n", 526 - atomic_long_read(&direct_pages_count[MMU_PAGE_1G]) << 20); 517 + if (radix_enabled()) { 518 + seq_printf(m, "DirectMap2M: %8lu kB\n", 519 + atomic_long_read(&direct_pages_count[MMU_PAGE_2M]) << 11); 520 + seq_printf(m, "DirectMap1G: %8lu kB\n", 521 + atomic_long_read(&direct_pages_count[MMU_PAGE_1G]) << 20); 522 + } else { 523 + seq_printf(m, "DirectMap16M: %8lu kB\n", 524 + atomic_long_read(&direct_pages_count[MMU_PAGE_16M]) << 14); 525 + seq_printf(m, "DirectMap16G: %8lu kB\n", 526 + atomic_long_read(&direct_pages_count[MMU_PAGE_16G]) << 24); 527 + } 527 528 } 528 529 #endif /* CONFIG_PROC_FS */ 529 530
+17 -92
arch/powerpc/mm/book3s64/slb.c
··· 42 42 43 43 __ro_after_init DEFINE_STATIC_KEY_FALSE(stress_slb_key); 44 44 45 + bool no_slb_preload __initdata; 46 + static int __init parse_no_slb_preload(char *p) 47 + { 48 + no_slb_preload = true; 49 + return 0; 50 + } 51 + early_param("no_slb_preload", parse_no_slb_preload); 52 + __ro_after_init DEFINE_STATIC_KEY_FALSE(no_slb_preload_key); 53 + 45 54 static void assert_slb_presence(bool present, unsigned long ea) 46 55 { 47 56 #ifdef CONFIG_DEBUG_VM ··· 303 294 return false; 304 295 } 305 296 306 - static bool preload_add(struct thread_info *ti, unsigned long ea) 297 + static void preload_add(struct thread_info *ti, unsigned long ea) 307 298 { 308 299 unsigned char idx; 309 300 unsigned long esid; 301 + 302 + if (slb_preload_disabled()) 303 + return; 310 304 311 305 if (mmu_has_feature(MMU_FTR_1T_SEGMENT)) { 312 306 /* EAs are stored >> 28 so 256MB segments don't need clearing */ ··· 320 308 esid = ea >> SID_SHIFT; 321 309 322 310 if (preload_hit(ti, esid)) 323 - return false; 311 + return; 324 312 325 313 idx = (ti->slb_preload_tail + ti->slb_preload_nr) % SLB_PRELOAD_NR; 326 314 ti->slb_preload_esid[idx] = esid; ··· 328 316 ti->slb_preload_tail = (ti->slb_preload_tail + 1) % SLB_PRELOAD_NR; 329 317 else 330 318 ti->slb_preload_nr++; 331 - 332 - return true; 333 319 } 334 320 335 321 static void preload_age(struct thread_info *ti) ··· 336 326 return; 337 327 ti->slb_preload_nr--; 338 328 ti->slb_preload_tail = (ti->slb_preload_tail + 1) % SLB_PRELOAD_NR; 339 - } 340 - 341 - void slb_setup_new_exec(void) 342 - { 343 - struct thread_info *ti = current_thread_info(); 344 - struct mm_struct *mm = current->mm; 345 - unsigned long exec = 0x10000000; 346 - 347 - WARN_ON(irqs_disabled()); 348 - 349 - /* 350 - * preload cache can only be used to determine whether a SLB 351 - * entry exists if it does not start to overflow. 352 - */ 353 - if (ti->slb_preload_nr + 2 > SLB_PRELOAD_NR) 354 - return; 355 - 356 - hard_irq_disable(); 357 - 358 - /* 359 - * We have no good place to clear the slb preload cache on exec, 360 - * flush_thread is about the earliest arch hook but that happens 361 - * after we switch to the mm and have already preloaded the SLBEs. 362 - * 363 - * For the most part that's probably okay to use entries from the 364 - * previous exec, they will age out if unused. It may turn out to 365 - * be an advantage to clear the cache before switching to it, 366 - * however. 367 - */ 368 - 369 - /* 370 - * preload some userspace segments into the SLB. 371 - * Almost all 32 and 64bit PowerPC executables are linked at 372 - * 0x10000000 so it makes sense to preload this segment. 373 - */ 374 - if (!is_kernel_addr(exec)) { 375 - if (preload_add(ti, exec)) 376 - slb_allocate_user(mm, exec); 377 - } 378 - 379 - /* Libraries and mmaps. */ 380 - if (!is_kernel_addr(mm->mmap_base)) { 381 - if (preload_add(ti, mm->mmap_base)) 382 - slb_allocate_user(mm, mm->mmap_base); 383 - } 384 - 385 - /* see switch_slb */ 386 - asm volatile("isync" : : : "memory"); 387 - 388 - local_irq_enable(); 389 - } 390 - 391 - void preload_new_slb_context(unsigned long start, unsigned long sp) 392 - { 393 - struct thread_info *ti = current_thread_info(); 394 - struct mm_struct *mm = current->mm; 395 - unsigned long heap = mm->start_brk; 396 - 397 - WARN_ON(irqs_disabled()); 398 - 399 - /* see above */ 400 - if (ti->slb_preload_nr + 3 > SLB_PRELOAD_NR) 401 - return; 402 - 403 - hard_irq_disable(); 404 - 405 - /* Userspace entry address. */ 406 - if (!is_kernel_addr(start)) { 407 - if (preload_add(ti, start)) 408 - slb_allocate_user(mm, start); 409 - } 410 - 411 - /* Top of stack, grows down. */ 412 - if (!is_kernel_addr(sp)) { 413 - if (preload_add(ti, sp)) 414 - slb_allocate_user(mm, sp); 415 - } 416 - 417 - /* Bottom of heap, grows up. */ 418 - if (heap && !is_kernel_addr(heap)) { 419 - if (preload_add(ti, heap)) 420 - slb_allocate_user(mm, heap); 421 - } 422 - 423 - /* see switch_slb */ 424 - asm volatile("isync" : : : "memory"); 425 - 426 - local_irq_enable(); 427 329 } 428 330 429 331 static void slb_cache_slbie_kernel(unsigned int index) ··· 423 501 get_paca()->slb_used_bitmap = get_paca()->slb_kern_bitmap; 424 502 425 503 copy_mm_to_paca(mm); 504 + 505 + if (slb_preload_disabled()) 506 + return; 426 507 427 508 /* 428 509 * We gradually age out SLBs after a number of context switches to
+5
arch/powerpc/mm/ptdump/8xx.c
··· 71 71 72 72 struct ptdump_pg_level pg_level[5] = { 73 73 { /* pgd */ 74 + .name = "PGD", 74 75 .flag = flag_array, 75 76 .num = ARRAY_SIZE(flag_array), 76 77 }, { /* p4d */ 78 + .name = "P4D", 77 79 .flag = flag_array, 78 80 .num = ARRAY_SIZE(flag_array), 79 81 }, { /* pud */ 82 + .name = "PUD", 80 83 .flag = flag_array, 81 84 .num = ARRAY_SIZE(flag_array), 82 85 }, { /* pmd */ 86 + .name = "PMD", 83 87 .flag = flag_array, 84 88 .num = ARRAY_SIZE(flag_array), 85 89 }, { /* pte */ 90 + .name = "PTE", 86 91 .flag = flag_array, 87 92 .num = ARRAY_SIZE(flag_array), 88 93 },
+5
arch/powerpc/mm/ptdump/book3s64.c
··· 104 104 105 105 struct ptdump_pg_level pg_level[5] = { 106 106 { /* pgd */ 107 + .name = "PGD", 107 108 .flag = flag_array, 108 109 .num = ARRAY_SIZE(flag_array), 109 110 }, { /* p4d */ 111 + .name = "P4D", 110 112 .flag = flag_array, 111 113 .num = ARRAY_SIZE(flag_array), 112 114 }, { /* pud */ 115 + .name = "PUD", 113 116 .flag = flag_array, 114 117 .num = ARRAY_SIZE(flag_array), 115 118 }, { /* pmd */ 119 + .name = "PMD", 116 120 .flag = flag_array, 117 121 .num = ARRAY_SIZE(flag_array), 118 122 }, { /* pte */ 123 + .name = "PTE", 119 124 .flag = flag_array, 120 125 .num = ARRAY_SIZE(flag_array), 121 126 },
+6
arch/powerpc/mm/ptdump/hashpagetable.c
··· 216 216 vpn = hpt_vpn(ea, vsid, ssize); 217 217 hash = hpt_hash(vpn, shift, ssize); 218 218 want_v = hpte_encode_avpn(vpn, psize, ssize); 219 + if (cpu_has_feature(CPU_FTR_ARCH_300)) 220 + want_v = hpte_old_to_new_v(want_v); 219 221 220 222 /* to check in the secondary hash table, we invert the hash */ 221 223 if (!primary) ··· 231 229 /* HPTE matches */ 232 230 *v = be64_to_cpu(hptep->v); 233 231 *r = be64_to_cpu(hptep->r); 232 + if (cpu_has_feature(CPU_FTR_ARCH_300)) { 233 + *v = hpte_new_to_old_v(*v, *r); 234 + *r = hpte_new_to_old_r(*r); 235 + } 234 236 return 0; 235 237 } 236 238 ++hpte_group;
+1
arch/powerpc/mm/ptdump/ptdump.c
··· 178 178 pt_dump_seq_printf(st->seq, REG "-" REG " ", st->start_address, addr - 1); 179 179 pt_dump_seq_printf(st->seq, " " REG " ", st->start_pa); 180 180 pt_dump_size(st->seq, addr - st->start_address); 181 + pt_dump_seq_printf(st->seq, "%s ", pg_level[st->level].name); 181 182 } 182 183 183 184 static void note_prot_wx(struct pg_state *st, unsigned long addr)
+1
arch/powerpc/mm/ptdump/ptdump.h
··· 13 13 14 14 struct ptdump_pg_level { 15 15 const struct flag_info *flag; 16 + char name[4]; 16 17 size_t num; 17 18 u64 mask; 18 19 };
+5
arch/powerpc/mm/ptdump/shared.c
··· 69 69 70 70 struct ptdump_pg_level pg_level[5] = { 71 71 { /* pgd */ 72 + .name = "PGD", 72 73 .flag = flag_array, 73 74 .num = ARRAY_SIZE(flag_array), 74 75 }, { /* p4d */ 76 + .name = "P4D", 75 77 .flag = flag_array, 76 78 .num = ARRAY_SIZE(flag_array), 77 79 }, { /* pud */ 80 + .name = "PUD", 78 81 .flag = flag_array, 79 82 .num = ARRAY_SIZE(flag_array), 80 83 }, { /* pmd */ 84 + .name = "PMD", 81 85 .flag = flag_array, 82 86 .num = ARRAY_SIZE(flag_array), 83 87 }, { /* pte */ 88 + .name = "PTE", 84 89 .flag = flag_array, 85 90 .num = ARRAY_SIZE(flag_array), 86 91 },
+2
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
··· 123 123 124 124 gc->owner = THIS_MODULE; 125 125 gc->label = kasprintf(GFP_KERNEL, "%pfw", dev_fwnode(dev)); 126 + if (!gc->label) 127 + return -ENOMEM; 126 128 gc->can_sleep = 1; 127 129 gc->ngpio = MCU_NUM_GPIO; 128 130 gc->base = -1;
+1
arch/powerpc/platforms/powermac/backlight.c
··· 11 11 #include <linux/kernel.h> 12 12 #include <linux/backlight.h> 13 13 #include <linux/adb.h> 14 + #include <linux/of.h> 14 15 #include <linux/pmu.h> 15 16 #include <linux/atomic.h> 16 17 #include <linux/export.h>
+14 -3
arch/powerpc/platforms/pseries/lparcfg.c
··· 78 78 u8 capped; 79 79 u8 weight; 80 80 u8 unallocated_weight; 81 + u8 resource_group_index; 82 + u16 active_procs_in_resource_group; 81 83 u16 active_procs_in_pool; 82 84 u16 active_system_procs; 83 85 u16 phys_platform_procs; ··· 88 86 }; 89 87 90 88 /* 91 - * H_GET_PPP hcall returns info in 4 parms. 89 + * H_GET_PPP hcall returns info in 5 parms. 92 90 * entitled_capacity,unallocated_capacity, 93 91 * aggregation, resource_capability). 94 92 * ··· 96 94 * R5 = Unallocated Processor Capacity Percentage. 97 95 * R6 (AABBCCDDEEFFGGHH). 98 96 * XXXX - reserved (0) 99 - * XXXX - reserved (0) 97 + * XXXX - Active Cores in Resource Group 100 98 * XXXX - Group Number 101 99 * XXXX - Pool Number. 102 100 * R7 (IIJJKKLLMMNNOOPP). 103 - * XX - reserved. (0) 101 + * XX - Resource group Number 104 102 * XX - bit 0-6 reserved (0). bit 7 is Capped indicator. 105 103 * XX - variable processor Capacity Weight 106 104 * XX - Unallocated Variable Processor Capacity Weight. ··· 122 120 ppp_data->entitlement = retbuf[0]; 123 121 ppp_data->unallocated_entitlement = retbuf[1]; 124 122 123 + ppp_data->active_procs_in_resource_group = (retbuf[2] >> 4 * 8) & 0xffff; 125 124 ppp_data->group_num = (retbuf[2] >> 2 * 8) & 0xffff; 126 125 ppp_data->pool_num = retbuf[2] & 0xffff; 127 126 127 + ppp_data->resource_group_index = (retbuf[3] >> 7 * 8) & 0xff; 128 128 ppp_data->capped = (retbuf[3] >> 6 * 8) & 0x01; 129 129 ppp_data->weight = (retbuf[3] >> 5 * 8) & 0xff; 130 130 ppp_data->unallocated_weight = (retbuf[3] >> 4 * 8) & 0xff; ··· 239 235 seq_printf(m, "capped=%d\n", ppp_data.capped); 240 236 seq_printf(m, "unallocated_capacity=%lld\n", 241 237 ppp_data.unallocated_entitlement); 238 + 239 + if (ppp_data.active_procs_in_resource_group) { 240 + seq_printf(m, "resource_group_number=%d\n", 241 + ppp_data.resource_group_index); 242 + seq_printf(m, "resource_group_active_processors=%d\n", 243 + ppp_data.active_procs_in_resource_group); 244 + } 242 245 243 246 /* The last bits of information returned from h_get_ppp are only 244 247 * valid if the ibm,partition-performance-parameters-level
+1
arch/powerpc/tools/head_check.sh
··· 1 + #!/bin/sh 1 2 # Copyright © 2016 IBM Corporation 2 3 3 4 # This program is free software; you can redistribute it and/or
+2 -1
drivers/macintosh/mac_hid.c
··· 187 187 void *buffer, size_t *lenp, loff_t *ppos) 188 188 { 189 189 int *valp = table->data; 190 - int old_val = *valp; 190 + int old_val; 191 191 int rc; 192 192 193 193 rc = mutex_lock_killable(&mac_hid_emumouse_mutex); 194 194 if (rc) 195 195 return rc; 196 196 197 + old_val = *valp; 197 198 rc = proc_dointvec(table, write, buffer, lenp, ppos); 198 199 199 200 if (rc == 0 && write && *valp != old_val) {
+2
drivers/macintosh/via-pmu-backlight.c
··· 11 11 #include <asm/ptrace.h> 12 12 #include <linux/adb.h> 13 13 #include <linux/backlight.h> 14 + #include <linux/fb.h> 15 + #include <linux/of.h> 14 16 #include <linux/pmu.h> 15 17 #include <asm/backlight.h> 16 18