dragonfly.git
4 years agosbin/hammer2: Fix root blockref type in "freemap"
Tomohiro Kusumi [Tue, 13 Aug 2019 16:00:03 +0000 (01:00 +0900)]
sbin/hammer2: Fix root blockref type in "freemap"

The root blockref type for freemap should be
HAMMER2_BREF_TYPE_FREEMAP rather than HAMMER2_BREF_TYPE_VOLUME.
Both are pseudo types, but sync with what fchain uses.

4 years agosys/vfs/hammer2: Use HAMMER2_FREEMAP_LEVEL1_MASK
Tomohiro Kusumi [Tue, 13 Aug 2019 01:30:43 +0000 (10:30 +0900)]
sys/vfs/hammer2: Use HAMMER2_FREEMAP_LEVEL1_MASK

(HAMMER2_FREEMAP_LEVEL1_SIZE - 1) -> HAMMER2_FREEMAP_LEVEL1_MASK

4 years agosys/vfs/hammer2: Drop redundant H2FMSHIFT() macro
Tomohiro Kusumi [Mon, 12 Aug 2019 16:31:35 +0000 (01:31 +0900)]
sys/vfs/hammer2: Drop redundant H2FMSHIFT() macro

Since H2FMSHIFT() is only used with freemap radix levels, it can be
completely replaced with the existing HAMMER2_FREEMAP_LEVEL*_SIZE.
This is more readable.

4 years agosys/vfs/hammer2: Move duplicated macros H2FM*() to hammer2_disk.h
Tomohiro Kusumi [Mon, 12 Aug 2019 16:13:47 +0000 (01:13 +0900)]
sys/vfs/hammer2: Move duplicated macros H2FM*() to hammer2_disk.h

These macros exist in both freemap and bulkfree code.
Should be part of ondisk layout spec.

4 years agosys/vfs/hammer2: Drop unused inline function hammer2_freemapradix()
Tomohiro Kusumi [Mon, 12 Aug 2019 16:03:40 +0000 (01:03 +0900)]
sys/vfs/hammer2: Drop unused inline function hammer2_freemapradix()

Unused since 93f3933ac3e2ad37a7ba775663c711b13588f147 in 2013.

4 years agosys/vfs/hammer2: Use HAMMER2_FREEMAP_LEVEL1_SIZE
Tomohiro Kusumi [Mon, 12 Aug 2019 16:00:06 +0000 (01:00 +0900)]
sys/vfs/hammer2: Use HAMMER2_FREEMAP_LEVEL1_SIZE

4 years agosbin/newfs_hammer2: Drop -Isbin/hammer2 in Makefile
Tomohiro Kusumi [Sun, 11 Aug 2019 16:32:06 +0000 (01:32 +0900)]
sbin/newfs_hammer2: Drop -Isbin/hammer2 in Makefile

Unlike newfs_hammer(8), newfs_hammer2(8) just creates root inodes,
therefore it doesn't (need to) rely on hammer2(8) for ondisk
initialization nor does it have such functionality.

4 years agosbin/hammer2: Don't test uuid on "info"/"mountall" if uuid is 0
Tomohiro Kusumi [Sun, 11 Aug 2019 16:01:55 +0000 (01:01 +0900)]
sbin/hammer2: Don't test uuid on "info"/"mountall" if uuid is 0

Don't terminate if HAMMER2 device/partition has 0 uuid.

4 years agosbin/hammer2: Remove unnecessary { ... } scope
Tomohiro Kusumi [Sun, 11 Aug 2019 15:13:52 +0000 (00:13 +0900)]
sbin/hammer2: Remove unnecessary { ... } scope

4 years agosbin/newfs_hammer2: Whitespace cleanups
Tomohiro Kusumi [Sun, 11 Aug 2019 04:03:07 +0000 (13:03 +0900)]
sbin/newfs_hammer2: Whitespace cleanups

4 years agosbin/newfs_hammer2: Fix usage() output
Tomohiro Kusumi [Sun, 11 Aug 2019 03:55:00 +0000 (12:55 +0900)]
sbin/newfs_hammer2: Fix usage() output

Sync with newfs_hammer2(8).
Unlike HAMMER1, label name via -L is optional.

4 years agosbin/newfs_hammer2: Drop unused GIG
Tomohiro Kusumi [Sun, 11 Aug 2019 03:49:36 +0000 (12:49 +0900)]
sbin/newfs_hammer2: Drop unused GIG

from 2012.
There is no block device size requirement like HAMMER1.

4 years agosys/vfs/hammer2: Cleanup unused bp/nbio's in strategy
Tomohiro Kusumi [Sat, 10 Aug 2019 22:41:44 +0000 (07:41 +0900)]
sys/vfs/hammer2: Cleanup unused bp/nbio's in strategy

4 years agosys/vfs/hammer2: Use MAXBSIZE for getblk() size limit
Tomohiro Kusumi [Sat, 10 Aug 2019 22:01:45 +0000 (07:01 +0900)]
sys/vfs/hammer2: Use MAXBSIZE for getblk() size limit

4 years agodrm/linux: Add X86_FEATURE_HYPERVISOR
François Tigeot [Sat, 10 Aug 2019 19:57:15 +0000 (21:57 +0200)]
drm/linux: Add X86_FEATURE_HYPERVISOR

4 years agoBuild: Bump __DragonFly_version to 500703
François Tigeot [Sat, 10 Aug 2019 19:51:01 +0000 (21:51 +0200)]
Build: Bump __DragonFly_version to 500703

Knowing whether static TLS binding is useable or not is important
for some ports like graphics/mesa-libs

4 years agosys/vfs/hammer2: Fix comments on inode lock on truncation
Tomohiro Kusumi [Sat, 10 Aug 2019 17:04:03 +0000 (02:04 +0900)]
sys/vfs/hammer2: Fix comments on inode lock on truncation

Inodes are locked when these are called.

4 years agosys/vfs/hammer2: Fix indentation
Tomohiro Kusumi [Sat, 10 Aug 2019 15:05:07 +0000 (00:05 +0900)]
sys/vfs/hammer2: Fix indentation

4 years agokernel: Fix the _KERNEL/_KERNEL_STRUCTURES checks w/ error msg a bit.
Sascha Wildner [Sat, 10 Aug 2019 11:52:09 +0000 (13:52 +0200)]
kernel: Fix the _KERNEL/_KERNEL_STRUCTURES checks w/ error msg a bit.

Uniformly use this style:

#ifndef _KERNEL
#error "..."
#endif

over this style:

#ifndef _KERNEL
#error "..."
#else
[rest of header]
#endif

Pointed-out-by: zrj
4 years agokdump(1): Remove an unneeded include path in the Makefile.
Sascha Wildner [Sat, 10 Aug 2019 09:54:53 +0000 (11:54 +0200)]
kdump(1): Remove an unneeded include path in the Makefile.

Include syscalls.c relative to ${.CURDIR}/../../sys, that we need
anyway.

4 years agortld - Support static TLS bindings for late-loaded shared libraries (2)
Matthew Dillon [Sat, 10 Aug 2019 06:48:40 +0000 (23:48 -0700)]
rtld - Support static TLS bindings for late-loaded shared libraries (2)

* Add missing static_tls.h

Reported-by: ftigeot
4 years agortld - Support static TLS bindings for late-loaded shared libraries
Matthew Dillon [Fri, 9 Aug 2019 22:22:18 +0000 (15:22 -0700)]
rtld - Support static TLS bindings for late-loaded shared libraries

* Allow late (manual) dlopen()s to load shared libraries which
  use static TLS variables, as long as there is space.  Do proper
  late-binding and initialize the area for all threads.

* rtld will cache a symbol lookup on first-need for:
  "_pthread_distribute_static_tls" and then call it as needed to
  initialize late-bound static TLS space.

  This symbol is weakly bounded to __libc_distribute_static_tls in libc,
  and strongly overridden by _libthread_distribute_static_tls in
  libthread_xu.

* Fixes mesa glx-tls and others.

* Test code from FreeBSD.  Also tested with other combinations
  including a pthread_create() and -static compilation.

https://github.com/dumbbell/test-tls-initial-exec

4 years ago<machine/stdint.h>: Move __offsetof() to <sys/cdefs.h>.
Sascha Wildner [Fri, 9 Aug 2019 19:08:02 +0000 (21:08 +0200)]
<machine/stdint.h>: Move __offsetof() to <sys/cdefs.h>.

It didn't really fit well into <machine/stdint.h> which is for machine
dependent types only.

See FreeBSD's r99594.

I took a comment and some additional casts from FreeBSD.

Pointed-out-by: zrj
4 years agolibc/utmpx: Fix updwtmpx() across newsyslog rotation of /var/log/wtmpx.
Sascha Wildner [Fri, 9 Aug 2019 17:19:07 +0000 (19:19 +0200)]
libc/utmpx: Fix updwtmpx() across newsyslog rotation of /var/log/wtmpx.

When /var/log/wtmpx is rotated by newsyslog(8), an empty /var/log/wtmpx
is created. Fix updwtmpx() to write the signature record this case as
well. This signature record is used by setutxdb() to verify the file.

4 years ago<machine/stdint.h>: Use __GNUC_PREREQ__() for a __GNUC__ check.
Sascha Wildner [Fri, 9 Aug 2019 17:11:12 +0000 (19:11 +0200)]
<machine/stdint.h>: Use __GNUC_PREREQ__() for a __GNUC__ check.

Reported-by: zrj
4 years agoreboot(8): Fix argument order in logwtmpx().
Sascha Wildner [Thu, 8 Aug 2019 20:32:11 +0000 (22:32 +0200)]
reboot(8): Fix argument order in logwtmpx().

4 years agoinet6: discard NA messages with a lladdress we own
Roy Marples [Thu, 8 Aug 2019 16:41:55 +0000 (17:41 +0100)]
inet6: discard NA messages with a lladdress we own

This allows userland to send NA messages for already existing
addresses without the kernel reporting incorrectly that a
duplicate address has been detected.

4 years agonet/if: introduce if_bylla to find an interface by hardware address
Roy Marples [Thu, 8 Aug 2019 16:38:21 +0000 (17:38 +0100)]
net/if: introduce if_bylla to find an interface by hardware address

4 years ago<sys/stdint.h>: Remove obsolete typedefs for __wctrans_t and __wctype.h.
Sascha Wildner [Thu, 8 Aug 2019 08:32:03 +0000 (10:32 +0200)]
<sys/stdint.h>: Remove obsolete typedefs for __wctrans_t and __wctype.h.

These are no longer used since 0d5acd7467c4e95f792ef49fceb3ab8e917ce86b.

Reported-by: zrj
4 years ago<uchar.h>: Define char16_t and char32_t better.
Sascha Wildner [Wed, 7 Aug 2019 20:00:17 +0000 (22:00 +0200)]
<uchar.h>: Define char16_t and char32_t better.

Define them unless we use C++11 or higher. Also, remove __char16_t
and __char32_t from <sys/types.h>. Furthermore, remove the unneeded
declaration guards.

Thanks to zrj for his help.

4 years agodrm/linux: Implement more idr routines
François Tigeot [Wed, 7 Aug 2019 17:56:50 +0000 (19:56 +0200)]
drm/linux: Implement more idr routines

Add idr_get_next() and idr_for_each_entry()

Inspired-from: FreeBSD

4 years agokernel: Enable more generic drm code
François Tigeot [Wed, 7 Aug 2019 17:34:00 +0000 (19:34 +0200)]
kernel: Enable more generic drm code

Reduce differences with Linux 4.7.10

4 years agoDocument ENOBUFS error in read(2) and recv(2).
Roy Marples [Wed, 7 Aug 2019 01:05:43 +0000 (02:05 +0100)]
Document ENOBUFS error in read(2) and recv(2).

4 years agosocket: introduce SO_RERROR to detect receive buffer overflow
Roy Marples [Wed, 7 Aug 2019 00:48:21 +0000 (01:48 +0100)]
socket: introduce SO_RERROR to detect receive buffer overflow

kernel receive buffers are initially of a limited size and
generally the network protocols that use them don't care
if a packet gets lost.

However some users do care about lost messages even if not
baked into the protocol - such as consumers of route(4) to
track state.

POSIX states that read(2) can return an error of ENOBUFS so
return this error code when an overflow is detected.
Guard this with socket option SO_RERROR so that existing
applications which do not care can carry on not caring by
default.

Taken-from: NetBSD
Reviewed-by: sephe
4 years agoTest commit
Roy Marples [Tue, 6 Aug 2019 22:32:53 +0000 (23:32 +0100)]
Test commit

4 years agodbopen.3: Mention O_CLOEXEC.
Sascha Wildner [Tue, 6 Aug 2019 21:03:02 +0000 (23:03 +0200)]
dbopen.3: Mention O_CLOEXEC.

4 years ago<sys/copyright.h>: Remove a K&R leftover; use just spaces instead of /**/.
Sascha Wildner [Tue, 6 Aug 2019 18:45:35 +0000 (20:45 +0200)]
<sys/copyright.h>: Remove a K&R leftover; use just spaces instead of /**/.

4 years agosys/vfs/hammer2: Drop redundant ; in H2XOPDESCRIPTOR()
Tomohiro Kusumi [Mon, 5 Aug 2019 04:24:26 +0000 (13:24 +0900)]
sys/vfs/hammer2: Drop redundant ; in H2XOPDESCRIPTOR()

4 years agoFWIW, fix systags.sh.
Sascha Wildner [Tue, 6 Aug 2019 11:08:22 +0000 (13:08 +0200)]
FWIW, fix systags.sh.

4 years agokernel/ixgbe: Use __restrict instead of restrict like everywhere else.
Sascha Wildner [Tue, 6 Aug 2019 08:26:38 +0000 (10:26 +0200)]
kernel/ixgbe: Use __restrict instead of restrict like everywhere else.

4 years agokernel/drm: Add print_hex_buffer() and use it.
Sascha Wildner [Mon, 5 Aug 2019 19:02:28 +0000 (21:02 +0200)]
kernel/drm: Add print_hex_buffer() and use it.

4 years agosail(6): Sync with NetBSD.
Sascha Wildner [Mon, 29 Jul 2019 10:43:57 +0000 (12:43 +0200)]
sail(6): Sync with NetBSD.

This, among other things, fixes an old curses related bug that caused
FreeBSD ports to take NetBSD's instead of ours (the games/bsdgames port
takes our source as the distfile). They've since switched to debian's
sail.

See https://svnweb.freebsd.org/ports?view=revision&revision=495354

4 years agosys/vfs/hammer2: Drop obsolete comments on chain
Tomohiro Kusumi [Sun, 4 Aug 2019 16:29:16 +0000 (01:29 +0900)]
sys/vfs/hammer2: Drop obsolete comments on chain

"dbtree", "dbq", "core_entry", "domodify" are all removed in around 2014.

4 years agoahci - sili - Reduce insertion delay from 10 seconds to 5
Matthew Dillon [Sat, 3 Aug 2019 20:42:45 +0000 (13:42 -0700)]
ahci - sili - Reduce insertion delay from 10 seconds to 5

* Reduce the insertion delay for hot-plug from 10 seconds to
  5 seconds.

4 years agosys/vfs/hammer2: Test bref type HAMMER2_BREF_TYPE_EMPTY instead 0
Tomohiro Kusumi [Fri, 2 Aug 2019 22:22:44 +0000 (07:22 +0900)]
sys/vfs/hammer2: Test bref type HAMMER2_BREF_TYPE_EMPTY instead 0

4 years agotelnet - Apply FreeBSD-SA-19:12.telnet.asc to telnet
Matthew Dillon [Sat, 3 Aug 2019 16:09:45 +0000 (09:09 -0700)]
telnet - Apply FreeBSD-SA-19:12.telnet.asc to telnet

* Fix two environment variable vulnerabililties in the telnet
  client.

* Generally replace all sprintf()s with snprintf()s.

4 years agosys/vfs/hammer2: Fix function name in panic() calls
Tomohiro Kusumi [Thu, 1 Aug 2019 20:27:37 +0000 (05:27 +0900)]
sys/vfs/hammer2: Fix function name in panic() calls

4 years agosys/vfs/hammer2: Drop unused CHAIN_CORE_DELETE_BMAP_ENTRIES
Tomohiro Kusumi [Thu, 1 Aug 2019 18:36:05 +0000 (03:36 +0900)]
sys/vfs/hammer2: Drop unused CHAIN_CORE_DELETE_BMAP_ENTRIES

Added in 8138a154be31c3db1d8bd046ca7b003a6c79c01c in 2014,
but never used. It also doesn't seem to have any meaning in
current implementation.

4 years agokernel - Add SIOCGIFALIAS
Matthew Dillon [Fri, 2 Aug 2019 15:26:32 +0000 (08:26 -0700)]
kernel - Add SIOCGIFALIAS

* Add SIOCGIFALIAS to retrieve ifconfig information on a single
  alias entry.

Submitted-by: rsmarples (Roy Marples)
Taken-from: NetBSD

4 years agokernel: Clean up a bit after the recent tap/tun changes.
Sascha Wildner [Fri, 2 Aug 2019 14:59:23 +0000 (16:59 +0200)]
kernel: Clean up a bit after the recent tap/tun changes.

4 years agohammer2 - Reorder errno priority for unlink directory errors
Matthew Dillon [Fri, 2 Aug 2019 05:13:49 +0000 (22:13 -0700)]
hammer2 - Reorder errno priority for unlink directory errors

* When AT_REMOVEDIR is not specified, or unlink() is called on a
  directory, prioritize returning EISDIR over ENOTEMPTY.

* Unbreaks part of 'go'.

Reported-by: hsw
4 years agodrm/linux: Add pci_name()
François Tigeot [Thu, 1 Aug 2019 18:37:12 +0000 (20:37 +0200)]
drm/linux: Add pci_name()

Obtained-from: FreeBSD

4 years agodrm/linux: Add DEFINE_SPINLOCK()
François Tigeot [Thu, 1 Aug 2019 18:32:36 +0000 (20:32 +0200)]
drm/linux: Add DEFINE_SPINLOCK()

4 years agokernel - Add quirks for CORSAIR STRAFE_RGB keyboard
Matthew Dillon [Thu, 1 Aug 2019 17:57:54 +0000 (10:57 -0700)]
kernel - Add quirks for CORSAIR STRAFE_RGB keyboard

* Add two quirk features to add delays during initialization and
  control message operation.

* Add quirks for the CORSAIR STRAFE_RGB keyboard and numerous other
  CORSAIR keyboards.

* Does not particularly fix specific issues with these keyboards,
  but the code is good so include it.  Quirks are generally taken
  from Linux.

4 years agokernel - Enable busmaster on bridges (BIOS might not)
Matthew Dillon [Thu, 1 Aug 2019 17:51:55 +0000 (10:51 -0700)]
kernel - Enable busmaster on bridges (BIOS might not)

* BIOSes do not always enable busmaster on bridges.  Make sure
  busmaster is enabled on all bridges.

* Reproduced with an Asus X370-PRO (AM4) motherboard which was not
  enabling busmaster on the bridges connecting either the motherboard
  IGB or the quad IGB card installed in a slot, but only when booting
  EFI.  When booting legacy the BIOS did enable busmaster.

* The characteristics of the failure is that NICs fail to physically
  transmit packets and received packets cannot be DMA'd into the rings,
  causing the packet error counter to increment once the receive
  hardware FIFO is full.

* Fixes EFI booting on some motherboards.

4 years agobuild - Adjust _CMSG_ALIGN() for compatibility
Matthew Dillon [Thu, 1 Aug 2019 17:01:17 +0000 (10:01 -0700)]
build - Adjust _CMSG_ALIGN() for compatibility

* The argument to _CMSG_ALIGN() is commonly unsigned, fix compiler
  warnings by making the alignment constants unsigned.

* Also take a page from FreeBSD and cast the (n) argument to an
  unsigned quantity (size_t).

* Note that the alignment code is still hardwired to 4 bytes,
  and will eventually have to be changed to something more portable.
  For now do not change it as doing so would introduce an ABI
  incompatibility.

Rerported-by: rsmarples (Roy Marples)
4 years agosys/vfs/hammer2: Drop unused hammer2_chain::flush_node
Tomohiro Kusumi [Thu, 1 Aug 2019 16:03:30 +0000 (01:03 +0900)]
sys/vfs/hammer2: Drop unused hammer2_chain::flush_node

No longer used since ecfe89b8868b30c9ddfa9c86cb4b0a20365a248d.

4 years agosys/vfs/hammer2: Use HAMMER2_BREF_TYPE_EMPTY for blockref type 0
Tomohiro Kusumi [Thu, 1 Aug 2019 15:12:38 +0000 (00:12 +0900)]
sys/vfs/hammer2: Use HAMMER2_BREF_TYPE_EMPTY for blockref type 0

4 years agoRemove <machine/inttypes.h> from a number of files that don't need it.
Sascha Wildner [Thu, 1 Aug 2019 10:40:39 +0000 (12:40 +0200)]
Remove <machine/inttypes.h> from a number of files that don't need it.

4 years agoAdd missing <sys/filio.h> inclusion to vknetd(8). Fixes buildworld.
Sascha Wildner [Wed, 31 Jul 2019 09:40:14 +0000 (11:40 +0200)]
Add missing <sys/filio.h> inclusion to vknetd(8). Fixes buildworld.

Reported-by: zrj
4 years agovknetd - Isue FIOSETOWN to set pid for tap interface
Matthew Dillon [Tue, 30 Jul 2019 19:55:35 +0000 (12:55 -0700)]
vknetd - Isue FIOSETOWN to set pid for tap interface

* Issue FIOSETOWN ioctl to set the pid for the tap interface in the
  child.  The primary open occurs in the parent process and is lost
  when we demonize.

* Note that vknetd does not set FIOASYNC and does not use SIGIO

4 years agoif_tap - set pid reporting with FIOSETOWN too
Matthew Dillon [Tue, 30 Jul 2019 19:54:09 +0000 (12:54 -0700)]
if_tap - set pid reporting with FIOSETOWN too

* Set pid reporting with FIOSETOWN as well.

4 years agoif_tap/if_tun - Remove pre-created devices
Matthew Dillon [Tue, 30 Jul 2019 19:29:02 +0000 (12:29 -0700)]
if_tap/if_tun - Remove pre-created devices

* The pre-created devices cause bitmap confusion between the
  if autoclone bitmap tracking in netif and the bitmap tracking
  in the device drivers.

  Just remove the pre-created devices entirely.  Users must manually
  create the appropriate tap or tun interface, or use the auto-cloning
  device (/dev/tap and /dev/tun).

* Fixes panics and auto clone create errors related to this confusion.

Reported-by: tuxillo
4 years agovknetd - Use the auto-clone /dev/tap device
Matthew Dillon [Tue, 30 Jul 2019 19:25:20 +0000 (12:25 -0700)]
vknetd - Use the auto-clone /dev/tap device

* Don't scan pre-created /dev/tapN devices, use the auto-clone device.
  The pre-created devices are going away.

4 years agobsd.cpu.gcc80.mk: Sync with GCC 8.3.0 documentation.
Sascha Wildner [Tue, 30 Jul 2019 18:08:42 +0000 (20:08 +0200)]
bsd.cpu.gcc80.mk: Sync with GCC 8.3.0 documentation.

This adds cannonlake, icelake-client, icelake-server, and knm as values
for CPUTYPE.

4 years agokcollect - Fix comments
Antonio Huete Jimenez [Tue, 30 Jul 2019 10:55:15 +0000 (12:55 +0200)]
kcollect - Fix comments

4 years agosbin/hammer2: Introduce HAMMER2_SHOW_TAB for "show"
Tomohiro Kusumi [Sat, 27 Jul 2019 20:26:36 +0000 (05:26 +0900)]
sbin/hammer2: Introduce HAMMER2_SHOW_TAB for "show"

The default stays 2, but now tunable via HAMMER2_SHOW_TAB.

4 years agokernel/vga: Remove unneeded opt_*.h inclusions.
Sascha Wildner [Sun, 28 Jul 2019 12:15:24 +0000 (14:15 +0200)]
kernel/vga: Remove unneeded opt_*.h inclusions.

4 years agoetc/Makefile: Better handle removal of /var/db/entropy as a file.
Sascha Wildner [Sun, 28 Jul 2019 11:09:49 +0000 (13:09 +0200)]
etc/Makefile: Better handle removal of /var/db/entropy as a file.

Move it to the place where other such cases are handled.

4 years ago<vfs/hammer2/hammer2.h>: Fix buildworld after 120385e8e4086a3b.
Sascha Wildner [Sun, 28 Jul 2019 10:32:03 +0000 (12:32 +0200)]
<vfs/hammer2/hammer2.h>: Fix buildworld after 120385e8e4086a3b.

4 years ago<sys/buf2.h>: Remove a number of unneeded #include's.
Sascha Wildner [Sun, 28 Jul 2019 09:46:14 +0000 (11:46 +0200)]
<sys/buf2.h>: Remove a number of unneeded #include's.

Only <sys/buf.h> is actually needed for the header.

Adjust some kernel files accordingly.

4 years agobuild - Update pkg-static to version 03, bootstrap https
Matthew Dillon [Sun, 28 Jul 2019 04:42:23 +0000 (21:42 -0700)]
build - Update pkg-static to version 03, bootstrap https

* There appears to be a database versioning issue between pkg-static
  and pkg on master, re-synchronize the pkg-static tarball.

* Currently the pkg bootstrap installs a df-latest.conf with
  http:// paths instead of https:// paths, because it doesn't
  have the CA root.

  After installing pkg, Makefile.usr now also installs ca_root_nss
  and then copies the df-latest.conf.sample file to df-latest.conf,
  thus installing the official df-latest.conf using https.

* Note that this sequence is not entirely safe because the initial
  bootstrap will be insecure if the CA root certificates are not
  already installed.  They should be installed by our official images,
  but will not be (currently) if one creates an absolutely pristine
  base system with installworld/installkernel/distribution.

  The bootstrap should now work in both situations, but we really
  need to include root certs in the base system I think.

4 years agosys/vfs/hammer2: Update ascii-art/comments in hammer2_disk.h
Tomohiro Kusumi [Thu, 25 Jul 2019 20:43:22 +0000 (05:43 +0900)]
sys/vfs/hammer2: Update ascii-art/comments in hammer2_disk.h

Update old comments written when ondisk layout wasn't stable.

4 years agokmalloc.9: Mention M_CACHEALIGN.
Sascha Wildner [Sat, 27 Jul 2019 13:30:17 +0000 (15:30 +0200)]
kmalloc.9: Mention M_CACHEALIGN.

While here, move the examples to an EXAMPLES section.

4 years agokernel - Replace kmalloc_cachealign() with kmalloc(... M_CACHEALIGN)
Matthew Dillon [Thu, 25 Jul 2019 17:30:00 +0000 (10:30 -0700)]
kernel - Replace kmalloc_cachealign() with kmalloc(... M_CACHEALIGN)

* Add M_CACHEALIGN, which ensures that the result is aligned to
  a cache line.

* Remove kmalloc_cachealign(), replacing all uses with kmalloc
  using M_CACHEALIGN.

4 years agosbin/mount_hammer2: Fix perror(3) message
Tomohiro Kusumi [Thu, 25 Jul 2019 14:16:17 +0000 (23:16 +0900)]
sbin/mount_hammer2: Fix perror(3) message

": " is added by perror(3) itself.

4 years agosbin/hammer2: Add missing info for "show"
Tomohiro Kusumi [Thu, 25 Jul 2019 12:08:45 +0000 (21:08 +0900)]
sbin/hammer2: Add missing info for "show"

Add missing inode fields.
Also add blockref count for indirect blocks (i.e. not necessarily 4).

4 years agousr.sbin/fstyp: Minor fix for HAMMER2
Tomohiro Kusumi [Wed, 24 Jul 2019 15:43:42 +0000 (00:43 +0900)]
usr.sbin/fstyp: Minor fix for HAMMER2

4 years agosbin/hammer2: Add missing inode fields (0x0084-) for printinode
Tomohiro Kusumi [Wed, 24 Jul 2019 15:31:16 +0000 (00:31 +0900)]
sbin/hammer2: Add missing inode fields (0x0084-) for printinode

4 years agolibefivar: Remove unused PACKAGE from Makefile.
Sascha Wildner [Wed, 24 Jul 2019 00:23:22 +0000 (02:23 +0200)]
libefivar: Remove unused PACKAGE from Makefile.

4 years agousr.bin/kcollect - Rework the hosthame mismatch cases a bit
Antonio Huete Jimenez [Tue, 23 Jul 2019 23:18:52 +0000 (01:18 +0200)]
usr.bin/kcollect - Rework the hosthame mismatch cases a bit

- Fix a bug where it was not possible to show data from
  another host.
- Showing host live data won't be possible if there is a hostname
  mismatch between the DB and the host reading from it.

4 years agokcollect(8) - Add a description of the output fields.
Antonio Huete Jimenez [Tue, 23 Jul 2019 18:38:02 +0000 (20:38 +0200)]
kcollect(8) - Add a description of the output fields.

4 years agousr.bin/kcollect - Cleanup prototypes a bit.
Antonio Huete Jimenez [Tue, 23 Jul 2019 11:31:53 +0000 (13:31 +0200)]
usr.bin/kcollect - Cleanup prototypes a bit.

4 years agosbin/hammer2: Update printinode
Tomohiro Kusumi [Mon, 22 Jul 2019 20:42:58 +0000 (05:42 +0900)]
sbin/hammer2: Update printinode

Hasn't been updated since 2015.

4 years agousr.sbin/fstyp: Add -l option support for HAMMER2
Tomohiro Kusumi [Mon, 22 Jul 2019 16:38:30 +0000 (01:38 +0900)]
usr.sbin/fstyp: Add -l option support for HAMMER2

4 years agosbin/hammer2: Minor fix
Tomohiro Kusumi [Mon, 22 Jul 2019 16:34:55 +0000 (01:34 +0900)]
sbin/hammer2: Minor fix

4 years agolibcrypto: Remove two no longer needed .PATHs.
Sascha Wildner [Mon, 22 Jul 2019 23:03:07 +0000 (01:03 +0200)]
libcrypto: Remove two no longer needed .PATHs.

4 years agoprintf.3: .Fa -> .Dv
Sascha Wildner [Mon, 22 Jul 2019 16:19:49 +0000 (18:19 +0200)]
printf.3: .Fa -> .Dv

4 years agosys/vfs/hammer2: Add XXX for obsolete comments on hardlink
Tomohiro Kusumi [Mon, 22 Jul 2019 02:11:08 +0000 (11:11 +0900)]
sys/vfs/hammer2: Add XXX for obsolete comments on hardlink

4 years agokernel/drm: Various cleanups.
Sascha Wildner [Mon, 22 Jul 2019 14:54:59 +0000 (16:54 +0200)]
kernel/drm: Various cleanups.

* Change further references for the radeonkms.ko -> radeon.ko renaming.

* Remove no longer needed iicbus_if.h from Makefile.

* Cleanup radeon Makefile.

4 years agolibldns: Remove local copy of ldns.h.
Sascha Wildner [Mon, 22 Jul 2019 10:58:18 +0000 (12:58 +0200)]
libldns: Remove local copy of ldns.h.

It's identical to the version in contrib/.

4 years agoboot/stand.h: Remove zipfs_fsops extern.
Sascha Wildner [Mon, 22 Jul 2019 10:57:28 +0000 (12:57 +0200)]
boot/stand.h: Remove zipfs_fsops extern.

It was forgotten in f6f7cf3446e6c5f6332bcbf0ec9c442b38ac8652.

4 years agowho/utmpentry: Remove duplicate include and sort better.
Sascha Wildner [Mon, 22 Jul 2019 08:37:35 +0000 (10:37 +0200)]
who/utmpentry: Remove duplicate include and sort better.

4 years agoFix up recent entropy file commits.
Sascha Wildner [Mon, 22 Jul 2019 07:11:02 +0000 (09:11 +0200)]
Fix up recent entropy file commits.

* Use spaces, not tabs, in mtree files (see README).

* Move file to the right place in Makefile_upgrade.inc.

4 years agosbin/newfs_hammer2: Drop obsolete comment on inode
Tomohiro Kusumi [Sun, 21 Jul 2019 19:54:16 +0000 (04:54 +0900)]
sbin/newfs_hammer2: Drop obsolete comment on inode

Drop comment from 2012. Inode is 1024 bytes now.

4 years agosys/vfs/hammer2: Fix comments on HAMMER2_FREEMAP_LEVEL*_RADIX
Tomohiro Kusumi [Sun, 21 Jul 2019 19:53:34 +0000 (04:53 +0900)]
sys/vfs/hammer2: Fix comments on HAMMER2_FREEMAP_LEVEL*_RADIX

Also see 5cebbe36266c384e5bb3f6a9a2364cdd7d750fe1.

4 years agoworld - Change entropy file location (2)
Matthew Dillon [Mon, 22 Jul 2019 05:33:46 +0000 (22:33 -0700)]
world - Change entropy file location (2)

* Fix missing parenthesis

Reported-by: Aaron LI
4 years agodebug - Adjust vmpageinfo
Matthew Dillon [Mon, 22 Jul 2019 04:46:06 +0000 (21:46 -0700)]
debug - Adjust vmpageinfo

* Add the pmap writeable_count and pmap_count to the output.

4 years agoworld - Change entropy file location
Matthew Dillon [Mon, 22 Jul 2019 02:36:09 +0000 (19:36 -0700)]
world - Change entropy file location

* Move entropy to the file /var/db/entropy/reboot, set entropy_dir
  default to /var/db/entropy.

* The 'reboot' file is written out on reboot by default.

* Any file in /var/db/entropy will be added to the entropy on boot.
  (this was already operational)

4 years agohier.7: Mention /var/run/shm.
Sascha Wildner [Sun, 21 Jul 2019 17:50:55 +0000 (19:50 +0200)]
hier.7: Mention /var/run/shm.