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

Merge tag 'powerpc-5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull more powerpc updates from Michael Ellerman:
"The bulk of this is the series to make CONFIG_COMPAT user-selectable,
it's been around for a long time but was blocked behind the
syscall-in-C series.

Plus there's also a few fixes and other minor things.

Summary:

- A fix for a crash in machine check handling on pseries (ie. guests)

- A small series to make it possible to disable CONFIG_COMPAT, and
turn it off by default for ppc64le where it's not used.

- A few other miscellaneous fixes and small improvements.

Thanks to: Alexey Kardashevskiy, Anju T Sudhakar, Arnd Bergmann,
Christophe Leroy, Dan Carpenter, Ganesh Goudar, Geert Uytterhoeven,
Geoff Levand, Mahesh Salgaonkar, Markus Elfring, Michal Suchanek,
Nicholas Piggin, Stephen Boyd, Wen Xiong"

* tag 'powerpc-5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
selftests/powerpc: Always build the tm-poison test 64-bit
powerpc: Improve ppc_save_regs()
Revert "powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled"
powerpc/time: Replace <linux/clk-provider.h> by <linux/of_clk.h>
powerpc/pseries/ddw: Extend upper limit for huge DMA window for persistent memory
powerpc/perf: split callchain.c by bitness
powerpc/64: Make COMPAT user-selectable disabled on littleendian by default.
powerpc/64: make buildable without CONFIG_COMPAT
powerpc/perf: consolidate valid_user_sp -> invalid_user_sp
powerpc/perf: consolidate read_user_stack_32
powerpc: move common register copy functions from signal_32.c to signal.c
powerpc: Add back __ARCH_WANT_SYS_LLSEEK macro
powerpc/ps3: Set CONFIG_UEVENT_HELPER=y in ps3_defconfig
powerpc/ps3: Remove an unneeded NULL check
powerpc/ps3: Remove duplicate error message
powerpc/powernv: Re-enable imc trace-mode in kernel
powerpc/perf: Implement a global lock to avoid races between trace, core and thread imc events.
powerpc/pseries: Fix MCE handling on pseries
selftests/eeh: Skip ahci adapters
powerpc/64s: Fix doorbell wakeup msgclr optimisation

+766 -601
+3 -2
arch/powerpc/Kconfig
··· 266 266 default 180 267 267 268 268 config COMPAT 269 - bool 270 - default y if PPC64 269 + bool "Enable support for 32bit binaries" 270 + depends on PPC64 271 + default y if !CPU_LITTLE_ENDIAN 271 272 select COMPAT_BINFMT_ELF 272 273 select ARCH_WANT_OLD_COMPAT_IPC 273 274 select COMPAT_OLD_SIGACTION
+2
arch/powerpc/configs/ps3_defconfig
··· 60 60 CONFIG_CFG80211_WEXT=y 61 61 CONFIG_MAC80211=m 62 62 # CONFIG_MAC80211_RC_MINSTREL is not set 63 + CONFIG_UEVENT_HELPER=y 64 + CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 63 65 CONFIG_BLK_DEV_LOOP=y 64 66 CONFIG_BLK_DEV_RAM=y 65 67 CONFIG_BLK_DEV_RAM_SIZE=65535
+2 -2
arch/powerpc/include/asm/thread_info.h
··· 162 162 return (ti->local_flags & flags) != 0; 163 163 } 164 164 165 - #ifdef CONFIG_PPC64 165 + #ifdef CONFIG_COMPAT 166 166 #define is_32bit_task() (test_thread_flag(TIF_32BIT)) 167 167 #else 168 - #define is_32bit_task() (1) 168 + #define is_32bit_task() (IS_ENABLED(CONFIG_PPC32)) 169 169 #endif 170 170 171 171 #if defined(CONFIG_PPC64)
+1
arch/powerpc/include/asm/unistd.h
··· 31 31 #define __ARCH_WANT_SYS_SOCKETCALL 32 32 #define __ARCH_WANT_SYS_FADVISE64 33 33 #define __ARCH_WANT_SYS_GETPGRP 34 + #define __ARCH_WANT_SYS_LLSEEK 34 35 #define __ARCH_WANT_SYS_NICE 35 36 #define __ARCH_WANT_SYS_OLD_GETRLIMIT 36 37 #define __ARCH_WANT_SYS_OLD_UNAME
+3 -2
arch/powerpc/kernel/Makefile
··· 40 40 endif 41 41 42 42 obj-y := cputable.o syscalls.o \ 43 - irq.o align.o signal_32.o pmc.o vdso.o \ 43 + irq.o align.o signal_$(BITS).o pmc.o vdso.o \ 44 44 process.o systbl.o idle.o \ 45 45 signal.o sysfs.o cacheinfo.o time.o \ 46 46 prom.o traps.o setup-common.o \ 47 47 udbg.o misc.o io.o misc_$(BITS).o \ 48 48 of_platform.o prom_parse.o 49 49 obj-y += ptrace/ 50 - obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o signal_64.o \ 50 + obj-$(CONFIG_PPC64) += setup_64.o \ 51 51 paca.o nvram_64.o firmware.o note.o \ 52 52 syscall_64.o 53 + obj-$(CONFIG_COMPAT) += sys_ppc32.o signal_32.o 53 54 obj-$(CONFIG_VDSO32) += vdso32/ 54 55 obj-$(CONFIG_PPC_WATCHDOG) += watchdog.o 55 56 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
+2
arch/powerpc/kernel/entry_64.S
··· 52 52 SYS_CALL_TABLE: 53 53 .tc sys_call_table[TC],sys_call_table 54 54 55 + #ifdef CONFIG_COMPAT 55 56 COMPAT_SYS_CALL_TABLE: 56 57 .tc compat_sys_call_table[TC],compat_sys_call_table 58 + #endif 57 59 58 60 /* This value is used to mark exception frames on the stack. */ 59 61 exception_marker:
-19
arch/powerpc/kernel/exceptions-64s.S
··· 3121 3121 li r5,SIGSEGV 3122 3122 bl bad_page_fault 3123 3123 b interrupt_return 3124 - 3125 - /* 3126 - * When doorbell is triggered from system reset wakeup, the message is 3127 - * not cleared, so it would fire again when EE is enabled. 3128 - * 3129 - * When coming from local_irq_enable, there may be the same problem if 3130 - * we were hard disabled. 3131 - * 3132 - * Execute msgclr to clear pending exceptions before handling it. 3133 - */ 3134 - h_doorbell_common_msgclr: 3135 - LOAD_REG_IMMEDIATE(r3, PPC_DBELL_MSGTYPE << (63-36)) 3136 - PPC_MSGCLR(3) 3137 - b h_doorbell_common_virt 3138 - 3139 - doorbell_super_common_msgclr: 3140 - LOAD_REG_IMMEDIATE(r3, PPC_DBELL_MSGTYPE << (63-36)) 3141 - PPC_MSGCLRP(3) 3142 - b doorbell_super_common_virt
+13
arch/powerpc/kernel/irq.c
··· 527 527 return; 528 528 } 529 529 530 + if (reason == PACA_IRQ_DBELL) { 531 + /* 532 + * When doorbell triggers a system reset wakeup, the message 533 + * is not cleared, so if the doorbell interrupt is replayed 534 + * and the IPI handled, the doorbell interrupt would still 535 + * fire when EE is enabled. 536 + * 537 + * To avoid taking the superfluous doorbell interrupt, 538 + * execute a msgclr here before the interrupt is replayed. 539 + */ 540 + ppc_msgclr(PPC_DBELL_MSGTYPE); 541 + } 542 + 530 543 /* 531 544 * The 0 index (SRR1[42:45]=b0000) must always evaluate to 0, 532 545 * so this can be called unconditionally with the SRR1 wake
+5 -1
arch/powerpc/kernel/ppc_save_regs.S
··· 55 55 PPC_STL r29,29*SZL(r3) 56 56 PPC_STL r30,30*SZL(r3) 57 57 PPC_STL r31,31*SZL(r3) 58 + lbz r0,PACAIRQSOFTMASK(r13) 59 + PPC_STL r0,SOFTE-STACK_FRAME_OVERHEAD(r3) 58 60 #endif 59 61 /* go up one stack frame for SP */ 60 62 PPC_LL r4,0(r1) 61 63 PPC_STL r4,1*SZL(r3) 62 64 /* get caller's LR */ 63 65 PPC_LL r0,LRSAVE(r4) 64 - PPC_STL r0,_NIP-STACK_FRAME_OVERHEAD(r3) 65 66 PPC_STL r0,_LINK-STACK_FRAME_OVERHEAD(r3) 67 + mflr r0 68 + PPC_STL r0,_NIP-STACK_FRAME_OVERHEAD(r3) 66 69 mfmsr r0 67 70 PPC_STL r0,_MSR-STACK_FRAME_OVERHEAD(r3) 68 71 mfctr r0 ··· 76 73 PPC_STL r0,_CCR-STACK_FRAME_OVERHEAD(r3) 77 74 li r0,0 78 75 PPC_STL r0,_TRAP-STACK_FRAME_OVERHEAD(r3) 76 + PPC_STL r0,ORIG_GPR3-STACK_FRAME_OVERHEAD(r3) 79 77 blr
+1 -1
arch/powerpc/kernel/ptrace/Makefile
··· 6 6 CFLAGS_ptrace-view.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' 7 7 8 8 obj-y += ptrace.o ptrace-view.o 9 - obj-$(CONFIG_PPC64) += ptrace32.o 9 + obj-$(CONFIG_COMPAT) += ptrace32.o 10 10 obj-$(CONFIG_VSX) += ptrace-vsx.o 11 11 ifneq ($(CONFIG_VSX),y) 12 12 obj-y += ptrace-novsx.o
+142 -2
arch/powerpc/kernel/signal.c
··· 18 18 #include <linux/syscalls.h> 19 19 #include <asm/hw_breakpoint.h> 20 20 #include <linux/uaccess.h> 21 + #include <asm/switch_to.h> 21 22 #include <asm/unistd.h> 22 23 #include <asm/debug.h> 23 24 #include <asm/tm.h> 24 25 25 26 #include "signal.h" 27 + 28 + #ifdef CONFIG_VSX 29 + unsigned long copy_fpr_to_user(void __user *to, 30 + struct task_struct *task) 31 + { 32 + u64 buf[ELF_NFPREG]; 33 + int i; 34 + 35 + /* save FPR copy to local buffer then write to the thread_struct */ 36 + for (i = 0; i < (ELF_NFPREG - 1) ; i++) 37 + buf[i] = task->thread.TS_FPR(i); 38 + buf[i] = task->thread.fp_state.fpscr; 39 + return __copy_to_user(to, buf, ELF_NFPREG * sizeof(double)); 40 + } 41 + 42 + unsigned long copy_fpr_from_user(struct task_struct *task, 43 + void __user *from) 44 + { 45 + u64 buf[ELF_NFPREG]; 46 + int i; 47 + 48 + if (__copy_from_user(buf, from, ELF_NFPREG * sizeof(double))) 49 + return 1; 50 + for (i = 0; i < (ELF_NFPREG - 1) ; i++) 51 + task->thread.TS_FPR(i) = buf[i]; 52 + task->thread.fp_state.fpscr = buf[i]; 53 + 54 + return 0; 55 + } 56 + 57 + unsigned long copy_vsx_to_user(void __user *to, 58 + struct task_struct *task) 59 + { 60 + u64 buf[ELF_NVSRHALFREG]; 61 + int i; 62 + 63 + /* save FPR copy to local buffer then write to the thread_struct */ 64 + for (i = 0; i < ELF_NVSRHALFREG; i++) 65 + buf[i] = task->thread.fp_state.fpr[i][TS_VSRLOWOFFSET]; 66 + return __copy_to_user(to, buf, ELF_NVSRHALFREG * sizeof(double)); 67 + } 68 + 69 + unsigned long copy_vsx_from_user(struct task_struct *task, 70 + void __user *from) 71 + { 72 + u64 buf[ELF_NVSRHALFREG]; 73 + int i; 74 + 75 + if (__copy_from_user(buf, from, ELF_NVSRHALFREG * sizeof(double))) 76 + return 1; 77 + for (i = 0; i < ELF_NVSRHALFREG ; i++) 78 + task->thread.fp_state.fpr[i][TS_VSRLOWOFFSET] = buf[i]; 79 + return 0; 80 + } 81 + 82 + #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 83 + unsigned long copy_ckfpr_to_user(void __user *to, 84 + struct task_struct *task) 85 + { 86 + u64 buf[ELF_NFPREG]; 87 + int i; 88 + 89 + /* save FPR copy to local buffer then write to the thread_struct */ 90 + for (i = 0; i < (ELF_NFPREG - 1) ; i++) 91 + buf[i] = task->thread.TS_CKFPR(i); 92 + buf[i] = task->thread.ckfp_state.fpscr; 93 + return __copy_to_user(to, buf, ELF_NFPREG * sizeof(double)); 94 + } 95 + 96 + unsigned long copy_ckfpr_from_user(struct task_struct *task, 97 + void __user *from) 98 + { 99 + u64 buf[ELF_NFPREG]; 100 + int i; 101 + 102 + if (__copy_from_user(buf, from, ELF_NFPREG * sizeof(double))) 103 + return 1; 104 + for (i = 0; i < (ELF_NFPREG - 1) ; i++) 105 + task->thread.TS_CKFPR(i) = buf[i]; 106 + task->thread.ckfp_state.fpscr = buf[i]; 107 + 108 + return 0; 109 + } 110 + 111 + unsigned long copy_ckvsx_to_user(void __user *to, 112 + struct task_struct *task) 113 + { 114 + u64 buf[ELF_NVSRHALFREG]; 115 + int i; 116 + 117 + /* save FPR copy to local buffer then write to the thread_struct */ 118 + for (i = 0; i < ELF_NVSRHALFREG; i++) 119 + buf[i] = task->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET]; 120 + return __copy_to_user(to, buf, ELF_NVSRHALFREG * sizeof(double)); 121 + } 122 + 123 + unsigned long copy_ckvsx_from_user(struct task_struct *task, 124 + void __user *from) 125 + { 126 + u64 buf[ELF_NVSRHALFREG]; 127 + int i; 128 + 129 + if (__copy_from_user(buf, from, ELF_NVSRHALFREG * sizeof(double))) 130 + return 1; 131 + for (i = 0; i < ELF_NVSRHALFREG ; i++) 132 + task->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET] = buf[i]; 133 + return 0; 134 + } 135 + #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ 136 + #else 137 + inline unsigned long copy_fpr_to_user(void __user *to, 138 + struct task_struct *task) 139 + { 140 + return __copy_to_user(to, task->thread.fp_state.fpr, 141 + ELF_NFPREG * sizeof(double)); 142 + } 143 + 144 + inline unsigned long copy_fpr_from_user(struct task_struct *task, 145 + void __user *from) 146 + { 147 + return __copy_from_user(task->thread.fp_state.fpr, from, 148 + ELF_NFPREG * sizeof(double)); 149 + } 150 + 151 + #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 152 + inline unsigned long copy_ckfpr_to_user(void __user *to, 153 + struct task_struct *task) 154 + { 155 + return __copy_to_user(to, task->thread.ckfp_state.fpr, 156 + ELF_NFPREG * sizeof(double)); 157 + } 158 + 159 + inline unsigned long copy_ckfpr_from_user(struct task_struct *task, 160 + void __user *from) 161 + { 162 + return __copy_from_user(task->thread.ckfp_state.fpr, from, 163 + ELF_NFPREG * sizeof(double)); 164 + } 165 + #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ 166 + #endif 26 167 27 168 /* Log an error when sending an unhandled signal to a process. Controlled 28 169 * through debug.exception-trace sysctl. ··· 247 106 sigset_t *oldset = sigmask_to_save(); 248 107 struct ksignal ksig = { .sig = 0 }; 249 108 int ret; 250 - int is32 = is_32bit_task(); 251 109 252 110 BUG_ON(tsk != current); 253 111 ··· 276 136 277 137 rseq_signal_deliver(&ksig, tsk->thread.regs); 278 138 279 - if (is32) { 139 + if (is_32bit_task()) { 280 140 if (ksig.ka.sa.sa_flags & SA_SIGINFO) 281 141 ret = handle_rt_signal32(&ksig, oldset, tsk); 282 142 else
-140
arch/powerpc/kernel/signal_32.c
··· 235 235 int abigap[56]; 236 236 }; 237 237 238 - #ifdef CONFIG_VSX 239 - unsigned long copy_fpr_to_user(void __user *to, 240 - struct task_struct *task) 241 - { 242 - u64 buf[ELF_NFPREG]; 243 - int i; 244 - 245 - /* save FPR copy to local buffer then write to the thread_struct */ 246 - for (i = 0; i < (ELF_NFPREG - 1) ; i++) 247 - buf[i] = task->thread.TS_FPR(i); 248 - buf[i] = task->thread.fp_state.fpscr; 249 - return __copy_to_user(to, buf, ELF_NFPREG * sizeof(double)); 250 - } 251 - 252 - unsigned long copy_fpr_from_user(struct task_struct *task, 253 - void __user *from) 254 - { 255 - u64 buf[ELF_NFPREG]; 256 - int i; 257 - 258 - if (__copy_from_user(buf, from, ELF_NFPREG * sizeof(double))) 259 - return 1; 260 - for (i = 0; i < (ELF_NFPREG - 1) ; i++) 261 - task->thread.TS_FPR(i) = buf[i]; 262 - task->thread.fp_state.fpscr = buf[i]; 263 - 264 - return 0; 265 - } 266 - 267 - unsigned long copy_vsx_to_user(void __user *to, 268 - struct task_struct *task) 269 - { 270 - u64 buf[ELF_NVSRHALFREG]; 271 - int i; 272 - 273 - /* save FPR copy to local buffer then write to the thread_struct */ 274 - for (i = 0; i < ELF_NVSRHALFREG; i++) 275 - buf[i] = task->thread.fp_state.fpr[i][TS_VSRLOWOFFSET]; 276 - return __copy_to_user(to, buf, ELF_NVSRHALFREG * sizeof(double)); 277 - } 278 - 279 - unsigned long copy_vsx_from_user(struct task_struct *task, 280 - void __user *from) 281 - { 282 - u64 buf[ELF_NVSRHALFREG]; 283 - int i; 284 - 285 - if (__copy_from_user(buf, from, ELF_NVSRHALFREG * sizeof(double))) 286 - return 1; 287 - for (i = 0; i < ELF_NVSRHALFREG ; i++) 288 - task->thread.fp_state.fpr[i][TS_VSRLOWOFFSET] = buf[i]; 289 - return 0; 290 - } 291 - 292 - #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 293 - unsigned long copy_ckfpr_to_user(void __user *to, 294 - struct task_struct *task) 295 - { 296 - u64 buf[ELF_NFPREG]; 297 - int i; 298 - 299 - /* save FPR copy to local buffer then write to the thread_struct */ 300 - for (i = 0; i < (ELF_NFPREG - 1) ; i++) 301 - buf[i] = task->thread.TS_CKFPR(i); 302 - buf[i] = task->thread.ckfp_state.fpscr; 303 - return __copy_to_user(to, buf, ELF_NFPREG * sizeof(double)); 304 - } 305 - 306 - unsigned long copy_ckfpr_from_user(struct task_struct *task, 307 - void __user *from) 308 - { 309 - u64 buf[ELF_NFPREG]; 310 - int i; 311 - 312 - if (__copy_from_user(buf, from, ELF_NFPREG * sizeof(double))) 313 - return 1; 314 - for (i = 0; i < (ELF_NFPREG - 1) ; i++) 315 - task->thread.TS_CKFPR(i) = buf[i]; 316 - task->thread.ckfp_state.fpscr = buf[i]; 317 - 318 - return 0; 319 - } 320 - 321 - unsigned long copy_ckvsx_to_user(void __user *to, 322 - struct task_struct *task) 323 - { 324 - u64 buf[ELF_NVSRHALFREG]; 325 - int i; 326 - 327 - /* save FPR copy to local buffer then write to the thread_struct */ 328 - for (i = 0; i < ELF_NVSRHALFREG; i++) 329 - buf[i] = task->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET]; 330 - return __copy_to_user(to, buf, ELF_NVSRHALFREG * sizeof(double)); 331 - } 332 - 333 - unsigned long copy_ckvsx_from_user(struct task_struct *task, 334 - void __user *from) 335 - { 336 - u64 buf[ELF_NVSRHALFREG]; 337 - int i; 338 - 339 - if (__copy_from_user(buf, from, ELF_NVSRHALFREG * sizeof(double))) 340 - return 1; 341 - for (i = 0; i < ELF_NVSRHALFREG ; i++) 342 - task->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET] = buf[i]; 343 - return 0; 344 - } 345 - #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ 346 - #else 347 - inline unsigned long copy_fpr_to_user(void __user *to, 348 - struct task_struct *task) 349 - { 350 - return __copy_to_user(to, task->thread.fp_state.fpr, 351 - ELF_NFPREG * sizeof(double)); 352 - } 353 - 354 - inline unsigned long copy_fpr_from_user(struct task_struct *task, 355 - void __user *from) 356 - { 357 - return __copy_from_user(task->thread.fp_state.fpr, from, 358 - ELF_NFPREG * sizeof(double)); 359 - } 360 - 361 - #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 362 - inline unsigned long copy_ckfpr_to_user(void __user *to, 363 - struct task_struct *task) 364 - { 365 - return __copy_to_user(to, task->thread.ckfp_state.fpr, 366 - ELF_NFPREG * sizeof(double)); 367 - } 368 - 369 - inline unsigned long copy_ckfpr_from_user(struct task_struct *task, 370 - void __user *from) 371 - { 372 - return __copy_from_user(task->thread.ckfp_state.fpr, from, 373 - ELF_NFPREG * sizeof(double)); 374 - } 375 - #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ 376 - #endif 377 - 378 238 /* 379 239 * Save the current user registers on the user stack. 380 240 * We only save the altivec/spe registers if the process has used
+2 -4
arch/powerpc/kernel/syscall_64.c
··· 22 22 long r6, long r7, long r8, 23 23 unsigned long r0, struct pt_regs *regs) 24 24 { 25 - unsigned long ti_flags; 26 25 syscall_fn f; 27 26 28 27 if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG)) ··· 59 60 60 61 local_irq_enable(); 61 62 62 - ti_flags = current_thread_info()->flags; 63 - if (unlikely(ti_flags & _TIF_SYSCALL_DOTRACE)) { 63 + if (unlikely(current_thread_info()->flags & _TIF_SYSCALL_DOTRACE)) { 64 64 /* 65 65 * We use the return value of do_syscall_trace_enter() as the 66 66 * syscall number. If the syscall was rejected for any reason ··· 84 86 /* May be faster to do array_index_nospec? */ 85 87 barrier_nospec(); 86 88 87 - if (unlikely(ti_flags & _TIF_32BIT)) { 89 + if (unlikely(is_32bit_task())) { 88 90 f = (void *)compat_sys_call_table[r0]; 89 91 90 92 r3 &= 0x00000000ffffffffULL;
+14 -34
arch/powerpc/kernel/time.c
··· 50 50 #include <linux/irq.h> 51 51 #include <linux/delay.h> 52 52 #include <linux/irq_work.h> 53 - #include <linux/clk-provider.h> 53 + #include <linux/of_clk.h> 54 54 #include <linux/suspend.h> 55 55 #include <linux/sched/cputime.h> 56 56 #include <linux/processor.h> ··· 522 522 "i" (offsetof(struct paca_struct, irq_work_pending))); 523 523 } 524 524 525 - void arch_irq_work_raise(void) 526 - { 527 - preempt_disable(); 528 - set_irq_work_pending_flag(); 529 - /* 530 - * Non-nmi code running with interrupts disabled will replay 531 - * irq_happened before it re-enables interrupts, so setthe 532 - * decrementer there instead of causing a hardware exception 533 - * which would immediately hit the masked interrupt handler 534 - * and have the net effect of setting the decrementer in 535 - * irq_happened. 536 - * 537 - * NMI interrupts can not check this when they return, so the 538 - * decrementer hardware exception is raised, which will fire 539 - * when interrupts are next enabled. 540 - * 541 - * BookE does not support this yet, it must audit all NMI 542 - * interrupt handlers to ensure they call nmi_enter() so this 543 - * check would be correct. 544 - */ 545 - if (IS_ENABLED(CONFIG_BOOKE) || !irqs_disabled() || in_nmi()) { 546 - set_dec(1); 547 - } else { 548 - hard_irq_disable(); 549 - local_paca->irq_happened |= PACA_IRQ_DEC; 550 - } 551 - preempt_enable(); 552 - } 553 - 554 525 #else /* 32-bit */ 555 526 556 527 DEFINE_PER_CPU(u8, irq_work_pending); ··· 530 559 #define test_irq_work_pending() __this_cpu_read(irq_work_pending) 531 560 #define clear_irq_work_pending() __this_cpu_write(irq_work_pending, 0) 532 561 562 + #endif /* 32 vs 64 bit */ 563 + 533 564 void arch_irq_work_raise(void) 534 565 { 566 + /* 567 + * 64-bit code that uses irq soft-mask can just cause an immediate 568 + * interrupt here that gets soft masked, if this is called under 569 + * local_irq_disable(). It might be possible to prevent that happening 570 + * by noticing interrupts are disabled and setting decrementer pending 571 + * to be replayed when irqs are enabled. The problem there is that 572 + * tracing can call irq_work_raise, including in code that does low 573 + * level manipulations of irq soft-mask state (e.g., trace_hardirqs_on) 574 + * which could get tangled up if we're messing with the same state 575 + * here. 576 + */ 535 577 preempt_disable(); 536 578 set_irq_work_pending_flag(); 537 579 set_dec(1); 538 580 preempt_enable(); 539 581 } 540 - 541 - #endif /* 32 vs 64 bit */ 542 582 543 583 #else /* CONFIG_IRQ_WORK */ 544 584 ··· 1131 1149 init_decrementer_clockevent(); 1132 1150 tick_setup_hrtimer_broadcast(); 1133 1151 1134 - #ifdef CONFIG_COMMON_CLK 1135 1152 of_clk_init(NULL); 1136 - #endif 1137 1153 } 1138 1154 1139 1155 /*
+2 -1
arch/powerpc/kernel/vdso.c
··· 651 651 if (sys_call_table[i] != sys_ni_syscall) 652 652 vdso_data->syscall_map_64[i >> 5] |= 653 653 0x80000000UL >> (i & 0x1f); 654 - if (compat_sys_call_table[i] != sys_ni_syscall) 654 + if (IS_ENABLED(CONFIG_COMPAT) && 655 + compat_sys_call_table[i] != sys_ni_syscall) 655 656 vdso_data->syscall_map_32[i >> 5] |= 656 657 0x80000000UL >> (i & 0x1f); 657 658 #else /* CONFIG_PPC64 */
+4 -1
arch/powerpc/perf/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - obj-$(CONFIG_PERF_EVENTS) += callchain.o perf_regs.o 3 + obj-$(CONFIG_PERF_EVENTS) += callchain.o callchain_$(BITS).o perf_regs.o 4 + ifdef CONFIG_COMPAT 5 + obj-$(CONFIG_PERF_EVENTS) += callchain_32.o 6 + endif 4 7 5 8 obj-$(CONFIG_PPC_PERF_CTRS) += core-book3s.o bhrb.o 6 9 obj64-$(CONFIG_PPC_PERF_CTRS) += ppc970-pmu.o power5-pmu.o \
+1 -355
arch/powerpc/perf/callchain.c
··· 15 15 #include <asm/sigcontext.h> 16 16 #include <asm/ucontext.h> 17 17 #include <asm/vdso.h> 18 - #ifdef CONFIG_PPC64 19 - #include "../kernel/ppc32.h" 20 - #endif 21 18 #include <asm/pte-walk.h> 22 19 20 + #include "callchain.h" 23 21 24 22 /* 25 23 * Is sp valid as the address of the next kernel stack frame after prev_sp? ··· 96 98 perf_callchain_store(entry, next_ip); 97 99 if (!valid_next_sp(next_sp, sp)) 98 100 return; 99 - sp = next_sp; 100 - } 101 - } 102 - 103 - #ifdef CONFIG_PPC64 104 - /* 105 - * On 64-bit we don't want to invoke hash_page on user addresses from 106 - * interrupt context, so if the access faults, we read the page tables 107 - * to find which page (if any) is mapped and access it directly. 108 - */ 109 - static int read_user_stack_slow(void __user *ptr, void *buf, int nb) 110 - { 111 - int ret = -EFAULT; 112 - pgd_t *pgdir; 113 - pte_t *ptep, pte; 114 - unsigned shift; 115 - unsigned long addr = (unsigned long) ptr; 116 - unsigned long offset; 117 - unsigned long pfn, flags; 118 - void *kaddr; 119 - 120 - pgdir = current->mm->pgd; 121 - if (!pgdir) 122 - return -EFAULT; 123 - 124 - local_irq_save(flags); 125 - ptep = find_current_mm_pte(pgdir, addr, NULL, &shift); 126 - if (!ptep) 127 - goto err_out; 128 - if (!shift) 129 - shift = PAGE_SHIFT; 130 - 131 - /* align address to page boundary */ 132 - offset = addr & ((1UL << shift) - 1); 133 - 134 - pte = READ_ONCE(*ptep); 135 - if (!pte_present(pte) || !pte_user(pte)) 136 - goto err_out; 137 - pfn = pte_pfn(pte); 138 - if (!page_is_ram(pfn)) 139 - goto err_out; 140 - 141 - /* no highmem to worry about here */ 142 - kaddr = pfn_to_kaddr(pfn); 143 - memcpy(buf, kaddr + offset, nb); 144 - ret = 0; 145 - err_out: 146 - local_irq_restore(flags); 147 - return ret; 148 - } 149 - 150 - static int read_user_stack_64(unsigned long __user *ptr, unsigned long *ret) 151 - { 152 - if ((unsigned long)ptr > TASK_SIZE - sizeof(unsigned long) || 153 - ((unsigned long)ptr & 7)) 154 - return -EFAULT; 155 - 156 - if (!probe_user_read(ret, ptr, sizeof(*ret))) 157 - return 0; 158 - 159 - return read_user_stack_slow(ptr, ret, 8); 160 - } 161 - 162 - static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret) 163 - { 164 - if ((unsigned long)ptr > TASK_SIZE - sizeof(unsigned int) || 165 - ((unsigned long)ptr & 3)) 166 - return -EFAULT; 167 - 168 - if (!probe_user_read(ret, ptr, sizeof(*ret))) 169 - return 0; 170 - 171 - return read_user_stack_slow(ptr, ret, 4); 172 - } 173 - 174 - static inline int valid_user_sp(unsigned long sp, int is_64) 175 - { 176 - if (!sp || (sp & 7) || sp > (is_64 ? TASK_SIZE : 0x100000000UL) - 32) 177 - return 0; 178 - return 1; 179 - } 180 - 181 - /* 182 - * 64-bit user processes use the same stack frame for RT and non-RT signals. 183 - */ 184 - struct signal_frame_64 { 185 - char dummy[__SIGNAL_FRAMESIZE]; 186 - struct ucontext uc; 187 - unsigned long unused[2]; 188 - unsigned int tramp[6]; 189 - struct siginfo *pinfo; 190 - void *puc; 191 - struct siginfo info; 192 - char abigap[288]; 193 - }; 194 - 195 - static int is_sigreturn_64_address(unsigned long nip, unsigned long fp) 196 - { 197 - if (nip == fp + offsetof(struct signal_frame_64, tramp)) 198 - return 1; 199 - if (vdso64_rt_sigtramp && current->mm->context.vdso_base && 200 - nip == current->mm->context.vdso_base + vdso64_rt_sigtramp) 201 - return 1; 202 - return 0; 203 - } 204 - 205 - /* 206 - * Do some sanity checking on the signal frame pointed to by sp. 207 - * We check the pinfo and puc pointers in the frame. 208 - */ 209 - static int sane_signal_64_frame(unsigned long sp) 210 - { 211 - struct signal_frame_64 __user *sf; 212 - unsigned long pinfo, puc; 213 - 214 - sf = (struct signal_frame_64 __user *) sp; 215 - if (read_user_stack_64((unsigned long __user *) &sf->pinfo, &pinfo) || 216 - read_user_stack_64((unsigned long __user *) &sf->puc, &puc)) 217 - return 0; 218 - return pinfo == (unsigned long) &sf->info && 219 - puc == (unsigned long) &sf->uc; 220 - } 221 - 222 - static void perf_callchain_user_64(struct perf_callchain_entry_ctx *entry, 223 - struct pt_regs *regs) 224 - { 225 - unsigned long sp, next_sp; 226 - unsigned long next_ip; 227 - unsigned long lr; 228 - long level = 0; 229 - struct signal_frame_64 __user *sigframe; 230 - unsigned long __user *fp, *uregs; 231 - 232 - next_ip = perf_instruction_pointer(regs); 233 - lr = regs->link; 234 - sp = regs->gpr[1]; 235 - perf_callchain_store(entry, next_ip); 236 - 237 - while (entry->nr < entry->max_stack) { 238 - fp = (unsigned long __user *) sp; 239 - if (!valid_user_sp(sp, 1) || read_user_stack_64(fp, &next_sp)) 240 - return; 241 - if (level > 0 && read_user_stack_64(&fp[2], &next_ip)) 242 - return; 243 - 244 - /* 245 - * Note: the next_sp - sp >= signal frame size check 246 - * is true when next_sp < sp, which can happen when 247 - * transitioning from an alternate signal stack to the 248 - * normal stack. 249 - */ 250 - if (next_sp - sp >= sizeof(struct signal_frame_64) && 251 - (is_sigreturn_64_address(next_ip, sp) || 252 - (level <= 1 && is_sigreturn_64_address(lr, sp))) && 253 - sane_signal_64_frame(sp)) { 254 - /* 255 - * This looks like an signal frame 256 - */ 257 - sigframe = (struct signal_frame_64 __user *) sp; 258 - uregs = sigframe->uc.uc_mcontext.gp_regs; 259 - if (read_user_stack_64(&uregs[PT_NIP], &next_ip) || 260 - read_user_stack_64(&uregs[PT_LNK], &lr) || 261 - read_user_stack_64(&uregs[PT_R1], &sp)) 262 - return; 263 - level = 0; 264 - perf_callchain_store_context(entry, PERF_CONTEXT_USER); 265 - perf_callchain_store(entry, next_ip); 266 - continue; 267 - } 268 - 269 - if (level == 0) 270 - next_ip = lr; 271 - perf_callchain_store(entry, next_ip); 272 - ++level; 273 - sp = next_sp; 274 - } 275 - } 276 - 277 - #else /* CONFIG_PPC64 */ 278 - /* 279 - * On 32-bit we just access the address and let hash_page create a 280 - * HPTE if necessary, so there is no need to fall back to reading 281 - * the page tables. Since this is called at interrupt level, 282 - * do_page_fault() won't treat a DSI as a page fault. 283 - */ 284 - static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret) 285 - { 286 - if ((unsigned long)ptr > TASK_SIZE - sizeof(unsigned int) || 287 - ((unsigned long)ptr & 3)) 288 - return -EFAULT; 289 - 290 - return probe_user_read(ret, ptr, sizeof(*ret)); 291 - } 292 - 293 - static inline void perf_callchain_user_64(struct perf_callchain_entry_ctx *entry, 294 - struct pt_regs *regs) 295 - { 296 - } 297 - 298 - static inline int valid_user_sp(unsigned long sp, int is_64) 299 - { 300 - if (!sp || (sp & 7) || sp > TASK_SIZE - 32) 301 - return 0; 302 - return 1; 303 - } 304 - 305 - #define __SIGNAL_FRAMESIZE32 __SIGNAL_FRAMESIZE 306 - #define sigcontext32 sigcontext 307 - #define mcontext32 mcontext 308 - #define ucontext32 ucontext 309 - #define compat_siginfo_t struct siginfo 310 - 311 - #endif /* CONFIG_PPC64 */ 312 - 313 - /* 314 - * Layout for non-RT signal frames 315 - */ 316 - struct signal_frame_32 { 317 - char dummy[__SIGNAL_FRAMESIZE32]; 318 - struct sigcontext32 sctx; 319 - struct mcontext32 mctx; 320 - int abigap[56]; 321 - }; 322 - 323 - /* 324 - * Layout for RT signal frames 325 - */ 326 - struct rt_signal_frame_32 { 327 - char dummy[__SIGNAL_FRAMESIZE32 + 16]; 328 - compat_siginfo_t info; 329 - struct ucontext32 uc; 330 - int abigap[56]; 331 - }; 332 - 333 - static int is_sigreturn_32_address(unsigned int nip, unsigned int fp) 334 - { 335 - if (nip == fp + offsetof(struct signal_frame_32, mctx.mc_pad)) 336 - return 1; 337 - if (vdso32_sigtramp && current->mm->context.vdso_base && 338 - nip == current->mm->context.vdso_base + vdso32_sigtramp) 339 - return 1; 340 - return 0; 341 - } 342 - 343 - static int is_rt_sigreturn_32_address(unsigned int nip, unsigned int fp) 344 - { 345 - if (nip == fp + offsetof(struct rt_signal_frame_32, 346 - uc.uc_mcontext.mc_pad)) 347 - return 1; 348 - if (vdso32_rt_sigtramp && current->mm->context.vdso_base && 349 - nip == current->mm->context.vdso_base + vdso32_rt_sigtramp) 350 - return 1; 351 - return 0; 352 - } 353 - 354 - static int sane_signal_32_frame(unsigned int sp) 355 - { 356 - struct signal_frame_32 __user *sf; 357 - unsigned int regs; 358 - 359 - sf = (struct signal_frame_32 __user *) (unsigned long) sp; 360 - if (read_user_stack_32((unsigned int __user *) &sf->sctx.regs, &regs)) 361 - return 0; 362 - return regs == (unsigned long) &sf->mctx; 363 - } 364 - 365 - static int sane_rt_signal_32_frame(unsigned int sp) 366 - { 367 - struct rt_signal_frame_32 __user *sf; 368 - unsigned int regs; 369 - 370 - sf = (struct rt_signal_frame_32 __user *) (unsigned long) sp; 371 - if (read_user_stack_32((unsigned int __user *) &sf->uc.uc_regs, &regs)) 372 - return 0; 373 - return regs == (unsigned long) &sf->uc.uc_mcontext; 374 - } 375 - 376 - static unsigned int __user *signal_frame_32_regs(unsigned int sp, 377 - unsigned int next_sp, unsigned int next_ip) 378 - { 379 - struct mcontext32 __user *mctx = NULL; 380 - struct signal_frame_32 __user *sf; 381 - struct rt_signal_frame_32 __user *rt_sf; 382 - 383 - /* 384 - * Note: the next_sp - sp >= signal frame size check 385 - * is true when next_sp < sp, for example, when 386 - * transitioning from an alternate signal stack to the 387 - * normal stack. 388 - */ 389 - if (next_sp - sp >= sizeof(struct signal_frame_32) && 390 - is_sigreturn_32_address(next_ip, sp) && 391 - sane_signal_32_frame(sp)) { 392 - sf = (struct signal_frame_32 __user *) (unsigned long) sp; 393 - mctx = &sf->mctx; 394 - } 395 - 396 - if (!mctx && next_sp - sp >= sizeof(struct rt_signal_frame_32) && 397 - is_rt_sigreturn_32_address(next_ip, sp) && 398 - sane_rt_signal_32_frame(sp)) { 399 - rt_sf = (struct rt_signal_frame_32 __user *) (unsigned long) sp; 400 - mctx = &rt_sf->uc.uc_mcontext; 401 - } 402 - 403 - if (!mctx) 404 - return NULL; 405 - return mctx->mc_gregs; 406 - } 407 - 408 - static void perf_callchain_user_32(struct perf_callchain_entry_ctx *entry, 409 - struct pt_regs *regs) 410 - { 411 - unsigned int sp, next_sp; 412 - unsigned int next_ip; 413 - unsigned int lr; 414 - long level = 0; 415 - unsigned int __user *fp, *uregs; 416 - 417 - next_ip = perf_instruction_pointer(regs); 418 - lr = regs->link; 419 - sp = regs->gpr[1]; 420 - perf_callchain_store(entry, next_ip); 421 - 422 - while (entry->nr < entry->max_stack) { 423 - fp = (unsigned int __user *) (unsigned long) sp; 424 - if (!valid_user_sp(sp, 0) || read_user_stack_32(fp, &next_sp)) 425 - return; 426 - if (level > 0 && read_user_stack_32(&fp[1], &next_ip)) 427 - return; 428 - 429 - uregs = signal_frame_32_regs(sp, next_sp, next_ip); 430 - if (!uregs && level <= 1) 431 - uregs = signal_frame_32_regs(sp, next_sp, lr); 432 - if (uregs) { 433 - /* 434 - * This looks like an signal frame, so restart 435 - * the stack trace with the values in it. 436 - */ 437 - if (read_user_stack_32(&uregs[PT_NIP], &next_ip) || 438 - read_user_stack_32(&uregs[PT_LNK], &lr) || 439 - read_user_stack_32(&uregs[PT_R1], &sp)) 440 - return; 441 - level = 0; 442 - perf_callchain_store_context(entry, PERF_CONTEXT_USER); 443 - perf_callchain_store(entry, next_ip); 444 - continue; 445 - } 446 - 447 - if (level == 0) 448 - next_ip = lr; 449 - perf_callchain_store(entry, next_ip); 450 - ++level; 451 101 sp = next_sp; 452 102 } 453 103 }
+19
arch/powerpc/perf/callchain.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + #ifndef _POWERPC_PERF_CALLCHAIN_H 3 + #define _POWERPC_PERF_CALLCHAIN_H 4 + 5 + int read_user_stack_slow(void __user *ptr, void *buf, int nb); 6 + void perf_callchain_user_64(struct perf_callchain_entry_ctx *entry, 7 + struct pt_regs *regs); 8 + void perf_callchain_user_32(struct perf_callchain_entry_ctx *entry, 9 + struct pt_regs *regs); 10 + 11 + static inline bool invalid_user_sp(unsigned long sp) 12 + { 13 + unsigned long mask = is_32bit_task() ? 3 : 7; 14 + unsigned long top = STACK_TOP - (is_32bit_task() ? 16 : 32); 15 + 16 + return (!sp || (sp & mask) || (sp > top)); 17 + } 18 + 19 + #endif /* _POWERPC_PERF_CALLCHAIN_H */
+196
arch/powerpc/perf/callchain_32.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * Performance counter callchain support - powerpc architecture code 4 + * 5 + * Copyright © 2009 Paul Mackerras, IBM Corporation. 6 + */ 7 + #include <linux/kernel.h> 8 + #include <linux/sched.h> 9 + #include <linux/perf_event.h> 10 + #include <linux/percpu.h> 11 + #include <linux/uaccess.h> 12 + #include <linux/mm.h> 13 + #include <asm/ptrace.h> 14 + #include <asm/pgtable.h> 15 + #include <asm/sigcontext.h> 16 + #include <asm/ucontext.h> 17 + #include <asm/vdso.h> 18 + #include <asm/pte-walk.h> 19 + 20 + #include "callchain.h" 21 + 22 + #ifdef CONFIG_PPC64 23 + #include "../kernel/ppc32.h" 24 + #else /* CONFIG_PPC64 */ 25 + 26 + #define __SIGNAL_FRAMESIZE32 __SIGNAL_FRAMESIZE 27 + #define sigcontext32 sigcontext 28 + #define mcontext32 mcontext 29 + #define ucontext32 ucontext 30 + #define compat_siginfo_t struct siginfo 31 + 32 + #endif /* CONFIG_PPC64 */ 33 + 34 + /* 35 + * On 32-bit we just access the address and let hash_page create a 36 + * HPTE if necessary, so there is no need to fall back to reading 37 + * the page tables. Since this is called at interrupt level, 38 + * do_page_fault() won't treat a DSI as a page fault. 39 + */ 40 + static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret) 41 + { 42 + int rc; 43 + 44 + if ((unsigned long)ptr > TASK_SIZE - sizeof(unsigned int) || 45 + ((unsigned long)ptr & 3)) 46 + return -EFAULT; 47 + 48 + rc = probe_user_read(ret, ptr, sizeof(*ret)); 49 + 50 + if (IS_ENABLED(CONFIG_PPC64) && rc) 51 + return read_user_stack_slow(ptr, ret, 4); 52 + 53 + return rc; 54 + } 55 + 56 + /* 57 + * Layout for non-RT signal frames 58 + */ 59 + struct signal_frame_32 { 60 + char dummy[__SIGNAL_FRAMESIZE32]; 61 + struct sigcontext32 sctx; 62 + struct mcontext32 mctx; 63 + int abigap[56]; 64 + }; 65 + 66 + /* 67 + * Layout for RT signal frames 68 + */ 69 + struct rt_signal_frame_32 { 70 + char dummy[__SIGNAL_FRAMESIZE32 + 16]; 71 + compat_siginfo_t info; 72 + struct ucontext32 uc; 73 + int abigap[56]; 74 + }; 75 + 76 + static int is_sigreturn_32_address(unsigned int nip, unsigned int fp) 77 + { 78 + if (nip == fp + offsetof(struct signal_frame_32, mctx.mc_pad)) 79 + return 1; 80 + if (vdso32_sigtramp && current->mm->context.vdso_base && 81 + nip == current->mm->context.vdso_base + vdso32_sigtramp) 82 + return 1; 83 + return 0; 84 + } 85 + 86 + static int is_rt_sigreturn_32_address(unsigned int nip, unsigned int fp) 87 + { 88 + if (nip == fp + offsetof(struct rt_signal_frame_32, 89 + uc.uc_mcontext.mc_pad)) 90 + return 1; 91 + if (vdso32_rt_sigtramp && current->mm->context.vdso_base && 92 + nip == current->mm->context.vdso_base + vdso32_rt_sigtramp) 93 + return 1; 94 + return 0; 95 + } 96 + 97 + static int sane_signal_32_frame(unsigned int sp) 98 + { 99 + struct signal_frame_32 __user *sf; 100 + unsigned int regs; 101 + 102 + sf = (struct signal_frame_32 __user *) (unsigned long) sp; 103 + if (read_user_stack_32((unsigned int __user *) &sf->sctx.regs, &regs)) 104 + return 0; 105 + return regs == (unsigned long) &sf->mctx; 106 + } 107 + 108 + static int sane_rt_signal_32_frame(unsigned int sp) 109 + { 110 + struct rt_signal_frame_32 __user *sf; 111 + unsigned int regs; 112 + 113 + sf = (struct rt_signal_frame_32 __user *) (unsigned long) sp; 114 + if (read_user_stack_32((unsigned int __user *) &sf->uc.uc_regs, &regs)) 115 + return 0; 116 + return regs == (unsigned long) &sf->uc.uc_mcontext; 117 + } 118 + 119 + static unsigned int __user *signal_frame_32_regs(unsigned int sp, 120 + unsigned int next_sp, unsigned int next_ip) 121 + { 122 + struct mcontext32 __user *mctx = NULL; 123 + struct signal_frame_32 __user *sf; 124 + struct rt_signal_frame_32 __user *rt_sf; 125 + 126 + /* 127 + * Note: the next_sp - sp >= signal frame size check 128 + * is true when next_sp < sp, for example, when 129 + * transitioning from an alternate signal stack to the 130 + * normal stack. 131 + */ 132 + if (next_sp - sp >= sizeof(struct signal_frame_32) && 133 + is_sigreturn_32_address(next_ip, sp) && 134 + sane_signal_32_frame(sp)) { 135 + sf = (struct signal_frame_32 __user *) (unsigned long) sp; 136 + mctx = &sf->mctx; 137 + } 138 + 139 + if (!mctx && next_sp - sp >= sizeof(struct rt_signal_frame_32) && 140 + is_rt_sigreturn_32_address(next_ip, sp) && 141 + sane_rt_signal_32_frame(sp)) { 142 + rt_sf = (struct rt_signal_frame_32 __user *) (unsigned long) sp; 143 + mctx = &rt_sf->uc.uc_mcontext; 144 + } 145 + 146 + if (!mctx) 147 + return NULL; 148 + return mctx->mc_gregs; 149 + } 150 + 151 + void perf_callchain_user_32(struct perf_callchain_entry_ctx *entry, 152 + struct pt_regs *regs) 153 + { 154 + unsigned int sp, next_sp; 155 + unsigned int next_ip; 156 + unsigned int lr; 157 + long level = 0; 158 + unsigned int __user *fp, *uregs; 159 + 160 + next_ip = perf_instruction_pointer(regs); 161 + lr = regs->link; 162 + sp = regs->gpr[1]; 163 + perf_callchain_store(entry, next_ip); 164 + 165 + while (entry->nr < entry->max_stack) { 166 + fp = (unsigned int __user *) (unsigned long) sp; 167 + if (invalid_user_sp(sp) || read_user_stack_32(fp, &next_sp)) 168 + return; 169 + if (level > 0 && read_user_stack_32(&fp[1], &next_ip)) 170 + return; 171 + 172 + uregs = signal_frame_32_regs(sp, next_sp, next_ip); 173 + if (!uregs && level <= 1) 174 + uregs = signal_frame_32_regs(sp, next_sp, lr); 175 + if (uregs) { 176 + /* 177 + * This looks like an signal frame, so restart 178 + * the stack trace with the values in it. 179 + */ 180 + if (read_user_stack_32(&uregs[PT_NIP], &next_ip) || 181 + read_user_stack_32(&uregs[PT_LNK], &lr) || 182 + read_user_stack_32(&uregs[PT_R1], &sp)) 183 + return; 184 + level = 0; 185 + perf_callchain_store_context(entry, PERF_CONTEXT_USER); 186 + perf_callchain_store(entry, next_ip); 187 + continue; 188 + } 189 + 190 + if (level == 0) 191 + next_ip = lr; 192 + perf_callchain_store(entry, next_ip); 193 + ++level; 194 + sp = next_sp; 195 + } 196 + }
+174
arch/powerpc/perf/callchain_64.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * Performance counter callchain support - powerpc architecture code 4 + * 5 + * Copyright © 2009 Paul Mackerras, IBM Corporation. 6 + */ 7 + #include <linux/kernel.h> 8 + #include <linux/sched.h> 9 + #include <linux/perf_event.h> 10 + #include <linux/percpu.h> 11 + #include <linux/uaccess.h> 12 + #include <linux/mm.h> 13 + #include <asm/ptrace.h> 14 + #include <asm/pgtable.h> 15 + #include <asm/sigcontext.h> 16 + #include <asm/ucontext.h> 17 + #include <asm/vdso.h> 18 + #include <asm/pte-walk.h> 19 + 20 + #include "callchain.h" 21 + 22 + /* 23 + * On 64-bit we don't want to invoke hash_page on user addresses from 24 + * interrupt context, so if the access faults, we read the page tables 25 + * to find which page (if any) is mapped and access it directly. 26 + */ 27 + int read_user_stack_slow(void __user *ptr, void *buf, int nb) 28 + { 29 + int ret = -EFAULT; 30 + pgd_t *pgdir; 31 + pte_t *ptep, pte; 32 + unsigned int shift; 33 + unsigned long addr = (unsigned long) ptr; 34 + unsigned long offset; 35 + unsigned long pfn, flags; 36 + void *kaddr; 37 + 38 + pgdir = current->mm->pgd; 39 + if (!pgdir) 40 + return -EFAULT; 41 + 42 + local_irq_save(flags); 43 + ptep = find_current_mm_pte(pgdir, addr, NULL, &shift); 44 + if (!ptep) 45 + goto err_out; 46 + if (!shift) 47 + shift = PAGE_SHIFT; 48 + 49 + /* align address to page boundary */ 50 + offset = addr & ((1UL << shift) - 1); 51 + 52 + pte = READ_ONCE(*ptep); 53 + if (!pte_present(pte) || !pte_user(pte)) 54 + goto err_out; 55 + pfn = pte_pfn(pte); 56 + if (!page_is_ram(pfn)) 57 + goto err_out; 58 + 59 + /* no highmem to worry about here */ 60 + kaddr = pfn_to_kaddr(pfn); 61 + memcpy(buf, kaddr + offset, nb); 62 + ret = 0; 63 + err_out: 64 + local_irq_restore(flags); 65 + return ret; 66 + } 67 + 68 + static int read_user_stack_64(unsigned long __user *ptr, unsigned long *ret) 69 + { 70 + if ((unsigned long)ptr > TASK_SIZE - sizeof(unsigned long) || 71 + ((unsigned long)ptr & 7)) 72 + return -EFAULT; 73 + 74 + if (!probe_user_read(ret, ptr, sizeof(*ret))) 75 + return 0; 76 + 77 + return read_user_stack_slow(ptr, ret, 8); 78 + } 79 + 80 + /* 81 + * 64-bit user processes use the same stack frame for RT and non-RT signals. 82 + */ 83 + struct signal_frame_64 { 84 + char dummy[__SIGNAL_FRAMESIZE]; 85 + struct ucontext uc; 86 + unsigned long unused[2]; 87 + unsigned int tramp[6]; 88 + struct siginfo *pinfo; 89 + void *puc; 90 + struct siginfo info; 91 + char abigap[288]; 92 + }; 93 + 94 + static int is_sigreturn_64_address(unsigned long nip, unsigned long fp) 95 + { 96 + if (nip == fp + offsetof(struct signal_frame_64, tramp)) 97 + return 1; 98 + if (vdso64_rt_sigtramp && current->mm->context.vdso_base && 99 + nip == current->mm->context.vdso_base + vdso64_rt_sigtramp) 100 + return 1; 101 + return 0; 102 + } 103 + 104 + /* 105 + * Do some sanity checking on the signal frame pointed to by sp. 106 + * We check the pinfo and puc pointers in the frame. 107 + */ 108 + static int sane_signal_64_frame(unsigned long sp) 109 + { 110 + struct signal_frame_64 __user *sf; 111 + unsigned long pinfo, puc; 112 + 113 + sf = (struct signal_frame_64 __user *) sp; 114 + if (read_user_stack_64((unsigned long __user *) &sf->pinfo, &pinfo) || 115 + read_user_stack_64((unsigned long __user *) &sf->puc, &puc)) 116 + return 0; 117 + return pinfo == (unsigned long) &sf->info && 118 + puc == (unsigned long) &sf->uc; 119 + } 120 + 121 + void perf_callchain_user_64(struct perf_callchain_entry_ctx *entry, 122 + struct pt_regs *regs) 123 + { 124 + unsigned long sp, next_sp; 125 + unsigned long next_ip; 126 + unsigned long lr; 127 + long level = 0; 128 + struct signal_frame_64 __user *sigframe; 129 + unsigned long __user *fp, *uregs; 130 + 131 + next_ip = perf_instruction_pointer(regs); 132 + lr = regs->link; 133 + sp = regs->gpr[1]; 134 + perf_callchain_store(entry, next_ip); 135 + 136 + while (entry->nr < entry->max_stack) { 137 + fp = (unsigned long __user *) sp; 138 + if (invalid_user_sp(sp) || read_user_stack_64(fp, &next_sp)) 139 + return; 140 + if (level > 0 && read_user_stack_64(&fp[2], &next_ip)) 141 + return; 142 + 143 + /* 144 + * Note: the next_sp - sp >= signal frame size check 145 + * is true when next_sp < sp, which can happen when 146 + * transitioning from an alternate signal stack to the 147 + * normal stack. 148 + */ 149 + if (next_sp - sp >= sizeof(struct signal_frame_64) && 150 + (is_sigreturn_64_address(next_ip, sp) || 151 + (level <= 1 && is_sigreturn_64_address(lr, sp))) && 152 + sane_signal_64_frame(sp)) { 153 + /* 154 + * This looks like an signal frame 155 + */ 156 + sigframe = (struct signal_frame_64 __user *) sp; 157 + uregs = sigframe->uc.uc_mcontext.gp_regs; 158 + if (read_user_stack_64(&uregs[PT_NIP], &next_ip) || 159 + read_user_stack_64(&uregs[PT_LNK], &lr) || 160 + read_user_stack_64(&uregs[PT_R1], &sp)) 161 + return; 162 + level = 0; 163 + perf_callchain_store_context(entry, PERF_CONTEXT_USER); 164 + perf_callchain_store(entry, next_ip); 165 + continue; 166 + } 167 + 168 + if (level == 0) 169 + next_ip = lr; 170 + perf_callchain_store(entry, next_ip); 171 + ++level; 172 + sp = next_sp; 173 + } 174 + }
+149 -24
arch/powerpc/perf/imc-pmu.c
··· 44 44 static struct imc_pmu_ref *trace_imc_refc; 45 45 static int trace_imc_mem_size; 46 46 47 + /* 48 + * Global data structure used to avoid races between thread, 49 + * core and trace-imc 50 + */ 51 + static struct imc_pmu_ref imc_global_refc = { 52 + .lock = __MUTEX_INITIALIZER(imc_global_refc.lock), 53 + .id = 0, 54 + .refc = 0, 55 + }; 56 + 47 57 static struct imc_pmu *imc_event_to_pmu(struct perf_event *event) 48 58 { 49 59 return container_of(event->pmu, struct imc_pmu, pmu); ··· 708 698 return -EINVAL; 709 699 710 700 ref->refc = 0; 701 + /* 702 + * Reduce the global reference count, if this is the 703 + * last cpu in this core and core-imc event running 704 + * in this cpu. 705 + */ 706 + mutex_lock(&imc_global_refc.lock); 707 + if (imc_global_refc.id == IMC_DOMAIN_CORE) 708 + imc_global_refc.refc--; 709 + 710 + mutex_unlock(&imc_global_refc.lock); 711 711 } 712 712 return 0; 713 713 } ··· 728 708 "perf/powerpc/imc_core:online", 729 709 ppc_core_imc_cpu_online, 730 710 ppc_core_imc_cpu_offline); 711 + } 712 + 713 + static void reset_global_refc(struct perf_event *event) 714 + { 715 + mutex_lock(&imc_global_refc.lock); 716 + imc_global_refc.refc--; 717 + 718 + /* 719 + * If no other thread is running any 720 + * event for this domain(thread/core/trace), 721 + * set the global id to zero. 722 + */ 723 + if (imc_global_refc.refc <= 0) { 724 + imc_global_refc.refc = 0; 725 + imc_global_refc.id = 0; 726 + } 727 + mutex_unlock(&imc_global_refc.lock); 731 728 } 732 729 733 730 static void core_imc_counters_release(struct perf_event *event) ··· 796 759 ref->refc = 0; 797 760 } 798 761 mutex_unlock(&ref->lock); 762 + 763 + reset_global_refc(event); 799 764 } 800 765 801 766 static int core_imc_event_init(struct perf_event *event) ··· 858 819 ++ref->refc; 859 820 mutex_unlock(&ref->lock); 860 821 822 + /* 823 + * Since the system can run either in accumulation or trace-mode 824 + * of IMC at a time, core-imc events are allowed only if no other 825 + * trace/thread imc events are enabled/monitored. 826 + * 827 + * Take the global lock, and check the refc.id 828 + * to know whether any other trace/thread imc 829 + * events are running. 830 + */ 831 + mutex_lock(&imc_global_refc.lock); 832 + if (imc_global_refc.id == 0 || imc_global_refc.id == IMC_DOMAIN_CORE) { 833 + /* 834 + * No other trace/thread imc events are running in 835 + * the system, so set the refc.id to core-imc. 836 + */ 837 + imc_global_refc.id = IMC_DOMAIN_CORE; 838 + imc_global_refc.refc++; 839 + } else { 840 + mutex_unlock(&imc_global_refc.lock); 841 + return -EBUSY; 842 + } 843 + mutex_unlock(&imc_global_refc.lock); 844 + 861 845 event->hw.event_base = (u64)pcmi->vbase + (config & IMC_EVENT_OFFSET_MASK); 862 846 event->destroy = core_imc_counters_release; 863 847 return 0; ··· 939 877 940 878 static int ppc_thread_imc_cpu_offline(unsigned int cpu) 941 879 { 942 - mtspr(SPRN_LDBAR, 0); 880 + /* 881 + * Set the bit 0 of LDBAR to zero. 882 + * 883 + * If bit 0 of LDBAR is unset, it will stop posting 884 + * the counter data to memory. 885 + * For thread-imc, bit 0 of LDBAR will be set to 1 in the 886 + * event_add function. So reset this bit here, to stop the updates 887 + * to memory in the cpu_offline path. 888 + */ 889 + mtspr(SPRN_LDBAR, (mfspr(SPRN_LDBAR) & (~(1UL << 63)))); 890 + 891 + /* Reduce the refc if thread-imc event running on this cpu */ 892 + mutex_lock(&imc_global_refc.lock); 893 + if (imc_global_refc.id == IMC_DOMAIN_THREAD) 894 + imc_global_refc.refc--; 895 + mutex_unlock(&imc_global_refc.lock); 896 + 943 897 return 0; 944 898 } 945 899 ··· 994 916 if (!target) 995 917 return -EINVAL; 996 918 919 + mutex_lock(&imc_global_refc.lock); 920 + /* 921 + * Check if any other trace/core imc events are running in the 922 + * system, if not set the global id to thread-imc. 923 + */ 924 + if (imc_global_refc.id == 0 || imc_global_refc.id == IMC_DOMAIN_THREAD) { 925 + imc_global_refc.id = IMC_DOMAIN_THREAD; 926 + imc_global_refc.refc++; 927 + } else { 928 + mutex_unlock(&imc_global_refc.lock); 929 + return -EBUSY; 930 + } 931 + mutex_unlock(&imc_global_refc.lock); 932 + 997 933 event->pmu->task_ctx_nr = perf_sw_context; 934 + event->destroy = reset_global_refc; 998 935 return 0; 999 936 } 1000 937 ··· 1156 1063 int core_id; 1157 1064 struct imc_pmu_ref *ref; 1158 1065 1159 - mtspr(SPRN_LDBAR, 0); 1160 - 1161 1066 core_id = smp_processor_id() / threads_per_core; 1162 1067 ref = &core_imc_refc[core_id]; 1068 + if (!ref) { 1069 + pr_debug("imc: Failed to get event reference count\n"); 1070 + return; 1071 + } 1163 1072 1164 1073 mutex_lock(&ref->lock); 1165 1074 ref->refc--; ··· 1177 1082 ref->refc = 0; 1178 1083 } 1179 1084 mutex_unlock(&ref->lock); 1085 + 1086 + /* Set bit 0 of LDBAR to zero, to stop posting updates to memory */ 1087 + mtspr(SPRN_LDBAR, (mfspr(SPRN_LDBAR) & (~(1UL << 63)))); 1088 + 1180 1089 /* 1181 1090 * Take a snapshot and calculate the delta and update 1182 1091 * the event counter values. ··· 1232 1133 1233 1134 static int ppc_trace_imc_cpu_offline(unsigned int cpu) 1234 1135 { 1235 - mtspr(SPRN_LDBAR, 0); 1136 + /* 1137 + * No need to set bit 0 of LDBAR to zero, as 1138 + * it is set to zero for imc trace-mode 1139 + * 1140 + * Reduce the refc if any trace-imc event running 1141 + * on this cpu. 1142 + */ 1143 + mutex_lock(&imc_global_refc.lock); 1144 + if (imc_global_refc.id == IMC_DOMAIN_TRACE) 1145 + imc_global_refc.refc--; 1146 + mutex_unlock(&imc_global_refc.lock); 1147 + 1236 1148 return 0; 1237 1149 } 1238 1150 ··· 1336 1226 local_mem = get_trace_imc_event_base_addr(); 1337 1227 ldbar_value = ((u64)local_mem & THREAD_IMC_LDBAR_MASK) | TRACE_IMC_ENABLE; 1338 1228 1339 - if (core_imc_refc) 1340 - ref = &core_imc_refc[core_id]; 1229 + /* trace-imc reference count */ 1230 + if (trace_imc_refc) 1231 + ref = &trace_imc_refc[core_id]; 1341 1232 if (!ref) { 1342 - /* If core-imc is not enabled, use trace-imc reference count */ 1343 - if (trace_imc_refc) 1344 - ref = &trace_imc_refc[core_id]; 1345 - if (!ref) 1346 - return -EINVAL; 1233 + pr_debug("imc: Failed to get the event reference count\n"); 1234 + return -EINVAL; 1347 1235 } 1236 + 1348 1237 mtspr(SPRN_LDBAR, ldbar_value); 1349 1238 mutex_lock(&ref->lock); 1350 1239 if (ref->refc == 0) { ··· 1351 1242 get_hard_smp_processor_id(smp_processor_id()))) { 1352 1243 mutex_unlock(&ref->lock); 1353 1244 pr_err("trace-imc: Unable to start the counters for core %d\n", core_id); 1354 - mtspr(SPRN_LDBAR, 0); 1355 1245 return -EINVAL; 1356 1246 } 1357 1247 } 1358 1248 ++ref->refc; 1359 1249 mutex_unlock(&ref->lock); 1360 - 1361 1250 return 0; 1362 1251 } 1363 1252 ··· 1381 1274 int core_id = smp_processor_id() / threads_per_core; 1382 1275 struct imc_pmu_ref *ref = NULL; 1383 1276 1384 - if (core_imc_refc) 1385 - ref = &core_imc_refc[core_id]; 1277 + if (trace_imc_refc) 1278 + ref = &trace_imc_refc[core_id]; 1386 1279 if (!ref) { 1387 - /* If core-imc is not enabled, use trace-imc reference count */ 1388 - if (trace_imc_refc) 1389 - ref = &trace_imc_refc[core_id]; 1390 - if (!ref) 1391 - return; 1280 + pr_debug("imc: Failed to get event reference count\n"); 1281 + return; 1392 1282 } 1393 - mtspr(SPRN_LDBAR, 0); 1283 + 1394 1284 mutex_lock(&ref->lock); 1395 1285 ref->refc--; 1396 1286 if (ref->refc == 0) { ··· 1401 1297 ref->refc = 0; 1402 1298 } 1403 1299 mutex_unlock(&ref->lock); 1300 + 1404 1301 trace_imc_event_stop(event, flags); 1405 1302 } 1406 1303 ··· 1419 1314 if (event->attr.sample_period == 0) 1420 1315 return -ENOENT; 1421 1316 1317 + /* 1318 + * Take the global lock, and make sure 1319 + * no other thread is running any core/thread imc 1320 + * events 1321 + */ 1322 + mutex_lock(&imc_global_refc.lock); 1323 + if (imc_global_refc.id == 0 || imc_global_refc.id == IMC_DOMAIN_TRACE) { 1324 + /* 1325 + * No core/thread imc events are running in the 1326 + * system, so set the refc.id to trace-imc. 1327 + */ 1328 + imc_global_refc.id = IMC_DOMAIN_TRACE; 1329 + imc_global_refc.refc++; 1330 + } else { 1331 + mutex_unlock(&imc_global_refc.lock); 1332 + return -EBUSY; 1333 + } 1334 + mutex_unlock(&imc_global_refc.lock); 1335 + 1422 1336 event->hw.idx = -1; 1423 1337 target = event->hw.target; 1424 1338 1425 1339 event->pmu->task_ctx_nr = perf_hw_context; 1340 + event->destroy = reset_global_refc; 1426 1341 return 0; 1427 1342 } 1428 1343 ··· 1554 1429 static void thread_imc_ldbar_disable(void *dummy) 1555 1430 { 1556 1431 /* 1557 - * By Zeroing LDBAR, we disable thread-imc 1558 - * updates. 1432 + * By setting 0th bit of LDBAR to zero, we disable thread-imc 1433 + * updates to memory. 1559 1434 */ 1560 - mtspr(SPRN_LDBAR, 0); 1435 + mtspr(SPRN_LDBAR, (mfspr(SPRN_LDBAR) & (~(1UL << 63)))); 1561 1436 } 1562 1437 1563 1438 void thread_imc_disable(void)
+1 -8
arch/powerpc/platforms/powernv/opal-imc.c
··· 268 268 domain = IMC_DOMAIN_THREAD; 269 269 break; 270 270 case IMC_TYPE_TRACE: 271 - /* 272 - * FIXME. Using trace_imc events to monitor application 273 - * or KVM thread performance can cause a checkstop 274 - * (system crash). 275 - * Disable it for now. 276 - */ 277 - pr_info_once("IMC: disabling trace_imc PMU\n"); 278 - domain = -1; 271 + domain = IMC_DOMAIN_TRACE; 279 272 break; 280 273 default: 281 274 pr_warn("IMC Unknown Device type \n");
+1 -3
arch/powerpc/platforms/ps3/os-area.c
··· 613 613 /* Read in header and db from flash. */ 614 614 615 615 header = kmalloc(buf_len, GFP_KERNEL); 616 - if (!header) { 617 - pr_debug("%s: kmalloc failed\n", __func__); 616 + if (!header) 618 617 return -ENOMEM; 619 - } 620 618 621 619 count = os_area_flash_read(header, buf_len, 0); 622 620 if (count < 0) {
+9
arch/powerpc/platforms/pseries/iommu.c
··· 945 945 phys_addr_t max_addr = memory_hotplug_max(); 946 946 struct device_node *memory; 947 947 948 + /* 949 + * The "ibm,pmemory" can appear anywhere in the address space. 950 + * Assuming it is still backed by page structs, set the upper limit 951 + * for the huge DMA window as MAX_PHYSMEM_BITS. 952 + */ 953 + if (of_find_node_by_type(NULL, "ibm,pmemory")) 954 + return (sizeof(phys_addr_t) * 8 <= MAX_PHYSMEM_BITS) ? 955 + (phys_addr_t) -1 : (1ULL << MAX_PHYSMEM_BITS); 956 + 948 957 for_each_node_by_type(memory, "memory") { 949 958 unsigned long start, size; 950 959 int n_mem_addr_cells, n_mem_size_cells, len;
+11
arch/powerpc/platforms/pseries/ras.c
··· 686 686 #endif 687 687 688 688 out: 689 + /* 690 + * Enable translation as we will be accessing per-cpu variables 691 + * in save_mce_event() which may fall outside RMO region, also 692 + * leave it enabled because subsequently we will be queuing work 693 + * to workqueues where again per-cpu variables accessed, besides 694 + * fwnmi_release_errinfo() crashes when called in realmode on 695 + * pseries. 696 + * Note: All the realmode handling like flushing SLB entries for 697 + * SLB multihit is done by now. 698 + */ 699 + mtmsr(mfmsr() | MSR_IR | MSR_DR); 689 700 save_mce_event(regs, disposition == RTAS_DISP_FULLY_RECOVERED, 690 701 &mce_err, regs->nip, eaddr, paddr); 691 702
+1 -1
drivers/ps3/sys-manager-core.c
··· 31 31 { 32 32 BUG_ON(!ops); 33 33 BUG_ON(!ops->dev); 34 - ps3_sys_manager_ops = ops ? *ops : ps3_sys_manager_ops; 34 + ps3_sys_manager_ops = *ops; 35 35 } 36 36 EXPORT_SYMBOL_GPL(ps3_sys_manager_register_ops); 37 37
+2 -1
fs/read_write.c
··· 331 331 } 332 332 #endif 333 333 334 - #if !defined(CONFIG_64BIT) || defined(CONFIG_COMPAT) 334 + #if !defined(CONFIG_64BIT) || defined(CONFIG_COMPAT) || \ 335 + defined(__ARCH_WANT_SYS_LLSEEK) 335 336 SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high, 336 337 unsigned long, offset_low, loff_t __user *, result, 337 338 unsigned int, whence)
+5
tools/testing/selftests/powerpc/eeh/eeh-basic.sh
··· 41 41 continue; 42 42 fi 43 43 44 + if [ "ahci" = "$(basename $(realpath /sys/bus/pci/devices/$dev/driver))" ] ; then 45 + echo "$dev, Skipped: ahci doesn't support recovery" 46 + continue 47 + fi 48 + 44 49 # Don't inject errosr into an already-frozen PE. This happens with 45 50 # PEs that contain multiple PCI devices (e.g. multi-function cards) 46 51 # and injecting new errors during the recovery process will probably
+1
tools/testing/selftests/powerpc/tm/Makefile
··· 25 25 $(OUTPUT)/tm-trap: CFLAGS += -O0 -pthread -m64 26 26 $(OUTPUT)/tm-signal-context-force-tm: CFLAGS += -pthread -m64 27 27 $(OUTPUT)/tm-signal-pagefault: CFLAGS += -pthread -m64 28 + $(OUTPUT)/tm-poison: CFLAGS += -m64 28 29 29 30 SIGNAL_CONTEXT_CHK_TESTS := $(patsubst %,$(OUTPUT)/%,$(SIGNAL_CONTEXT_CHK_TESTS)) 30 31 $(SIGNAL_CONTEXT_CHK_TESTS): tm-signal.S