7 months agoMerge branch 'vendor/DHCPCD'
Roy Marples [Fri, 22 Oct 2021 13:51:47 +0000 (14:51 +0100)]
Merge branch 'vendor/DHCPCD'

7 months agoUpdate to dhcpcd-9.4.1 with the following changes: vendor/DHCPCD
Roy Marples [Fri, 22 Oct 2021 13:48:37 +0000 (14:48 +0100)]
Update to dhcpcd-9.4.1 with the following changes:

 * BSD: Find the correct interface for tunnelled routes
 * OpenBSD: Fix uniqueness of routes for matching priorities
 * Linux: Support more platforms for seccomp (thanks to Fabrice Fontaine)
 * eloop: Process all waiting fd's as they come in
 * control: Unlink sockets when not in privsep
 * privsep: Renamed Master to Manager
 * privsep: Renamed Privilged Actioneer to Privileged Proxy
 * privsep: Fix getting interface VLANID on BSD
 * privsep: Enforce proper alignment of serialized struct cmsghdr
 * IPv4LL: Don't remove statically assigned addresses
 * routes: Fix route comparision for network prefixes with different masks
 * DHCP6: Only send FQDN for SOLICIT, REQUEST, RENEW, or REBIND messages
 * DHCP6: Don't spam the log when a RA repeatedly triggers an INFORM
 * DHCP: Fix infinite INFORM messages

7 months agoSync zoneinfo database with tzdata2021e from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Fri, 22 Oct 2021 10:06:29 +0000 (12:06 +0200)]
Sync zoneinfo database with tzdata2021e from ftp://ftp.iana.org/tz/releases

Previously, we were on 2021a.

For a detailed list of changes, see share/zoneinfo/NEWS.

7 months agonet: Allow binding of unspecified address without address existance
Roy Marples [Wed, 20 Oct 2021 09:12:41 +0000 (10:12 +0100)]
net: Allow binding of unspecified address without address existance

This removes a broken check. The comment says it's broken, but
it's only broken by it's existance.

7 months agodsynth - Conditionally avoid passing PKG_SUFX make env
Matthew Dillon [Sun, 17 Oct 2021 21:24:02 +0000 (14:24 -0700)]
dsynth - Conditionally avoid passing PKG_SUFX make env

* Avoid WARNINGs in the logs due to passing PKG_SUFX into make env.
  Remove this for pkg versions 1.17 or bigger.

* Fixes WARNING's in the logs and related sleep 10's generated by
  the port Mk files.

7 months agodsynth - Add PKG_COMPRESSION_FORMAT
Matthew Dillon [Sun, 17 Oct 2021 17:37:36 +0000 (10:37 -0700)]

* Generate a PKG_COMPRESSION_FORMAT env variable in addition to
  PKG_SUFX.  This should fix the compression format used for
  package generation to be the one specified in dsynth.ini.

* For now keep PKG_SUFX in case dsynth is run on an older system.
  It will cause dports to generate warnings in the logs, which can
  be ignored.

7 months agodsynth - Support pkg 1.17 (.pkg suffix for packages)
Matthew Dillon [Sun, 17 Oct 2021 17:17:56 +0000 (10:17 -0700)]
dsynth - Support pkg 1.17 (.pkg suffix for packages)

* When scanning for binary packages, check for .pkg suffixed
  files unconditionally in addition to checking for the older
  .<compression_fmt> files.

* Use the template-generated pkg-static when regenerating the
  repo, otherwise an older pkg or pkg-static installed on the
  system will be used and cause problems with the new .pkg
  suffix format.

* Also give a 'reason' for why the template gets regenerated,
  when dsynth decides it needs to.

7 months agodsynth: Explicitly fail when the chroot can't resolve DNS names
Antonio Huete Jimenez [Sun, 17 Oct 2021 16:05:25 +0000 (18:05 +0200)]
dsynth: Explicitly fail when the chroot can't resolve DNS names

7 months agoinit(8): Remove unneeded libcrypto linking.
Sascha Wildner [Mon, 11 Oct 2021 06:45:17 +0000 (08:45 +0200)]
init(8): Remove unneeded libcrypto linking.

7 months agoLocal adjustments for OpenSSH-8.3p1.
Sascha Wildner [Sat, 9 Oct 2021 11:25:53 +0000 (13:25 +0200)]
Local adjustments for OpenSSH-8.3p1.

7 months agoMerge branch 'vendor/OPENSSH'
Sascha Wildner [Sat, 9 Oct 2021 11:25:09 +0000 (13:25 +0200)]
Merge branch 'vendor/OPENSSH'

7 months agoImport OpenSSH-8.8p1 vendor/OPENSSH
Sascha Wildner [Sat, 9 Oct 2021 11:24:01 +0000 (13:24 +0200)]
Import OpenSSH-8.8p1

7 months agoRevert "fdisk(8): check the result of read_s0()"
Sascha Wildner [Sun, 3 Oct 2021 21:55:31 +0000 (23:55 +0200)]
Revert "fdisk(8): check the result of read_s0()"

This reverts commit f01e65a33a3d0f4dc120b24b3298d75b1bb8f909.

We must ignore read_s0() errors when -I is passed.

This unbreaks ISO/IMG building.

7 months agobot test #2
Antonio Huete Jimenez [Sat, 2 Oct 2021 15:49:40 +0000 (17:49 +0200)]
bot test #2

7 months agobot test
Antonio Huete Jimenez [Sat, 2 Oct 2021 10:54:19 +0000 (12:54 +0200)]
bot test

7 months agoSync ACPICA with Intel's version 20210930.
Sascha Wildner [Fri, 1 Oct 2021 10:57:04 +0000 (12:57 +0200)]
Sync ACPICA with Intel's version 20210930.

* Add new "Windows 2020" _OSI string.

* Improve iasl(8).

* Some sleep/resume fixes (that I guess do not affect us).

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

7 months agolibressl: Fix validation errors in certificate chains with expired certificates
Antonio Huete Jimenez [Fri, 1 Oct 2021 07:33:55 +0000 (09:33 +0200)]
libressl: Fix validation errors in certificate chains with expired certificates

 - Local patch to LibreSSL, from OpenBSD 6.9 errata 018, September 30, 2021.
 - Tested with pkg, fetch.

Reported-by: zach, others
Taken-from: OpenBSD

7 months agoman.1: Add some examples (taken from FreeBSD).
Sascha Wildner [Fri, 24 Sep 2021 20:39:01 +0000 (22:39 +0200)]
man.1: Add some examples (taken from FreeBSD).

7 months agomandoc(1): Update local files for 1.14.6.
Sascha Wildner [Fri, 24 Sep 2021 20:27:08 +0000 (22:27 +0200)]
mandoc(1): Update local files for 1.14.6.

7 months agoMerge branch 'vendor/MDOCML'
Sascha Wildner [Fri, 24 Sep 2021 20:26:26 +0000 (22:26 +0200)]
Merge branch 'vendor/MDOCML'

7 months agoImport mandoc-1.14.6. vendor/MDOCML
Sascha Wildner [Fri, 24 Sep 2021 20:25:36 +0000 (22:25 +0200)]
Import mandoc-1.14.6.

See https://mandoc.bsd.lv/NEWS for a list of changes.

7 months agoFix a typo in a locale upgrade script.
Sascha Wildner [Fri, 24 Sep 2021 12:53:59 +0000 (14:53 +0200)]
Fix a typo in a locale upgrade script.

8 months agoFix .In abuse and a wrong include path in three manual pages.
Sascha Wildner [Thu, 16 Sep 2021 15:44:40 +0000 (17:44 +0200)]
Fix .In abuse and a wrong include path in three manual pages.

8 months agoFix some include file paths (.In) in two manual pages.
Sascha Wildner [Thu, 16 Sep 2021 07:38:47 +0000 (09:38 +0200)]
Fix some include file paths (.In) in two manual pages.

8 months agoUpdate the pciconf(8) database.
Sascha Wildner [Wed, 15 Sep 2021 15:02:55 +0000 (17:02 +0200)]
Update the pciconf(8) database.

September 14, 2021 snapshot from https://pci-ids.ucw.cz

8 months agoSome additions and fixes related to fdatasync(2) and posix_fallocate(2).
Sascha Wildner [Tue, 14 Sep 2021 20:14:14 +0000 (22:14 +0200)]
Some additions and fixes related to fdatasync(2) and posix_fallocate(2).

* Fix a small issue in VOP_FDATASYNC()'s definition in <sys/vfsops.h>.

* Mention fdatasync() in fsync.2 (this basically syncs that manual page
  with FreeBSD, with a few adjustments).

* Add a manual page for posix_fallocate() (from FreeBSD, with a few

* Mention fdatasync() in the list of reentrant functions in sigaction.2.

* In pthread_testcancel.3, mention fdatasync() in the list of functions
  for which a cancellation point will occur.

* Mention VOP_FDATASYNC() in VOP_FSYNC.9 (partly taken from FreeBSD).

* Remove a compatibility define in the fsstress tool.

Thanks to tkusumi for reviewing.

8 months agogencat(1): Bump WARNS to 6.
Sascha Wildner [Mon, 13 Sep 2021 15:25:11 +0000 (17:25 +0200)]
gencat(1): Bump WARNS to 6.

8 months agosys/kern: Add fdatasync(2)
Tomohiro Kusumi [Sat, 11 Sep 2021 16:57:53 +0000 (01:57 +0900)]
sys/kern: Add fdatasync(2)

Based on the following FreeBSD commits in 2016.

Add the syscall and also add it to pthread's cancellation point.
The default behavior is same as fsync(2), which is fine but inefficient.

8 months agolibc: Remove __NO_TLS checks inherited from FreeBSD.
Sascha Wildner [Sat, 11 Sep 2021 17:43:09 +0000 (19:43 +0200)]
libc: Remove __NO_TLS checks inherited from FreeBSD.

8 months agolibc: Move posix_fallocate() to the right place in Symbol.map.
Sascha Wildner [Sat, 11 Sep 2021 17:39:59 +0000 (19:39 +0200)]
libc: Move posix_fallocate() to the right place in Symbol.map.

8 months agosys/kern: Move vop_stdallocate() within vfs_default.c
Tomohiro Kusumi [Sat, 11 Sep 2021 15:40:04 +0000 (00:40 +0900)]
sys/kern: Move vop_stdallocate() within vfs_default.c

vop_allocate stuff are usually placed after vop_markatime,
but looking at vfs_default.c this std function should probably
be the last.

8 months ago<sys/kernel.h>: Remove unused SI_BOOT2_VMM definition.
Sascha Wildner [Thu, 9 Sep 2021 14:26:21 +0000 (16:26 +0200)]
<sys/kernel.h>: Remove unused SI_BOOT2_VMM definition.

8 months agosys/kern: Add posix_fallocate(2)
Tomohiro Kusumi [Wed, 8 Sep 2021 14:09:44 +0000 (23:09 +0900)]
sys/kern: Add posix_fallocate(2)

Based on the initial posix_fallocate(2) implementation in FreeBSD
from d91f88f7f38078ac6dd4b0f0e77470d605d1518e in 2011.

There is nothing special or efficient about the default behavior.
VFS has no knowledge of fs details.

8 months ago<sys/*.h>: Fix some include guard related comments.
Sascha Wildner [Tue, 7 Sep 2021 20:38:59 +0000 (22:38 +0200)]
<sys/*.h>: Fix some include guard related comments.

8 months ago<sys/*.h>: Fix some include guard names.
Sascha Wildner [Tue, 7 Sep 2021 20:34:29 +0000 (22:34 +0200)]
<sys/*.h>: Fix some include guard names.

8 months agokernel/libc: Remove the old vmm code.
Sascha Wildner [Tue, 7 Sep 2021 16:18:25 +0000 (18:18 +0200)]
kernel/libc: Remove the old vmm code.

Removes the kernel code and two system calls.

Bump __DragonFly_version too.

Reviewed-by: aly, dillon
8 months agoinstaller: Use <sys/diskmbr.h>'s define instead of a constant.
Sascha Wildner [Tue, 7 Sep 2021 02:34:42 +0000 (04:34 +0200)]
installer: Use <sys/diskmbr.h>'s define instead of a constant.

8 months agokernel: In some files, make it clearer that only 0 is returned.
Sascha Wildner [Sun, 5 Sep 2021 12:57:01 +0000 (14:57 +0200)]
kernel: In some files, make it clearer that only 0 is returned.

The error case has already been dealt with earlier in the function.

8 months agohammer2 - Fix panic when /tmp and /var/tmp are nullfs mounts
Matthew Dillon [Wed, 1 Sep 2021 23:07:22 +0000 (16:07 -0700)]
hammer2 - Fix panic when /tmp and /var/tmp are nullfs mounts

* Certain illegal rename operations can cause a panic() in hammer2
  when /tmp and/or /var/tmp are nullfs mounts into an H2 filesystem.

* Catch the situation, report it, and generate an error code instead
  of panicing.

Reported-by: tuxillo and at least one other person recently
8 months agousr.sbin/fstyp: Add BeFS support
Tomohiro Kusumi [Thu, 26 Aug 2021 15:04:26 +0000 (00:04 +0900)]
usr.sbin/fstyp: Add BeFS support

from FreeBSD 0e92585cde5101506720ca1b904372317b7d84b6

8 months agosys/vfs/ext2fs: Correct a typo in an error message
Tomohiro Kusumi [Thu, 26 Aug 2021 14:15:07 +0000 (23:15 +0900)]
sys/vfs/ext2fs: Correct a typo in an error message

from FreeBSD 47f880ebeb3092b1b7bbc6d75e82532e43bbf010

8 months agoMake a number of headers self-sufficient.
Sascha Wildner [Fri, 27 Aug 2021 14:06:00 +0000 (16:06 +0200)]
Make a number of headers self-sufficient.

Also, do not trust headers to bring in needed headers.

8 months ago<sys/mman.h>: Remove MAP_RENAME, MAP_NORESERVE and MAP_NOEXTEND defines.
Sascha Wildner [Fri, 27 Aug 2021 13:15:37 +0000 (15:15 +0200)]
<sys/mman.h>: Remove MAP_RENAME, MAP_NORESERVE and MAP_NOEXTEND defines.

They were all inherited from FreeBSD and never implemented nor used.
FreeBSD never implemented them either and has removed all of them by

Pointed-out-by: rtzoeller
8 months agoFix grammar issues in a few manual pages.
Sascha Wildner [Mon, 23 Aug 2021 21:36:56 +0000 (23:36 +0200)]
Fix grammar issues in a few manual pages.

8 months agolibnvmm.3: Fix some typos.
Sascha Wildner [Mon, 23 Aug 2021 20:07:35 +0000 (22:07 +0200)]
libnvmm.3: Fix some typos.

9 months agokernel/acpi: Remove the never used ACPI_NO_SEMAPHORES kernel option.
Sascha Wildner [Sun, 22 Aug 2021 11:00:44 +0000 (13:00 +0200)]
kernel/acpi: Remove the never used ACPI_NO_SEMAPHORES kernel option.

9 months agoSome trivial changes to better comply with strict aliasing. (2)
Sascha Wildner [Sat, 21 Aug 2021 21:40:36 +0000 (23:40 +0200)]
Some trivial changes to better comply with strict aliasing. (2)

Now that the warnings are fixed, do not pass -fno-strict-aliasing

9 months agogetconf(1): Add support for retrieving _SC_PHYS_PAGES.
Sascha Wildner [Sat, 21 Aug 2021 21:16:34 +0000 (23:16 +0200)]
getconf(1): Add support for retrieving _SC_PHYS_PAGES.

9 months agoboot0cfg(8): Use some constants from <sys/diskmbr.h>.
Sascha Wildner [Sat, 21 Aug 2021 19:27:50 +0000 (21:27 +0200)]
boot0cfg(8): Use some constants from <sys/diskmbr.h>.


9 months agoSome trivial changes to better comply with strict aliasing.
Gwenio [Thu, 7 Mar 2013 17:31:42 +0000 (12:31 -0500)]
Some trivial changes to better comply with strict aliasing.

9 months ago<sys/diskmbr.h>: Don't expose the partition type struct/array for boot code.
Sascha Wildner [Sat, 21 Aug 2021 20:35:50 +0000 (22:35 +0200)]
<sys/diskmbr.h>: Don't expose the partition type struct/array for boot code.

9 months agodefaults/compilers.conf: Add CCVER definitions for clang11.
Sascha Wildner [Sat, 21 Aug 2021 17:21:34 +0000 (19:21 +0200)]
defaults/compilers.conf: Add CCVER definitions for clang11.

9 months ago<sys/diskmbr.h>: Minor style fix (missed in last commit).
Sascha Wildner [Sat, 21 Aug 2021 14:56:10 +0000 (16:56 +0200)]
<sys/diskmbr.h>: Minor style fix (missed in last commit).

9 months agoinstaller(8): Move the contents of sysids.h into <sys/diskmbr.h>.
Sascha Wildner [Sat, 21 Aug 2021 14:42:36 +0000 (16:42 +0200)]
installer(8): Move the contents of sysids.h into <sys/diskmbr.h>.

It is needed by both fdisk(8) and the installer.

<sys/diskmbr.h> seems reasonable because it already has defines for
various partition types. Use them in the struct. Adjust the naming of
the structure and the array to match the rest of <sys/diskmbr.h>.

Based on a patch by Alexander Kuleshov <kuleshovmail@gmail.com>.

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

9 months agosysconf.3: Document more constants.
Sascha Wildner [Fri, 20 Aug 2021 21:36:12 +0000 (23:36 +0200)]
sysconf.3: Document more constants.

9 months agofdisk(8): check the result of the write_s0()
Alexander Kuleshov [Mon, 28 Dec 2015 12:34:55 +0000 (18:34 +0600)]
fdisk(8): check the result of the write_s0()

This patch provides a check of the write_s0() function call
which can be -1 on failure.

9 months agofdisk(8): close boot_fd on failure
Alexander Kuleshov [Mon, 28 Dec 2015 12:22:50 +0000 (18:22 +0600)]
fdisk(8): close boot_fd on failure

The init_boot() function opens/reads the /boot/mbr file or
file which is given with the -b option. There are couple
failure cases can be occured there. So we need to close
file description of /boot/mbr.

9 months agofdisk(8): check the result of read_s0()
Alexander Kuleshov [Mon, 28 Dec 2015 12:12:31 +0000 (18:12 +0600)]
fdisk(8): check the result of read_s0()

The read_s0() function can return -1 on failure, so we need to
check its result.

9 months agofdisk(8): check result of the read_disk() function
Alexander Kuleshov [Mon, 28 Dec 2015 11:50:15 +0000 (17:50 +0600)]
fdisk(8): check result of the read_disk() function

During detection of the sector size, the read_disk function may
return '-1'. This patch provides check for this case.

9 months agofdisk(8): check result of the getdevpath(3)
Alexander Kuleshov [Mon, 28 Dec 2015 11:47:58 +0000 (17:47 +0600)]
fdisk(8): check result of the getdevpath(3)

We are using the getdevpath(3) function in the fdisk.c As described
in the manual:

getdevpath() returns a pointer to a malloc()'d path on success and NULL
on failure.  If a failure occurs errno will be set appropriately.

So, we need to check the result of the getdevapth() call.

9 months agofdisk: use macros from the <sys/diskmbr.h>
Alexander Kuleshov [Mon, 28 Dec 2015 11:45:34 +0000 (17:45 +0600)]
fdisk: use macros from the <sys/diskmbr.h>

The fdisk(8) contains definitions of the C:H:S related macros. In
the same time, the <sys/diskmbr.h> header provides the same set of
macros. Let's use it, instead of self written.

9 months agoperiodic/accounting: Fix a missing "Doing login accounting:" line.
Sascha Wildner [Sat, 21 Aug 2021 10:47:43 +0000 (12:47 +0200)]
periodic/accounting: Fix a missing "Doing login accounting:" line.

While here, sync monthly/200.accounting with FreeBSD, adjust the
periodic.conf.5 manual page for the changes in 980397133d362b559ec,
and also point out that daily's accounting is process accounting
(from FreeBSD).

Submitted-by: James Cook (falsifian)
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/3289>

9 months agodsynth.1: Document hooks
Antonio Huete Jimenez [Fri, 20 Aug 2021 22:41:13 +0000 (00:41 +0200)]
dsynth.1: Document hooks

Suggested-and-reviewed-by: swildner
9 months ago<errno.h>: Make ENOTRECOVERABLE and EOWNERDEAD visible unconditionally.
Sascha Wildner [Sun, 15 Aug 2021 10:40:20 +0000 (12:40 +0200)]
<errno.h>: Make ENOTRECOVERABLE and EOWNERDEAD visible unconditionally.

The problem here is that GCC will expect these errnos to be
visible unconditionally for its C++ headers - and errors in
<bits/error_constants> if they aren't - as soon as we set the
HAVE_E* for them in GCC's config.h.

On the other hand we have software such as www/qt5-webengine
that sets _POSIX_C_SOURCE and/or _XOPEN_SOURCE to older standards
that didn't specify those two errnos.

If anything, it is rather a "fault" of GCC's C++ header handling
than one of qt5-webengine.

Reported-by: tuxillo
9 months ago<signal.h>/<ucontext.h>: Split those two headers better.
Sascha Wildner [Sun, 15 Aug 2021 10:32:08 +0000 (12:32 +0200)]
<signal.h>/<ucontext.h>: Split those two headers better.

<signal.h> needs only ucontext_t and stack_t from <ucontext.h>. Split
those out to <sys/_ucontext.h> and stop including the full <ucontext.h>
from <signal.h> and vice versa, for userland.

In <ucontext.h>, continue defining siginfo_t for non-POSIX because
third party code expects us to.

This has been tested with a full dports bulk build.

9 months agoUpdate the pciconf(8) database.
Sascha Wildner [Sun, 15 Aug 2021 10:24:39 +0000 (12:24 +0200)]
Update the pciconf(8) database.

July 25, 2021 snapshot from https://pci-ids.ucw.cz

9 months ago<stdio.h>: Clean up the POSIX namespace better.
Sascha Wildner [Sat, 14 Aug 2021 00:51:31 +0000 (02:51 +0200)]
<stdio.h>: Clean up the POSIX namespace better.

* Include just <machine/stdint.h> for POSIX, but leave <sys/types.h>
  otherwise for the traditional expectations of third party code.

* POSIX did not require <stdio.h> to define off_t until Issue 7, even
  though ftello() and fseeko() were using it for a long time. This
  seems to be a "bug" in the specification, so adjust the visibility
  of off_t to match that of the functions. Actually use off_t for the
  ftello() and fseeko() prototypes.

Tested with a full bulk build.

9 months agoInclude <inttypes.h> instead of <cpu/inttypes.h> in world.
Sascha Wildner [Thu, 5 Aug 2021 07:20:01 +0000 (09:20 +0200)]
Include <inttypes.h> instead of <cpu/inttypes.h> in world.

Remove the unneeded inclusions otherwise.

9 months agolibc: Clean up the Symbol.maps a bit.
Sascha Wildner [Fri, 13 Aug 2021 23:49:08 +0000 (01:49 +0200)]
libc: Clean up the Symbol.maps a bit.

* Remove sysv_cond_wait and sysv_cond_signal because these functions
  were always static.

* Remove tre_have_approx because this function is only available with
  -DTRE_APPROX which we never used, nor build with right away.

* Remove pthread_init since there was never a pthread_init in libc.
  Seems to be just a typo.

* Remove mexitcount which was kernel only.

* Add a comment to a symbol that will only show up when libc is built
  with a debug option.

9 months agolibc: Clean up some kernel profiling bits.
Sascha Wildner [Sat, 14 Aug 2021 00:48:11 +0000 (02:48 +0200)]
libc: Clean up some kernel profiling bits.

9 months agohammer2 - bulkfree now validates bigmask
Matthew Dillon [Fri, 13 Aug 2021 01:41:54 +0000 (18:41 -0700)]
hammer2 - bulkfree now validates bigmask

* bulkfree now validates that the roll-up bigmask is reasonable
  and adjusts it if it is not.

* Add vfs.hammer2.aux_flags and implement a bigmask override with
  it that, if set, forces bigmask to -1 in the bulkfree.  Should
  not be needed now that bulkfree validates the field.

9 months agohammer2 - Only clear the bigmask hint in relaxed mode freemap scans
Matthew Dillon [Thu, 12 Aug 2021 22:52:25 +0000 (15:52 -0700)]
hammer2 - Only clear the bigmask hint in relaxed mode freemap scans

* When allocating blocks, the bigmask hint allows the allocator to
  skip sub-trees that are known to be fully allocated.  The bit for
  the appropriate radix (block size being allocated) is cleared when
  a full scan reveals no available blocks in the sub-tree.

* When the filesystem starts to fill up, there might not be any blocks
  in class-assigned sub-trees, but there could be blocks in the sub-trees
  for other classes.  Normally the allocator first tries to find a block
  in a matching class, and if that fails it tries to find a block in an
  unrelated class using a 'relaxed' freemap search.

  The bug is that the bigmask hint was being cleared for non-relaxed
  searches that failed, causing the later relaxed search to also fail
  even though blocks might be allocatable.

* Fixed by only clearing the bit when a full relaxed scan determines
  that no blocks are available.

9 months agoid(1): Fix buildworld.
Sascha Wildner [Thu, 12 Aug 2021 15:18:42 +0000 (17:18 +0200)]
id(1): Fix buildworld.

9 months agosbin/hammer2: Fix total_size inconsistency check
Tomohiro Kusumi [Tue, 10 Aug 2021 06:18:57 +0000 (15:18 +0900)]
sbin/hammer2: Fix total_size inconsistency check

This should be errx(). The ondisk total_size != sum of volumes
means total_size is corrupted or volume(s) missing, regardless of
<4 bad volume headers.

9 months agosbin/hammer2: Silence -Waddress-of-packed-member warnings
Tomohiro Kusumi [Mon, 9 Aug 2021 21:35:52 +0000 (06:35 +0900)]
sbin/hammer2: Silence -Waddress-of-packed-member warnings

Not a problem on x86_64, but silence warnings caused by callers
passing address of packed (possibly unaligned) struct fields.

9 months agoid: Add 'a' no-op option for compatibility with other implementations (Solaris)
Antonio Huete Jimenez [Tue, 10 Aug 2021 22:32:14 +0000 (00:32 +0200)]
id: Add 'a' no-op option for compatibility with other implementations (Solaris)

Taken-from: FreeBSD

9 months agotmpfs - Remove debugging kprintf()
Matthew Dillon [Mon, 9 Aug 2021 22:33:53 +0000 (15:33 -0700)]
tmpfs - Remove debugging kprintf()

* Remove the kprintf("tmpfs: vp %p sleepfail\n", vp), this
  case has been verified to occur in numerous situations and
  the code path is now considered to be tested.

9 months agokernel - Add a hold count to struct rman
Matthew Dillon [Mon, 9 Aug 2021 17:53:00 +0000 (10:53 -0700)]
kernel - Add a hold count to struct rman

* Add a hold count to protect against destruction, fixing a race
  between rman list iterations (the sysctl iteration) and device
  activity that adjusts the rman lists.

* Fixes a panic related to Firefox.

9 months agokernel - Workaround qemu bug w/ MSR_IA32_ARCH_CAPABILITIES
Matthew Dillon [Mon, 9 Aug 2021 17:45:53 +0000 (10:45 -0700)]
kernel - Workaround qemu bug w/ MSR_IA32_ARCH_CAPABILITIES

* qemu allows cpuid report that MSR_IA32_ARCH_CAPABILITIES exists, but
  then fails to implement the MSR.  This causes the kernel to panic
  in early boot.

* Use rdmsr_safe() and report the non-working msr instead of panicing.

* Fixes qemu + DFly on some recent Intel cpus.

refs #3292

9 months ago<errno.h>: Add ENOTRECOVERABLE and EOWNERDEAD.
Sascha Wildner [Sun, 8 Aug 2021 18:22:41 +0000 (20:22 +0200)]

These errno constants are really for robust mutexes which we do not
support. However, llvm seems to be abusing ENOTRECOVERABLE for other
purposes, so just add them both.

Reported-by: tuxillo
9 months agoAdd some necessary #include's in signal related headers.
Sascha Wildner [Sat, 7 Aug 2021 11:44:36 +0000 (13:44 +0200)]
Add some necessary #include's in signal related headers.

9 months agomkdep: Remove the old, never used mkdep.sh.
Sascha Wildner [Sun, 1 Aug 2021 19:06:49 +0000 (21:06 +0200)]
mkdep: Remove the old, never used mkdep.sh.

It was needed on some architectures supported by FreeBSD, which is how
we inherited it.

Rename the mkdep.gcc.sh to mkdep.sh and clean up the Makefile.

9 months agomount.8: Fix typo.
Sascha Wildner [Sat, 31 Jul 2021 18:22:58 +0000 (20:22 +0200)]
mount.8: Fix typo.

9 months agogdb.4/sysctl.9: Remove dead .Xr
Sascha Wildner [Sat, 31 Jul 2021 18:18:12 +0000 (20:18 +0200)]
gdb.4/sysctl.9: Remove dead .Xr

9 months agoSync ACPICA with Intel's version 20210730.
Sascha Wildner [Sat, 31 Jul 2021 08:43:23 +0000 (10:43 +0200)]
Sync ACPICA with Intel's version 20210730.

* Various fixes for iasl(8).

* Fixes and additions in table definitions.

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

9 months agondp(8): Use RT_ROUNDUP to correctly increase the position in the buffer.
Sascha Wildner [Fri, 30 Jul 2021 17:43:02 +0000 (19:43 +0200)]
ndp(8): Use RT_ROUNDUP to correctly increase the position in the buffer.

Submitted-by: James Cook (falsifian)
Dragonfly-bug: https://bugs.dragonflybsd.org/issues/3291

9 months agonvmm.4: Fix section order.
Sascha Wildner [Thu, 29 Jul 2021 15:36:09 +0000 (17:36 +0200)]
nvmm.4: Fix section order.

9 months agolibnvmm.3: Oops, forgot one .Cd correction.
Sascha Wildner [Thu, 29 Jul 2021 12:48:05 +0000 (14:48 +0200)]
libnvmm.3: Oops, forgot one .Cd correction.

9 months agolibnvmm.3: Fix .Cd misuse.
Sascha Wildner [Thu, 29 Jul 2021 12:46:30 +0000 (14:46 +0200)]
libnvmm.3: Fix .Cd misuse.

9 months agolibnvmm.3: Extend NAME section and add MLINKS for functions.
Sascha Wildner [Thu, 29 Jul 2021 08:06:34 +0000 (10:06 +0200)]
libnvmm.3: Extend NAME section and add MLINKS for functions.

9 months agonvmm: Some documentation adjustments.
Sascha Wildner [Thu, 29 Jul 2021 03:41:43 +0000 (05:41 +0200)]
nvmm: Some documentation adjustments.

* Fix '.Lb libnvmm' for mandoc(1).

* Use standard list in libnvmm.3's ERRORS section.

* Add a SYNOPSIS to nvmm.4.

* Use short form .Nm in nvmmctl.8.

9 months agoRevert "WIP"
Aaron LI [Wed, 28 Jul 2021 23:30:27 +0000 (07:30 +0800)]
Revert "WIP"

This reverts commit 5d4c71cc3f59393bac29819031ed5afcedda6359.

Oops, didn't intend to commit this...

9 months agoWIP
Aaron LI [Wed, 28 Jul 2021 11:08:35 +0000 (19:08 +0800)]

9 months agotest/nvmm/demo: Clean up header inclusions
Aaron LI [Wed, 28 Jul 2021 11:06:44 +0000 (19:06 +0800)]
test/nvmm/demo: Clean up header inclusions

* Remove unused header inclusions.
* Reorder header inclusions.
* Define MSR_APICBASE, APICBASE_BSP and APICBASE_EN locally to be more

9 months agotestcases/libnvmm: Remove unneeded header inclusions
Aaron LI [Wed, 28 Jul 2021 10:44:24 +0000 (18:44 +0800)]
testcases/libnvmm: Remove unneeded header inclusions

They are now provided by the <dev/virtual/nvmm/nvmm.h> header file.

9 months agolibnvmm: Remove unneeded header inclusions and defines
Aaron LI [Wed, 28 Jul 2021 10:41:18 +0000 (18:41 +0800)]
libnvmm: Remove unneeded header inclusions and defines

They are now provided by the <dev/virtual/nvmm/nvmm.h> header file.

9 months agonvmm: Adjust comments about TSC sync and gd_reqflags check
Aaron LI [Wed, 28 Jul 2021 10:37:22 +0000 (18:37 +0800)]
nvmm: Adjust comments about TSC sync and gd_reqflags check

Replace QEMU with a more generic "emulator", and adjust the comments
about TSC sync to be more consistent and concise.

9 months agonvmm: Move DragonFly-specific code to os_vmspace_create()
Aaron LI [Wed, 28 Jul 2021 10:30:22 +0000 (18:30 +0800)]
nvmm: Move DragonFly-specific code to os_vmspace_create()

Move the DragonFly-specific pmap code to os_vmspace_create() in
nvmm_dragonfly.c, making the nvmm.c code more OS-independent.

9 months agonvmmctl(8): Fix installing to a ${DESTDIR} on hosts without the nvmm group.
Sascha Wildner [Tue, 27 Jul 2021 13:55:52 +0000 (15:55 +0200)]
nvmmctl(8): Fix installing to a ${DESTDIR} on hosts without the nvmm group.

This affects building master ISO/IMGs on older hosts, or any other
such scenario involving a ${DESTDIR}. If the host's world is too old,
let install(1) use the databases (master.passwd, group) from the source

installworlds for the purpose of upgrading the machine without ${DESTDIR}
had the databases upgraded earlier in the install and are not affected.

9 months agoRevert "install(1): Disable -N option in btools."
Sascha Wildner [Tue, 27 Jul 2021 13:49:23 +0000 (15:49 +0200)]
Revert "install(1): Disable -N option in btools."

This reverts commit bf226617061340a3979d19957444da0997124229.

This is too useful to be missing.