Merge branch 'fixes' into next
authorMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Jun 2018 10:32:02 +0000 (20:32 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Jun 2018 10:32:02 +0000 (20:32 +1000)
We ended up with an ugly conflict between fixes and next in ftrace.h
involving multiple nested ifdefs, and the automatic resolution is
wrong. So merge fixes into next so we can fix it up.

1  2 
Documentation/ABI/testing/sysfs-class-cxl
arch/powerpc/include/asm/ftrace.h
arch/powerpc/include/asm/paca.h
drivers/misc/cxl/pci.c
drivers/misc/cxl/sysfs.c

index fc3a2203c566e78730f43f55fbd1a48e7fd034a7,b2dabd06659dd0b4cce575e0e00336f9d5f36cb6..3dfb80b8656140487a5f975f08b1202f9a3974c4
@@@ -62,39 -66,35 +62,54 @@@ struct dyn_arch_ftrace 
  #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
  #define ARCH_SUPPORTS_FTRACE_OPS 1
  #endif
 -#endif
 +#endif /* CONFIG_FUNCTION_TRACER */
  
 -#if defined(CONFIG_FTRACE_SYSCALLS) && !defined(__ASSEMBLY__)
 +#ifndef __ASSEMBLY__
- #if defined(CONFIG_FTRACE_SYSCALLS) && defined(PPC64_ELF_ABI_v1)
++#ifdef CONFIG_FTRACE_SYSCALLS
+ /*
+  * Some syscall entry functions on powerpc start with "ppc_" (fork and clone,
+  * for instance) or ppc32_/ppc64_. We should also match the sys_ variant with
+  * those.
+  */
  #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
+ #ifdef PPC64_ELF_ABI_v1
  static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
  {
-       /*
-        * Compare the symbol name with the system call name. Skip the .sys or .SyS
-        * prefix from the symbol name and the sys prefix from the system call name and
-        * just match the rest. This is only needed on ppc64 since symbol names on
-        * 32bit do not start with a period so the generic function will work.
-        */
-       return !strcmp(sym + 4, name + 3);
+       /* We need to skip past the initial dot, and the __se_sys alias */
+       return !strcmp(sym + 1, name) ||
+               (!strncmp(sym, ".__se_sys", 9) && !strcmp(sym + 6, name)) ||
+               (!strncmp(sym, ".ppc_", 5) && !strcmp(sym + 5, name + 4)) ||
+               (!strncmp(sym, ".ppc32_", 7) && !strcmp(sym + 7, name + 4)) ||
+               (!strncmp(sym, ".ppc64_", 7) && !strcmp(sym + 7, name + 4));
  }
- #endif /* CONFIG_FTRACE_SYSCALLS && PPC64_ELF_ABI_v1 */
+ #else
+ static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
+ {
+       return !strcmp(sym, name) ||
+               (!strncmp(sym, "__se_sys", 8) && !strcmp(sym + 5, name)) ||
+               (!strncmp(sym, "ppc_", 4) && !strcmp(sym + 4, name + 4)) ||
+               (!strncmp(sym, "ppc32_", 6) && !strcmp(sym + 6, name + 4)) ||
+               (!strncmp(sym, "ppc64_", 6) && !strcmp(sym + 6, name + 4));
+ }
 -#endif
 -#endif /* CONFIG_FTRACE_SYSCALLS && !__ASSEMBLY__ */
++#endif /* PPC64_ELF_ABI_v1 */
++#endif /* CONFIG_FTRACE_SYSCALLS */
 +
 +#ifdef CONFIG_PPC64
 +#include <asm/paca.h>
 +
 +static inline void this_cpu_disable_ftrace(void)
 +{
 +      get_paca()->ftrace_enabled = 0;
 +}
 +
 +static inline void this_cpu_enable_ftrace(void)
 +{
 +      get_paca()->ftrace_enabled = 1;
 +}
 +#else /* CONFIG_PPC64 */
 +static inline void this_cpu_disable_ftrace(void) { }
 +static inline void this_cpu_enable_ftrace(void) { }
 +#endif /* CONFIG_PPC64 */
 +#endif /* !__ASSEMBLY__ */
  
  #endif /* _ASM_POWERPC_FTRACE */
Simple merge
Simple merge
Simple merge