15 months agoMerge branch 'vendor/GDB'
zrj [Tue, 7 Jan 2020 18:25:48 +0000 (20:25 +0200)]
Merge branch 'vendor/GDB'


15 months agoRemove few unused texi sources on gdb branch. vendor/GDB
zrj [Tue, 7 Jan 2020 18:08:17 +0000 (20:08 +0200)]
Remove few unused texi sources on gdb branch.

 As it was done in 874e15d007943a40fad40d5e25620e2bf00235a1

15 months agovmstat - Add verbose for -m
Matthew Dillon [Tue, 7 Jan 2020 05:23:29 +0000 (21:23 -0800)]
vmstat - Add verbose for -m

* If -m -v is specified all memory pools are dumped, even
  if not in use.

15 months agolibkvm - Fix minidump page table processing
Matthew Dillon [Mon, 6 Jan 2020 23:33:27 +0000 (15:33 -0800)]
libkvm - Fix minidump page table processing

* libkvm was not properly handling 1GB and 2MB page table entries.
  These entries need to be masked against PG_PS_FRAME, not PG_FRAME.

* Fixes vmstat -m -N kernel -M vmcore output, and probably other
  output too.

15 months agovmstat - Fix vmstat -m output
Matthew Dillon [Mon, 6 Jan 2020 18:05:35 +0000 (10:05 -0800)]
vmstat - Fix vmstat -m output

* The malloc_type structure's ks_use field is now a pointer
  to a dynamically malloc()d array of ncpus, instead of a fixed
  array of SMP_MAXCPU.

* Fixes segfault for vmstat -m output.

15 months agokernel - Fix bug in malloc_reinit_ncpus()
Matthew Dillon [Mon, 6 Jan 2020 18:04:35 +0000 (10:04 -0800)]
kernel - Fix bug in malloc_reinit_ncpus()

* malloc_reinit_ncpus() was not properly reinitializing the
  last malloc_type in the linked list.

15 months agokernel - Change default vfs timestamp precision sec -> usec
Matthew Dillon [Mon, 6 Jan 2020 08:27:52 +0000 (00:27 -0800)]
kernel - Change default vfs timestamp precision sec -> usec

* Change the default vfs.timestamp_precision setting from
  seconds (0) to microseconds (2).

* Nanoseconds is more problematic because utimes() only has a
  microsecond precision and cpu concurrency might cause some confusion.
  So for now leave it set to microseconds.

15 months agocpdup - Bump version, add usec timestamp precision
Matthew Dillon [Mon, 6 Jan 2020 08:21:44 +0000 (00:21 -0800)]
cpdup - Bump version, add usec timestamp precision

* cpdup will now run utimes() with microsecond precision (the
  most it can handle), if possible.  It previously only used
  seconds precision.

* Compatibilty with older cpdup's is maintained for remote copies
  (though it will warn you of the version mismatch).  Older cpdup's
  only transfer the seconds field.

* cpdup still only uses the seconds field when comparing files,
  in order to maintain maximum compatibility between operating systems
  and filesystems.

15 months agodsynth - Enhance purge-distfiles directive
Matthew Dillon [Mon, 6 Jan 2020 01:43:52 +0000 (17:43 -0800)]
dsynth - Enhance purge-distfiles directive

* Improve the distfiles list by using -VALLFILES instead of -VDISTFILES.

* Match up the related lock files so we can purge lock files that
  are no longer relevant.

15 months ago<time.h>: Check strptime()'s format argument with __strftimelike.
Sascha Wildner [Sun, 5 Jan 2020 10:22:06 +0000 (11:22 +0100)]
<time.h>: Check strptime()'s format argument with __strftimelike.

As the manual page says, "all conversion specifications are identical
to those described in strftime(3)."

15 months agobasename.3/dirname.3: Adjust for recent commits.
Sascha Wildner [Sat, 4 Jan 2020 21:54:16 +0000 (22:54 +0100)]
basename.3/dirname.3: Adjust for recent commits.

15 months agolibc - Adopt more linux-friendly basename() and dirname()
Matthew Dillon [Sat, 4 Jan 2020 20:48:20 +0000 (12:48 -0800)]
libc - Adopt more linux-friendly basename() and dirname()

* Essentially take the FreeBSD basename() and dirname() code, changing
  the API to be more linux-friendly.  This reduces work required in dports.

* Adjust numerous cases in our base code that assumed the old prototypes
  and side effects.

* The passed-in string pointers are no longer const and can be modified
  in-place by the functions.  The returned value is no longer sometimes
  dynamically allocated and will instead either return a constant string,
  a portion of the passed in string, or a modified portion of the
  passed-in string.

  The API unfortunately has to be declared to return a char * instead of
  a const char *, even though it sometimes returns pointers to constant

  The API is now thread-safe.

* The API is still a huge historical mess but at least the ports for
  the most part assume the above behavior now due to linux doing the
  same thing.

Reviewed-by: multiple people
15 months agodrm - Fix workqueue bugs w/recent drm pushes
Matthew Dillon [Sat, 4 Jan 2020 19:58:56 +0000 (11:58 -0800)]
drm - Fix workqueue bugs w/recent drm pushes

* The linux workqueue code uses pcpu queues in many situations.
  At least one use-case in the recent drm code push can result in
  taskqueue_enqueue() calls being issued on active tasks to a different
  queue, causing (typically) overnight or idle related panics.

* Adjust the linux workqueue code to use the new taskqueue API
  functions that supports this behavior.

15 months agokernel - Update taskq code
Matthew Dillon [Sat, 4 Jan 2020 19:51:58 +0000 (11:51 -0800)]
kernel - Update taskq code

* Move the task_queue declaration out of struct timeout_task and
  into struct task.

  Generally speaking we want to transition to using the stored
  queue instead of requiring it to be passed in every API call,
  but we maintain API compatibility for now.

* Assert that the stored queue matches the passed-in queue
  in several places.

* Add taskqueue_enqueue_optq(), an API function that allows the
  queue a task is placed on to be changed.  For example, when a
  pcpu queue is passed-in.

  If the task cannot be moved to the passed-in queue it will remain
  on its current queue, otherwise it will be moved/added to the
  passed-in queue.  The queue the task is placed on is returned in
  an indirect rgument.

* Add taskqueue_cancel_simple() and taskqueue_drain_simple().
  These functions just take the task as an argument, the
  queue does not need to be specified.

15 months agodrm/radeon: Use pci_alloc_consistent()
François Tigeot [Sat, 4 Jan 2020 09:50:09 +0000 (10:50 +0100)]
drm/radeon: Use pci_alloc_consistent()

15 months agodsynth - Don't prompt on purge-distfiles if no files to delete
Matthew Dillon [Sat, 4 Jan 2020 02:45:44 +0000 (18:45 -0800)]
dsynth - Don't prompt on purge-distfiles if no files to delete

* Don't ask whether we should delete 0 distfiles.

Requested-by: zrj
15 months agodsynth - Delete obsolete packages for 'dsynth everything'
Matthew Dillon [Fri, 3 Jan 2020 19:54:58 +0000 (11:54 -0800)]
dsynth - Delete obsolete packages for 'dsynth everything'

* When runnig 'dsynth everything', delete any obsolete packages
  in the repo that don't show up in the dports scan.

Requested-by: zrj
15 months agodrm/linux: Add pci_alloc_consistent()
François Tigeot [Fri, 3 Jan 2020 18:08:37 +0000 (19:08 +0100)]
drm/linux: Add pci_alloc_consistent()

15 months agousr.sbin/fstyp: Cleanup hammer2.c
Tomohiro Kusumi [Fri, 3 Jan 2020 15:27:55 +0000 (00:27 +0900)]
usr.sbin/fstyp: Cleanup hammer2.c

* Change "goto done;" to "goto fail;" as these are all failures.
* Use lower case for error messages as fstyp uses lower case.
* Other minor fixes.

15 months agousr.sbin/fstyp: Fix -Werror=maybe-uninitialized on NetBSD
Tomohiro Kusumi [Fri, 3 Jan 2020 08:36:56 +0000 (17:36 +0900)]
usr.sbin/fstyp: Fix -Werror=maybe-uninitialized on NetBSD

Fix below which was seen on NetBSD.
'ondisk' may be used uninitialized in this function [-Werror=maybe-uninitialized]

2 years agousr.sbin/fstyp: Cleanup hammer.c
Tomohiro Kusumi [Wed, 2 Jan 2019 22:11:18 +0000 (07:11 +0900)]
usr.sbin/fstyp: Cleanup hammer.c

Change "goto done;" to "goto fail;" as these are all failures.
Plus other minor fixes.

2 years agousr.sbin/fstyp: Remove Capsicum related code
Tomohiro Kusumi [Wed, 2 Jan 2019 15:45:46 +0000 (00:45 +0900)]
usr.sbin/fstyp: Remove Capsicum related code

Looks to be unneeded in DragonFly.
FreeBSD calls caph_enter() after this.

15 months ago<sys/resource.h>: Clean up visibility of defines, and other fixes.
Sascha Wildner [Wed, 1 Jan 2020 19:24:00 +0000 (20:24 +0100)]
<sys/resource.h>: Clean up visibility of defines, and other fixes.

* Sprinkle some __BSD_VISIBLE checks around various non-POSIX defines.

* Remove the no longer needed orlimit struct.

* In <sys/types.h>, put a __BSD_VISIBLE check around the rlim_t
  definition, because POSIX does not require it in <sys/types.h>.

Thanks to zrj for testing with a dports bulk build and fixing the two
packages that were wrongly requesting a restricted compilation

15 months agoFix compiling iwm(4) into the kernel.
Sascha Wildner [Wed, 1 Jan 2020 12:22:14 +0000 (13:22 +0100)]
Fix compiling iwm(4) into the kernel.

15 months agousr.sbin/fstyp: Fix -Werror=maybe-uninitialized on NetBSD
Tomohiro Kusumi [Wed, 1 Jan 2020 15:20:27 +0000 (00:20 +0900)]
usr.sbin/fstyp: Fix -Werror=maybe-uninitialized on NetBSD

Fix below which was seen on NetBSD.
'volpath' may be used uninitialized in this function [-Werror=maybe-uninitialized]

15 months agoiwm - Full sync from FreeBSD
Matthew Dillon [Tue, 31 Dec 2019 03:09:33 +0000 (19:09 -0800)]
iwm - Full sync from FreeBSD

* Full sync from freebsd, plus add iwm-9000 and iwm-9260 support.

* Patch up some ABI changes to ieee80211_*() which we don't have

15 months agoBump copyrights. Happy 2020!!
Sascha Wildner [Wed, 1 Jan 2020 00:14:18 +0000 (01:14 +0100)]
Bump copyrights. Happy 2020!!

15 months agousr.sbin/fstyp: Add HAS_DEVPATH for HAMMER1/2 support in FreeBSD/NetBSD
Tomohiro Kusumi [Tue, 31 Dec 2019 16:34:36 +0000 (01:34 +0900)]
usr.sbin/fstyp: Add HAS_DEVPATH for HAMMER1/2 support in FreeBSD/NetBSD

Since now that FreeBSD has an old version of hammer.c and hammer2.c,
add HAS_DEVPATH conditional to make it easier for FreeBSD (and NetBSD)
to sync with DragonFly for HAMMER1/2 support.

15 months agousr.sbin/fstyp: Add precache_encoding to fsvtypes[]
Tomohiro Kusumi [Tue, 31 Dec 2019 15:33:49 +0000 (00:33 +0900)]
usr.sbin/fstyp: Add precache_encoding to fsvtypes[]

Although this struct is DragonFly specific, try to be compatible
with what FreeBSD does.

15 months agoRemove mrouted(8) and the associated utilities from our tree.
Sascha Wildner [Tue, 31 Dec 2019 14:02:43 +0000 (15:02 +0100)]
Remove mrouted(8) and the associated utilities from our tree.

Our version was old and unmaintained. A newer version can be found in
dports, if anyone still needs it, but it likely is used only rarely,
if at all.

15 months agoboot/loader: Fix -Wundef warnings in the legacy and UEFI loaders.
Sascha Wildner [Mon, 30 Dec 2019 09:39:46 +0000 (10:39 +0100)]
boot/loader: Fix -Wundef warnings in the legacy and UEFI loaders.

With the previous commit in acdragonfly.h, we can now normally
include acpi.h.

15 months agoACPICA: Fix including acpi.h when building standalone code.
Sascha Wildner [Mon, 30 Dec 2019 09:37:53 +0000 (10:37 +0100)]
ACPICA: Fix including acpi.h when building standalone code.

Leaving ACPI_USE_STANDARD_HEADERS undefined prevents standard headers
from being included and causing conflicts with <stand.h>, most notably
for putenv() and random() which have different prototypes in libstand.

<stand.h> and libstand provide everything we need.

15 months agodrm/i915: Disable GUC support again on Kabylake GPUs
François Tigeot [Sun, 29 Dec 2019 18:56:10 +0000 (19:56 +0100)]
drm/i915: Disable GUC support again on Kabylake GPUs

It causes hard locks on some machines

Reported-by: noob237
15 months agoboot/efi: Handle ACPI_USE_SYSTEM_INTTYPES definition in the Makefile.
Sascha Wildner [Sun, 29 Dec 2019 13:12:57 +0000 (14:12 +0100)]
boot/efi: Handle ACPI_USE_SYSTEM_INTTYPES definition in the Makefile.

In preparation for future patches that clean up -Wundef in sys/boot.

15 months agodsynth - Exit if command-line port specifications are mangled
Matthew Dillon [Sun, 29 Dec 2019 03:19:10 +0000 (19:19 -0800)]
dsynth - Exit if command-line port specifications are mangled

* Exit if command-line port specifications are mangled

Reported-by: zrj
15 months agoboot/edk2: Fix a -Wundef warning.
Sascha Wildner [Sat, 28 Dec 2019 20:34:11 +0000 (21:34 +0100)]
boot/edk2: Fix a -Wundef warning.

15 months ago<machine/acpica_machdep.h>: Sigh another w/s fix.
Sascha Wildner [Sat, 28 Dec 2019 19:47:38 +0000 (20:47 +0100)]
<machine/acpica_machdep.h>: Sigh another w/s fix.

15 months ago<machine/acpica_machdep.h>: Adjust more whitespace.
Sascha Wildner [Sat, 28 Dec 2019 19:44:56 +0000 (20:44 +0100)]
<machine/acpica_machdep.h>: Adjust more whitespace.

15 months ago<machine/acpi_machdep.h>: More cleanup.
Sascha Wildner [Sat, 28 Dec 2019 19:43:29 +0000 (20:43 +0100)]
<machine/acpi_machdep.h>: More cleanup.

The *_XFACE definitions are not needed. ACPICA cares about this itself.

While here, fix some whitespace and adjust the include guard name.

15 months agousr.sbin/fstyp: Make fstypes' precache_encoding const
Tomohiro Kusumi [Sat, 28 Dec 2019 15:28:08 +0000 (00:28 +0900)]
usr.sbin/fstyp: Make fstypes' precache_encoding const

This from f3e1c87543147f0c95d3d9e5d79d4a704e1ab1af should be const.
Failed to compile on NetBSD with below error.
"initialization discards 'const' qualifier from pointer target type"

15 months agobsd-family-tree: add several new releases
Eitan Adler [Sat, 28 Dec 2019 07:48:13 +0000 (07:48 +0000)]
bsd-family-tree: add several new releases

Obtained from: FreeBSD

15 months agousr.sbin/fstyp: Use iconv(3) to convert NTFS vol labels correctly
Tomohiro Kusumi [Fri, 27 Dec 2019 16:20:40 +0000 (01:20 +0900)]
usr.sbin/fstyp: Use iconv(3) to convert NTFS vol labels correctly

from freebsd/freebsd@23a4b310ffa90719eb9d11506bde1befab3c695f

15 months agousr.sbin/fstyp: Show exFAT volume labels with -l flag
Tomohiro Kusumi [Fri, 27 Dec 2019 15:21:11 +0000 (00:21 +0900)]
usr.sbin/fstyp: Show exFAT volume labels with -l flag

from freebsd/freebsd@73773fcda9f69ce7ee0c73292f273bab940223bf

15 months agodsynth - Abort on certain probe errors during pkglist scan
Matthew Dillon [Fri, 27 Dec 2019 08:32:17 +0000 (00:32 -0800)]
dsynth - Abort on certain probe errors during pkglist scan

* If any directly-specified package or any direct dependency of
  any directly-specified package fails to probe, we now abort
  prior to entering ncurses mode.

* Note that 'dsynth everything' does not abort.

Requested-by: zrj
15 months agokernel - Fix vm.swap_size sysctl
Matthew Dillon [Fri, 27 Dec 2019 08:09:03 +0000 (00:09 -0800)]
kernel - Fix vm.swap_size sysctl

* vm.swap_size was improperly reporting the amount of free
  swap space rather than the amount of swap space configured.

* Add vm.swap_free to report the amount of free swap space.

* Does not affect pstat or libkvm which use the vm.swap_info_array

15 months agodrm/i915: Update to Linux 4.8.17
François Tigeot [Fri, 27 Dec 2019 08:09:34 +0000 (09:09 +0100)]
drm/i915: Update to Linux 4.8.17

* Broxton, Valleyview and Cherryview support improvements

* Broadwell and Gen9/Skylake support improvements

* Broadwell brightness fixes from OpenBSD

* Atomic modesetting improvements

* Various bug fixes and performance enhancements

15 months agodsynth - Fix bug in pkglist depend scan
Matthew Dillon [Thu, 26 Dec 2019 06:14:06 +0000 (22:14 -0800)]
dsynth - Fix bug in pkglist depend scan

* Fix a bug where the pkglist scan could could end up putting a
  flavored packge in the hash table more than once, causing a portion
  of the dependency chain to become confused.

  This could cause certain build requests to always rebuild some
  of the dependencies that were already built.  For example, building
  graphics/mesa-dri always caused py-sphinx@py37 to be rebuilt.

* The fix is to move the flavor generator out of the backend and
  into the frontend.  The frontend now detects the generic package
  with multiple flavors and generates individual requests to the

  Previously the backend tried to process the flavors itself and
  transmit extra records back to the frontend (which the frontend
  didn't expect).

  This has the added advantage of issuing separate make commands to
  retrieve information about each flavor, instead of running just one
  and synthesizing (copying it) for each flavor.

* Also add assertions in pkg_enter() to ensure that no duplicates
  can slip through in the future.

Reported-by: zrj
15 months agodsynth - flavor hangs off separator, not tag
Matthew Dillon [Thu, 26 Dec 2019 02:21:16 +0000 (18:21 -0800)]
dsynth - flavor hangs off separator, not tag

* I'm fairly sure the flavor hangs off the dependency element
  before the tag, not after the tag.

15 months agodsynth - ignore cumulative errors for flavor dummy nodes
Matthew Dillon [Thu, 26 Dec 2019 01:06:01 +0000 (17:06 -0800)]
dsynth - ignore cumulative errors for flavor dummy nodes

* Ignore cumulative errors for flavor dummy nodes when the
  intention is to find the default flavor.  Some of the flavors
  might not be supported by the architecture.

Reported-by: zrj
15 months agodrm/linux: Add schedule_timeout_uninterruptible()
François Tigeot [Thu, 26 Dec 2019 08:22:46 +0000 (09:22 +0100)]
drm/linux: Add schedule_timeout_uninterruptible()

15 months agodrm/linux: Add some sysfs stub functions
François Tigeot [Thu, 26 Dec 2019 08:21:44 +0000 (09:21 +0100)]
drm/linux: Add some sysfs stub functions

15 months agodrm/linux: Add or improve some wait_queue functions
François Tigeot [Thu, 26 Dec 2019 08:20:16 +0000 (09:20 +0100)]
drm/linux: Add or improve some wait_queue functions

15 months agoboot/efi: Sync our TianoCore EDK II headers with the edk2-stable201911 tag.
Sascha Wildner [Wed, 25 Dec 2019 21:56:06 +0000 (22:56 +0100)]
boot/efi: Sync our TianoCore EDK II headers with the edk2-stable201911 tag.

Nothing of relevance to us:

* Improved static assertions for UEFI Data Types.

* Better clang support.

* Additional memory types and ARM specific macros.

15 months ago<machine/acpica_machdep.h>: Remove unused defines.
Sascha Wildner [Wed, 25 Dec 2019 21:25:12 +0000 (22:25 +0100)]
<machine/acpica_machdep.h>: Remove unused defines.

15 months agousr.sbin/fstyp: Add APFS support
Tomohiro Kusumi [Wed, 25 Dec 2019 15:31:19 +0000 (00:31 +0900)]
usr.sbin/fstyp: Add APFS support

fstyp(8) man page will be updated once FreeBSD officially updates it.

taken-from: freebsd/freebsd@171bb54729d6d6554eb09c9a3507b184795f33e3

15 months agousr.sbin/fstyp: Add HFS+ support
Tomohiro Kusumi [Wed, 25 Dec 2019 15:23:24 +0000 (00:23 +0900)]
usr.sbin/fstyp: Add HFS+ support

fstyp(8) man page will be updated once FreeBSD officially updates it.

taken-from: freebsd/freebsd@b4d7ad9f787e74e712423def67de8bd76f71943a

15 months agologin.conf: Don't dump /COPYRIGHT on users' screens when logging in.
Sascha Wildner [Tue, 24 Dec 2019 12:51:53 +0000 (13:51 +0100)]
login.conf: Don't dump /COPYRIGHT on users' screens when logging in.

This reverts e72f0762b947abfb33852312cbec661ce8761559.

The /etc/COPYRIGHT file is meant to be created by the local admin
and to be non-existent by default. It has nothing to do with our
/COPYRIGHT, except the name.

It looks like FreeBSD went through the same cycle. See their
revisions 70122 and 70189.

Also add a comment that explains what's intended.

Discussed-with: aly

15 months agodrm/i915: Update to Linux commit b224c4dc70cdd5f42d24a7057148c6ace90e4f4e
François Tigeot [Tue, 24 Dec 2019 09:56:47 +0000 (10:56 +0100)]
drm/i915: Update to Linux commit b224c4dc70cdd5f42d24a7057148c6ace90e4f4e

"drm/i915: Unbreak interrupts on pre-gen6"

15 months agodrm/linux: Add Linux kthread functions
François Tigeot [Tue, 24 Dec 2019 09:42:35 +0000 (10:42 +0100)]
drm/linux: Add Linux kthread functions

15 months agoRemove <sys/ata.h> in 'make distribution', too.
Sascha Wildner [Sun, 22 Dec 2019 19:26:44 +0000 (20:26 +0100)]
Remove <sys/ata.h> in 'make distribution', too.

It was forgotten in d3fa4cd65d803191393035c6d9169800d7ae76a5.

15 months agosys/dev/disk/dm: Refactor dmioctl()
Tomohiro Kusumi [Sun, 22 Dec 2019 16:11:10 +0000 (01:11 +0900)]
sys/dev/disk/dm: Refactor dmioctl()

More readable without dm_ioctl_switch() as a separate function.
taken-from: NetBSD

15 months agoMakefile.inc1: Disconnect libelf from the build.
zrj [Fri, 20 Dec 2019 09:33:51 +0000 (11:33 +0200)]
Makefile.inc1: Disconnect libelf from the build.

 Internal lib is no longer needed after libexecinfo changes.

15 months agolibexecinfo(3): Internalize libelf in symtab.c.
zrj [Fri, 20 Dec 2019 09:21:44 +0000 (11:21 +0200)]
libexecinfo(3): Internalize libelf in symtab.c.

 Previous variant had symbol conflicts against ports libelf library.
 Use custom, cut down variant that provides basic set needed for
 libexecinfo symtab.c, ensure symbols are static and mangled.
 The libelf (as provided in contrib) is not very suitable for generic
 implementation of backtrace(3) function family.

 This is a temporary workaround to unbreak specific ports that are link
 against libelf and libexecinfo (including static compilations).

Reported-by: Romick@users
15 months agolibexecinfo(3): Mangle symtab_*() symbols.
zrj [Fri, 20 Dec 2019 09:18:37 +0000 (11:18 +0200)]
libexecinfo(3): Mangle symtab_*() symbols.

 These are not part public API.

15 months agolibexecinfo(3): Prevent use of uninitialized.
zrj [Fri, 20 Dec 2019 09:17:08 +0000 (11:17 +0200)]
libexecinfo(3): Prevent use of uninitialized.

 The gelf_getshdr() and gelf_getsy() can return NULL in certain cases.

15 months agodrm/linux: Add a few linux/sched functions
François Tigeot [Sat, 21 Dec 2019 21:18:53 +0000 (22:18 +0100)]
drm/linux: Add a few linux/sched functions

15 months agodrm/linux: Add wait_for_completion()
François Tigeot [Sat, 21 Dec 2019 21:13:12 +0000 (22:13 +0100)]
drm/linux: Add wait_for_completion()

15 months agodrm: Protect irq_list with lockmgr locks
François Tigeot [Sat, 21 Dec 2019 18:23:03 +0000 (19:23 +0100)]
drm: Protect irq_list with lockmgr locks

15 months agodrm: Protect iomap_list with lockmgr locks
François Tigeot [Sat, 21 Dec 2019 18:19:44 +0000 (19:19 +0100)]
drm: Protect iomap_list with lockmgr locks

15 months agodhcpcd: Update README.DRAGONFLY
Roy Marples [Fri, 20 Dec 2019 22:41:26 +0000 (22:41 +0000)]

15 months agoMerge branch 'vendor/DHCPCD'
Roy Marples [Fri, 20 Dec 2019 22:39:50 +0000 (22:39 +0000)]
Merge branch 'vendor/DHCPCD'

15 months agoImport dhcpcd-8.1.4 with the following change:
Roy Marples [Fri, 20 Dec 2019 22:35:27 +0000 (22:35 +0000)]
Import dhcpcd-8.1.4 with the following change:

 * options: Fix allocating the script option

15 months agokernel - Clean up minor kernel memory leak (2)
Matthew Dillon [Fri, 20 Dec 2019 19:34:33 +0000 (11:34 -0800)]
kernel - Clean up minor kernel memory leak (2)

* Move the bzero()s because there is one case where rt_msg_buffer()
  can actually be called with the msghdr already partially filled-out.

* Tested w/dsynth, openvpn should now build.  This should also solve
  the reported panic.

Reported-by: zrj, kworr
15 months agodrm: Protect vmmap_list with lockmgr locks
François Tigeot [Fri, 20 Dec 2019 14:11:44 +0000 (15:11 +0100)]
drm: Protect vmmap_list with lockmgr locks

Suggested-by: dillon
15 months agodhcpcd: Update README.DRAGONFLY
Roy Marples [Fri, 20 Dec 2019 12:16:55 +0000 (12:16 +0000)]

15 months agoMerge branch 'vendor/DHCPCD'
Roy Marples [Fri, 20 Dec 2019 12:14:18 +0000 (12:14 +0000)]
Merge branch 'vendor/DHCPCD'

15 months agoImport dhcpcd-8.1.3 with the following changes:
Roy Marples [Fri, 20 Dec 2019 12:09:22 +0000 (12:09 +0000)]
Import dhcpcd-8.1.3 with the following changes:

 * dhcpcd: Only report SSID when we have a carrier
 * IPv6ND: Fix reachable test
 * DHCP6: Work better with infinite addresses
 * DHCP6: Suboption 3 of NTP Server is a FQDN
 * DHCP6: Fix deprecating a delegated prefix
 * DHCP: Ensure we have a lease to extract options from

15 months agolibkvm - Minor fix to debugging code
Matthew Dillon [Thu, 19 Dec 2019 07:10:10 +0000 (23:10 -0800)]
libkvm - Minor fix to debugging code

* Fix mask generation in dump_blist() -> scanradix().

* No affect during normal operation of the library.

Submitted-by: swildner
15 months agoinet: Add support for IPv4 /31 prefixes, as described in RFC 3021.
Roy Marples [Wed, 18 Dec 2019 16:30:12 +0000 (16:30 +0000)]
inet: Add support for IPv4 /31 prefixes, as described in RFC 3021.

To run a /31 network, participating hosts MUST drop support
for directed broadcasts, and treat the first and last addresses
on subnet as unicast. The broadcast address for the prefix
should be the link local broadcast address, INADDR_BROADCAST.

Taken from FreeBSD, r226402.

15 months agokernel - Fix rman_make_alignment_flags()
Matthew Dillon [Wed, 18 Dec 2019 16:27:23 +0000 (08:27 -0800)]
kernel - Fix rman_make_alignment_flags()

* Fix rman_make_alignment_flags() to work properly up to 2^63.
  Remove assumption about being able to shift a 32-bit integer
  by 32, this is not hardware-portable.

* Note that this function is only used by ancient pccard code

Reported-by: swildner
15 months agortld - Remove 'register' keyword
Matthew Dillon [Wed, 18 Dec 2019 16:20:08 +0000 (08:20 -0800)]
rtld - Remove 'register' keyword

* Remove use of 'register'.

15 months agortld-elf - Fix ancient C code
Matthew Dillon [Wed, 18 Dec 2019 16:18:32 +0000 (08:18 -0800)]
rtld-elf - Fix ancient C code

* Adjust malloc() (used only by rtld-elf) to use size_t and fix
  a number of shift operations.

Submitted-by: swildner
15 months agosys/dev/disk/dm: Fix argc test for striped target
Tomohiro Kusumi [Wed, 18 Dec 2019 15:04:11 +0000 (00:04 +0900)]
sys/dev/disk/dm: Fix argc test for striped target

Should be 2 since stripe # could be 0.
taken-from: NetBSD

15 months agoleave - Allow up to 99 in the minutes field in + mode
Matthew Dillon [Wed, 18 Dec 2019 06:57:31 +0000 (22:57 -0800)]
leave - Allow up to 99 in the minutes field in + mode

* Allow the minutes field to specify up to the value 99 in
  + mode, just like microwaves and oven timers have for decades.

* Takes the app out of the dark ages and into... well, actually,
  its still in the dark ages.

Requested-by: zach
15 months agodrm: Improve sysfs implementation
François Tigeot [Tue, 17 Dec 2019 20:09:14 +0000 (21:09 +0100)]
drm: Improve sysfs implementation

* Add necessary code to really allocate or free Linux
  device structs associated with connectors.

* This prevents panics in DRM_DEBUG statements

Reported-by: Peeter Must
15 months agousr.sbin/fstyp: Fix copyright
Tomohiro Kusumi [Tue, 17 Dec 2019 16:19:16 +0000 (01:19 +0900)]
usr.sbin/fstyp: Fix copyright

hammer.c and hammer2.c aren't ported from FreeBSD.

15 months agousr.sbin/fstyp: Fix copying unterminated ondisk string
Tomohiro Kusumi [Tue, 17 Dec 2019 15:01:00 +0000 (00:01 +0900)]
usr.sbin/fstyp: Fix copying unterminated ondisk string

15 months agousr.sbin/fstyp: Expand LABEL_LEN to 512
Tomohiro Kusumi [Tue, 17 Dec 2019 14:43:03 +0000 (23:43 +0900)]
usr.sbin/fstyp: Expand LABEL_LEN to 512

In theory 256 could be too small for HAMMER2 especially since

15 months agokernel - Clean up minor kernel memory leak
Matthew Dillon [Tue, 17 Dec 2019 07:05:24 +0000 (23:05 -0800)]
kernel - Clean up minor kernel memory leak

* The ifconfig sysctl code was not filling every last byte of the
  returned buffer, creating a small memory leak.  Zero the buffer
  prior to filling it in to guarantee that no garbage is left in
  these spots.

15 months agokernel - Optimize nlookup() a bit more
Matthew Dillon [Tue, 17 Dec 2019 07:03:52 +0000 (23:03 -0800)]
kernel - Optimize nlookup() a bit more

* Optimize the fast-path for nlookup() for non-modifying
  operations (i.e. open() without O_CREAT, stat(), etc).  In
  such cases special directory modes need not be considered
  as long as world-execute permissions are present.

Suggested-by: mjg
15 months agokernel - Refactor malloc_type to reduce static data in image
Matthew Dillon [Tue, 17 Dec 2019 06:58:26 +0000 (22:58 -0800)]
kernel - Refactor malloc_type to reduce static data in image

* malloc_type was embedding a SMP_MAXCPU array of kmalloc_use
  structures, which winds up being 16KB a pop x 400+ MALLOC_DEFINE()

  This was over 6MB of static data in the kernel binary, and it
  wasn't BSS because the declaration is initialized with some defaults.
  So this reduction is significant and directly impacts both memory
  use and kernel boot times.

* Change malloc_type->ks_use from an array to a pointer.  Embed
  a single kmalloc_use structure (ks_use0) as the default.

  When ncpus is probed, the kernel now goes through all malloc_type
  structures and dynamically allocates a properly-sized ks_use
  array.  Any new malloc hoppers after that point will also dynamically
  allocate ks_use.

15 months agokern.pre.mk: Remove obsolete comment.
Sascha Wildner [Mon, 16 Dec 2019 16:26:04 +0000 (17:26 +0100)]
kern.pre.mk: Remove obsolete comment.

15 months agokern.pre.mk: Add back some Makefile code to fix VKERNEL64 (2)
Matthew Dillon [Mon, 16 Dec 2019 04:42:14 +0000 (20:42 -0800)]
kern.pre.mk: Add back some Makefile code to fix VKERNEL64 (2)

* Conditionalize the last commit so it only occurs
  for vkernel64 builds.

15 months ago<sys/types.h>: Add some *_T_DECLARED guards for upcoming work.
Sascha Wildner [Sun, 15 Dec 2019 22:40:33 +0000 (23:40 +0100)]
<sys/types.h>: Add some *_T_DECLARED guards for upcoming work.

These will be used when we clean up <sys/stat.h> and <dirent.h> in the
near future.

15 months agokern.pre.mk: Add back some Makefile code to fix VKERNEL64.
Sascha Wildner [Sun, 15 Dec 2019 22:38:47 +0000 (23:38 +0100)]
kern.pre.mk: Add back some Makefile code to fix VKERNEL64.

I removed this by mistake in c47c81dbc5495f8c4fa01a238784813eb56a239e.

Seems this is still needed, even though we inherited it from FreeBSD
before we had the vkernel.

Reported-by: tuxillo
15 months agodrm/linux: Fix io_mapping() functions
François Tigeot [Sun, 15 Dec 2019 22:13:04 +0000 (23:13 +0100)]
drm/linux: Fix io_mapping() functions

These functions were mostly stubs and did not properly set memory
cache attributes causing some operations like framebuffer access
to be excessively slow.

Use ioremap() variants internally to fix that.

Spotted-by: peeter, dillon
15 months agokernel - Test pending ints in more crit_exit*() paths
Matthew Dillon [Sun, 15 Dec 2019 20:24:02 +0000 (12:24 -0800)]
kernel - Test pending ints in more crit_exit*() paths

* A number of crit_exit*() paths, primarily in the mutex and
  spinlock code, were not testing for interrupts made pending
  on the last unwind of the critical section.

  This was originally intended to improve performance, but it
  can lead to non-deterministic latencies for processing interrupts.

* Process these pending events in such cases.  We will see if it
  affects performance but I don't think it will be noticeable.

15 months agokernel - Improve pmap_change_attr() when used on the DMAP
Matthew Dillon [Sun, 15 Dec 2019 20:18:44 +0000 (12:18 -0800)]
kernel - Improve pmap_change_attr() when used on the DMAP

* When used on the DMAP's 1GB or 2MB pages pmap_change_attr()
  basically didn't work because it tries to access terminal PTEs
  (and there aren't any), instead accidently accessing the
  underlying physical memory and causing corruption.

* Fix this by (1) Forcing the DMAP to use 2MB pages and
  (2) special-casing DMAP addresses in pmap_change_attr()
  to act on the PDEs.

* This is not a complete fix because the granularity for
  any DMAP VAs will still be ~2MB and not 4K.  Its use by
  the DRM subsystem requires more investigation.  But the
  changes should improve some of the reported GPU corruption

Reported-by: peeter
Testing-by: multiple
15 months agokern.{post,pre}.mk: Clean up a bit.
Sascha Wildner [Sat, 14 Dec 2019 19:06:46 +0000 (20:06 +0100)]
kern.{post,pre}.mk: Clean up a bit.

* eddep is not used in kernel context.

* linterrs and the lint target should have been removed when I removed
  xlint back in 84f800532904979799aaeb8123487026f76a6640.

* setdef[01].c and setdefs.h should have been removed when gensetdefs
  was removed in 5e0107f67f7c659007103f791401be27957081cf.

* Remove some old FreeBSD inherited code that we don't need to build
  a kernel without /usr/src.

* While here, Remove unneeded quotation marks around two include

15 months agophantasia(6): Fix monters file permissions.
zrj [Sat, 14 Dec 2019 10:24:14 +0000 (12:24 +0200)]
phantasia(6): Fix monters file permissions.

 Allow games group to write too.

Reported-by: zach