Handle functions that use a nop in the arm64 fbtTo trace leaf asm functions we can insert a single nop instruction asthe first instruction in a function and trigger off this.Reviewed by: gnnSpo
Handle functions that use a nop in the arm64 fbtTo trace leaf asm functions we can insert a single nop instruction asthe first instruction in a function and trigger off this.Reviewed by: gnnSponsored by: Innovate UKDifferential Revision: https://reviews.freebsd.org/D28132(cherry picked from commit 28d945204ea1014d7de6906af8470ed8b3311335)
show more ...
Fix dtrace fbt return probes on arm64As with arm and riscv fix return fbt probes on arm64. arg0 should bethe offset within the function of the return instruction and arg1should be the return valu
Fix dtrace fbt return probes on arm64As with arm and riscv fix return fbt probes on arm64. arg0 should bethe offset within the function of the return instruction and arg1should be the return value.Reviewed by: kp, markjSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D33440(cherry picked from commit e3ccf4f9dee9ae39774639407264199a07fa41ff)
Reimplemen FreeBSD/arm64 dtrace_gethrtime() to use the system timer.dtrace_gethrtime() is the high-resolution nanosecond timestemp usedfor the DTrace 'timestamp' built-in variable. The new impleme
Reimplemen FreeBSD/arm64 dtrace_gethrtime() to use the system timer.dtrace_gethrtime() is the high-resolution nanosecond timestemp usedfor the DTrace 'timestamp' built-in variable. The new implementationuses the EL0 cycle counter and frequency registers in ARMv8-A. Thisreplaces a previous implementation that relied on aninstrumentation-safe implementation of getnanotime(), which providedonly timer resolution.Approved by: re (gjb)Reviewed by: andrew, bsdimp (older version)Useful comments appreciated: jrtc27, emasteDifferential Revision: https://reviews.freebsd.org/D28723
Handle using a sub instruction in the arm64 fbtSome stack frames are too large for a store pair instruction we alreadydetect in the arm64 fbt code. Add support for handling subtracting thestack p
Handle using a sub instruction in the arm64 fbtSome stack frames are too large for a store pair instruction we alreadydetect in the arm64 fbt code. Add support for handling subtracting thestack pointer directly.Sponsored by: Innovate UK
Changes that improve DTrace FBT reliability on freebsd/arm64:- Implement a dtrace_getnanouptime(), matching the existing dtrace_getnanotime(), to avoid DTrace calling out to a potentially instr
Changes that improve DTrace FBT reliability on freebsd/arm64:- Implement a dtrace_getnanouptime(), matching the existing dtrace_getnanotime(), to avoid DTrace calling out to a potentially instrumentable function. (These should probably both be under KDTRACE_HOOKS. Also, it's not clear to me that they are correct implementations for the DTrace thread time functions they are used in .. fixes for another commit.)- Don't allow FBT to instrument functions involved in EL1 exception handling that are involved in FBT trap processing: handle_el1h_sync() and do_el1h_sync().- Don't allow FBT to instrument DDB and KDB functions, as that makes it rather harder to debug FBT problems.Prior to these changes, use of FBT on FreeBSD/arm64 rapidly led to kernelpanics due to recursion in DTrace.Reliable FBT on FreeBSD/arm64 is reliant on another change from @andrew tohave the aarch64 instrumentor more carefully check that instructions itreplaces are against the stack pointer, which can otherwise lead to memorycorruption. That change remains under review.MFC after: 2 weeksReviewed by: andrew, kp, markj (earlier version), jrtc27 (earlier version)Differential revision: https://reviews.freebsd.org/D27766
Check that the frame pointer is within the current stack.This same check is used on other architectures. Previously this wouldpermit a stack frame to unwind into any arbitrary kernel address(inc
Check that the frame pointer is within the current stack.This same check is used on other architectures. Previously this wouldpermit a stack frame to unwind into any arbitrary kernel address(including unmapped addresses).Reviewed by: andrew, markjObtained from: CheriBSDSponsored by: DARPADifferential Revision: https://reviews.freebsd.org/D27362
Use uintptr_t instead of uint64_t for pointers in stack frames.Reviewed by: andrewObtained from: CheriBSDSponsored by: DARPADifferential Revision: https://reviews.freebsd.org/D27361
Don't overflow the trap frame when accessing lr or xzr.When emulating a load pair or store pair in dtrace on arm64 we need tocopy the data between the stack and trap frame. When the registers are
Don't overflow the trap frame when accessing lr or xzr.When emulating a load pair or store pair in dtrace on arm64 we need tocopy the data between the stack and trap frame. When the registers areeither the link register or the zero register we will access memorypast the end of the trap frame as these are encoded as registers 30 and31 respectively while the array they access only has 30 entries.Fix this by creating 2 helper functions to perform the operation withspecial cases for these registers.Sponsored by: Innovate UK
DTrace aarch64: Avoid calling unwind_frame() in the probe context.unwind_frame() may be instrumented by FBT, leading to recursion intodtrace_probe(). Manually inline unwind_frame() as we do with s
DTrace aarch64: Avoid calling unwind_frame() in the probe context.unwind_frame() may be instrumented by FBT, leading to recursion intodtrace_probe(). Manually inline unwind_frame() as we do with stackunwinding code for other architectures.Submitted by: Domagoj StolfaReviewed by: manuMFC after: 1 weekSponsored by: DARPA / AFRLDifferential Revision: https://reviews.freebsd.org/D15359
Rename assym.s to assym.incassym is only to be included by other .s files, and should neveractually be assembled by itself.Reviewed by: imp, bdrewery (earlier)Sponsored by: The FreeBSD Foundati
Rename assym.s to assym.incassym is only to be included by other .s files, and should neveractually be assembled by itself.Reviewed by: imp, bdrewery (earlier)Sponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D14180
Corrected misspelled versions of rendezvous.The MFC will include a compat definition of smp_no_rendevous_barrier()that calls smp_no_rendezvous_barrier().Reviewed by: gnn, kibMFC after: 1 weekD
Corrected misspelled versions of rendezvous.The MFC will include a compat definition of smp_no_rendevous_barrier()that calls smp_no_rendezvous_barrier().Reviewed by: gnn, kibMFC after: 1 weekDifferential Revision: https://reviews.freebsd.org/D10313
Fix improper use of "its".Sponsored by: Dell EMC Isilon
Set oldfp so the check for fp == oldfp works as expected.Obtained from: ABT Systems LtdSponsored by: The FreeBSD Foundation
Fix dtrace_interrupt_disable and dtrace_interrupt_enable by having theformer return the current status for the latter to use. Without this wecould enable interrupts when they shouldn't be.It's st
Fix dtrace_interrupt_disable and dtrace_interrupt_enable by having theformer return the current status for the latter to use. Without this wecould enable interrupts when they shouldn't be.It's still not quite right as it should only update the bits we care about,bit should be good enough until the correct fix can be tested.PR: 204270Obtained from: ABT Systems LtdSponsored by: The FreeBSD Foundation
Try to unbreak the build after r300611 by including the headerdefining VM_MIN_KERNEL_ADDRESS.Sponsored by: DARPA/AFRL
Mark all memory before the kernel as toxic to DTrace.Obtained from: ABT Systems LtdSponsored by: The FreeBSD Foundation
Make the second argument of dtrace_invop() a trapframe pointer.Currently this argument is a pointer into the stack which is used by FBTto fetch the first five probe arguments. On all non-x86 archi
Make the second argument of dtrace_invop() a trapframe pointer.Currently this argument is a pointer into the stack which is used by FBTto fetch the first five probe arguments. On all non-x86 architectures it'ssimply the trapframe address, so this change has no functional impact. Onamd64 it's a pointer into the trapframe such that stack[1 .. 5] gives thefirst five argument registers, which are deliberately grouped together inthe amd64 trapframe definition.A trapframe argument simplifies the invop handlers on !x86 and makes thex86 FBT invop handler easier to understand. Moreover, it allows for invophandlers that may want to modify the register set of the interrupted thread.
Implement dtrace_getupcstack in ARM64Allow using DTRACE for performance analysis of userspaceapplications - the function call stack can be captured.This is almost an exact copy of AMD64 solution.
Implement dtrace_getupcstack in ARM64Allow using DTRACE for performance analysis of userspaceapplications - the function call stack can be captured.This is almost an exact copy of AMD64 solution.Obtained from: SemihalfSponsored by: CaviumReviewed by: emaste, gnn, jhibbitsDifferential Revision: https://reviews.freebsd.org/D5779
Remove unused variables dtrace_in_probe and dtrace_in_probe_addr.
As <machine/vmparam.h> is included from <vm/vm_param.h>, there is noneed to include it explicitly when <vm/vm_param.h> is already included.Suggested by: alcReviewed by: alcDifferential Revision:
As <machine/vmparam.h> is included from <vm/vm_param.h>, there is noneed to include it explicitly when <vm/vm_param.h> is already included.Suggested by: alcReviewed by: alcDifferential Revision: https://reviews.freebsd.org/D5379
First cut of DTrace for AArch64.Reviewed by: andrew, emasteSponsored by: ARM LimitedDifferential Revision: https://reviews.freebsd.org/D2738