forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'csky-for-linus-4.21' of git://github.com/c-sky/csky-linux
Pull arch/csky updates from Guo Ren: "Here are three main features (cpu_hotplug, basic ftrace, basic perf) and some bugfixes: Features: - Add CPU-hotplug support for SMP - Add ftrace with function trace and function graph trace - Add Perf support - Add EM_CSKY_OLD 39 - optimize kernel panic print. - remove syscall_exit_work Bugfixes: - fix abiv2 mmap(... O_SYNC) failure - fix gdb coredump error - remove vdsp implement for kernel - fix qemu failure to bootup sometimes - fix ftrace call-graph panic - fix device tree node reference leak - remove meaningless header-y - fix save hi,lo,dspcr regs in switch_stack - remove unused members in processor.h" * tag 'csky-for-linus-4.21' of git://github.com/c-sky/csky-linux: csky: Add perf support for C-SKY csky: Add EM_CSKY_OLD 39 clocksource/drivers/c-sky: fixup ftrace call-graph panic csky: ftrace call graph supported. csky: basic ftrace supported csky: remove unused members in processor.h csky: optimize kernel panic print. csky: stacktrace supported. csky: CPU-hotplug supported for SMP clocksource/drivers/c-sky: fixup qemu fail to bootup sometimes. csky: fixup save hi,lo,dspcr regs in switch_stack. csky: remove syscall_exit_work csky: fixup remove vdsp implement for kernel. csky: bugfix gdb coredump error. csky: fixup abiv2 mmap(... O_SYNC) failed. csky: define syscall_get_arch() elf-em.h: add EM_CSKY csky: remove meaningless header-y csky: Don't leak device tree node reference
- Loading branch information
Showing
36 changed files
with
1,555 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | ||
|
||
#ifndef __ABI_CSKY_PTRACE_H | ||
#define __ABI_CSKY_PTRACE_H | ||
|
||
struct switch_stack { | ||
unsigned long r8; | ||
unsigned long r9; | ||
unsigned long r10; | ||
unsigned long r11; | ||
unsigned long r12; | ||
unsigned long r13; | ||
unsigned long r14; | ||
unsigned long r15; | ||
}; | ||
#endif /* __ABI_CSKY_PTRACE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | ||
|
||
#ifndef __ABI_CSKY_PTRACE_H | ||
#define __ABI_CSKY_PTRACE_H | ||
|
||
struct switch_stack { | ||
#ifdef CONFIG_CPU_HAS_HILO | ||
unsigned long rhi; | ||
unsigned long rlo; | ||
unsigned long cr14; | ||
unsigned long pad; | ||
#endif | ||
unsigned long r4; | ||
unsigned long r5; | ||
unsigned long r6; | ||
unsigned long r7; | ||
unsigned long r8; | ||
unsigned long r9; | ||
unsigned long r10; | ||
unsigned long r11; | ||
|
||
unsigned long r15; | ||
unsigned long r16; | ||
unsigned long r17; | ||
unsigned long r26; | ||
unsigned long r27; | ||
unsigned long r28; | ||
unsigned long r29; | ||
unsigned long r30; | ||
}; | ||
#endif /* __ABI_CSKY_PTRACE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | ||
|
||
#include <linux/linkage.h> | ||
#include <asm/ftrace.h> | ||
|
||
/* | ||
* csky-gcc with -pg will put the following asm after prologue: | ||
* push r15 | ||
* jsri _mcount | ||
* | ||
* stack layout after mcount_enter in _mcount(): | ||
* | ||
* current sp => 0:+-------+ | ||
* | a0-a3 | -> must save all argument regs | ||
* +16:+-------+ | ||
* | lr | -> _mcount lr (instrumente function's pc) | ||
* +20:+-------+ | ||
* | fp=r8 | -> instrumented function fp | ||
* +24:+-------+ | ||
* | plr | -> instrumented function lr (parent's pc) | ||
* +-------+ | ||
*/ | ||
|
||
.macro mcount_enter | ||
subi sp, 24 | ||
stw a0, (sp, 0) | ||
stw a1, (sp, 4) | ||
stw a2, (sp, 8) | ||
stw a3, (sp, 12) | ||
stw lr, (sp, 16) | ||
stw r8, (sp, 20) | ||
.endm | ||
|
||
.macro mcount_exit | ||
ldw a0, (sp, 0) | ||
ldw a1, (sp, 4) | ||
ldw a2, (sp, 8) | ||
ldw a3, (sp, 12) | ||
ldw t1, (sp, 16) | ||
ldw r8, (sp, 20) | ||
ldw lr, (sp, 24) | ||
addi sp, 28 | ||
jmp t1 | ||
.endm | ||
|
||
.macro save_return_regs | ||
subi sp, 16 | ||
stw a0, (sp, 0) | ||
stw a1, (sp, 4) | ||
stw a2, (sp, 8) | ||
stw a3, (sp, 12) | ||
.endm | ||
|
||
.macro restore_return_regs | ||
mov lr, a0 | ||
ldw a0, (sp, 0) | ||
ldw a1, (sp, 4) | ||
ldw a2, (sp, 8) | ||
ldw a3, (sp, 12) | ||
addi sp, 16 | ||
.endm | ||
|
||
ENTRY(ftrace_stub) | ||
jmp lr | ||
END(ftrace_stub) | ||
|
||
ENTRY(_mcount) | ||
mcount_enter | ||
|
||
/* r26 is link register, only used with jsri translation */ | ||
lrw r26, ftrace_trace_function | ||
ldw r26, (r26, 0) | ||
lrw a1, ftrace_stub | ||
cmpne r26, a1 | ||
bf skip_ftrace | ||
|
||
mov a0, lr | ||
subi a0, MCOUNT_INSN_SIZE | ||
ldw a1, (sp, 24) | ||
|
||
jsr r26 | ||
|
||
#ifndef CONFIG_FUNCTION_GRAPH_TRACER | ||
skip_ftrace: | ||
mcount_exit | ||
#else | ||
skip_ftrace: | ||
lrw a0, ftrace_graph_return | ||
ldw a0, (a0, 0) | ||
lrw a1, ftrace_stub | ||
cmpne a0, a1 | ||
bt ftrace_graph_caller | ||
|
||
lrw a0, ftrace_graph_entry | ||
ldw a0, (a0, 0) | ||
lrw a1, ftrace_graph_entry_stub | ||
cmpne a0, a1 | ||
bt ftrace_graph_caller | ||
|
||
mcount_exit | ||
#endif | ||
END(_mcount) | ||
|
||
#ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
ENTRY(ftrace_graph_caller) | ||
mov a0, sp | ||
addi a0, 24 | ||
ldw a1, (sp, 16) | ||
subi a1, MCOUNT_INSN_SIZE | ||
mov a2, r8 | ||
lrw r26, prepare_ftrace_return | ||
jsr r26 | ||
mcount_exit | ||
END(ftrace_graph_caller) | ||
|
||
ENTRY(return_to_handler) | ||
save_return_regs | ||
mov a0, r8 | ||
jsri ftrace_return_to_handler | ||
restore_return_regs | ||
jmp lr | ||
END(return_to_handler) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | ||
|
||
#ifndef __ASM_CSKY_FTRACE_H | ||
#define __ASM_CSKY_FTRACE_H | ||
|
||
#define MCOUNT_INSN_SIZE 4 | ||
|
||
#define HAVE_FUNCTION_GRAPH_FP_TEST | ||
|
||
#define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR | ||
|
||
#endif /* __ASM_CSKY_FTRACE_H */ |
Oops, something went wrong.