3 years agohammer - Fix bugs, fix serious snapshot bug, flush adjustments
Matthew Dillon [Sat, 17 Mar 2018 08:20:36 +0000 (01:20 -0700)]
hammer - Fix bugs, fix serious snapshot bug, flush adjustments

* Make sure we only flush the volume header for a general sync request
  and not for a fsync() on /.

* Fix more lock order reversals when translating directory entries
  to inodes.

* Separate out spmp elements into their own list to make umount ordering

* Flush in three stages.

  (1) flush dirty filesystem inodes
  (2) flush PFS meta-data topology up to the filesystem inodes.
  (3) flush the volume root and its meta-data up to the PFS inodes.

  This is staging for later sync concurrency improvements.

* Fix a bug where creating enough snapshots (more than 4 total PFSs)
  causes some PFSs to lose an important flag in their blockref, which
  causes flushes to stop working properly on that PFS.

3 years agohammer2 - More involved refactoring of chain_repparent, cleanup
Matthew Dillon [Fri, 16 Mar 2018 18:01:11 +0000 (11:01 -0700)]
hammer2 - More involved refactoring of chain_repparent, cleanup

* Remove unused locking flags (remove the NOLOCK and NOUNLOCK

* Add HAMMER2_RESOLVE_NONBLOCK to hammer2_chain_lock() for use
  only by hammer2_chain_getparent() and hammer2_chain_repparent().

* Refactor hammer2_chain_getparent() and hammer2_chain_repparent().
  Add a hot-path that uses HAMMER2_RESOLVE_NONBLOCK.  If this fails
  we now do a much more involved tracking operation via 'reptrack'
  to deal with races against indirect block deletions.

* Cleanup the copyright messages.

* Fix an issue where a sync could be held-up indefinitely by
  ongoing overlapping modifying operations.

* Install a proper initial inode count when creating a snapshot.

* Fix a deadlock in checkdirempty().  A chain lock was winding
  up being ordered incorrectly.

3 years agohammer2 - Refactor LRU chain recycling
Matthew Dillon [Wed, 14 Mar 2018 23:37:29 +0000 (16:37 -0700)]
hammer2 - Refactor LRU chain recycling

* Refactor LRU chain recycling by allowing a chain to remain on the
  LRU even if it gets referenced again.  This will be detected and
  handled properly if the LRU tries to recycle the chain.

* Improved LRU performance by avoiding unnecessary global-ish spinlocks.

* Also fixes a rare flagging/list race.

3 years agohammer2 - Flush asynchronization, bug fixes, stabilization (2)
Matthew Dillon [Wed, 14 Mar 2018 05:27:10 +0000 (22:27 -0700)]
hammer2 - Flush asynchronization, bug fixes, stabilization (2)

* Add the HAMMER2_INODE_DIRTYDATA flag and use it to interlock
  clearing the vnode's dirty flag.

3 years agohammer2 - Flush asynchronization, bug fixes, stabilization
Matthew Dillon [Wed, 14 Mar 2018 01:00:44 +0000 (18:00 -0700)]
hammer2 - Flush asynchronization, bug fixes, stabilization

* Better-asynchronize the flush (sync) code.  Generally split flushing
  of inodes and flushing of topology above the inodes such that we can
  flush the inodes inside a normal transaction.

  This leaves only the topology flush in the flush transaction (which
  locks out all other modifying transactions).  Concurrent read/write/
  flush performance is significantly improved.

* Fix numerous bugs in the inode tracking code where the chain topology
  under an inode could wind up remaining in a modified state when the
  vnode is in a clean state.  This could cause hefty 'sync' latency on
  clean trees (that had already been flushed).

* Fix numerous bugs in the handling of lost parent links, which occurs
  due to locking races primarily when indirect blocks have to be
  inserted or deleted.

* Deleted-chain sub-topology tracking had some issues which could lead
  to chain's being lost, resulting in malloc complaints on umount.

* Rename a few H2 sysctl variables for readability.

* Adjust the "dumpchain" debugging directive to allow us to trace
  the ONFLUSH topology.

3 years agoobjformat(1): Fix comment in the Makefile.
Sascha Wildner [Sat, 17 Mar 2018 08:30:45 +0000 (09:30 +0100)]
objformat(1): Fix comment in the Makefile.

3 years agolibipsec: Using snprintf() to append to a buffer is not valid in C99.
Sascha Wildner [Sat, 17 Mar 2018 07:40:02 +0000 (08:40 +0100)]
libipsec: Using snprintf() to append to a buffer is not valid in C99.

This silences a gcc80 -Wrestrict warning.

Reported-by: zrj
Taken-from:  FreeBSD (r216369)

3 years agokernel/usb4bsd: Sync the quirks with FreeBSD.
Sascha Wildner [Fri, 16 Mar 2018 18:44:40 +0000 (19:44 +0100)]
kernel/usb4bsd: Sync the quirks with FreeBSD.

Might be we don't yet properly support every device that some of
these quirks are for.

3 years agoUpdate the pciconf(8) database.
Sascha Wildner [Fri, 16 Mar 2018 06:42:33 +0000 (07:42 +0100)]
Update the pciconf(8) database.

March 6, 2018 snapshot from https://pci-ids.ucw.cz

3 years agodialog(1): Use ${} uniformly.
Sascha Wildner [Wed, 14 Mar 2018 16:42:51 +0000 (17:42 +0100)]
dialog(1): Use ${} uniformly.

3 years agoexport.5: Bump .Dd
Sascha Wildner [Wed, 14 Mar 2018 08:30:45 +0000 (09:30 +0100)]
export.5: Bump .Dd

3 years agomountd(8): Fix several more warnings, raise WARNS to 3
Aaron LI [Fri, 10 Nov 2017 12:44:40 +0000 (20:44 +0800)]
mountd(8): Fix several more warnings, raise WARNS to 3

3 years agoexports.5: network prefixlength (CIDR) format is supported
Aaron LI [Fri, 10 Nov 2017 12:04:33 +0000 (20:04 +0800)]
exports.5: network prefixlength (CIDR) format is supported

Also take various minor fixes from FreeBSD.

3 years agomountd(8): Fix a type mismatch and several compilation warnings
Aaron LI [Fri, 10 Nov 2017 12:03:25 +0000 (20:03 +0800)]
mountd(8): Fix a type mismatch and several compilation warnings

The char ** type mismatch is taken from FreeBSD r292864

3 years agomountd(8): Replace malloc+strcpy with strdup/strndup
Aaron LI [Fri, 10 Nov 2017 12:01:35 +0000 (20:01 +0800)]
mountd(8): Replace malloc+strcpy with strdup/strndup

Taken-from: FreeBSD r324007,r324014

3 years agomountd(8): Change default uid/gid to nobody/nogroup (65534/65533)
Aaron LI [Fri, 10 Nov 2017 11:38:10 +0000 (19:38 +0800)]
mountd(8): Change default uid/gid to nobody/nogroup (65534/65533)

The default values found in /etc/passwd and /etc/group are 65534, 65533.
In mountd.c, the defaults were -2, which was 65534 back when uid_t was 16bits.
Without this patch, a file created by root on an NFS exported volume without
the "-root=" export option will end up owned by uid 4**32 - 2.
When discussed on freebsd-current@, it seemed that users preferred the
values being changed to 65534/65533.
I have not added code to acquire these values from the databases, since
the mountd daemon might get "stuck" during startup waiting for a non-responsive
password database server.

Taken-from: FreeBSD usr.sbin/mountd/mountd.c r318262

3 years agomountd(8): Fix conversion of prefix length to a netmask
Aaron LI [Fri, 10 Nov 2017 11:02:16 +0000 (19:02 +0800)]
mountd(8): Fix conversion of prefix length to a netmask

Taken-from: FreeBSD usr.sbin/mountd/mountd.c r219125

3 years agotest - Fix fsx build
Matthew Dillon [Wed, 14 Mar 2018 00:56:32 +0000 (17:56 -0700)]
test - Fix fsx build

* Fix the 'install' target so it works as intended.

3 years agoAdd references to mount_hammer2.8 in a few manual pages.
Sascha Wildner [Tue, 13 Mar 2018 10:40:26 +0000 (11:40 +0100)]
Add references to mount_hammer2.8 in a few manual pages.

3 years agops.1: Update FILES section a bit.
Sascha Wildner [Tue, 13 Mar 2018 10:37:43 +0000 (11:37 +0100)]
ps.1: Update FILES section a bit.

3 years agomtree: Remove BSD.local.dist.
Sascha Wildner [Tue, 13 Mar 2018 10:30:01 +0000 (11:30 +0100)]
mtree: Remove BSD.local.dist.

The (d)ports framework uses its own Templates/BSD.local.dist.

Discussed-with: zrj

3 years agoetc/periodic: Add more xz(1)/zstd(1) support.
Sascha Wildner [Tue, 13 Mar 2018 10:01:43 +0000 (11:01 +0100)]
etc/periodic: Add more xz(1)/zstd(1) support.

3 years agoperiodic/security/800.loginfail: Add xz(1) and zstd(1) support.
Sascha Wildner [Tue, 13 Mar 2018 09:49:10 +0000 (10:49 +0100)]
periodic/security/800.loginfail: Add xz(1) and zstd(1) support.

3 years agoperiodic.conf.5: Document two more variables.
Sascha Wildner [Tue, 13 Mar 2018 09:21:59 +0000 (10:21 +0100)]
periodic.conf.5: Document two more variables.

3 years agokernel - Remove minidump debugging
Matthew Dillon [Tue, 13 Mar 2018 02:09:59 +0000 (19:09 -0700)]
kernel - Remove minidump debugging

* Remove minidump debugging "pdp %04x..." lines.  Minidump fixes have
  been well tested at this point.

3 years agoperiodic: Sync with FreeBSD current
Aaron LI [Thu, 8 Mar 2018 16:28:24 +0000 (00:28 +0800)]
periodic: Sync with FreeBSD current

* Sync periodic scripts, periodic.conf, periodic.conf.5 with FreeBSD
* The "{daily,weekly,monthly}_status_security_<var>_enable" variables are
  changed to be "security_status_<var>_enable" and
  "security_status_<var>_period" (daily, weekly, monthly).
* Keep DFly-specific settings (e.g., HAMMER and HAMMER2 related)
* Ignore the FreeBSD-specific things, e.g., ZFS, GEOM

3 years agorc.d/accounting: Sync with FreeBSD
Aaron LI [Thu, 8 Mar 2018 16:26:34 +0000 (00:26 +0800)]
rc.d/accounting: Sync with FreeBSD

Prepare to sync periodic with FreeBSD

3 years agoperiodic: Remove obsolete daily/status-named and weekly/clean-kvmdb
Aaron LI [Thu, 8 Mar 2018 16:24:33 +0000 (00:24 +0800)]
periodic: Remove obsolete daily/status-named and weekly/clean-kvmdb

3 years agoperiodic: Remove already disabled monthly statistics report
Aaron LI [Thu, 8 Mar 2018 16:14:47 +0000 (00:14 +0800)]
periodic: Remove already disabled monthly statistics report

The up-to-date tool can be obtained from DPorts: sysutils/bsdstats

To sync with FreeBSD

3 years agoperiodic(8): Sync with FreeBSD current
Aaron LI [Thu, 8 Mar 2018 03:10:19 +0000 (11:10 +0800)]
periodic(8): Sync with FreeBSD current

3 years agocryptsetup(8): Revert part of 0482a033108. We got mlockall().
Sascha Wildner [Mon, 12 Mar 2018 07:53:20 +0000 (08:53 +0100)]
cryptsetup(8): Revert part of 0482a033108. We got mlockall().

3 years agoinitrd/oinit: chdir to the new root before chroot to it
Aaron LI [Mon, 12 Mar 2018 04:10:39 +0000 (12:10 +0800)]
initrd/oinit: chdir to the new root before chroot to it

chroot(2) doesn't change the working directory of the current process,
therefore a single chroot(2) to a new root (during the early boot with
encrypted root) causes getcwd(3) fail, which further causes problems for
some rc scripts.

For example:
Without this fix, and by placing a 'echo "PWD=`pwd`"' to the beginning
of /etc/rc, the following messages were logged on the console:
Mar 12 10:40:28 dfly kernel: pwd: .: No such file or directory
Mar 12 10:40:28 dfly kernel: PWD=

Another example with "unbound" rc start:
Mar  3 09:28:11 dfly kernel: Obtaining a trust anchor:
Mar  3 09:28:11 dfly kernel: _su: No such file or directory
Mar  3 09:28:11 dfly kernel: _su: Trying to start from "/"
Mar  3 09:28:12 dfly kernel: .
Mar  3 09:28:12 dfly kernel: [1520040492] unbound-checkconf[1138:0] error: cannot getcwd: No such file or directory
Mar  3 09:28:12 dfly kernel: Starting unbound.
Mar  3 09:28:12 dfly kernel: [1520040492] unbound[1139:0] warning: unbound is already running as pid 1139.

uWSGI rc startup also failed to setup correct working directory due to
this problem.

3 years agoImport byacc-20170709
Antonio Huete Jimenez [Sun, 11 Mar 2018 15:17:21 +0000 (08:17 -0700)]
Import byacc-20170709

3 years agodisklabel64 - Make disktype optional, fix alignment bug
Matthew Dillon [Sat, 10 Mar 2018 21:39:59 +0000 (13:39 -0800)]
disklabel64 - Make disktype optional, fix alignment bug

* Make the disktype optional, use 'auto' automatically

* Fix a bug in the kernel's l64_makevirginlabel() calculation.
  It was not properly calculating the alignment relative to
  the physical disk.

* Refactor some of the documentation

* Refactor examples

Submitted-by: Aaron LI <aly@aaronly.me>
3 years agoboot/efi: Sync our TianoCore EDK II headers with the UDK2018 branch.
Sascha Wildner [Sat, 10 Mar 2018 19:34:23 +0000 (20:34 +0100)]
boot/efi: Sync our TianoCore EDK II headers with the UDK2018 branch.

Just comments in one header.

3 years agolocate(1): Bring in some updates/fixes from FreeBSD
Aaron LI [Sat, 10 Mar 2018 03:59:29 +0000 (11:59 +0800)]
locate(1): Bring in some updates/fixes from FreeBSD

* The default value of "FILESYSTEMS" option is now determined using lsvfs(1),
  which contains all local file systems that are not synthetic, loopback mounts
  or read-only.
* New config option "PRUNEDIRS" in /etc/locate.rc with default value of ".git"
  to ignore the ".git" directories when making database.
* Warn when locate.updatedb(8) is directly run by root
* Some cleanups (no functional change)
* Improve license declarations, fix white spaces and typos

3 years agolsvfs(1): Return simply 1 on failure.
Sascha Wildner [Sat, 10 Mar 2018 09:17:41 +0000 (10:17 +0100)]
lsvfs(1): Return simply 1 on failure.

3 years agolsvfs(1): Tabify the rest of lsvfs.c.
Sascha Wildner [Sat, 10 Mar 2018 09:17:00 +0000 (10:17 +0100)]
lsvfs(1): Tabify the rest of lsvfs.c.

3 years agolsvfs(1): Sync a bit with FreeBSD, as applicable.
Sascha Wildner [Sat, 10 Mar 2018 09:08:27 +0000 (10:08 +0100)]
lsvfs(1): Sync a bit with FreeBSD, as applicable.

Specifically, merge r185029/r251580 and sync the manual page.

Taken-from: FreeBSD

3 years agolsvfs.1: Explain why lsvfs(1) shows 2 references to UFS on encrypted root.
Sascha Wildner [Sat, 10 Mar 2018 08:16:00 +0000 (09:16 +0100)]
lsvfs.1: Explain why lsvfs(1) shows 2 references to UFS on encrypted root.

While here, fix two cases where a new sentence didn't start on a new

Idea-by: Aaron LI <aly@aaronly.me>
3 years agonvmectl(8): Add missing DPADD in the Makefile.
Sascha Wildner [Fri, 9 Mar 2018 18:30:58 +0000 (19:30 +0100)]
nvmectl(8): Add missing DPADD in the Makefile.

3 years agolocate.updatedb(8): Add hammer2 support.
Sascha Wildner [Fri, 9 Mar 2018 08:26:53 +0000 (09:26 +0100)]
locate.updatedb(8): Add hammer2 support.

Reported-by: Aaron LI <aly@aaronly.me>
3 years agodes_crypt.3: Fix typo.
Sascha Wildner [Wed, 7 Mar 2018 09:15:19 +0000 (10:15 +0100)]
des_crypt.3: Fix typo.

3 years agopsm.4: Remove useless BUGS section.
Sascha Wildner [Wed, 7 Mar 2018 09:08:12 +0000 (10:08 +0100)]
psm.4: Remove useless BUGS section.

3 years agosysmouse.4: Fix some typos.
Sascha Wildner [Wed, 7 Mar 2018 09:03:59 +0000 (10:03 +0100)]
sysmouse.4: Fix some typos.

3 years agosys/vfs/autofs: Cleanups
Tomohiro Kusumi [Tue, 6 Mar 2018 18:27:04 +0000 (03:27 +0900)]
sys/vfs/autofs: Cleanups

Move local varaibles to inner scopes where possible.
The existing local variable declarations are mostly from FreeBSD,
but I've also changed NetBSD autofs the way this commit does.

(Don't do this for autofs userspace though. Increasing diff from
FreeBSD for non functional thing like this is much less important,
whereas kernel side is basically a rewrite.)

3 years agokernel/extp{read,write}v: Change ioccnt from u_int to int.
Sascha Wildner [Tue, 6 Mar 2018 07:46:34 +0000 (08:46 +0100)]
kernel/extp{read,write}v: Change ioccnt from u_int to int.

Just like preadv(), pwritev(). Struct uio's uio_ioccnt is also int.
Also adjust iovec_copyin() to take an int.

While here, make iovec const, also like in preadv/pwritev.

Discussed-with: dillon

3 years agosyscons: Remove unused variable.
zrj [Mon, 5 Mar 2018 07:21:33 +0000 (09:21 +0200)]
syscons: Remove unused variable.

3 years agosyscons - Fix NULL pointer access in 0d7c8a4d1cafae68239
Imre Vadász [Sun, 4 Mar 2018 21:49:59 +0000 (22:49 +0100)]
syscons - Fix NULL pointer access in 0d7c8a4d1cafae68239

3 years agoflopen.3: Use .Fa where appropriate.
Sascha Wildner [Sun, 4 Mar 2018 16:42:13 +0000 (17:42 +0100)]
flopen.3: Use .Fa where appropriate.

3 years agosyscons - Wait for drm modesetting at appropriate places.
Imre Vadász [Sun, 4 Mar 2018 13:51:34 +0000 (14:51 +0100)]
syscons - Wait for drm modesetting at appropriate places.

* This avoids races between userland using DRM, and the drm modesetting
  callbacks called by syscons.

* Always call the drm modesetting callback, when we are switching from a
  virtual terminal that is in Graphics mode. Before that was skipped unless
  we were switching to a virtual terminal that is in Text mode.
  However with the framebuffer mmap-ing through syscons, it also makes sense
  to use virtual terminals in Graphics mode, without going through drm. So
  we have to make sure to restore the syscons framebuffer there as well.

3 years agopc64 - Unmask some AMD Family 15h and 16h CPUs for TSC mpsync test.
Imre Vadász [Sun, 4 Mar 2018 12:03:57 +0000 (13:03 +0100)]
pc64 - Unmask some AMD Family 15h and 16h CPUs for TSC mpsync test.

* The problematic
  Erratum 778 "Processor Core Time Stamp Counters May Experience Drift" is
  only listed for Family 15h < Model 30h and for Family 16h < Model 30h
  (Family 15h == Bulldozer, and Family 16h == Jaguar).

3 years agoFix typo in MLINK name.
Sascha Wildner [Sun, 4 Mar 2018 09:18:24 +0000 (10:18 +0100)]
Fix typo in MLINK name.

3 years agoRemove some sendsys()/waitsys() remains.
Sascha Wildner [Sat, 3 Mar 2018 17:20:16 +0000 (18:20 +0100)]
Remove some sendsys()/waitsys() remains.

3 years agosysmouse - Fix sigio handling after c2962d9da8200947ee394b190eea39d437fb1af7
Imre Vadász [Wed, 28 Feb 2018 20:47:08 +0000 (21:47 +0100)]
sysmouse - Fix sigio handling after c2962d9da8200947ee394b190eea39d437fb1af7

3 years agoRemove some really old portability hacks that should no longer be needed.
Sascha Wildner [Sat, 3 Mar 2018 15:52:10 +0000 (16:52 +0100)]
Remove some really old portability hacks that should no longer be needed.

This no longer declares ftruncate()/lseek()/mmap() and truncate() in
either <stdio.h> or <sys/types.h>. 20 years after FreeBSD added it
(in r24896) we should be over it. What's left, we'll fix better.

3 years ago<arpa/inet.h>: Some cleanups.
Sascha Wildner [Sat, 3 Mar 2018 15:42:06 +0000 (16:42 +0100)]
<arpa/inet.h>: Some cleanups.

* Stop defining struct in6_addr. This doesn't belong here, and it was
  originally only added because of some issue in pkgsrc. Thanks to
  Sevan Janiyan for confirming that this no longer occurs.

* Incude <stdint.h> instead of the full <sys/types.h> and define
  in_addr_t and in_port_t per POSIX.

* Put inet_ntoa_r under __BSD_VISIBLE.

* Remove an obsolete comment.

3 years ago<pthread.h>: Add missing 'const' to four functions.
Sascha Wildner [Sat, 3 Mar 2018 15:34:48 +0000 (16:34 +0100)]
<pthread.h>: Add missing 'const' to four functions.

3 years agoSort SEE ALSO in two manual pages.
Sascha Wildner [Fri, 2 Mar 2018 13:30:48 +0000 (14:30 +0100)]
Sort SEE ALSO in two manual pages.

3 years agonfs.5: Add missing markup.
Sascha Wildner [Fri, 2 Mar 2018 07:10:50 +0000 (08:10 +0100)]
nfs.5: Add missing markup.

3 years agonfs.5: Clarify vfs.nfs.nfsv3_commit_on_close description a bit.
Sascha Wildner [Fri, 2 Mar 2018 07:08:07 +0000 (08:08 +0100)]
nfs.5: Clarify vfs.nfs.nfsv3_commit_on_close description a bit.

3 years ago{read,write}.2: A bit more cleanup. Also add ext*() MLINKS.
Sascha Wildner [Fri, 2 Mar 2018 06:40:17 +0000 (07:40 +0100)]
{read,write}.2: A bit more cleanup. Also add ext*() MLINKS.

3 years agoworld - Document extpread() and extpwrite()
Matthew Dillon [Fri, 2 Mar 2018 02:57:11 +0000 (18:57 -0800)]
world - Document extpread() and extpwrite()

* Document these DragonFly-specific system calls.

3 years agofstat(1): Add hammer2 support.
Sascha Wildner [Wed, 28 Feb 2018 13:24:07 +0000 (14:24 +0100)]
fstat(1): Add hammer2 support.

3 years ago<vfs/hammer2/hammer2.h>: Expose VTOI() with _KERNEL_STRUCTURES.
Sascha Wildner [Wed, 28 Feb 2018 13:22:56 +0000 (14:22 +0100)]
<vfs/hammer2/hammer2.h>: Expose VTOI() with _KERNEL_STRUCTURES.

3 years agokernel/netgraph7: Fix panic
Markus Pfeiffer [Sat, 24 Feb 2018 14:11:06 +0000 (14:11 +0000)]
kernel/netgraph7: Fix panic

We just unset the M_HASH flag for the mbuf before queueing the
message to the netisr, making sure the handler doesn't run
on the wrong CPU.

3 years agolibc: Fix a comment in Makefile.inc.
Sascha Wildner [Fri, 23 Feb 2018 08:30:55 +0000 (09:30 +0100)]
libc: Fix a comment in Makefile.inc.

3 years agostring.3: Fix types of strlcat() and strlcpy() prototypes.
Sascha Wildner [Fri, 23 Feb 2018 07:57:14 +0000 (08:57 +0100)]
string.3: Fix types of strlcat() and strlcpy() prototypes.

3 years agosyscons - Detangle sysmouse from tty handling, implement a custom FIFO.
Imre Vadász [Thu, 22 Feb 2018 21:54:33 +0000 (22:54 +0100)]
syscons - Detangle sysmouse from tty handling, implement a custom FIFO.

* This avoids unnecessary IPIs and other overhead from the tty handling.

* This also makes reads from the character device always get only complete
  sysmouse packets.

3 years agosyscons - No special minor device number is needed anymore for sysmouse.
Imre Vadász [Thu, 22 Feb 2018 21:54:10 +0000 (22:54 +0100)]
syscons - No special minor device number is needed anymore for sysmouse.

3 years agoselect.2: timeout is restrict too.
Sascha Wildner [Thu, 22 Feb 2018 17:56:30 +0000 (18:56 +0100)]
select.2: timeout is restrict too.

3 years agoAdd missing restrict qualifiers to various manual pages.
Sascha Wildner [Thu, 22 Feb 2018 17:40:14 +0000 (18:40 +0100)]
Add missing restrict qualifiers to various manual pages.

3 years agokernel/u4b: Some additional work for the recent cdce(4) addition.
Sascha Wildner [Thu, 22 Feb 2018 13:37:35 +0000 (14:37 +0100)]
kernel/u4b: Some additional work for the recent cdce(4) addition.

* Add a manual page from FreeBSD.

* Add to LINT64.

* Adjust devd(8) configuration so that cdce.ko automatically loads upon

3 years agokernel/u4b: Use CDCE_LOCK/CDCE_UNLOCK macros
Markus Pfeiffer [Wed, 21 Feb 2018 23:57:23 +0000 (23:57 +0000)]
kernel/u4b: Use CDCE_LOCK/CDCE_UNLOCK macros

3 years agokernel: port if_cdce
Markus Pfeiffer [Mon, 19 Feb 2018 20:59:02 +0000 (20:59 +0000)]
kernel: port if_cdce

While here also update it to FreeBSD's

3 years agokernel/acpi: Remove the old APM emulation code.
Sascha Wildner [Thu, 22 Feb 2018 06:50:13 +0000 (07:50 +0100)]
kernel/acpi: Remove the old APM emulation code.

This is no longer needed by anything. The <machine/apm_bios.h> header
with APM ioctl defines can go as well.

While here, do a little adjustment of comments and manual pages too.

Pointed-out-by: ivadasz
3 years agoUPGRADING: Mention the recent removal of 'device virtio_pci'.
Sascha Wildner [Wed, 21 Feb 2018 10:01:29 +0000 (11:01 +0100)]
UPGRADING: Mention the recent removal of 'device virtio_pci'.

3 years agonrelease - Add missing headers to src-sys.tar.bz2
Matthew Dillon [Tue, 20 Feb 2018 18:47:26 +0000 (10:47 -0800)]
nrelease - Add missing headers to src-sys.tar.bz2

* Add missing headers to src-sys.tar.bz2 so 'make nativekernel'
  actually works.

Reported-by: Constantine A. Murenin
3 years agolibc/libc_rtld: Fix up some comments in the Makefiles.
Sascha Wildner [Tue, 20 Feb 2018 13:28:02 +0000 (14:28 +0100)]
libc/libc_rtld: Fix up some comments in the Makefiles.

3 years agogpt - Add a new directive called 'init'
Matthew Dillon [Tue, 20 Feb 2018 08:39:01 +0000 (00:39 -0800)]
gpt - Add a new directive called 'init'

* Add a new directive called 'init'.  This directive works like
  gpt create except it will also create a msdos slice 0 (and newfs_msdos
  it), and a "DragonFly Label64" slice 1, and
  'disklabel -r -w <slice1> auto'.

* If -B is also specified, the init directive will populate the msdos
  filesystem with efi/boot/bootx64.efi, and also supplies -B to the
  disklabel command.

* This command does not create the boot, swap, or root filesystem
  partitions in the disklabel.  It is meant to do something similar
  to what fdisk -IB used to do for us for legacy partitions (though
  I should note that fdisk -IB didn't initialize a new disklabel).  But
  we do for gpt.

3 years agokernel/ncr: Fix double assignment.
Sascha Wildner [Tue, 20 Feb 2018 07:36:41 +0000 (08:36 +0100)]
kernel/ncr: Fix double assignment.

Taken-from: FreeBSD

3 years agokernel/i915: Fix double assignment (Linux' ed58570f55e2c5755).
Sascha Wildner [Tue, 20 Feb 2018 07:30:16 +0000 (08:30 +0100)]
kernel/i915: Fix double assignment (Linux' ed58570f55e2c5755).

3 years agokernel/i915: Fix double assignment (Linux' 52eb92c6fe8f89c30).
Sascha Wildner [Tue, 20 Feb 2018 07:25:33 +0000 (08:25 +0100)]
kernel/i915: Fix double assignment (Linux' 52eb92c6fe8f89c30).

3 years agortadvd(8): Fix double assignment.
Sascha Wildner [Tue, 20 Feb 2018 07:10:06 +0000 (08:10 +0100)]
rtadvd(8): Fix double assignment.

ra->nd_ra_flags_reserved is initialized properly a few lines below.
Assigning 0 first is unnecessary.

3 years agokernel/urtw: Fix double assignments.
Sascha Wildner [Tue, 20 Feb 2018 07:05:43 +0000 (08:05 +0100)]
kernel/urtw: Fix double assignments.

This driver hasn't been properly ported and isn't built currently. The
fix is just to silence coccinelle when searching for double assignments.

Taken-from: FreeBSD

3 years agotools/w00t: Fix double assignment.
Sascha Wildner [Tue, 20 Feb 2018 06:57:52 +0000 (07:57 +0100)]
tools/w00t: Fix double assignment.

3 years agoFix two double assignments in the kernel and the boot code.
Sascha Wildner [Mon, 19 Feb 2018 12:46:53 +0000 (13:46 +0100)]
Fix two double assignments in the kernel and the boot code.

3 years agovirtio - Remove explicit load of virtio.ko. Remove device virtio_pci line.
Imre Vadász [Sun, 12 Mar 2017 12:54:48 +0000 (13:54 +0100)]
virtio - Remove explicit load of virtio.ko. Remove device virtio_pci line.

* virtio.ko never needs to be loaded explicitly, since virtio_pci.ko
  depends on it.

* Also get rid of device virtio_pci line in the kernel config. Similar to
  other buses, link virtio_pci statically into the kernel when both
  device virtio and device pci are configured.

3 years agoncurses: Make sure to pass NXCFLAGS to NXCC.
zrj [Mon, 5 Feb 2018 18:04:30 +0000 (20:04 +0200)]
ncurses: Make sure to pass NXCFLAGS to NXCC.

Only the -I... paths are needed for cpp invocation.

3 years agoLIBPRIV: Make sure sh(1) only depends on lib.so.
zrj [Wed, 7 Feb 2018 14:48:20 +0000 (16:48 +0200)]
LIBPRIV: Make sure sh(1) only depends on lib.so.

Avoid possible cases of failed installworld target.

3 years agosh(1): Add and use pregenerated headers.
zrj [Tue, 6 Feb 2018 21:56:48 +0000 (23:56 +0200)]
sh(1): Add and use pregenerated headers.

These only add 30k to the repo while ensuring that bin/sh would not be
affected by bad shell script invocation etc. As the bonus it solves the
issue in share/initrd too. Nothing in the generated headers should fail
for our use cases. If that would change, please report it.

3 years agodevinfo - Print info, whether a device is flagged as disabled.
Imre Vadász [Mon, 5 Feb 2018 17:19:52 +0000 (18:19 +0100)]
devinfo - Print info, whether a device is flagged as disabled.

* Also make -v print only enabled devices, specifying -v twice will also
  print disabled devices. This should make "devinfo -v" output less
  confusing on modern hardware with lots of non-present devices in the ACPI

3 years agolibdevinfo - Fix enum devinfo_state.
Imre Vadász [Mon, 5 Feb 2018 17:19:33 +0000 (18:19 +0100)]
libdevinfo - Fix enum devinfo_state.

3 years agokern - Add D_MEM flag to /dev/mem and /dev/kmem character devices.
Imre Vadász [Mon, 5 Feb 2018 20:24:11 +0000 (21:24 +0100)]
kern - Add D_MEM flag to /dev/mem and /dev/kmem character devices.

* This makes seeking actually work on these character devices, which fixes
  performance of various tools when reading from /dev/mem or /dev/kmem.

3 years agoatkbdc - Do not attach PS2 controller via legacy ISA bus, if FADT says so.
Imre Vadász [Thu, 1 Feb 2018 12:16:55 +0000 (13:16 +0100)]
atkbdc - Do not attach PS2 controller via legacy ISA bus, if FADT says so.

* If the FADT BootFlags value tells us that we shouldn't expect the PS2
  controller to be at the IO ports 0x60/0x64, we should instead only attach
  the atkbdc driver when there is a matching device in the ACPI namespace.

* This avoids attempts to attach the atkbdc PS2 controller driver on
  hardware which doesn't have a usable PS2 controller. This happens on
  many modern notebooks, and has been the case for some time on desktop
  hardware that doesn't provide an emulated PS2 controller for using USB
  input devices all the time (it either is never initialized, or might
  get disabled by some of the ACPI or USB initialization during bootup).

3 years agoReplace local array size calculations with NELEM().
Sascha Wildner [Sun, 18 Feb 2018 01:42:43 +0000 (02:42 +0100)]
Replace local array size calculations with NELEM().

3 years agoConvert from __arysize to NELEM
Eitan Adler [Fri, 16 Feb 2018 08:53:39 +0000 (00:53 -0800)]
Convert from __arysize to NELEM

Try to use a single macro across the board

Discussed-with: zrj, swildner

3 years agonfs.5: Adjust (c) year.
Sascha Wildner [Sat, 17 Feb 2018 22:35:11 +0000 (23:35 +0100)]
nfs.5: Adjust (c) year.

3 years agonfs.5: Remove unneeded .Pp
Sascha Wildner [Sat, 17 Feb 2018 22:31:09 +0000 (23:31 +0100)]
nfs.5: Remove unneeded .Pp

3 years agodevfs.5: Document sysctl.
Sascha Wildner [Sat, 17 Feb 2018 22:29:15 +0000 (23:29 +0100)]
devfs.5: Document sysctl.

Submitted-by: zrj