mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-27 04:30:53 +07:00
0dc016dbd8
This patch introduce kprobeopt for ARM 32. Limitations: - Currently only kernel compiled with ARM ISA is supported. - Offset between probe point and optinsn slot must not larger than 32MiB. Masami Hiramatsu suggests replacing 2 words, it will make things complex. Futher patch can make such optimization. Kprobe opt on ARM is relatively simpler than kprobe opt on x86 because ARM instruction is always 4 bytes aligned and 4 bytes long. This patch replace probed instruction by a 'b', branch to trampoline code and then calls optimized_callback(). optimized_callback() calls opt_pre_handler() to execute kprobe handler. It also emulate/simulate replaced instruction. When unregistering kprobe, the deferred manner of unoptimizer may leave branch instruction before optimizer is called. Different from x86_64, which only copy the probed insn after optprobe_template_end and reexecute them, this patch call singlestep to emulate/simulate the insn directly. Futher patch can optimize this behavior. Signed-off-by: Wang Nan <wangnan0@huawei.com> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Will Deacon <will.deacon@arm.com> Reviewed-by: Jon Medhurst (Tixy) <tixy@linaro.org> Signed-off-by: Jon Medhurst <tixy@linaro.org>
94 lines
2.8 KiB
Makefile
94 lines
2.8 KiB
Makefile
#
|
|
# Makefile for the linux kernel.
|
|
#
|
|
|
|
CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET)
|
|
AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
|
|
|
|
ifdef CONFIG_FUNCTION_TRACER
|
|
CFLAGS_REMOVE_ftrace.o = -pg
|
|
CFLAGS_REMOVE_insn.o = -pg
|
|
CFLAGS_REMOVE_patch.o = -pg
|
|
endif
|
|
|
|
CFLAGS_REMOVE_return_address.o = -pg
|
|
|
|
# Object file lists.
|
|
|
|
obj-y := elf.o entry-common.o irq.o opcodes.o \
|
|
process.o ptrace.o return_address.o \
|
|
setup.o signal.o sigreturn_codes.o \
|
|
stacktrace.o sys_arm.o time.o traps.o
|
|
|
|
obj-$(CONFIG_ATAGS) += atags_parse.o
|
|
obj-$(CONFIG_ATAGS_PROC) += atags_proc.o
|
|
obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o
|
|
|
|
ifeq ($(CONFIG_CPU_V7M),y)
|
|
obj-y += entry-v7m.o v7m.o
|
|
else
|
|
obj-y += entry-armv.o
|
|
endif
|
|
|
|
obj-$(CONFIG_CPU_IDLE) += cpuidle.o
|
|
obj-$(CONFIG_ISA_DMA_API) += dma.o
|
|
obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
|
|
obj-$(CONFIG_MODULES) += armksyms.o module.o
|
|
obj-$(CONFIG_ARTHUR) += arthur.o
|
|
obj-$(CONFIG_ISA_DMA) += dma-isa.o
|
|
obj-$(CONFIG_PCI) += bios32.o isa.o
|
|
obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o
|
|
obj-$(CONFIG_HIBERNATION) += hibernate.o
|
|
obj-$(CONFIG_SMP) += smp.o
|
|
ifdef CONFIG_MMU
|
|
obj-$(CONFIG_SMP) += smp_tlb.o
|
|
endif
|
|
obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o
|
|
obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o
|
|
obj-$(CONFIG_ARM_ARCH_TIMER) += arch_timer.o
|
|
obj-$(CONFIG_FUNCTION_TRACER) += entry-ftrace.o
|
|
obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o insn.o
|
|
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o insn.o
|
|
obj-$(CONFIG_JUMP_LABEL) += jump_label.o insn.o patch.o
|
|
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
|
|
# Main staffs in KPROBES are in arch/arm/probes/ .
|
|
obj-$(CONFIG_KPROBES) += patch.o insn.o
|
|
obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
|
|
obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
|
|
obj-$(CONFIG_KGDB) += kgdb.o patch.o
|
|
obj-$(CONFIG_ARM_UNWIND) += unwind.o
|
|
obj-$(CONFIG_HAVE_TCM) += tcm.o
|
|
obj-$(CONFIG_OF) += devtree.o
|
|
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
|
|
obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o
|
|
CFLAGS_swp_emulate.o := -Wa,-march=armv7-a
|
|
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
|
|
|
|
obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o
|
|
obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
|
|
obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
|
|
obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o
|
|
obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o
|
|
obj-$(CONFIG_IWMMXT) += iwmmxt.o
|
|
obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
|
|
obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o perf_event_cpu.o
|
|
CFLAGS_pj4-cp0.o := -marm
|
|
AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
|
|
obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o
|
|
|
|
ifneq ($(CONFIG_ARCH_EBSA110),y)
|
|
obj-y += io.o
|
|
endif
|
|
|
|
head-y := head$(MMUEXT).o
|
|
obj-$(CONFIG_DEBUG_LL) += debug.o
|
|
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
|
|
|
obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o
|
|
ifeq ($(CONFIG_ARM_PSCI),y)
|
|
obj-y += psci.o
|
|
obj-$(CONFIG_SMP) += psci_smp.o
|
|
endif
|
|
|
|
extra-y := $(head-y) vmlinux.lds
|