dtrace: fix userspace access on boxes with SMAPdtrace has its own routines which were not updated after SMAP support gotimplemented. Use ifunc just like for other routines.This in particular fix
dtrace: fix userspace access on boxes with SMAPdtrace has its own routines which were not updated after SMAP support gotimplemented. Use ifunc just like for other routines.This in particular fixes ustack().Reviewed by: markjSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D18542
show more ...
Remove very old and unused signal information codes.These have been supplanted by the MI signal information codes in<sys/signal.h> since 7.0. The FPE_*_TRAP ones were deprecated evenearlier in 1
Remove very old and unused signal information codes.These have been supplanted by the MI signal information codes in<sys/signal.h> since 7.0. The FPE_*_TRAP ones were deprecated evenearlier in 1999.PR: 226579 (exp-run)Reviewed by: kibDifferential Revision: https://reviews.freebsd.org/D14637
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
Avoid CPU migration in dtrace_gethrtime() on x86.dtrace_gethrtime() may be called outside of probe context, and inparticular, from the DTRACEIOC_BUFSNAP handler.Disable interrupts rather than us
Avoid CPU migration in dtrace_gethrtime() on x86.dtrace_gethrtime() may be called outside of probe context, and inparticular, from the DTRACEIOC_BUFSNAP handler.Disable interrupts rather than using sched_pin() to help ensure thatwe don't call any external functions when in probe context.PR: 218452MFC after: 1 week
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
Directly include needed headers rather than relying on pollution.We get machine/cpu.h via kmem.h -> proc.h -> _vm_domain.h -> seq.h.Reported by: Ryan LibbySponsored by: Dell EMC IsilonX-MFC wit
Directly include needed headers rather than relying on pollution.We get machine/cpu.h via kmem.h -> proc.h -> _vm_domain.h -> seq.h.Reported by: Ryan LibbySponsored by: Dell EMC IsilonX-MFC with: r313841
Prevent CPU migration when checking the DTrace nofault flag on x86.dtrace_trap() consumes page and protection faults triggered by code runningin DTrace probe context. Such faults occur with interr
Prevent CPU migration when checking the DTrace nofault flag on x86.dtrace_trap() consumes page and protection faults triggered by code runningin DTrace probe context. Such faults occur with interrupts disabled and aredetected using a per-CPU flag. Regular faults cause dtrace_trap() to becalled with interrupts enabled, and nothing was ensuring that the flag wasread from the correct CPU. This may result in dtrace_trap() consumingunrelated page and protection faults when DTrace is enabled, causing thefault handler to return without actually having handled the fault.Diagnosed by: Ryan Libby <rlibby@gmail.com>MFC after: 3 daysSponsored by: Dell EMC Isilon
Merge {amd64,i386}/instr_size.c into x86_instr_size.c.Also reduce the diff between us and upstream: the input data model willalways be DATAMODEL_NATIVE because of a bug (p_model is never set but i
Merge {amd64,i386}/instr_size.c into x86_instr_size.c.Also reduce the diff between us and upstream: the input data model willalways be DATAMODEL_NATIVE because of a bug (p_model is never set but isalways initialized to 0), so we don't need to override the caller anyway.This change is also necessary to support the pid provider for 32-bitprocesses on amd64.MFC after: 2 weeks
Add an EARLY_AP_STARTUP option to start APs earlier during boot.Currently, Application Processors (non-boot CPUs) are started byMD code at SI_SUB_CPU, but they are kept waiting in a "pen" untilSI
Add an EARLY_AP_STARTUP option to start APs earlier during boot.Currently, Application Processors (non-boot CPUs) are started byMD code at SI_SUB_CPU, but they are kept waiting in a "pen" untilSI_SUB_SMP at which point they are released to run kernel threads.SI_SUB_SMP is one of the last SYSINIT levels, so APs don't enterthe scheduler and start running threads until fairly late in theboot.This change moves SI_SUB_SMP up to just before software interruptthreads are created allowing the APs to start executing kernelthreads much sooner (before any devices are probed). This allowsseveral initialization routines that need to perform initializationon all CPUs to now perform that initialization in one step ratherthan having to defer the AP initialization to a second SYSINIT runat SI_SUB_SMP. It also permits all CPUs to be available forhandling interrupts before any devices are probed.This last feature fixes a problem on with interrupt vector exhaustion.Specifically, in the old model all device interrupts were routedonto the boot CPU during boot. Later after the APs were released atSI_SUB_SMP, interrupts were redistributed across all CPUs.However, several drivers for multiqueue hardware allocate N interruptsper CPU in the system. In a system with many CPUs, just a few driversdoing this could exhaust the available pool of interrupt vectors onthe boot CPU as each driver was allocating N * mp_ncpu vectors on theboot CPU. Now, drivers will allocate interrupts on their desired CPUsduring boot meaning that only N interrupts are allocated from the bootCPU instead of N * mp_ncpu.Some other bits of code can also be simplified as smp_started isnow true much earlier and will now always be true for these bits ofcode. This removes the need to treat the single-CPU boot environmentas a special case.As a transition aid, the new behavior is available under a new kerneloption (EARLY_AP_STARTUP). This will allow the option to be turned offif need be during initial testing. I plan to enable this on x86 bydefault in a followup commit in the next few days and to have allplatforms moved over before 11.0. Once the transition is complete,the option will be removed along with the !EARLY_AP_STARTUP code.These changes have only been tested on x86. Other platform maintainersare encouraged to port their architectures over as well. The mainthings to check for are any uses of smp_started in MD code that can besimplified and SI_SUB_SMP SYSINITs in MD code that can be removed inthe EARLY_AP_STARTUP case (e.g. the interrupt shuffling).PR: kern/199321Reviewed by: markj, gnn, kibSponsored by: Netflix
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.
Initialize DTrace hrtimer frequency during SI_SUB_CPU on i386 and amd64.This allows the hrtimer to be used earlier during boot. This is requiredfor boot-time DTrace: anonymous enablings are create
Initialize DTrace hrtimer frequency during SI_SUB_CPU on i386 and amd64.This allows the hrtimer to be used earlier during boot. This is requiredfor boot-time DTrace: anonymous enablings are created duringSI_SUB_DTRACE_ANON, which runs before APs are started. In particular,the DTrace deadman timer requires that the hrtimer be functional.MFC after: 2 weeks
Remove unused variables dtrace_in_probe and dtrace_in_probe_addr.
Fix a bug in the amd64 dtrace_getarg() implementation: when unwinding thestack, take into account the copy of rsi pushed between the breakpointtrapframe and the dtrace_invop frame. Prior to r287644
Fix a bug in the amd64 dtrace_getarg() implementation: when unwinding thestack, take into account the copy of rsi pushed between the breakpointtrapframe and the dtrace_invop frame. Prior to r287644, this was coveredby the fact that sizeof(struct amd64_frame) was 24 rather than 16.Reported by: smh
dtrace_getarg: remove stray return statement on amd64, powerpcMFC after: 10 days
Remove the arg0 field from struct amd64_frame. Its existence was a bug,since on amd64 the first argument to a function is generally not on thestack.Revert an old DTrace bug fix to some code that
Remove the arg0 field from struct amd64_frame. Its existence was a bug,since on amd64 the first argument to a function is generally not on thestack.Revert an old DTrace bug fix to some code that assumed thatsizeof(struct amd64_frame) == 16.Reviewed by: jhb, kibSponsored by: EMC / Isilon Storage DivisionDifferential Revision: https://reviews.freebsd.org/D3255
When checking for the valid value of the frame pointer, verify that itbelongs to the kernel stack address range for the thread. Right now,code checks that new frame is not farther then KSTACK_PAGE
When checking for the valid value of the frame pointer, verify that itbelongs to the kernel stack address range for the thread. Right now,code checks that new frame is not farther then KSTACK_PAGES pages fromthe current frame, which allows the address to point past the top ofthe stack.Reviewed by: andrew, emaste, markjDifferential revision: https://reviews.freebsd.org/D3108Sponsored by: The FreeBSD FoundationMFC after: 2 weeks
Remove unused references to calltrap.MFC after: 3 days
Remove some commented-out upstream code for handling traps from usermodeDTrace probes. This handling is already done in trap() on i386 and amd64.
Fix DTrace's panic() action.It would previously call into some unfinished Solaris compatibility code andreturn without actually calling panic(9). The compatibility code isunneeded, however, so ju
Fix DTrace's panic() action.It would previously call into some unfinished Solaris compatibility code andreturn without actually calling panic(9). The compatibility code isunneeded, however, so just remove it and have dtrace_panic() call vpanic(9)directly.Differential Revision: https://reviews.freebsd.org/D2349Reviewed by: avgMFC after: 2 weeksSponsored by: EMC / Isilon Storage Division
Import a missing piece of commit b8fac8e162eda7e98d from illumos-gate.This adds an upper bound, dtrace_ustackdepth_max, to the number of framestraversed when computing the userland stack depth. So
Import a missing piece of commit b8fac8e162eda7e98d from illumos-gate.This adds an upper bound, dtrace_ustackdepth_max, to the number of framestraversed when computing the userland stack depth. Some programs - notablyfirefox - are otherwise able to trigger an infinite loop indtrace_getustack_common(), causing a panic.MFC after: 1 week
Mechanically convert cddl sun #ifdef's to illumosSince the upstream for cddl code is now illumos not sun, mechanicallyconvert all sun #ifdef's to illumos #ifdef's which have been used in allnewer
Mechanically convert cddl sun #ifdef's to illumosSince the upstream for cddl code is now illumos not sun, mechanicallyconvert all sun #ifdef's to illumos #ifdef's which have been used in allnewer code for some time.Also do a manual pass to correct the use if #ifdef comments as per style(9)as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos.MFC after: 1 monthSponsored by: Multiplay
Restore the trap type argument to the DTrace trap hook, removed in r268600.It's redundant at the moment since it can be obtained from the trapframeon the architectures where DTrace is supported, bu
Restore the trap type argument to the DTrace trap hook, removed in r268600.It's redundant at the moment since it can be obtained from the trapframeon the architectures where DTrace is supported, but this won't be the casewith ARM.
Use a C wrapper for trap() instead of checking and calling the DTrace traphook in assembly.Suggested by: kibReviewed by: kib (original version)X-MFC-With: r268600
Invoke the DTrace trap handler before calling trap() on amd64. This matchesthe upstream implementation and helps ensure that a trap induced by tracingfbt::trap:entry is handled without recursively
Invoke the DTrace trap handler before calling trap() on amd64. This matchesthe upstream implementation and helps ensure that a trap induced by tracingfbt::trap:entry is handled without recursively generating another trap.This makes it possible to run most (but not all) of the DTrace tests undercommon/safety/ without triggering a kernel panic.Submitted by: Anton Rang <anton.rang@isilon.com> (original version)Phabric: D95
Fix a couple of bugs on amd64 when fetching probe arguments beyond thefirst five for probes entered through a UD fault (i.e. FBT probes).Specifically, handle the fact that dtrace_invop_callsite mu
Fix a couple of bugs on amd64 when fetching probe arguments beyond thefirst five for probes entered through a UD fault (i.e. FBT probes).Specifically, handle the fact that dtrace_invop_callsite must be16 byte-aligned and thus may not immediately follow the call todtrace_invop() in dtrace_invop_start(). Also fetch register arguments andthe stack pointer through a struct trapframe instead of a struct reg.PR: 191260Submitted by: luke.tw@gmail.comMFC after: 3 weeks
1234