linux/arch/loongarch/include/asm
Tiezhu Yang 19bc6cb640 LoongArch: Add uprobes support
Uprobes is the user-space counterpart to kprobes, this patch adds
uprobes support for LoongArch.

Here is a simple example with CONFIG_UPROBE_EVENTS=y:

  # cat test.c
  #include <stdio.h>

  int add(int a, int b)
  {
  	  return a + b;
  }

  int main()
  {
	  return add(2, 7);
  }
  # gcc test.c -o /tmp/test
  # nm /tmp/test | grep add
  0000000120004194 T add
  # cd /sys/kernel/debug/tracing
  # echo > uprobe_events
  # echo "p:myuprobe /tmp/test:0x4194 %r4 %r5" > uprobe_events
  # echo "r:myuretprobe /tmp/test:0x4194 %r4" >> uprobe_events
  # echo 1 > events/uprobes/enable
  # echo 1 > tracing_on
  # /tmp/test
  # cat trace
  ...
  #           TASK-PID     CPU#  |||||  TIMESTAMP  FUNCTION
  #              | |         |   |||||     |         |
              test-1060    [001] DNZff  1015.770620: myuprobe: (0x120004194) arg1=0x2 arg2=0x7
              test-1060    [001] DNZff  1015.770930: myuretprobe: (0x1200041f0 <- 0x120004194) arg1=0x9

Tested-by: Jeff Xie <xiehuan09@gmail.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-06-29 20:58:44 +08:00
..
vdso LoongArch: Add support to clone a time namespace 2023-06-29 20:58:43 +08:00
acenv.h LoongArch: Add boot and setup routines 2022-06-03 20:09:28 +08:00
acpi.h LoongArch: Export some arch-specific pm interfaces 2023-06-29 20:58:44 +08:00
addrspace.h LoongArch: Fix _CONST64_(x) as unsigned 2023-04-18 19:38:58 +08:00
alternative-asm.h LoongArch: Add alternative runtime patching mechanism 2022-12-14 08:36:11 +08:00
alternative.h LoongArch: Add alternative runtime patching mechanism 2022-12-14 08:36:11 +08:00
asm-extable.h LoongArch: BPF: Add BPF exception tables 2022-12-14 08:36:11 +08:00
asm-offsets.h LoongArch: Add misc common routines 2022-06-03 20:09:28 +08:00
asm-prototypes.h LoongArch: Add other common headers 2022-06-03 20:09:28 +08:00
asm.h LoongArch: Mark some assembler symbols as non-kprobe-able 2023-02-25 22:12:17 +08:00
asmmacro.h LoongArch: Add vector extensions support 2023-06-29 20:58:43 +08:00
atomic.h LoongArch: Remove useless header compiler.h 2022-07-29 18:22:32 +08:00
barrier.h LoongArch: Support dbar with different hints 2023-06-29 20:58:44 +08:00
bitops.h LoongArch: Add atomic/locking headers 2022-06-03 20:09:28 +08:00
bitrev.h LoongArch: Add atomic/locking headers 2022-06-03 20:09:28 +08:00
bootinfo.h LoongArch: Clean up plat_swiotlb_setup() related code 2023-04-19 12:07:27 +08:00
branch.h LoongArch: Make compute_return_era() return void 2022-06-25 18:06:07 +08:00
bug.h LoongArch: Use generic BUG() handler 2022-10-12 16:36:19 +08:00
bugs.h LoongArch: Add alternative runtime patching mechanism 2022-12-14 08:36:11 +08:00
cache.h LoongArch: Add memory management 2022-06-03 20:09:28 +08:00
cacheflush.h LoongArch: Refactor cache probe and flush methods 2022-10-12 16:36:14 +08:00
cacheops.h LoongArch: Refactor cache probe and flush methods 2022-10-12 16:36:14 +08:00
checksum.h LoongArch: Add checksum optimization for 64-bit system 2023-05-01 17:19:43 +08:00
clocksource.h LoongArch: Add other common headers 2022-06-03 20:09:28 +08:00
cmpxchg.h locking/arch: Rename all internal __xchg() names to __arch_xchg() 2023-04-29 09:08:44 +02:00
cpu-features.h LoongArch: Introduce hardware page table walker 2023-06-29 20:58:44 +08:00
cpu-info.h LoongArch: Add SMT (Simultaneous Multi-Threading) support 2023-06-29 20:58:43 +08:00
cpu.h LoongArch: Introduce hardware page table walker 2023-06-29 20:58:44 +08:00
cpufeature.h LoongArch: Add ELF and module support 2022-06-03 20:09:28 +08:00
delay.h LoongArch: Add some library functions 2022-06-03 20:09:28 +08:00
dma-direct.h LoongArch: Add Non-Uniform Memory Access (NUMA) support 2022-06-03 20:09:29 +08:00
dma.h LoongArch: Add PCI controller support 2022-08-12 13:10:11 +08:00
dmi.h LoongArch: Add boot and setup routines 2022-06-03 20:09:28 +08:00
efi.h LoongArch changes for v6.2 2022-12-19 08:23:27 -06:00
elf.h LoongArch: Define ELF relocation types added in ABIv2.0 2022-10-12 16:36:14 +08:00
entry-common.h LoongArch: Add exception/interrupt handling 2022-06-03 20:09:28 +08:00
exec.h LoongArch: Add ELF and module support 2022-06-03 20:09:28 +08:00
extable.h LoongArch: BPF: Add BPF exception tables 2022-12-14 08:36:11 +08:00
fb.h LoongArch: Add misc common routines 2022-06-03 20:09:28 +08:00
fixmap.h LoongArch: Use TLB for ioremap() 2022-10-12 16:36:14 +08:00
fpregdef.h LoongArch: Prepare for assemblers with proper FCSR class support 2023-06-29 20:58:43 +08:00
fpu.h LoongArch: Add vector extensions support 2023-06-29 20:58:43 +08:00
ftrace.h LoongArch: ftrace: Add direct call support 2023-05-01 17:19:53 +08:00
futex.h LoongArch: extable: Add a dedicated uaccess handler 2022-12-14 08:36:11 +08:00
gpr-num.h LoongArch: extable: Also recognize ABI names of registers 2023-06-29 20:58:43 +08:00
hardirq.h LoongArch: Fix the !CONFIG_SMP build 2022-06-08 11:00:40 +08:00
hugetlb.h LoongArch: Add memory management 2022-06-03 20:09:28 +08:00
hw_breakpoint.h LoongArch: Add hardware breakpoints/watchpoints support 2023-02-25 22:12:17 +08:00
hw_irq.h LoongArch: Add exception/interrupt handling 2022-06-03 20:09:28 +08:00
idle.h LoongArch: Add process management 2022-06-03 20:09:28 +08:00
inst.h LoongArch: Add larch_insn_gen_break() to generate break insns 2023-06-29 20:58:44 +08:00
io.h LoongArch: Support dbar with different hints 2023-06-29 20:58:44 +08:00
irq_regs.h LoongArch: Add exception/interrupt handling 2022-06-03 20:09:28 +08:00
irq.h ACPI updates for 6.2-rc1 2022-12-13 19:19:41 +08:00
irqflags.h LoongArch: Remove useless header compiler.h 2022-07-29 18:22:32 +08:00
jump_label.h LoongArch: Add jump-label implementation 2023-06-29 20:58:44 +08:00
Kbuild LoongArch: Support dbar with different hints 2023-06-29 20:58:44 +08:00
kdebug.h LoongArch: Add exception/interrupt handling 2022-06-03 20:09:28 +08:00
kexec.h LoongArch: Add kexec support 2022-10-12 16:36:19 +08:00
kprobes.h LoongArch: Use larch_insn_gen_break() for kprobes 2023-06-29 20:58:44 +08:00
linkage.h LoongArch: Add other common headers 2022-06-03 20:09:28 +08:00
local.h locking/arch: Wire up local_try_cmpxchg() 2023-04-29 09:09:16 +02:00
loongarch.h LoongArch: Introduce hardware page table walker 2023-06-29 20:58:44 +08:00
loongson.h LoongArch: Add suspend (ACPI S3) support 2022-12-14 08:41:53 +08:00
mmu_context.h LoongArch: Add process management 2022-06-03 20:09:28 +08:00
mmu.h LoongArch: Add process management 2022-06-03 20:09:28 +08:00
mmzone.h LoongArch: Add Non-Uniform Memory Access (NUMA) support 2022-06-03 20:09:29 +08:00
module.h LoongArch: Add guard for the larch_insn_gen_xxx functions 2023-06-29 20:58:42 +08:00
module.lds.h LoongArch: module: set section addresses to 0x0 2023-04-18 19:38:58 +08:00
numa.h LoongArch: Add Non-Uniform Memory Access (NUMA) support 2022-06-03 20:09:29 +08:00
page.h LoongArch: Add support to clone a time namespace 2023-06-29 20:58:43 +08:00
pci.h LoongArch: Add PCI controller support 2022-08-12 13:10:11 +08:00
percpu.h LoongArch: Tweak CFLAGS for Clang compatibility 2023-06-29 20:58:43 +08:00
perf_event.h LoongArch: Add perf events support 2022-10-12 16:36:14 +08:00
pgalloc.h MIPS&LoongArch&NIOS2: adjust prototypes of p?d_init() 2022-12-11 18:12:11 -08:00
pgtable-bits.h LoongArch: Let pmd_present() return true when splitting pmd 2023-06-15 14:35:52 +08:00
pgtable.h LoongArch: Introduce hardware page table walker 2023-06-29 20:58:44 +08:00
prefetch.h LoongArch: Add other common headers 2022-06-03 20:09:28 +08:00
processor.h LoongArch: ptrace: Add hardware single step support 2023-02-25 22:12:17 +08:00
ptrace.h LoongArch: Add support for function error injection 2023-05-01 17:19:52 +08:00
qspinlock.h LoongArch: Support dbar with different hints 2023-06-29 20:58:44 +08:00
regdef.h
seccomp.h LoongArch: Add system call support 2022-06-03 20:09:28 +08:00
serial.h LoongArch: Add other common headers 2022-06-03 20:09:28 +08:00
setup.h LoongArch: Add support for kernel address space layout randomization (KASLR) 2023-02-25 22:12:17 +08:00
shmparam.h LoongArch: Add memory management 2022-06-03 20:09:28 +08:00
smp.h loongarch/cpu: Mark play_dead() __noreturn 2023-03-06 15:34:06 -08:00
sparsemem.h LoongArch: add sparse memory vmemmap support 2022-12-11 18:12:12 -08:00
spinlock_types.h LoongArch: Add qspinlock support 2022-10-12 16:36:14 +08:00
spinlock.h LoongArch: Add qspinlock support 2022-10-12 16:36:14 +08:00
stackframe.h LoongArch: Add la_abs macro implementation 2023-02-25 22:12:16 +08:00
stackprotector.h LoongArch: Add basic STACKPROTECTOR support 2022-12-14 08:41:53 +08:00
stacktrace.h LoongArch: Add USER_STACKTRACE support 2022-08-12 13:10:11 +08:00
string.h LoongArch: Use alternative to optimize libraries 2022-12-14 08:36:11 +08:00
suspend.h LoongArch: Export some arch-specific pm interfaces 2023-06-29 20:58:44 +08:00
switch_to.h LoongArch: Add hardware breakpoints/watchpoints support 2023-02-25 22:12:17 +08:00
syscall.h LoongArch: Add system call support 2022-06-03 20:09:28 +08:00
thread_info.h LoongArch: Add unaligned access support 2022-12-14 08:36:11 +08:00
time.h LoongArch: Add suspend (ACPI S3) support 2022-12-14 08:41:53 +08:00
timex.h LoongArch: Remove MIPS comment about cycle counter 2022-06-08 11:00:40 +08:00
tlb.h LoongArch: Introduce hardware page table walker 2023-06-29 20:58:44 +08:00
tlbflush.h LoongArch: Add multi-processor (SMP) support 2022-06-03 20:09:29 +08:00
topology.h LoongArch: Add Non-Uniform Memory Access (NUMA) support 2022-06-03 20:09:29 +08:00
types.h LoongArch: Add other common headers 2022-06-03 20:09:28 +08:00
uaccess.h LoongArch: Use la.pcrel instead of la.abs when it's trivially possible 2023-02-25 22:12:16 +08:00
unistd.h LoongArch: Add system call support 2022-06-03 20:09:28 +08:00
unwind.h LoongArch: Add generic ex-handler unwind in prologue unwinder 2023-01-17 11:42:16 +08:00
uprobes.h LoongArch: Add uprobes support 2023-06-29 20:58:44 +08:00
vdso.h LoongArch: Add vDSO syscall __vdso_getcpu() 2022-08-12 13:10:11 +08:00
vermagic.h LoongArch: Add ELF and module support 2022-06-03 20:09:28 +08:00
vmalloc.h LoongArch: Add memory management 2022-06-03 20:09:28 +08:00