git: kernel - Enhance the sniff code, refactor interrupt disablement for IPIs

Matthew Dillon dillon at
Sun Mar 26 23:43:17 PDT 2017

commit 67534613c487a9b4308151907f5d0e4777f5c814
Author: Matthew Dillon <dillon at>
Date:   Sun Mar 26 23:24:09 2017 -0700

    kernel - Enhance the sniff code, refactor interrupt disablement for IPIs
    * Add kern.sniff_enable, default to 1.  Allows the sysop to disable the
      feature if desired.
    * Add kern.sniff_target, allows sniff IPIs to be targetted to all cpus
      (-1), or to a particular cpu (0...N).  This feature allows the sysop
      to test IPI delivery to particular CPUs (typically monitoring with
      systat -pv 0.1) to determine that delivery is working properly.
    * Bring in some additional AMD-specific setup from FreeBSD, beginnings
      of support for the APIC Extended space.  For now just make sure the
      extended entries are masked.
    * Change interrupt disablement expectations.  The caller of apic_ipi(),
      selected_apic_ipi(), and related macros is now required to hard-disable
      interrupts rather than these functions doing so.  This allows the caller
      to run certain operational sequences atomically.
    * Use the TSC to detect IPI send stalls instead of a hard-coded loop count.
    * Also set the APIC_LEVEL_ASSERT bit when issuing a directed IPI, though
      the spec says this is unnecessary.  Do it anyway.
    * Remove unnecessary critical section in selected_apic_ipi().  We are in
      a hard-disablement and in particular we do not want to accidently trigger
      a splz() due to the crit_exit() while in the hard-disablement.
    * Enhance the IPI stall detection and recovery code.  Provide more
      inforamtion.  Also enable the LOOPMASK_IN debugging tracker by default.
    * Add a testing feature to machdep.all_but_self_ipi_enable.  By setting
      this to 2, we force the smp_invltlb() to always use the ALL_BUT_SELF IPI.
      For testing only.

Summary of changes:
 sys/cpu/x86_64/include/cpufunc.h      |   1 +
 sys/kern/kern_clock.c                 |  16 ++++-
 sys/kern/lwkt_ipiq.c                  |   2 +
 sys/platform/pc64/apic/apicreg.h      |  75 ++++++++++++++++++++-
 sys/platform/pc64/apic/lapic.c        | 123 +++++++++++++++++++++++++++-------
 sys/platform/pc64/x86_64/mp_machdep.c |  73 +++++++++++++++++---
 sys/platform/pc64/x86_64/pmap_inval.c |   4 +-
 7 files changed, 251 insertions(+), 43 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list