Commit 593c7546 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull parisc updates from Helge Deller:
 "Dynamic ftrace support by Sven Schnelle and a header guard fix by
  Denis Efremov"

* 'parisc-5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: asm: psw.h: missing header guard
  parisc: add dynamic ftrace
  compiler.h: add CC_USING_PATCHABLE_FUNCTION_ENTRY
  parisc: use pr_debug() in kernel/module.c
  parisc: add WARN_ON() to clear_fixmap
  parisc: add spinlock to patch function
  parisc: add support for patching multiple words
parents 565eb5f8 b3d5f311
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ config PARISC
	select HAVE_ARCH_KGDB
	select HAVE_KPROBES
	select HAVE_KRETPROBES
	select HAVE_DYNAMIC_FTRACE if $(cc-option,-fpatchable-function-entry=1,1)
	select HAVE_FTRACE_MCOUNT_RECORD if HAVE_DYNAMIC_FTRACE

	help
	  The PA-RISC microprocessor is designed by Hewlett-Packard and used
+18 −0
Original line number Diff line number Diff line
@@ -47,6 +47,24 @@ ifneq ($(SUBARCH),$(UTS_MACHINE))
	endif
endif

ifdef CONFIG_DYNAMIC_FTRACE
ifdef CONFIG_64BIT
NOP_COUNT := 8
else
NOP_COUNT := 5
endif

export CC_USING_RECORD_MCOUNT:=1
export CC_USING_PATCHABLE_FUNCTION_ENTRY:=1

KBUILD_AFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1
KBUILD_CFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1 \
		 -DFTRACE_PATCHABLE_FUNCTION_SIZE=$(NOP_COUNT)

CC_FLAGS_FTRACE := -fpatchable-function-entry=$(NOP_COUNT),$(shell echo $$(($(NOP_COUNT)-1)))
KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/parisc/kernel/module.lds
endif

OBJCOPY_FLAGS =-O binary -R .note -R .comment -S

cflags-y	:= -pipe
+13 −2
Original line number Diff line number Diff line
@@ -5,12 +5,23 @@
#ifndef __ASSEMBLY__
extern void mcount(void);

#define MCOUNT_ADDR		((unsigned long)mcount)
#define MCOUNT_INSN_SIZE	4

#define CC_USING_NOP_MCOUNT
extern unsigned long sys_call_table[];

extern unsigned long return_address(unsigned int);

#ifdef CONFIG_DYNAMIC_FTRACE
extern void ftrace_caller(void);

struct dyn_arch_ftrace {
};

unsigned long ftrace_call_adjust(unsigned long addr);

#endif

#define ftrace_return_address(n) return_address(n)

#endif /* __ASSEMBLY__ */
+3 −1
Original line number Diff line number Diff line
@@ -4,8 +4,10 @@

/* stop machine and patch kernel text */
void patch_text(void *addr, unsigned int insn);
void patch_text_multiple(void *addr, u32 *insn, unsigned int len);

/* patch kernel text with machine already stopped (e.g. in kgdb) */
void __patch_text(void *addr, unsigned int insn);
void __patch_text(void *addr, u32 insn);
void __patch_text_multiple(void *addr, u32 *insn, unsigned int len);

#endif
+1 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PARISC_PSW_H

#define _PARISC_PSW_H

#define	PSW_I	0x00000001
#define	PSW_D	0x00000002
Loading