dragonfly.git
2 years agoMerge branch 'vendor/TCSH'
Sascha Wildner [Mon, 31 May 2021 14:49:59 +0000 (16:49 +0200)]
Merge branch 'vendor/TCSH'

2 years agotcsh: Add csh-mode.el to the vendor branch.
Sascha Wildner [Mon, 31 May 2021 14:49:32 +0000 (16:49 +0200)]
tcsh: Add csh-mode.el to the vendor branch.

2 years agoRemove pccard_ether_delay rc variable.
Sascha Wildner [Sun, 30 May 2021 18:01:43 +0000 (20:01 +0200)]
Remove pccard_ether_delay rc variable.

Unused since cc41928392d83f4c9800219f797fd4ce87fbb295.

2 years agoamdtemp - Fix family 0x17 support, add family 0x19 support (2)
Matthew Dillon [Sun, 30 May 2021 06:50:33 +0000 (23:50 -0700)]
amdtemp - Fix family 0x17 support, add family 0x19 support (2)

* Get rid of debugging kprintfs and the family 0x18 sillyness I had
  added earlier.

* Unfortunately, there are still a multitude of problems with this
  driver.  Not only is the ncores supposed to be per-unit (and isn't,
  its whole-system), but the amdtemp driver attaches four times
  on the 3990X (units 0, 1, 2, 3) because there are four root complexes.
  Each attachment lists 8 CCDs.  And, insofar as I can tell, each of
  the four attachments are reading the same sensors even though they
  are hanging off of four different root complexes.

  (This is in addition to the driver not knowing how to map temp
   sensors to CPUs).

2 years agoamdtemp - Fix family 0x17 support, add family 0x19 support
Matthew Dillon [Sun, 30 May 2021 04:46:22 +0000 (21:46 -0700)]
amdtemp - Fix family 0x17 support, add family 0x19 support

* Also add family 0x19 to amdsmn and amdtemp.

* Add the AMD temperature sensors to the sensor infrastructure.  Sensors
  will now properly show up in 'systat -sensors 1'

* Fix up the parsing confusing.  Make it confusing, but less confusing
  than it was before.

  Tested with 3550H, 5900X, and 3990X.

* Note that the sc_ncores calculation is still broken, it appears to be
  calculating the total number of cores in the system and not the number
  of cores per reporting complex.  This means that the per-cpu temps in
  the sysctl tree (dev.cpu.N.temperature) will not be reported properly.

  But at least now it reports CCD temps as CCD temps, and these appear to
  be reported properly.

* Add family 0x18 (?) as well, think of it as family 0x19.  What is family
  0x18 you ask?  I have no idea.  But its between 0x17 and 0x19 so if it
  exists anywhere it probably use the same schema.

2 years agokernel - Misc adjustments to code documentation
Matthew Dillon [Sat, 29 May 2021 00:20:23 +0000 (17:20 -0700)]
kernel - Misc adjustments to code documentation

* Misc adjustments to bring some of the pmap related code
  comments up-to-date.

Submitted-by: falsifian (James Cook)
2 years agoperiodic: Rename 220.snapshot-hammer2 to 162.snapshot-hammer2.
Sascha Wildner [Thu, 27 May 2021 01:26:24 +0000 (03:26 +0200)]
periodic: Rename 220.snapshot-hammer2 to 162.snapshot-hammer2.

160.clean-hammer does cleanup _and_ snapshots for hammer1.

161.clean-hammer2 does the cleanup part for hammer2, so putting the
snapshot part of the job for hammer2 as 162 looks like the natural
choice.

2 years agoActually install the 510.status-world-kernel periodic script.
Sascha Wildner [Thu, 27 May 2021 00:30:56 +0000 (02:30 +0200)]
Actually install the 510.status-world-kernel periodic script.

2 years agoperiodic.conf.5: Fix .Dd
Sascha Wildner [Thu, 27 May 2021 00:01:58 +0000 (02:01 +0200)]
periodic.conf.5: Fix .Dd

2 years agolibusb: Remove two bogus vars from the Makefile.
Sascha Wildner [Wed, 26 May 2021 23:54:16 +0000 (01:54 +0200)]
libusb: Remove two bogus vars from the Makefile.

2 years agousb.4: Mention wsp(4) in the device list. Add some more useful references.
Sascha Wildner [Wed, 26 May 2021 23:23:45 +0000 (01:23 +0200)]
usb.4: Mention wsp(4) in the device list. Add some more useful references.

While here, add references to usb(4) to various USB driver manual pages.

2 years agoFix manual pages for the KERN_OSREV and KERN_OSRELDATE sysctls.
Sascha Wildner [Tue, 25 May 2021 20:24:09 +0000 (22:24 +0200)]
Fix manual pages for the KERN_OSREV and KERN_OSRELDATE sysctls.

Submitted-by: mikdusan
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/3270>

2 years agogcc: Fix the passing of LIBRARY_PATH to the linker.
Sascha Wildner [Tue, 25 May 2021 19:53:23 +0000 (21:53 +0200)]
gcc: Fix the passing of LIBRARY_PATH to the linker.

Don't define LINK_LIBGCC_SPEC as empty so that it will be the default
%D, which adds the necessary -L's for the directories in LIBRARY_PATH
to the linker command line.

It also adds a duplicate, but I think harmless, -L /usr/lib/gcc80
which we add earlier already. This can be improved separately.

Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2897>

2 years agobsd-family-tree: Sync with FreeBSD.
Sascha Wildner [Tue, 25 May 2021 07:50:55 +0000 (09:50 +0200)]
bsd-family-tree: Sync with FreeBSD.

2 years agolibexec/dma: sync with upstream
Daniel Fojt [Sat, 22 May 2021 08:32:11 +0000 (10:32 +0200)]
libexec/dma: sync with upstream

- fix parsing recipient from header
- fix '-oi' cmdline option processing
- add system hostname to received header comment
- read the correct aliases file when invoked as "newaliases"
- make verify_server_fingerprint() static
- update manpage

Discussed with: Sascha Wildner

2 years agokernel - Fix kernel crash in sysctl path
Matthew Dillon [Wed, 19 May 2021 18:05:20 +0000 (11:05 -0700)]
kernel - Fix kernel crash in sysctl path

* Fix a kernel crash which can occur in a particular sysctl due to some
  processes not having a p_textnch path.  The sysctl code was assuming that
  p->p_textnch would always be valid.  procfs already has the added check.

* Fix a race against exit, requiring the proc->p_token to be held.

Reported-by: htop devs, BenBE, cgzones
2 years agokernel - Clean-up comments on kmalloc_obj
Matthew Dillon [Wed, 19 May 2021 00:10:52 +0000 (17:10 -0700)]
kernel - Clean-up comments on kmalloc_obj

* Rewrite some of the confusing comments (that were no longer appplicable).

* Remove the mgt back-pointer from the slab structure.  It is something
  that I originally had to actively deal with slabs in kfree_obj(), but
  eventually decided to nix in favor of a top-down passive poll instead.

Reported-by: James Cook
2 years agokernel - Reduce auto maxvnodes calculation
Matthew Dillon [Tue, 18 May 2021 18:30:11 +0000 (11:30 -0700)]
kernel - Reduce auto maxvnodes calculation

* Reduce the default kern.maxvnodes value further.  On low-memory systems
  reduce the calculation by roughly 40%.  On systems with more memory,
  reduce the calculation by roughly 60%.

  kern.maxvnodes has a large knock-on effect with kernel memory use.
  The number of struct vnode, struct vm_object, and various filesystem
  structures tend to scale with kern.maxvnodes.  These have gotten larger
  over the years.

  At the same time, block caching is now mostly done at the block-device
  level rather than the vnode level, particularly for HAMMER1 and HAMMER2
  filesystems.  Having a huge kern.maxvnodes setting just isn't necessary.
  Even on huge-memory machines, going beyond a few million isn't going to
  do a whole lot.

* With these changes, a system with 2G of ram, maxvnodes drops from roughly
  70,000 to roughly 40,000.  On a system with 64G of ram, maxvnodes drops
  from the cap (4M) to around 1.6M.

* This modestly reduces steady-state kernel wired memory use on
  systems with modest to high uptimes.

2 years agokernel - Adjust count algorithm a little
Matthew Dillon [Tue, 18 May 2021 16:54:24 +0000 (09:54 -0700)]
kernel - Adjust count algorithm a little

* Remove an unnecessary pre-alignment.  The division rounds down and will
  take care of any mis-alignment with regards to calculating the correct
  count value.

* Theoretically due to the fact that the slab is already aligned, and the
  size is already aligned, and the division rounds down, the count
  calculation will be correct.  However we leave te safety code in and make
  it a bit more robust just in case some programmer messes with the code
  later on.

Reported-by: James Cook
2 years agokernel - Major refactor of pageout daemon algorithms (2)
Matthew Dillon [Tue, 18 May 2021 04:57:37 +0000 (21:57 -0700)]
kernel - Major refactor of pageout daemon algorithms (2)

* Refactor the pageout daemon's 'pass' variable handling.  No longer
  sleep or slow down the pageout daemon if paging has been running for
  a long time, doing so just places the system in an unrecoverable
  state.

* Fix a vm_paging_target2() test that was inverted.  This caused the
  vm_pageout_scan_inactive() to improperly break out after scanning
  one page per queue (x 1024 queues so it wasn't readily apparent).

* Modify the 'vmwait' and 'pfault' trip points (that block a process on
  low memory) based on the process nice value.  The result is that nice +N
  processes which are heavy memory users will tend to block before
  completely exhausting the FREE+CACHE pool, allowing other lower-niced
  processes to continue running somewhat normally.

  I say somewhat because the mechanism isn't perfect.  However, it should
  be good enough that if bulk work is partitioned a bit with higher nice
  values, shells should remain responsive enough to diagnose issues even
  during extreme paging.

* For the moment make the 'vmwait' trip point only slightly worse
  than the 'pfault' trip point at any given p_nice.  The 'vmwait' trip
  point used to be significantly worse (that is, would trip earlier).

  We have generally found that blockages on pfault are significantly more
  damaging to performance than blockages on I/O-related allocations, so
  don't completely equalize the two trip points.

* Have the pageout code check for and report possible vm_page queue
  races when removing pages.  In particular, pages appear to be able
  to wind up in PQ_CACHE that are still PG_MAPPED.

* Fix various calculations that divide by MAXSCAN_DIVIDER to error
  on the high-side instead of the low-side.

* Fix vm.pageout_debug output to reduce spew.

2 years agovmpageinfo - Update debug/ program
Matthew Dillon [Tue, 18 May 2021 04:56:09 +0000 (21:56 -0700)]
vmpageinfo - Update debug/ program

* Update vmpageinfo for kernel vm work and make it
  compile again.

2 years agodsynth - Add -M scale option
Matthew Dillon [Mon, 17 May 2021 22:48:59 +0000 (15:48 -0700)]
dsynth - Add -M scale option

* Add option to scale the number of workers allowed.  The dynamic workers
  calculation operates normally but all results are scaled accordingly.
  Values between 0.01 and 99.0 are acceptable.

  This option does not modify the number of jobs for each worker.

* Typically used for load testing.  Generally speaking, for actual use
  the scale should be specified between 0.8 and 1.2.   The default scale
  factor is 1.0.

2 years agokernel - Major refactor of pageout daemon algorithms
Matthew Dillon [Mon, 17 May 2021 20:04:56 +0000 (13:04 -0700)]
kernel - Major refactor of pageout daemon algorithms

* Rewrite a large chunk of the pageout daemon's algorithm to significantly
  improve page selection for pageout on low-memory systems.

* Implement persistent markers for hold and active queue scans.  Instead
  of moving pages within the queues, we now implement a persistent marker
  and just move the marker instead.  This ensures 100% fair scanning of
  these queues.

* The pageout state machine is now governed by the following sysctls
  (with some example default settings from a 32G box containing 8071042
  pages):

  vm.v_free_reserved: 20216
  vm.v_free_min: 40419
  vm.v_paging_wait: 80838
  vm.v_paging_start: 121257
  vm.v_paging_target1: 161676
  vm.v_paging_target2: 202095

  And separately

  vm.v_inactive_target: 484161

  The arrangement is as follows:

    reserved < severe < minimum < wait < start < target1 < target2

* Paging is governed as follows:  The pageout daemon is activated when
  FREE+CACHE falls below (v_paging_start).  The daemon will free memory
  up until FREE+CACHE reaches (v_paging_target1), and then continue to
  free memory up more slowly until FREE+CACHE reaches (v_paging_target2).

  If, due to memory demand, FREE+CACHE falls below (v_paging_wait), most
  userland processes will begin short-stalls on VM allocations and page
  faults, and return to normal operation once FREE+CACHE goes above
  (v_paging_wait) (that is, as soon as possible).

  If, due to memory demand, FREE+CACHE falls below (v_paging_min), most
  userland processes will block on VM allocations and page faults until
  the level returns to above (v_paging_wait).

  The hysteresis between (wait) and (start) allows most processes to
  continue running normally during nominal paging activities.

* The pageout daemon operates in batches and then loops as necessary.
  Pages will be moved from CACHE to FREE as necessary, then from INACTIVE
  to CACHE as necessary, then from ACTIVE to INACTIVE as necessary.  Care
  is taken to avoid completely exhausting any given queue to ensure that
  the queue scan is reasonably efficient.

* The ACTIVE to INACTIVE scan has been significantly reorganized and
  integrated with the page_stats scan (which updates m->act_count for
  pages in the ACTIVE queue).  Pages in the ACTIVE queue are no longer
  moved within the lists.  Instead a persistent roving marker is employed
  for each queue.

  The m->act_count tests is made against a dynamically adjusted comparison
  variable called vm.pageout_stats_actcmp.  When no progress is made this
  variable is increased, and when sufficient progress is made this variable
  is decreased.  Thus, under very heavy memory loads, a more permission
  m->act_count test allows active pages to be deactivated more quickly.

* The INACTIVE to FREE+CACHE scan remains relatively unchanged.  A two-pass
  LRU arrangement continues to be employed in order to give the system
  time to reclaim a deactivated page before it would otherwise get paged out.

* The vm_pageout_page_stats() scan has been almost completely rewritten.
  This scan is responsible for updating m->act_count on pages in the
  ACTIVE queue.  Example sysctl settings shown below

  vm.pageout_stats_rsecs: 300 <--- passive run time (seconds) after pageout
  vm.pageout_stats_scan: 472 <--- max number of pages to scan per tick
  vm.pageout_stats_ticks: 10 <--- poll rate in ticks
  vm.pageout_stats_inamin: 16 <--- inactive ratio governing dynamic
  vm.pageout_stats_inalim: 4096      adjustment of actcmnp.
  vm.pageout_stats_actcmp: 2 <--- dynamically adjusted by the kernel

  The page stats code polls slowly and will update m->act_count and
  deactivate pages until it is able to achieve (v_inactive_target) worth
  of pages in the inactive queue.

  Once this target has been reached, the poll stops deactivating pages, but
  will continue to run for (pageout_stats_rsecs) seconds after the pageout
  daemon last ran (typically 5 minutes) and continue to passively update
  m->act_count duiring this period.

  The polling resumes upon any pageout daemon activation and the cycle
  repeats.

* The vm_pageout_page_stats() scan is mostly responsible for selecting
  the correct pages to move from ACTIVE to INACTIVE.  Choosing the correct
  pages allows the system to continue to operate smoothly while concurrent
  paging is in progress.  The additional 5 minutes of passive operation
  allows it to pre-stage m->act_count for pages in the ACTIVE queue to
  help grease the wheels for the next pageout daemon activation.

    TESTING

* On a test box with memory limited to 2GB, running chrome.  Video runs
  smoothly despite constant paging.  Active tabs appear to operate smoothly.
  Inactive tabs are able to page-in decently fast and resume operation.

* On a workstation with 32GB of memory and a large number of open chrome
  tabs, allowed to sit overnight (chrome burns up a lot of memory when tabs
  remain open), then video tested the next day.  Paging appeared to operate
  well and so far there has been no stuttering.

* On a 64GB build box running dsynth 32/32 (intentionally overloaded).  The
  full bulk starts normally.  The packages tend to get larger and larger as
  they are built.  dsynth and the pageout daemon operate reasonably well in
  this situation.  I was mostly looking for excessive stalls due to heavy
  memory loads and it looks like the new code handles it quite well.

2 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sun, 16 May 2021 19:11:14 +0000 (21:11 +0200)]
Update the pciconf(8) database.

May 16, 2021 snapshot from https://pci-ids.ucw.cz

2 years agosys/vfs/ext2fs: Make inode extra time fields updating logic more closer to Linux
Tomohiro Kusumi [Sun, 16 May 2021 18:13:52 +0000 (03:13 +0900)]
sys/vfs/ext2fs: Make inode extra time fields updating logic more closer to Linux

from FreeBSD c40a160fd0aa48ceb6e243c72cb8b9b59dc4e13d
from FreeBSD 2a984c2b49822bb4a31aeb6a050d746aef73162f

2 years agosys/vfs/hammer2: Remove unused hammer2_dev::{n,max}ipstacks
Tomohiro Kusumi [Sun, 16 May 2021 15:55:27 +0000 (00:55 +0900)]
sys/vfs/hammer2: Remove unused hammer2_dev::{n,max}ipstacks

First appeared in 703720e4d599857d052f0a65f2840224ce36ec5a
in 2012, but never used for anything.

2 years agosys/vfs/hammer2: Remove no longer used typedef for mtx_link_t
Tomohiro Kusumi [Sun, 16 May 2021 15:39:32 +0000 (00:39 +0900)]
sys/vfs/hammer2: Remove no longer used typedef for mtx_link_t

No longer used since 01d71aa5538cba09383737ddbea2fb05e1e75e78 in 2015.

2 years agosys/vfs/hammer2: Remove unused hammer2_dev::bflast
Tomohiro Kusumi [Sun, 16 May 2021 15:27:25 +0000 (00:27 +0900)]
sys/vfs/hammer2: Remove unused hammer2_dev::bflast

First appeared in 9dca9515d47eeb36c9696bb04c0112bafd8efe38
in 2017, but never used for anything.

2 years agosys/vfs/hammer2: Remove "REPORT_REFS_ERRORS /* XXX remove me */"
Tomohiro Kusumi [Sat, 15 May 2021 20:35:52 +0000 (05:35 +0900)]
sys/vfs/hammer2: Remove "REPORT_REFS_ERRORS /* XXX remove me */"

2 years agosys/vfs/hammer2: Use MPTOPMP()
Tomohiro Kusumi [Sat, 15 May 2021 19:36:03 +0000 (04:36 +0900)]
sys/vfs/hammer2: Use MPTOPMP()

2 years agosys/vfs/hammer2: Make hammer2_mtx_upgrade_try() macro around mutex(9)
Tomohiro Kusumi [Sat, 15 May 2021 18:48:29 +0000 (03:48 +0900)]
sys/vfs/hammer2: Make hammer2_mtx_upgrade_try() macro around mutex(9)

just like any other HAMMER2 lock primitive.
This used to be more than that until
b6b260f2b42aa5a135e4b57ce102dcb0dbbf88c3 in 2016.

2 years agosys/vfs/hammer2: Remove no longer used hammer2_xid_t and macros
Tomohiro Kusumi [Sat, 15 May 2021 18:14:40 +0000 (03:14 +0900)]
sys/vfs/hammer2: Remove no longer used hammer2_xid_t and macros

These are no longer used since da6f36f44bb9c76612e31b56cdfe4d787e53d61f
in 2014.

2 years agosys/vfs/hammer2: Remove unused HMNT2_NOAUTOSNAP
Tomohiro Kusumi [Sat, 15 May 2021 17:01:23 +0000 (02:01 +0900)]
sys/vfs/hammer2: Remove unused HMNT2_NOAUTOSNAP

First appeared 9 years ago in 703720e4d599857d052f0a65f2840224ce36ec5a
but never used for anything.

2 years agokernel - Implement POLLHUP for pipes and filesystem fifos (4)
Matthew Dillon [Thu, 13 May 2021 18:03:39 +0000 (11:03 -0700)]
kernel - Implement POLLHUP for pipes and filesystem fifos (4)

* pipes need the same shutdown-vs-closed treatment.  Only trigger
  POLLHUP when the other end is closed.  Do not trigger POLLHUP
  when the other end issues a shutdown(..SHUT_WR).

* NOTE: Linux does not support shutdown() on pipes because linux
  pipes are half-duplex.  BSD pipes are full-duplex and shutdown()
  makes more sense.  That said, make shutdown()'s POLLHUP behavior
  uniform across the board... meaningthat shutdown() does NOT trigger
  POLLHUP, only a complete close().

  This is important because I suspect linux programmers might use
  POLLHUP to try to detect unexpected terminations, whereas a
  shutdown() is par for the course when communications are being
  shut-down in an expected manner.

2 years agokernel - Implement POLLHUP for pipes and filesystem fifos (3)
Matthew Dillon [Thu, 13 May 2021 17:37:03 +0000 (10:37 -0700)]
kernel - Implement POLLHUP for pipes and filesystem fifos (3)

* Add an internal NOTE_HUPONLY flag to allow the poll() system call
  to tell the kevent system that EVFILT_READ should only trigger on
  a HUP and not trigger on read-data-present.

* Linux does not trigger POLLHUP on a half-closed socket, make
  DFly have the same behavior.  POLLHUP is only triggered on a fully-closed
  socket.

* Fix bug where data-present on the pipe, socket, or fifo would trigger an
  EVFILT_READ event when only a HUP is being requested.  This caused our
  poll() implementation to complain about spurious events (which then
  results in incorrect operation).

2 years agobsd-family-tree: Sync with FreeBSD.
Sascha Wildner [Thu, 13 May 2021 17:08:43 +0000 (19:08 +0200)]
bsd-family-tree: Sync with FreeBSD.

2 years agokernel - Implement POLLHUP for pipes and filesystem fifos (2)
Matthew Dillon [Thu, 13 May 2021 16:15:27 +0000 (09:15 -0700)]
kernel - Implement POLLHUP for pipes and filesystem fifos (2)

* Allow POLLHUP to be requested without POLLIN.

Reported-by: mjg
2 years agofstat - Improve output formatting
Matthew Dillon [Wed, 12 May 2021 22:55:48 +0000 (15:55 -0700)]
fstat - Improve output formatting

Improve fstat output formatting and do some minor source
cleanups.

Includes-patch-by: (bug#3272) falsifian
2 years agokernel - Implement POLLHUP for pipes and filesystem fifso
Matthew Dillon [Wed, 12 May 2021 22:02:52 +0000 (15:02 -0700)]
kernel - Implement POLLHUP for pipes and filesystem fifso

* POLLHUP was implemented for sockets but not for pipes and
  filesystem fifos.

* Implement the poll() bit for pipes and filesystem fifos as well.

* Fixes Zig portability to dfly, and probably fixes other things.

Reported-by: (bugs) mikdusan
2 years agokernel/ichsmb: Add {Cannon,Comet,Tiger,Gemini}lake PCI IDs.
Sascha Wildner [Sun, 9 May 2021 19:21:51 +0000 (21:21 +0200)]
kernel/ichsmb: Add {Cannon,Comet,Tiger,Gemini}lake PCI IDs.

* Also set INTR_MPSAFE. Looks like an oversight from me in
  a9656fbcd49c376aba5e04370d8b0f1fa96e063c.

Taken-from: FreeBSD

2 years agousr.sbin/autofs: Best effort to maintain mounttab and mountdtab
Tomohiro Kusumi [Wed, 5 May 2021 14:10:57 +0000 (23:10 +0900)]
usr.sbin/autofs: Best effort to maintain mounttab and mountdtab

from FreeBSD 88e531f38c2412bf030f4e8dd563efc45b70797e

3 years agokernel/mptable: Fix wrong start of mptable search area for non-EBDA case.
Sascha Wildner [Tue, 27 Apr 2021 19:31:24 +0000 (21:31 +0200)]
kernel/mptable: Fix wrong start of mptable search area for non-EBDA case.

If no Extended BIOS Data Area (EBDA) exists, the kernel will fall back
to searching the MP table in the last kilobyte of the base memory. The
amount of base memory is in kilobytes but the calculation was treating
it like bytes. Adjust the calculation.

Nothing except bhyve seems to have triggered this path so far. Usually
there is an EBDA.

Thanks to everyone involved.

Reported-by: Pierre-Alain TORET <pierre-alain.toret@protonmail.com>
Fix-by: Peter Grehan <grehan@freebsd.org> (changed a little by me)
FreeBSD-bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255191

3 years ago<sys/mount.h>: Include <sys/cdefs.h> immediately.
Sascha Wildner [Mon, 26 Apr 2021 15:30:33 +0000 (17:30 +0200)]
<sys/mount.h>: Include <sys/cdefs.h> immediately.

3 years ago<sys/elf32.h>: Use standard integer types.
Sascha Wildner [Mon, 26 Apr 2021 15:25:43 +0000 (17:25 +0200)]
<sys/elf32.h>: Use standard integer types.

3 years ago6.1 version numbering. v6.1.0
Justin C. Sherrill [Wed, 21 Apr 2021 03:30:38 +0000 (23:30 -0400)]
6.1 version numbering.

3 years agodsynth - Don't double-add ports-mgmt/pkg
Matthew Dillon [Sun, 18 Apr 2021 17:21:34 +0000 (10:21 -0700)]
dsynth - Don't double-add ports-mgmt/pkg

* dsynth automatically pre-adds ports-mgmt/pkg.  Ignore any manually
  specified duplicate.

Reported-by: tuxillo
3 years agofcntl.2: Little markup fix.
Sascha Wildner [Sat, 17 Apr 2021 18:47:00 +0000 (20:47 +0200)]
fcntl.2: Little markup fix.

3 years ago<sys/_malloc.h>: Use basic integer types like in the rest of the header.
Sascha Wildner [Sat, 17 Apr 2021 10:03:29 +0000 (12:03 +0200)]
<sys/_malloc.h>: Use basic integer types like in the rest of the header.

3 years agoUpgrade libressl. 2/2
Daniel Fojt [Fri, 26 Mar 2021 12:47:21 +0000 (13:47 +0100)]
Upgrade libressl. 2/2

Update README.DRAGONFLY.

3 years agoUpgrade libressl. 1/2
Daniel Fojt [Fri, 16 Apr 2021 18:49:09 +0000 (20:49 +0200)]
Upgrade libressl. 1/2

Merge branch 'vendor/LIBRESSL' into master.

3 years agovendor/libressl: upgrade from 3.2.4 to 3.2.5
Daniel Fojt [Fri, 26 Mar 2021 12:41:25 +0000 (13:41 +0100)]
vendor/libressl: upgrade from 3.2.4 to 3.2.5

Fixes possible use-after-free caused by TLS client using session
resumption.

3 years agoee(1): Ensure that it always reads from/writes to a terminal.
Sascha Wildner [Fri, 16 Apr 2021 17:54:19 +0000 (19:54 +0200)]
ee(1): Ensure that it always reads from/writes to a terminal.

While here, fix a typo and a minor issue in the manual page.

Taken-from: FreeBSD

3 years agoinitrd: Add a minimal /etc/termcap to fix issues with vi(1), less(1) etc.
Sascha Wildner [Fri, 16 Apr 2021 09:30:52 +0000 (11:30 +0200)]
initrd: Add a minimal /etc/termcap to fix issues with vi(1), less(1) etc.

It's the cons25 entry from our base termcap.

In rc, set TERM to cons25.

3 years agoUpdate the pciconf(8) database.
Sascha Wildner [Fri, 16 Apr 2021 05:04:49 +0000 (07:04 +0200)]
Update the pciconf(8) database.

April 11, 2021 snapshot from https://pci-ids.ucw.cz

3 years ago/etc/profile: Remove bogus Emacs command line editing option.
Sascha Wildner [Wed, 14 Apr 2021 14:57:42 +0000 (16:57 +0200)]
/etc/profile: Remove bogus Emacs command line editing option.

This is default for interactive shells.

3 years agoncurses/tic: Remove bogus definitions of _XOPEN_SOURCE_EXTENDED.
Sascha Wildner [Tue, 13 Apr 2021 21:40:36 +0000 (23:40 +0200)]
ncurses/tic: Remove bogus definitions of _XOPEN_SOURCE_EXTENDED.

XPG 4.2 aka SUSv1 aka UNIX95 is 26 years old stuff and I'm pretty
sure that we will never support it. Our default environment is just
fine here.

3 years agoncurses: Fix a typo in a Makefile comment.
Sascha Wildner [Tue, 13 Apr 2021 20:28:09 +0000 (22:28 +0200)]
ncurses: Fix a typo in a Makefile comment.

3 years agoinitrd: Make shutdown work on the initrd image.
Sascha Wildner [Sun, 11 Apr 2021 18:37:25 +0000 (20:37 +0200)]
initrd: Make shutdown work on the initrd image.

* Make shutdown default to -o on the initrd because oinit doesn't handle
  signals like its big sibling.

* Install wall(1) and create a dummy /var/run/utmpx for it.

* Link /usr/bin and /usr/sbin to /bin, too. wall(1) is called as
  /usr/bin/wall from shutdown.

3 years agoRevert "WIP"
Sascha Wildner [Thu, 8 Apr 2021 15:42:19 +0000 (17:42 +0200)]
Revert "WIP"

This reverts commit 07fd2313fd09be36541983b354138f6659600312.

Sorry, I didn't intend to push this.

3 years agodsynth.1: Fix typo.
Sascha Wildner [Thu, 8 Apr 2021 15:18:08 +0000 (17:18 +0200)]
dsynth.1: Fix typo.

3 years agoWIP
Sascha Wildner [Tue, 6 Apr 2021 10:52:50 +0000 (12:52 +0200)]
WIP

3 years agoinitrd: Fix typo in the motd.
Sascha Wildner [Tue, 6 Apr 2021 10:41:31 +0000 (12:41 +0200)]
initrd: Fix typo in the motd.

3 years agoRemove usage of BSD integer types in two standard headers.
Sascha Wildner [Mon, 5 Apr 2021 18:32:36 +0000 (20:32 +0200)]
Remove usage of BSD integer types in two standard headers.

3 years agozstd: Install zstdgrep too.
Sascha Wildner [Sun, 4 Apr 2021 20:46:39 +0000 (22:46 +0200)]
zstd: Install zstdgrep too.

3 years agoxz: Update README.DELETED.
Sascha Wildner [Sun, 4 Apr 2021 20:36:11 +0000 (22:36 +0200)]
xz: Update README.DELETED.

3 years agozstd: Update README.DELETED.
Sascha Wildner [Sun, 4 Apr 2021 20:34:06 +0000 (22:34 +0200)]
zstd: Update README.DELETED.

3 years agoMerge branch 'vendor/XZ'
Sascha Wildner [Sun, 4 Apr 2021 20:29:57 +0000 (22:29 +0200)]
Merge branch 'vendor/XZ'

3 years agoRemove {lz,xz}less and manual pages from the vendor branch. vendor/XZ
Sascha Wildner [Sun, 4 Apr 2021 20:29:25 +0000 (22:29 +0200)]
Remove {lz,xz}less and manual pages from the vendor branch.

3 years agoMerge branch 'vendor/ZSTD'
Sascha Wildner [Sun, 4 Apr 2021 20:27:37 +0000 (22:27 +0200)]
Merge branch 'vendor/ZSTD'

3 years agoRemove external *less programs/manpages.
Sascha Wildner [Sun, 4 Apr 2021 20:27:23 +0000 (22:27 +0200)]
Remove external *less programs/manpages.

* Point {xz,bz,...}less manual pages at less(1) since all compressed
  less is handled by its own lessopen.sh support.

* Stop installing external {lz,xz,zstd,z}less programs and manual pages.

3 years agoRemove zstdless and its manual page from the vendor branch. vendor/ZSTD
Sascha Wildner [Sun, 4 Apr 2021 20:24:54 +0000 (22:24 +0200)]
Remove zstdless and its manual page from the vendor branch.

3 years agoless: Add {z,bz,xz,lz,zstd}less wrappers for viewing compressed files.
Sascha Wildner [Sun, 4 Apr 2021 19:02:32 +0000 (21:02 +0200)]
less: Add {z,bz,xz,lz,zstd}less wrappers for viewing compressed files.

Taken-from: FreeBSD

3 years agonewsyslog.8: Uncomment a reference to zstd.1.
Sascha Wildner [Sun, 4 Apr 2021 19:02:00 +0000 (21:02 +0200)]
newsyslog.8: Uncomment a reference to zstd.1.

3 years agolibarchive: Fix Symbol.map.
Sascha Wildner [Sun, 4 Apr 2021 18:09:41 +0000 (20:09 +0200)]
libarchive: Fix Symbol.map.

The two symbols added in c37c9ab3239b3abb889e6cfd43e7211513955129 do not
exist in libarchive. Anything else related to zstd was already present in
the Symbol.map.

3 years agozstd(1): Enable multi-threading support in the zstd(1) utility.
Sascha Wildner [Sun, 4 Apr 2021 13:12:25 +0000 (15:12 +0200)]
zstd(1): Enable multi-threading support in the zstd(1) utility.

Note that it is only used when -T is specified.

Leave libzstd itself without multi-threading, to prevent libarchive from
getting a libpthread dependency. Instead, compile libzstd's necessary
bits into zstd(1) and enable multi-threading only in the utilitily.

For detailed reasoning on this, please check zrj's commit message for
3ff63cdaea3abd5eece6e57d01a1ab57a4312636.

While here, clean up libzstd's Makefile a bit.

3 years agomtree: Indent with spaces.
Sascha Wildner [Sat, 3 Apr 2021 15:05:16 +0000 (17:05 +0200)]
mtree: Indent with spaces.

3 years agolibzstd: Raise WARNS to 4.
Sascha Wildner [Sat, 3 Apr 2021 11:32:42 +0000 (13:32 +0200)]
libzstd: Raise WARNS to 4.

3 years agozstd: Remove Makefile.depend's.
Sascha Wildner [Sat, 3 Apr 2021 11:09:29 +0000 (13:09 +0200)]
zstd: Remove Makefile.depend's.

3 years agozstd: Add our READMEs.
Sascha Wildner [Sat, 3 Apr 2021 09:27:50 +0000 (11:27 +0200)]
zstd: Add our READMEs.

3 years agozstd: Remove unneeded gunk from contrib/zstd.
Sascha Wildner [Sat, 3 Apr 2021 09:26:28 +0000 (11:26 +0200)]
zstd: Remove unneeded gunk from contrib/zstd.

3 years agoMerge branch 'vendor/ZSTD' into master
Sascha Wildner [Sat, 3 Apr 2021 09:23:01 +0000 (11:23 +0200)]
Merge branch 'vendor/ZSTD' into master

3 years agoImport zstd 1.4.8 to a vendor branch.
Sascha Wildner [Sat, 3 Apr 2021 09:18:04 +0000 (11:18 +0200)]
Import zstd 1.4.8 to a vendor branch.

3 years agolibzstd: Fix specifying -fno-tree-vectorize for zstd_decompress_block.c.
Sascha Wildner [Sat, 3 Apr 2021 00:56:07 +0000 (02:56 +0200)]
libzstd: Fix specifying -fno-tree-vectorize for zstd_decompress_block.c.

3 years agonewsyslog.conf.5: Add zstd.1 reference and bump .Dd
Sascha Wildner [Fri, 2 Apr 2021 20:06:19 +0000 (22:06 +0200)]
newsyslog.conf.5: Add zstd.1 reference and bump .Dd

3 years agoRevert "newsyslog(8): Comment out zstd support for now."
Sascha Wildner [Fri, 2 Apr 2021 20:01:38 +0000 (22:01 +0200)]
Revert "newsyslog(8): Comment out zstd support for now."

This reverts commit b4fcc362a220df584355e7fae6974e113e4caf3a.

3 years agobuild - Add zstd to the build (libzstd as private library)
Matthew Dillon [Thu, 1 Apr 2021 17:50:51 +0000 (10:50 -0700)]
build - Add zstd to the build (libzstd as private library)

* Bring in contrib/zstd from FreeBSD.

* Add libzstd as a private library (i.e. priv/libprivate_zstd) to
  avoid confusion.  (Note that FreeBSD also has zstd in base as
  a private library).

* Add zstd, unzstd, zstdcat, zstdmt utilities.

* Integrate into libarchive, initrd, dsynth, and misc other
  base system elements.

Ported-from: FreeBSD

3 years agoSync ACPICA with Intel's version 20210331.
Sascha Wildner [Fri, 2 Apr 2021 12:39:47 +0000 (14:39 +0200)]
Sync ACPICA with Intel's version 20210331.

* ACPI 6.4 support.

* Various fixes.

For a detailed list, please see sys/contrib/dev/acpica/changes.txt.

3 years agoFix typo in various licenses: merchantibility -> merchantability
Sascha Wildner [Fri, 2 Apr 2021 12:39:13 +0000 (14:39 +0200)]
Fix typo in various licenses: merchantibility -> merchantability

3 years agodsynth - add zstd support (2)
Matthew Dillon [Thu, 1 Apr 2021 17:05:51 +0000 (10:05 -0700)]
dsynth - add zstd support (2)

* Fix a suffix test to handle tar+zstd's 4-character suffix.

3 years agofcntl.2: Fix typo in .Dd
Sascha Wildner [Thu, 1 Apr 2021 09:13:04 +0000 (11:13 +0200)]
fcntl.2: Fix typo in .Dd

3 years agokernel - More fixes to libc's uname
Matthew Dillon [Wed, 31 Mar 2021 21:34:50 +0000 (14:34 -0700)]
kernel - More fixes to libc's uname

* Remove no no-longer-used buf[] (and fix syntax error during
  compilation).

* Do not parse garbage data in buffers in case the sysctls fail.
  This would not have been fatal anyway since we always ensure
  that the buffers are zero-terminated, but it wasn't clean either.
  Clean it up.

* Use the proper name->arrayname for a pointer to the array instead
  of &name->arrayname.  We could also use &name->arrayname[0] but
  just stick with the first method.

Pointed-out-by: dan
3 years agokernel - Adjust varsym API to match manual page, remove from uname
Matthew Dillon [Wed, 31 Mar 2021 21:09:19 +0000 (14:09 -0700)]
kernel - Adjust varsym API to match manual page, remove from uname

* Adjust the varsym system call to match the manual page.  It
  now returns 0 on success instead of the length, and returns
  -1 with an errno of EOVERFLOW if the supplied buffer is too small.

* The uname*() code in libc actually assumed 0 would be returned
  on success, and thus never actually allowed varsym overrides.  Just
  remove the functionality (that nobody uses) entirely.

Reported-by: dan
3 years agokernel - Add fcntl(F_GETPATH) (3)
Matthew Dillon [Tue, 30 Mar 2021 21:14:15 +0000 (14:14 -0700)]
kernel - Add fcntl(F_GETPATH) (3)

* cache_fullpath() limits the result to MAXPATHLEN, but we must
  still adjust the error code to match the manual page and netbsd.

3 years agoModify fcntl.2 manpage to include informations about F_GETPATH
dan [Tue, 30 Mar 2021 20:29:51 +0000 (22:29 +0200)]
Modify fcntl.2 manpage to include informations about F_GETPATH

3 years agokernel - Add fcntl(F_GETPATH)
1338-1 [Tue, 30 Mar 2021 19:31:32 +0000 (21:31 +0200)]
kernel - Add fcntl(F_GETPATH)

* Implement fcntl(F_GETPATH).  For now limit to fp's representing
  vnodes only.  Use cache_fullpath().

* This fcntl() allows a program to retrieve the file path related to
  an open descriptor.

Author:    1338-1 <1338minus1@protonmail.com> also known as dan_
Tested-by: dillon
3 years agovmstat - Adjust kmalloc zone name display
Matthew Dillon [Mon, 29 Mar 2021 21:10:41 +0000 (14:10 -0700)]
vmstat - Adjust kmalloc zone name display

* Replace any spaces in zone names with underscores in the output
  to make sorting the output by field easier.

* Add double -mm option to sort output by the higher of MemUse
  or SlabUse to make it easier to pick-out high-use zones.

3 years agokernel - Use kmalloc_obj for M_VM_OBJECT
Matthew Dillon [Mon, 29 Mar 2021 19:28:10 +0000 (12:28 -0700)]
kernel - Use kmalloc_obj for M_VM_OBJECT

* Use the kmalloc_obj API for struct vm_object management.  Further
  reduces kernel memory fragmentation.

3 years agodsynth: add zstd support
Krzysztof Piecuch [Wed, 10 Mar 2021 22:02:06 +0000 (22:02 +0000)]
dsynth: add zstd support

* Add support for the extension

* However, we need support in base and in pkg before this will work, so it
  is not the default.

Submitted-by: piecuch (pikrzyszt)
3 years agoem/emx: Add support for I219 LM15~19 and I219 V15~19
Sepherosa Ziehau [Mon, 29 Mar 2021 15:12:25 +0000 (23:12 +0800)]
em/emx: Add support for I219 LM15~19 and I219 V15~19

Obtained-from: e1000e

3 years agoem/emx: Merge Intel em-7.7.8.
Sepherosa Ziehau [Tue, 23 Mar 2021 14:48:52 +0000 (22:48 +0800)]
em/emx: Merge Intel em-7.7.8.

Mainly fix setting for I219-LM12 and I219-V12.