1. 19 Dec, 2017 19 commits
    • Stephen Hurd's avatar
      Update Matthew Macy contact info · 96fc97c8
      Stephen Hurd authored
      Email address has changed, uses consistent name (Matthew, not Matt)
      Reported by:	Matthew Macy <mmacy@mattmacy.io>
      Differential Revision:	https://reviews.freebsd.org/D13537
    • Mark Johnston's avatar
      Avoid using bioq_* in gmirror. · 9abe2e7e
      Mark Johnston authored
      gmirror does not perform any sorting of I/O requests, so the bioq API
      doesn't provide any advantages over plain TAILQs. The API also does not
      provide operations needed by an upcoming change.
      No functional change intended. The diff shrinks the geom_mirror.ko
      text and the gmirror softc slightly.
      Tested by:	pho (part of a larger patch)
      MFC after:	1 week
      Sponsored by:	Dell EMC Isilon
    • Alan Cox's avatar
      Document the semantics of atomic_thread_fence operations. · 22fd1b5d
      Alan Cox authored
      Add atomic_load_<type> and atomic_store_<type>, and explain why they
      Define the synchronizes-with relationship and its effects.
      Reorder and revise some of the existing text.  For example, more
      precisely describe when ordinary accesses are atomic.
      Reviewed by:	jhb, kib
      MFC after:	1 week
      Differential Revision:	https://reviews.freebsd.org/D13522
    • Nathan Whitehorn's avatar
      The highest-order bit of the bootloader cookie is 1, with the result that · d6716aa2
      Nathan Whitehorn authored
      the 32-bit cookie can be sign-extended on its way out of the loader and
      through Open Firmware. If sign-extended, the in-kernel check of its value
      would fail on 64-bit systems, resulting in a mountroot prompt. Solve this
      by telling the kernel to ignore the high-order bits.
      PR:		kern/224437
      Submitted by:	Gustavo Romero
    • Nathan Whitehorn's avatar
      Make __startkernel line up with KERNBASE, so that the math to compute the · 7cc0ad62
      Nathan Whitehorn authored
      applied relocation offset in link_elf.c works as intended. We may want to
      revisit how that works in future, for example by having elf_reloc_self()
      actually store the numbers it is using rather than computing them later,
      but this fixes symbol lookup after r326203.
      Reported by:	andreast@
      Pointy hat to:	me
    • Konstantin Belousov's avatar
      mlx5en: Avoid SFENCe on x86 · e44f4f35
      Konstantin Belousov authored
      The IA32 memory model guarantees that all writes are seen in the program
      order.  Also, any access to the uncacheable memory flushes the store
      buffers.  As the consequence, SFENCE instruction is (almost) never needed,
      in particular, it is not needed to ensure the correct order of updates as
      seen by a PCIe device.
      Use atomic_thread_fence_rel() instead of wb() to only emit compiler barriers
      on x86 there.  Other architectures get the right barrier instruction as
      Reviewed by:	hselasky
      Sponsored by:	Mellanox Technologies
      MFC after:	1 week
    • Konstantin Belousov's avatar
      Perform all accesses to uma_reclaim_needed using atomic(9) KPI. · 200f8117
      Konstantin Belousov authored
      Reviewed by:	alc, jhb
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D13534
    • Konstantin Belousov's avatar
      Use atomic_load(9) to read ppsinfo sequence numbers. · 6f697994
      Konstantin Belousov authored
      In this case volatile qualifiers enusre that a compiler does not
      optimize the accesses out.
      Reviewed by:	alc, jhb
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D13534
    • Konstantin Belousov's avatar
      Add atomic_load(9) and atomic_store(9) operations. · 30d4f9e8
      Konstantin Belousov authored
      They provide relaxed-ordered atomic access semantic.  Due to the
      FreeBSD memory model, the operations are syntaxical wrappers around
      the volatile accesses.  The volatile qualifier is used to ensure that
      the access not optimized out and in turn depends on the volatile
      semantic as implemented by supported compilers.
      The motivation for adding the operation is to help people coming from
      other systems or knowing the C11/C++ standards where atomics have
      special type and require use of the special access operations.  It is
      still the case that FreeBSD requires plain load and stores of aligned
      integer types to be atomic.
      Suggested by:	jhb
      Reviewed by:	alc, jhb
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D13534
    • Warner Losh's avatar
      When doing a dump, the scheduler is normally not running, so this · 5cf3cd10
      Warner Losh authored
      changed worked to capture dumps for me. However, the test for
      SCHEDULER_STOPPED() isn't right. We can also call the dump routine
      from ddb, in which case the scheduler is still running. This leads to
      an assertion panic that we're sleeping when we shouldn't. Instead, use
      the proper test for dumping or not. This brings us in line with other
      places that do special things while we're doing polled I/O like this.
      Noticed by: pho@
      Differential Revision: https://reviews.freebsd.org/D13531
    • Warner Losh's avatar
      No need to use relative paths like this here. · fc1340fb
      Warner Losh authored
      Sponsored by: Netflix
    • Warner Losh's avatar
      Hoist btx include stuff to i386/Makefile.inc · ca481bff
      Warner Losh authored
      Sponsored by: Netflix
    • Warner Losh's avatar
      Interact is always called with NULL. Simplify code a little by · 6bc86037
      Warner Losh authored
      removing this argument, and expanding when rc is NULL. This
      effectively completes the back out of custom scripts for tftp booted
      loaders from r269153 that was started in r292344 with the new path
      tricks that obsoleted it.
      Submitted by: Netflix
    • Warner Losh's avatar
      Simplify things a little. The RETURN macro isn't required. It's only · 0ff3f28b
      Warner Losh authored
      used once, inside an #ifdef where it would be defined to be return.
      Sponsored by: Netflix
    • Eitan Adler's avatar
      arc lint: ignore /tests/ in chmod · 9ff7bf7a
      Eitan Adler authored
      shell scripts in scripts don't need
      to be chmod +x to work. In fact most are not.
      Of the tests I found from a simple search:
      65 are chmod +x
      84 are chmod -x
      simply disable the check for test shell scripts.
      Recommit requested by:	cem, rgrimes
    • Eitan Adler's avatar
      arclint: revert in prep for recommitting · 8fbecf7b
      Eitan Adler authored
    • Ed Maste's avatar
      lld: Don't write preemptible symbol values to the .got. · a5d5fd9f
      Ed Maste authored
      It is not necessary and matches what bfd and gold do.
      This was a regression from [LLVM] r315658.
      Obtained from:	LLVM r321023 by Rafael Espíndola
    • Conrad Meyer's avatar
      Implement ACPI CPU support when Processor object is not present · e054cac7
      Conrad Meyer authored
      By the ACPI standard (ACPI 5 chapter 8.4 Declaring Processors) Processors
      can be implemented in 2 distinct ways:
      * Through a Processor object type (which provides P_BLK)
      * Through a Device object type
      Prior to this change, the FreeBSD driver only supported the former.  AMD
      Epyc / Poweredge systems we are testing both implement the latter only.  Add
      the missing support.
      Because P_BLK is not defined in the device object case, C-states entering
      must be completely controlled via _CST methods rather than P_LVL2/3.
      John Baldwin points out that ACPI 6.0 formally deprecates the Processor
      keyword, so eventually processors will only be enumerated as Device objects.
      Submitted by:	attilio
      Reviewed by:	jhb, markj, Anton Rang <rang AT acm.org>
      Relnotes:	maybe
      Sponsored by:	Dell EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D13457
    • Warner Losh's avatar
      Support more images (but still no geli) · 22cf6021
      Warner Losh authored
      Print a qemu line to a shell script to ease testing each image
      Start to support multiple architectures (still very green)
      Create /etc/rc that echos success and halts the system for better
      automation (also include halt)
      Create /etc/fstab on a per-boot type to test loader's passing root
      to kernel.
      This lets me run a test, connect to it with telnet and get either a
      timeout, or a report of success.
      Sponsored by: Netflix
  2. 18 Dec, 2017 13 commits
    • John Baldwin's avatar
      Catch up to r325719 which makes the kern.proc.pid sysctl "work" for zombies. · 3a014c56
      John Baldwin authored
      Some of the ptrace tests need to wait for a child process to become a
      zombie before preceding.  The parent process polls the child process
      via the kern.proc.pid sysctl to wait for it to become a zombie.
      Previously the code polled until the sysctl failed with ESRCH.  Now it
      will poll until either the sysctl fails with ESRCH (for compatiblity
      with older kernels) or returns a kinfo_proc structure with the ki_stat
      field set to SZOMB.
      Reported by:	Jenkins
      Tested by:	markj
      Discussed with:	mjg
      MFC after:	1 week
    • Warner Losh's avatar
      Although we only have one quirk at the moment, guard against the day · 989c7f0b
      Warner Losh authored
      we have more than one by checking the actual quirk bit before delaying
      the reset.
      Noticed by: rpokala@
    • Warner Losh's avatar
      When we're disabling the nvme device, some drives have a controller · ce1ec9c1
      Warner Losh authored
      bug that requires 'hands off' for a period of time (2.3s) before we
      check the RDY bit. Sicne this is a very odd quirk for a very limited
      selection of drives, do this as a quirk. This prevented a successful
      reset of the card when the card wedged.
      Also, make sure that we comply with the advice from section 3.1.5 of
      the 1.3 spec says that transitioning CC.EN from 0 to 1 when CSTS.RDY
      is 1 or transitioning CC.EN from 1 to 0 when CSTS.RDY is 0 "has
      undefined results". Short circuit when EN == RDY == desired state.
      Finally, fail the reset if the disable fails. This will lead to a
      failed device, which is what we want. (note: nda device needs
      work for coping with a failed device).
      Sponsored by: Netflix
      Differential Revision: https://reviews.freebsd.org/D13389
    • Mark Johnston's avatar
      Avoid CPU migration in dtrace_gethrtime() on x86. · 6c7828a2
      Mark Johnston authored
      dtrace_gethrtime() may be called outside of probe context, and in
      particular, from the DTRACEIOC_BUFSNAP handler.
      Disable interrupts rather than using sched_pin() to help ensure that
      we don't call any external functions when in probe context.
      PR:		218452
      MFC after:	1 week
    • Bruce Evans's avatar
      Also forgotten in the previous that removed the permanent double mapping · d5d56007
      Bruce Evans authored
      of low physical memory:
      Update the comment about leaving the permanent mapping in place.  This
      also improves the wording of the comment.  PTD 0 is still left alone
      because it is fairly important that it was unmapped earlier, and the
      comment now describes the unmapping of the other low PTDs that the code
      actually does.
      Reviewed by:	kib
    • Bruce Evans's avatar
      Remove the permanent double mapping of low physical memory and replace · 2ba6fe00
      Bruce Evans authored
      it by a transient double mapping for the one instruction in ACPI wakeup
      where it is needed (and for many surrounding instructions in ACPI resume).
      Invalidate the TLB as soon as convenient after undoing the transient
      mapping.  ACPI resume already has the strict ordering needed for this.
      This fixes the non-trapping of null pointers and other garbage pointers
      below NBPDR (except transiently).  NBPDR is quite large (4MB, or 2MB for
      This fixes spurious traps at the first instruction in VM86 bioscalls.
      The traps are for transiently missing read permission in the first
      VM86 page (physical page 0) which was just written to at KERNBASE in
      the kernel.  The mechanism is unknown (it is not simply PG_G).
      locore uses a similar but larger transient double mapping and needs
      it for 2 instructions instead of 1.  Unmap the first PDE in it after
      the 2 instructions to detect most garbage pointers while bootstrapping.
      pmap_bootstrap() finishes the unmapping.
      Remove the avoidance of the double mapping for a recently fixed special
      case.  ACPI resume could use this avoidance (made non-special) to avoid
      any problems with the transient double mapping, but no such problems
      are known.
      Update comments in locore.  Many were for old versions of FreeBSD which
      tried to map low memory r/o except for special cases, or might have
      allowed access to low memory via physical offsets.  Now all kernel
      maps are r/w, and removal of of the double map disallows use of physical
      offsets again.
    • Bruce Evans's avatar
      Fix the undersupported option KERNLOAD, part 2: fix crashes in locore · 4a5eb9ac
      Bruce Evans authored
      when KERNLOAD is smaller than NBPDR (not the default) and PG_G is
      enabled (the default if the CPU supports it).  This case has relatively
      minor problems with coherency of the permanent double mapping, but the
      fix in r167869 to improve coherency creates page tables with 3 different
      errors so never worked.
      The permanent double mapping is fundamentally broken and will be removed
      soon.  It fundamentally breaks trapping for null pointers and requires
      complications to avoid cache coherency bugs.  It is currently used for
      only a single instruction in ACPI resume,
      Many fixes VM86 and/or ACPI and/or the double map were attempted near
      r1200000.  r167869 attempted to fix cache coherency bugs in an unusual
      case, but the bugs were unreachable because older errors in page tables
      caused a crash first.
      This commit just makes r167869 work as intended.  Part 1 of these fixes
      fixed the other errors, but also stopped mapping the PDE for KERNBASE
      as a large page, so double mapping of this PDE only causes the same
      problems as when KERNLOAD is the default.  Except for the problem of
      trapping null pointers, r167869 could be used to fix these problems,
      but it is inactive in usual cases.  The only known other problem is
      that incoherent permissions for page 0 cause spurious traps in VM86
      BIOS calls.
      Reviewed by:	kib
    • Baptiste Daroussin's avatar
      newsyslog: Fix issues after r326616 · 64874a79
      Baptiste Daroussin authored
      When building the command to execute for compression, newsyslog was modifying
      the generic arguments array instead of its own copy.
      Meaning on the second file to compress with the same arguments, the command line
      was not the one expected.
      Fix it by creating one copy of the arguments per execution and modifying that
      While here, print the command line executed in verbose mode.
      Reported by:	many
    • Bruce Evans's avatar
      Fix the undersupported option KERNLOAD, part 1: fix crashes in locore · 3f21dc29
      Bruce Evans authored
      when KERNLOAD is not a multiple of NBPDR (not the default) and PSE is
      enabled (the default if the CPU supports it).  Addresses in PDEs must
      be a multiple of NBPDR in the PSE case, but were not so in the crashing
      KERNLOAD defaults to NBPDR.  NBPDR is 4 MB for !PAE and 2 MB for PAE.
      The default can be changed by editing i386/include/vmparam.h or using
      makeoptions.  It can be changed to less than NBPDR to save real and
      virtual memory at a small cost in time, or to more than NBPDR to waste
      real and virtual memory.  It must be larger than 1 MB and a multiple of
      PAGE_SIZE.  When it is less than NBPDR, it is necessarily not a multiple
      of NBPDR.  This case has much larger bugs which will be fixed in part 2.
      The fix is to only use PSE for physical addresses above <KERNLOAD
      rounded _up_ to an NBPDR boundary>.  When the rounding is non-null,
      this leaves part of the kernel not using large pages.  Rounding down
      would avoid this pessimization, but would break setting of PAT bits
      on i/o pages if it goes below 1MB.  Since rounding down always goes
      below 1MB when KERNLOAD < NBPDR and the KERNLOAD > NBPDR case is not
      useful, never round down.
      Fix related style bugs (e.g., wrong literal values for NBPDR in comments).
      Reviewed by:	kib
    • Warner Losh's avatar
      libficl is only ever used in a loader (never a boot) program. Move it · 76a8f5b0
      Warner Losh authored
      to loader.mk.
      Sponsored by: Netflix
    • Warner Losh's avatar
      Move loader help file definitions to being 100% inside of loader.mk. · 25c2f4cb
      Warner Losh authored
      HELP_FILES is a loader only thing, so move it to loader.mk. Only
      generate the help file if HELP_FILES is defined. Adjust Makefiles to
      new convention. Fix a few cases where ${.CURDIR}/ was missing
      resulting in missing bits from the help files.
      Sponsored by: Netflix
    • Ian Lepore's avatar
      Do not attempt to refill the TX fifo if there is no data left to transfer. · b5496277
      Ian Lepore authored
      A comment in bcm_bsc_fill_tx_fifo() even lists sc_totlen > 0 as a
      precondition for calling the routine.   I apparently forgot to make the
      code do what my comment said.
    • Ian Lepore's avatar
      Fix debugging output, fallout from something like s/read/readctl/g · ae992394
      Ian Lepore authored
      while renaming variables in a previous change.
  3. 17 Dec, 2017 1 commit
  4. 16 Dec, 2017 7 commits