OpenCloudOS-Kernel/arch/riscv/kernel
Linus Torvalds 0f1f692375 While rewriting the function graph tracer, I discovered a design flaw that
was introduced by a patch that tried to fix one bug, but by doing so created
 another bug. As both bugs corrupt the output (but they do not crash the
 kernel), I decided to fix the design such that it could have both bugs
 fixed. The original fix, fixed time reporting of the function graph tracer
 when doing a max_depth of one. This was code that can test how much the
 kernel interferes with userspace. But in doing so, it could corrupt the time
 keeping of the function profiler.
 
 The issue is that the curr_ret_stack variable was being used for two
 different meanings. One was to keep track of the stack pointer on the
 ret_stack (shadow stack used by the function graph tracer), and the other
 use case was the graph call depth.  Although, the two may be closely
 related, where they got updated was the issue that lead to the two different
 bugs that required the two use cases to be updated differently.
 
 The big issue with this fix is that it requires changing each architecture.
 The good news is, I was able to remove a lot of code that was duplicated
 within the architectures and place it into a single location. Then I could
 make the fix in one place.
 
 I pushed this code into linux-next to let it settle over a week, and before
 doing so, I cross compiled all the affected architectures to make sure that
 they built fine.
 
 In the mean time, I also pulled in a patch that fixes the sched_switch
 previous tasks state output, that was not actually correct.
 -----BEGIN PGP SIGNATURE-----
 
 iIoEABYIADIWIQRRSw7ePDh/lE+zeZMp5XQQmuv6qgUCW/4NPhQccm9zdGVkdEBn
 b29kbWlzLm9yZwAKCRAp5XQQmuv6qnWAAQCyUIRLgYImr81eTl52lxNRsULk+aiI
 U29kRFWWU0c40AEA1X9sDF0MgOItbRGfZtnHTZEousXRDaDf4Fge2kF7Egg=
 =liQ0
 -----END PGP SIGNATURE-----

Merge tag 'trace-v4.20-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
 "While rewriting the function graph tracer, I discovered a design flaw
  that was introduced by a patch that tried to fix one bug, but by doing
  so created another bug.

  As both bugs corrupt the output (but they do not crash the kernel), I
  decided to fix the design such that it could have both bugs fixed. The
  original fix, fixed time reporting of the function graph tracer when
  doing a max_depth of one. This was code that can test how much the
  kernel interferes with userspace. But in doing so, it could corrupt
  the time keeping of the function profiler.

  The issue is that the curr_ret_stack variable was being used for two
  different meanings. One was to keep track of the stack pointer on the
  ret_stack (shadow stack used by the function graph tracer), and the
  other use case was the graph call depth. Although, the two may be
  closely related, where they got updated was the issue that lead to the
  two different bugs that required the two use cases to be updated
  differently.

  The big issue with this fix is that it requires changing each
  architecture. The good news is, I was able to remove a lot of code
  that was duplicated within the architectures and place it into a
  single location. Then I could make the fix in one place.

  I pushed this code into linux-next to let it settle over a week, and
  before doing so, I cross compiled all the affected architectures to
  make sure that they built fine.

  In the mean time, I also pulled in a patch that fixes the sched_switch
  previous tasks state output, that was not actually correct"

* tag 'trace-v4.20-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  sched, trace: Fix prev_state output in sched_switch tracepoint
  function_graph: Have profiler use curr_ret_stack and not depth
  function_graph: Reverse the order of pushing the ret_stack and the callback
  function_graph: Move return callback before update of curr_ret_stack
  function_graph: Use new curr_ret_depth to manage depth instead of curr_ret_stack
  function_graph: Make ftrace_push_return_trace() static
  sparc/function_graph: Simplify with function_graph_enter()
  sh/function_graph: Simplify with function_graph_enter()
  s390/function_graph: Simplify with function_graph_enter()
  riscv/function_graph: Simplify with function_graph_enter()
  powerpc/function_graph: Simplify with function_graph_enter()
  parisc: function_graph: Simplify with function_graph_enter()
  nds32: function_graph: Simplify with function_graph_enter()
  MIPS: function_graph: Simplify with function_graph_enter()
  microblaze: function_graph: Simplify with function_graph_enter()
  arm64: function_graph: Simplify with function_graph_enter()
  ARM: function_graph: Simplify with function_graph_enter()
  x86/function_graph: Simplify with function_graph_enter()
  function_graph: Create function_graph_enter() to consolidate architecture code
2018-11-30 09:32:34 -08:00
..
vdso RISC-V: Use KBUILD_CFLAGS instead of KCFLAGS when building the vDSO 2018-08-13 08:31:28 -07:00
.gitignore RISC-V: Build Infrastructure 2017-09-26 15:26:49 -07:00
Makefile Allow to disable FPU support 2018-10-22 17:02:23 -07:00
asm-offsets.c RISC-V: Task implementation 2017-09-26 15:26:46 -07:00
cacheinfo.c RISC-V: Don't set cacheinfo.{physical_line_partition,attributes} 2018-10-22 17:37:41 -07:00
cpu.c RISC-V: recognize S/U mode bits in print_isa 2018-11-20 05:19:28 -08:00
cpufeature.c RISC-V: properly determine hardware caps 2018-10-31 12:13:43 -07:00
entry.S RISC-V: SMP cleanup and new features 2018-10-22 17:41:43 -07:00
fpu.S Extract FPU context operations from entry.S 2018-10-22 17:02:22 -07:00
ftrace.c riscv/function_graph: Simplify with function_graph_enter() 2018-11-27 20:31:16 -05:00
head.S RISC-V: Build flat and compressed kernel images 2018-11-20 05:19:09 -08:00
irq.c RISC-V: Show IPI stats 2018-10-22 17:03:37 -07:00
mcount-dyn.S riscv/ftrace: Add DYNAMIC_FTRACE_WITH_REGS support 2018-04-02 19:59:13 -07:00
mcount.S RISC-V: remove the unused return_to_handler export 2018-10-22 17:38:12 -07:00
module-sections.c RISC-V: Add section of GOT.PLT for kernel module 2018-04-02 20:00:54 -07:00
module.c RISC-V: Silence some module warnings on 32-bit 2018-11-12 18:12:24 -08:00
module.lds RISC-V: Add section of GOT.PLT for kernel module 2018-04-02 20:00:54 -07:00
perf_event.c RISC-V: Fix !CONFIG_SMP compilation error 2018-08-13 08:31:32 -07:00
process.c Auto-detect whether a FPU exists 2018-10-22 17:02:23 -07:00
ptrace.c RISC-V: Add FP register ptrace support for gdb. 2018-10-22 17:38:04 -07:00
reset.c RISC-V: Init and Halt Code 2017-09-26 15:26:44 -07:00
riscv_ksyms.c riscv: split the declaration of __copy_user 2018-06-09 12:34:31 -07:00
setup.c RISC-V: SMP cleanup and new features 2018-10-22 17:41:43 -07:00
signal.c Auto-detect whether a FPU exists 2018-10-22 17:02:23 -07:00
smp.c RISC-V: Show IPI stats 2018-10-22 17:03:37 -07:00
smpboot.c RISC-V: Use Linux logical CPU number instead of hartid 2018-10-22 17:03:37 -07:00
stacktrace.c riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support 2018-04-02 19:59:13 -07:00
sys_riscv.c RISC-V: Use a less ugly workaround for unused variable warnings 2018-08-28 12:58:36 -07:00
syscall_table.c RISC-V: Make __NR_riscv_flush_icache visible to userspace 2018-01-07 15:14:37 -08:00
time.c clocksource: new RISC-V SBI timer driver 2018-08-13 08:31:31 -07:00
traps.c RISC-V: Don't increment sepc after breakpoint. 2018-08-13 08:31:30 -07:00
vdso.c riscv: remove redundant unlikely() 2018-01-30 19:12:06 -08:00
vmlinux.lds.S RISC-V: Build flat and compressed kernel images 2018-11-20 05:19:09 -08:00