Displaying 1 50 of 324,561 commits (0.020s)

FreeBSD — head/sys/sys vmmeter.h, head/usr.bin/vmstat vmstat.8

Update various statements in vmstat(8) to match reality.

- The process stats are actually thread counts rather than process
- Simplify various descriptions to remove mention of stats that are
  updated every 5 seconds (all VM related stats are now "instant",
  only the load average is updated every 5 seconds).
- Don't make any mention of special treatment for processes that have
  been active in the last 20 seconds.  We don't track that stat.
- Rework the description of active virtual memory.  Call it mapped
  virtual memory and explicitly point out it is not the same as the
  active page queue (which corresponds to "Active" in top(1)), and
  also hint at the possible bogusness of the value (e.g. if a process
  maps a single page out of a multiple GB file, the entire file's size
  is considered mapped).
- Simplify a few descriptions that implied their output was a value
  per interval.  All of the "rate" values are per-second rates scaled
  across the interval.
- Update a few comments for 'struct vmtotal' along similar lines.

Reported by:        mwlucas (indirectly)
Reviewed by:        kib
MFC after:        1 week
Differential Revision:        https://reviews.freebsd.org/D13905

FreeBSD — head/sys/dev/uart uart_dev_msm.h

UART Clock Selection Register holds a divider value for a supplied clock,
not a final baud rate. The value for this register has to be calculated.

Sponsored by:        DARPA, AFRL
Delta File
+0 -16 head/sys/dev/uart/uart_dev_msm.h
+0 -16 1 file

FreeBSD — head/sys/dev/uart uart_dev_msm.c uart_dev_msm.h

Support for UART device found in Qualcomm Snapdragon 410E SoC.

Tested on DragonBoard 410c.

Reviewed by:        andrew
Sponsored by:        DARPA, AFRL
Differential Revision:        https://reviews.freebsd.org/D13972

FreeBSD — user/pho/stress2/misc crossmp10.sh

Added a new test scenario.

Sponsored by:        Dell EMC Isilon
Delta File
+102 -0 user/pho/stress2/misc/crossmp10.sh
+102 -0 1 file

FreeBSD — head/sys/arm64/arm64 machdep.c

Set the base address of translation table 0.

This fixes operation on Qualcomm Snapdragon and some other platforms.

During boot time on subsystems initialization we have some amount of
kernel threads created, then scheduler gives CPU time to each thread.
Eventually scheduler returns CPU execution back to thread 0. In this
case writing zero to ttbr0 in cpu_switch leads Qualcomm board to
reboot (asynchronously, CPU continues execution).

Similar to other kernel threads install a valid physical address
(kernel pmap) to user page table base register ttbr0.

Reviewed by:        andrew
Sponsored by:        DARPA, AFRL
Differential Revision:        https://reviews.freebsd.org/D13536
Delta File
+3 -0 head/sys/arm64/arm64/machdep.c
+3 -0 1 file

FreeBSD — head/sys/fs/nfsserver nfs_nfsdstate.c

nfs: Do not printf each time a lock structure is freed during module unload

There can be a lot of those structures and printing a line each time we free
one on module unload.

MFC after:        3 days

FreeBSD — head/sys/amd64/amd64 machdep.c, head/sys/amd64/include md_var.h cpu.h

Move the kernphys declaration to machine/md_var.h.

Apparently machinde/cpu.h is supposed to contain MD implementations of
MI interfaces.  Also, remove kernphys declaration from machdep.c,
since it is already provided by md_var.h.

Requested and reviewed by:        bde
MFC after:        13 days

FreeBSD — stable/11/sys/compat/cloudabi cloudabi_futex.c cloudabi_util.h, stable/11/sys/compat/cloudabi32 cloudabi32_poll.c

MFC r327560:

  Allow timed waits with relative timeouts on locks and condvars.

  Even though pthreads doesn't support this, there are various alternative
  APIs that use this. For example, uv_cond_timedwait() accepts a relative
  timeout. So does Rust's std::sync::Condvar::wait_timeout().

  Though I personally think that relative timeouts are bad (due to
  imprecision for repeated operations), it does seem that people want
  this. Extend the existing futex functions to keep track of whether an
  absolute timeout is used in a boolean flag.

FreeBSD — head/sys/kern vfs_bio.c

correct read-ahead calculations in vfs_bio_getpages

Previously the calculations were done as if the requested region
ended at the start of the last requested page, not its end.
The problem as actually quite minor as it affected only stats and
page prefaulting, not the actual page data, and only with specific

Reviewed by:        kib (previous version)
MFC after:        2 weeks
Delta File
+8 -1 head/sys/kern/vfs_bio.c
+8 -1 1 file

FreeBSD — stable/11/sys/boot/common reloc_elf.c

MFC r327822:
Skip IRELATIVE relocations when loader processes ELF files.

FreeBSD — stable/11/sys/amd64/amd64 exception.S

MFC r327819:
Do not redundantly clear %RFLAGS.DF on fast syscall entry.

FreeBSD — stable/11/sys/amd64/amd64 machdep.c mp_machdep.c, stable/11/sys/amd64/include md_var.h

MFC r327818:
Move the hardware setup for fast syscalls into a common function.

FreeBSD — stable/11/sys/vm vm_swapout.c

MFC r327555:
Restructure swapout tests after vm map locking was removed.
Delta File
+45 -98 stable/11/sys/vm/vm_swapout.c
+45 -98 1 file

FreeBSD — stable/11/sys/vm vm_swapout.c

MFC r327450 (by alc):
Eliminate "minslptime".
Delta File
+6 -13 stable/11/sys/vm/vm_swapout.c
+6 -13 1 file

FreeBSD — head/sys/amd64/amd64 pmap.c, head/sys/amd64/include cpu.h

Fix compilation with gcc.

etext is already declared in machine/cpu.h, move kernphys declaration
there too.

Based on the patch by:        bde
MFC after:        13 days

FreeBSD — head/sys/amd64/include asmacros.h

Fix compilation with gas.

Submitted by:        bde
MFC after:        13 days
Delta File
+1 -1 head/sys/amd64/include/asmacros.h
+1 -1 1 file

FreeBSD — user/pho/stress2/tools setup.sh

Initial version of a simple setup script.

Sponsored by:        Dell EMC Isilon
Delta File
+28 -0 user/pho/stress2/tools/setup.sh
+28 -0 1 file

FreeBSD — user/pho/stress2/testcases/link link.c

Remove redundant test and added style fixes while here.

Sponsored by:        Dell EMC Isilon
Delta File
+12 -14 user/pho/stress2/testcases/link/link.c
+12 -14 1 file

FreeBSD — head/sys/amd64/amd64 pmap.c

Remove the 'last' argument from the pmap_pti_free_page().

It is in fact unused.

Noted and reviewed by:        markj
Sponsored by:        The FreeBSD Foundation
MFC after:        13 days
Delta File
+12 -13 head/sys/amd64/amd64/pmap.c
+12 -13 1 file

FreeBSD — head/sys/arm64/arm64 pmap.c

Add a pmap invalidate that doesn't call sched_pin.

When demoting DMAP pages curthread may be pointing to data within the
page we are demoting. Create a new invalidate that doesn't pin and use
it in the demote case.

As the demote has both interrupts disabled, and is within a critical section
this is safe from having the scheduler from switching to another CPU.

Reported by:        loos
Reviewed by:        loos
Sponsored by:        DARPA, AFRL
Differential Revision:        https://reviews.freebsd.org/D13955
Delta File
+10 -3 head/sys/arm64/arm64/pmap.c
+10 -3 1 file

FreeBSD — user/jeff/numa/sys/vm vm_page.c

This call to lock should've been unlock.

Reported by:        pho
Delta File
+1 -1 user/jeff/numa/sys/vm/vm_page.c
+1 -1 1 file

FreeBSD — head/sys/powerpc/powerpc mp_machdep.c

Call platform_smp_ap_init before decr_ap_init

    In platform_smp_ap_init we are doing some crucial code (eg. set LPCR register)
    which have influence over further execution.

    Practiculary in PowerNV platform we have experienced Data Storage Interrupt
    before we set apropriate LPCR. It caused code execution from location which was
    legal in bootloader (petitboot based on linux) but illegal in FreeBSD

FreeBSD — head/sys/powerpc/powerpc vm_machdep.c swtch64.S

PPC64: fix TOC behavior on process initialization

Set stack pointer to correct value after thread's stack pointer restore

Restoring new thread's stack pointer caused stack corruption because
restored stack pointer didn't point to callee (cpu_switch) stack frame but
caller stack frame.

As a result we had mysterious errors in caller function (sched_switch).

Solution: simply set stack pointer to correct value

Also, initialize TOC to a valid pointer once the thread is being

Created by:            Patryk Duda <pdk at semihalf.com>
Submitted by:          Wojciech Macek <wma at semihalf.com>
Obtained from:         Semihalf
Reviewed by:           nwhitehorn
Differential revision: https://reviews.freebsd.org/D13947
Sponsored by:          QCM Technologies

FreeBSD — head/sys/powerpc/powerpc machdep.c

PPC: machdep, zero BSS always but BookE

Zero BSS always. The only case when this operation is
ommitted is when booting on BookE.

Created by:            Wojciech Macek <wma at semihalf.com>
Obtained from:         Semihalf
Reviewed by:           imp, nwhitehorn
Differential revision: https://reviews.freebsd.org/D13948
Sponsored by:          QCM Technologies

FreeBSD — head/sys/kern subr_kdb.c

KDB: restart only CPUs stopped by KDB

There is a case when not all CPUs went online. In that situation,
restart only APs which were operational before entering KDB.

Created by:            Wojciech Macek <wma at semihalf.com>
Obtained from:         Semihalf
Reviewed by:           nwhitehorn
Differential revision: https://reviews.freebsd.org/D13949
Sponsored by:          QCM Technologies
Delta File
+3 -1 head/sys/kern/subr_kdb.c
+3 -1 1 file

FreeBSD — head/sys/powerpc/conf GENERIC64

PPC64: add AHCI back to GENERIC64

> Description of fields to fill in above:                     76 columns --|
> PR:                       If a GNATS PR is affected by the change.
> Submitted by:             If someone else sent in the change.
> Reviewed by:              If someone else reviewed your modification.
> Approved by:              If you needed approval for this commit.
> Obtained from:            If the change is from a third party.
> MFC after:                N [day[s]|week[s]|month[s]].  Request a reminder email.
> MFH:                      Ports tree branch name.  Request approval for merge.
> Relnotes:                 Set to 'yes' for mention in release notes.
> Security:                 Vulnerability reference (one per line) or description.
> Sponsored by:             If the change was sponsored by an organization.
> Differential Revision:    https://reviews.freebsd.org/D### (*full* phabric URL needed).
> Empty fields above will be automatically removed.

M    sys/powerpc/conf/GENERIC64
Delta File
+1 -1 head/sys/powerpc/conf/GENERIC64
+1 -1 1 file

FreeBSD — head/sbin/geom/class/nop gnop.8 geom_nop.c, head/sys/geom/nop g_nop.c g_nop.h

gnop(8): add the ability to set a nop provider's physical path

While I'm here, expand the existing tests a bit.

MFC after:        3 weeks
Differential Revision:        https://reviews.freebsd.org/D13579

FreeBSD — head/etc/mtree BSD.root.dist, head/share/man/man7 hier.7

stand: Add /boot/overlays to allow separation of overlays from base FDT

This matches directory structure used commonly in Linux-land, and it's
cleaner than mixing overlays into the existing module paths. Overlays are
still mixed in by specifying fdt_overlays in loader.conf(5).

Reviewed by:        manu
Differential Revision:        https://reviews.freebsd.org/D13922

FreeBSD — head/stand/fdt fdt_overlay.c fdt_overlay.h, head/sys/contrib/libfdt fdt_overlay.c libfdt.h

libfdt: Update to 1.4.6, switch to using libfdt for overlay support

libfdt highlights since 1.4.3:

- fdt_property_placeholder added to create a property without specifying its
value at creation time
- stringlist helper functions added to libfdt
- Improved overlay support
- Various internal cleanup

Also switch stand/fdt over to using libfdt for overlay support with this
update. Our current overlay implementation works only for limited use cases
with overlays generated only by some specific versions of our dtc(1). Swap
it out for the libfdt implementation, which supports any properly generated
overlay being applied to a properly generated base.

This will be followed up fairly soon with an update to dtc(1) in tree to
properly generate overlays.

MFC note: the <stdlib.h> include this update introduces in libfdt_env.h is
apparently not necessary in the context we use this in. It's not immediately
clear to me the motivation for it being introduced, but it came in with
overlay support. I've left it in for the sake of accuracy and because it's
not harmful here on HEAD, but MFC'ing this to stable/11 will require
wrapping the #include in an `#ifndef _STANDALONE` block or else it will

    [8 lines not shown]

FreeBSD — head/usr.sbin/kldxref ef_powerpc.c

Adjust format string to fix build.

FreeBSD — head/usr.sbin/kldxref ef_powerpc.c

Tidy some whitespace.

FreeBSD — head/sys/amd64/include vmm.h, head/sys/amd64/vmm/amd svm.c svm.h

Save and restore guest debug registers.

Currently most of the debug registers are not saved and restored
during VM transitions allowing guest and host debug register values to
leak into the opposite context.  One result is that hardware
watchpoints do not work reliably within a guest under VT-x.

Due to differences in SVM and VT-x, slightly different approaches are

For VT-x:

- Enable debug register save/restore for VM entry/exit in the VMCS for
- Explicitly save DR0-3,6 of the guest.
- Explicitly save DR0-3,6-7, MSR_DEBUGCTL, and the trap flag from
  %rflags for the host.  Note that because DR6 is "software" managed
  and not stored in the VMCS a kernel debugger which single steps
  through VM entry could corrupt the guest DR6 (since a single step
  trap taken after loading the guest DR6 could alter the DR6
  register).  To avoid this, explicitly disable single-stepping via
  the trace flag before loading the guest DR6.  A determined debugger
  could still defeat this by setting a breakpoint after the guest DR6
  was loaded and then single-stepping.

    [14 lines not shown]

FreeBSD — head/stand/common load_elf_obj.c, head/sys/kern link_elf_obj.c

Require the SHF_ALLOC flag for program sections from kernel object modules.

ELF object files can contain program sections which are not supposed
to be loaded into memory (e.g. .comment).  Normally the static linker
uses these flags to decide which sections are allocated to loadable
program segments in ELF binaries and shared objects (including kernels
on all architectures and kernel modules on architectures other than

Mapping ELF object files (such as amd64 kernel modules) into memory
directly is a bit of a grey area.  ELF object files are intended to be
used as inputs to the static linker.  As a result, there is not a
standardized definition for what the memory layout of an ELF object
should be (none of the section headers have valid virtual memory
addresses for example).

The kernel and loader were not checking the SHF_ALLOC flag but loading
any program sections with certain types such as SHT_PROGBITS.  As a
result, the kernel and loader would load into RAM some sections that
weren't marked with SHF_ALLOC such as .comment that are not loaded
into RAM for kernel modules on other architectures (which are
implemented as ELF shared objects).  Aside from possibly requiring
slightly more RAM to hold a kernel module this does not affect runtime
correctness as the kernel relocates symbols based on the layout it

    [41 lines not shown]

FreeBSD — head/bin/ls print.c ls.c

Convert ls(1) to not use libxo(3)

libxo imposes a large burden on system utilities. In the case of ls, that
burden is difficult to justify -- any language that can interact with json
output can use readdir(3) and stat(2).

Logically, this reverts r291607, r285857, r285803, r285734, r285425,
r284494, r284489, r284252, and r284198.

Kyua tests continue to pass (libxo integration was entirely untested).

Reported by:        many
Reviewed by:        imp
Discussed with:        manu, bdrewery
Sponsored by:        Dell EMC Isilon
Differential Revision:        https://reviews.freebsd.org/D13959
Delta File
+65 -140 head/bin/ls/print.c
+18 -39 head/bin/ls/ls.c
+19 -33 head/bin/ls/util.c
+1 -11 head/bin/ls/ls.1
+4 -7 head/bin/ls/extern.h
+0 -3 head/bin/ls/ls.h
+1 -2 2 files not shown
+108 -235 8 files

FreeBSD — head/sys/fs/fdescfs fdesc_vnops.c, head/sys/fs/nfs nfs_commonport.c nfs_var.h

Use long for the last argument to VOP_PATHCONF rather than a register_t.

pathconf(2) and fpathconf(2) both return a long.  The kern_[f]pathconf()
functions now accept a pointer to a long value rather than modifying
td_retval directly.  Instead, the system calls explicitly store the
returned long value in td_retval[0].

Requested by:        bde
Reviewed by:        kib
Sponsored by:        Chelsio Communications

FreeBSD — head/sys/dev/bwn if_bwn_pci.c if_bwn.c

bwn(4): Enable, by default, the opt-in support for bhnd(4) introduced in

bwn(4)/bhnd(4) has been tested with most chipsets currently supported by
bwn(4), and this change should be transparent to existing bwn(4) users;
please report any regressions that you do encounter.

To revert to using siba_bwn(4) instead of bhnd(4), place the following
lines in loader.conf(5):


Once we're satisfied that the switch to bhnd(4) has seen sufficient broader
testing, bwn(4) will be migrated to use the native bhnd(9) interface
directly, and support for siba_bwn(4) will be dropped (see D13518).

Sponsored by:        The FreeBSD Foundation

FreeBSD — user/jeff/numa/sys/arm/arm pmap-v4.c, user/jeff/numa/sys/fs/tmpfs tmpfs_subr.c

Fix a reservation locking bug spotted by markj.
Make the reservation object lock an array of locks.
Fix the paging and laundry targets.
Make laundry per-domain.
Fix a compile error on powerpc and arm.

FreeBSD — head/sys/amd64/amd64 machdep.c exception.S

Annotate a couple of changes from r328083.

Reviewed by:        kib
X-MFC with:        r328083

FreeBSD — head/usr.sbin/kldxref ef.c

kldxref: additional sytle(9) cleanup

Reported by:        kib (via comments in D13957)
Sponsored by:        The FreeBSD Foundation
Delta File
+16 -16 head/usr.sbin/kldxref/ef.c
+16 -16 1 file

FreeBSD — head/usr.sbin/kldxref ef.c ef_obj.c

kldxref: improve style(9)

Address style issues including some previously raised in D13923.

- Use designated initializers for structs
- Always use bracketed return style
- No initialization in declarations
- Align function prototype names
- Remove old commented code/unused includes

Submitted by:        Mitchell Horne <mhorne063 at gmail.com>
Reviewed by:        kib
Sponsored by:        The FreeBSD Foundation
Differential Revision:        https://reviews.freebsd.org/D13943

FreeBSD — head/sys/ufs/ffs ffs_softdep.c ffs_snapshot.c, head/sys/ufs/ufs ufs_vnops.c

ufs: use mallocarray(9).

Basic use of mallocarray to prevent overflows: static analyzers are also
likely to perform additional checks.

Since mallocarray expects unsigned parameters, unsign some
related variables to minimize sign conversions.

Reviewed by:        mckusick

FreeBSD — head/lib/libufs cgread.3 cgroup.c, head/sbin/fsck_ffs gjournal.c suj.c

Correct fsck journal-recovery code to update a cylinder-group
check-hash after making changes to the cylinder group. The problem
was that the journal-recovery code was calling the libufs bwrite()
function instead of the cgput() function. The cgput() function updates
the cylinder-group check-hash before writing the cylinder group.

This change required the additions of the cgget() and cgput() functions
to the libufs API to avoid a gratuitous bcopy of every cylinder group
to be read or written. These new functions have been added to the
libufs manual pages. This was the first opportunity that I have had
to use and document the use of the EDOOFUS error code.

Reviewed by: kib
Reported by: emaste and others

FreeBSD — head/sys/crypto/via padlock_cipher.c

Revert r327340, as the workaround for rep prefixes followed by .byte
directives is no longer needed after r328090.

FreeBSD — head/contrib/llvm/lib/Target/X86/AsmParser X86AsmParser.cpp, head/lib/clang freebsd_cc_version.h

Pull in r322623 from upstream llvm trunk (by Andrew V. Tischenko):

  Allow usage of X86-prefixes as separate instrs.
  Differential Revision: https://reviews.llvm.org/D42102

This should fix parse errors when x86 prefixes (such as 'lock' and
'rep') are followed by various non-mnemonic tokens, e.g. comments, .byte
directives and labels.

PR:                224669,225054

FreeBSD — head/sys/dev/nvme nvme_sim.c

Move setting of CAM_SIM_QUEUED to before we actually submit it to the
hardware. Setting it after is racy, and we can lose the race on a
heavily loaded system.

Reviewed by: scottl@, gallatin@
Sponsored by: Netflix
Delta File
+2 -2 head/sys/dev/nvme/nvme_sim.c
+2 -2 1 file

FreeBSD — head/usr.sbin/pmcstat pmcstat.c

Only call flush in pipe mode.
It fixes a crash with a socket in top mode.

# pmcstat -R -T -w1
# pmcstat -n1 -Sclock.prof -Slock.failed -O

MFC after:        1 week
Sponsored by:        Stormshield
Delta File
+1 -0 head/usr.sbin/pmcstat/pmcstat.c
+1 -0 1 file

FreeBSD — head/lib/libpmc pmclog.c, head/sys/dev/hwpmc hwpmc_logging.c hwpmc_mod.c

Fix pmcstat exit from kernel introduced by r325275.
pmcstat request for close will generate a close event.
This event will be in turn received by pmcstat to close the file.

Reviewed by:        kib
Tested by:        pho
MFC after:        1 week
Sponsored by: Stormshield

FreeBSD — stable/11/sys/geom/mirror g_mirror.h

MFC r327768:
Clarify the use of the gmirror flag mask constants.

FreeBSD — head/share/misc pci_vendors

Update pciids to 2018.01.14

MFC after:        3 days
Delta File
+190 -26 head/share/misc/pci_vendors
+190 -26 1 file

FreeBSD — head/sbin/fsdb fsdb.c

Fix buildworld after r328075, by also renaming cgget to cglookup in

Reported by:        ohartmann at walstatt.org,david at catwhisker.org
Pointy hat to:        mckusick
Delta File
+1 -1 head/sbin/fsdb/fsdb.c
+1 -1 1 file