Skip to content

Commit

Permalink
Merge tag 'nds32-for-linus-4.19-tag1' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/greentime/linux

Pull nds32 updates from Greentime Hu:
 "Contained in here are the bug fixes, building error fixes and ftrace
  support for nds32"

* tag 'nds32-for-linus-4.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux:
  nds32: linker script: GCOV kernel may refers data in __exit
  nds32: fix build error because of wrong semicolon
  nds32: Fix a kernel panic issue because of wrong frame pointer access.
  nds32: Only print one page of stack when die to prevent printing too much information.
  nds32: Add macro definition for offset of lp register on stack
  nds32: Remove the deprecated ABI implementation
  nds32/stack: Get real return address by using ftrace_graph_ret_addr
  nds32/ftrace: Support dynamic function graph tracer
  nds32/ftrace: Support dynamic function tracer
  nds32/ftrace: Add RECORD_MCOUNT support
  nds32/ftrace: Support static function graph tracer
  nds32/ftrace: Support static function tracer
  nds32: Extract the checking and getting pointer to a macro
  nds32: Clean up the coding style
  nds32: Fix get_user/put_user macro expand pointer problem
  nds32: Fix empty call trace
  nds32: add NULL entry to the end of_device_id array
  nds32: fix logic for module
  • Loading branch information
Linus Torvalds committed Sep 5, 2018
2 parents 0e9b103 + 3350139 commit d0c1db1
Show file tree
Hide file tree
Showing 16 changed files with 527 additions and 152 deletions.
4 changes: 4 additions & 0 deletions arch/nds32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ config NDS32
select NO_IOPORT_MAP
select RTC_LIB
select THREAD_INFO_IN_TASK
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_GRAPH_TRACER
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_DYNAMIC_FTRACE
help
Andes(nds32) Linux support.

Expand Down
4 changes: 4 additions & 0 deletions arch/nds32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ KBUILD_DEFCONFIG := defconfig

comma = ,

ifdef CONFIG_FUNCTION_TRACER
arch-y += -malways-save-lp -mno-relax
endif

KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog)
KBUILD_CFLAGS += -mcmodel=large

Expand Down
4 changes: 2 additions & 2 deletions arch/nds32/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ struct elf32_hdr;
*/
#define ELF_CLASS ELFCLASS32
#ifdef __NDS32_EB__
#define ELF_DATA ELFDATA2MSB;
#define ELF_DATA ELFDATA2MSB
#else
#define ELF_DATA ELFDATA2LSB;
#define ELF_DATA ELFDATA2LSB
#endif
#define ELF_ARCH EM_NDS32
#define USE_ELF_CORE_DUMP
Expand Down
46 changes: 46 additions & 0 deletions arch/nds32/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* SPDX-License-Identifier: GPL-2.0 */

#ifndef __ASM_NDS32_FTRACE_H
#define __ASM_NDS32_FTRACE_H

#ifdef CONFIG_FUNCTION_TRACER

#define HAVE_FUNCTION_GRAPH_FP_TEST

#define MCOUNT_ADDR ((unsigned long)(_mcount))
/* mcount call is composed of three instructions:
* sethi + ori + jral
*/
#define MCOUNT_INSN_SIZE 12

extern void _mcount(unsigned long parent_ip);

#ifdef CONFIG_DYNAMIC_FTRACE

#define FTRACE_ADDR ((unsigned long)_ftrace_caller)

#ifdef __NDS32_EL__
#define INSN_NOP 0x09000040
#define INSN_SIZE(insn) (((insn & 0x00000080) == 0) ? 4 : 2)
#define IS_SETHI(insn) ((insn & 0x000000fe) == 0x00000046)
#define ENDIAN_CONVERT(insn) be32_to_cpu(insn)
#else /* __NDS32_EB__ */
#define INSN_NOP 0x40000009
#define INSN_SIZE(insn) (((insn & 0x80000000) == 0) ? 4 : 2)
#define IS_SETHI(insn) ((insn & 0xfe000000) == 0x46000000)
#define ENDIAN_CONVERT(insn) (insn)
#endif

extern void _ftrace_caller(unsigned long parent_ip);
static inline unsigned long ftrace_call_adjust(unsigned long addr)
{
return addr;
}
struct dyn_arch_ftrace {
};

#endif /* CONFIG_DYNAMIC_FTRACE */

#endif /* CONFIG_FUNCTION_TRACER */

#endif /* __ASM_NDS32_FTRACE_H */
1 change: 1 addition & 0 deletions arch/nds32/include/asm/nds32.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#else
#define FP_OFFSET (-2)
#endif
#define LP_OFFSET (-1)

extern void __init early_trap_init(void);
static inline void GIE_ENABLE(void)
Expand Down
Loading

0 comments on commit d0c1db1

Please sign in to comment.