Sascha Wildner [Thu, 27 Sep 2018 06:54:51 +0000 (08:54 +0200)]
Change '#if NOT_YET' to '#if 0 /* not yet */' which fixes -Wundef.
Sascha Wildner [Thu, 27 Sep 2018 06:52:01 +0000 (08:52 +0200)]
Change '#if notyet' to '#if 0 /* not yet */' which fixes -Wundef.
Sascha Wildner [Thu, 27 Sep 2018 06:45:02 +0000 (08:45 +0200)]
kernel/pf: Provide an NBPF default if the module is built alone.
Sascha Wildner [Thu, 27 Sep 2018 06:32:40 +0000 (08:32 +0200)]
libkvm: Remove some inactive code.
François Tigeot [Thu, 27 Sep 2018 05:07:37 +0000 (07:07 +0200)]
Revert "drm/ttm: convert to the reservation api"
This reverts commit
c05dd8dc1634d5a751604913c322ee97f9510e46.
There is something very wrong with ww mutexes.
Sascha Wildner [Wed, 26 Sep 2018 20:12:08 +0000 (22:12 +0200)]
kernel/pf: Add missing use_bpf.h to the Makefile.
Sascha Wildner [Wed, 26 Sep 2018 20:00:39 +0000 (22:00 +0200)]
kernel/dcons: Fix two more -Wundef issues.
Sascha Wildner [Wed, 26 Sep 2018 19:16:55 +0000 (21:16 +0200)]
kernel/ufs: Fix -Wundef.
Sascha Wildner [Wed, 26 Sep 2018 19:09:52 +0000 (21:09 +0200)]
vkernel: Fix -Wundef.
Sascha Wildner [Wed, 26 Sep 2018 19:10:46 +0000 (21:10 +0200)]
kernel/mpr: Fix -Wundef.
Sascha Wildner [Wed, 26 Sep 2018 18:48:03 +0000 (20:48 +0200)]
kernel/ext2fs: Fix -Wundef.
Sascha Wildner [Wed, 26 Sep 2018 18:18:45 +0000 (20:18 +0200)]
kernel/drm: Fix -Wundef.
Sascha Wildner [Wed, 26 Sep 2018 18:00:47 +0000 (20:00 +0200)]
kernel/ntfs: Fix -Wundef.
Sascha Wildner [Wed, 26 Sep 2018 17:37:23 +0000 (19:37 +0200)]
kernel/if_mos: Fix -Wundef.
I introduced this issue myself in
6a054f0b7d59e39ebfc082d30cdd5d65f7def3ae.
Sascha Wildner [Wed, 26 Sep 2018 17:20:23 +0000 (19:20 +0200)]
kernel/vga: Fix -Wundef.
Sascha Wildner [Wed, 26 Sep 2018 17:05:30 +0000 (19:05 +0200)]
kernel/vinum: Fix -Wundef.
Sascha Wildner [Tue, 25 Sep 2018 19:24:30 +0000 (21:24 +0200)]
kernel/dcons: Fix -Wundef.
Sascha Wildner [Tue, 25 Sep 2018 18:41:16 +0000 (20:41 +0200)]
kernel/vmxnet3: Fix -Wundef.
Matthew Dillon [Tue, 25 Sep 2018 17:50:29 +0000 (10:50 -0700)]
kernel - Macro additional builtin's (3)
* Fix SLAB_DEBUG and LINT64 options.
Reported-by: swildner
Matthew Dillon [Tue, 25 Sep 2018 17:24:53 +0000 (10:24 -0700)]
kernel - Macro additional builtin's (2)
* Add _memcpy (currently unused). Replicate support the same way
for all the builtins.
Sascha Wildner [Tue, 25 Sep 2018 17:09:18 +0000 (19:09 +0200)]
kernel/hpt27xx: Enable some code that should work for us (fixes -Wundef).
Matthew Dillon [Tue, 25 Sep 2018 16:27:18 +0000 (09:27 -0700)]
kernel - Adjust vkernel build for builtin changes
* Adjust the vkernel build to be compatible with the
macros changes for bcopy, etc.
* It appears that since e.g. 'bcopy' is a PLT symbol in libc,
that I cannot simply create a weak '_bcopy' symbol that
points to it. So this solution is a bit of a hack.
Matthew Dillon [Mon, 24 Sep 2018 17:35:44 +0000 (10:35 -0700)]
kernel - Do not overwrite uap args in system calls
* This was the only case where a uap argument was overwritten.
Make it use a local variable instead.
* Prep for potential later remapping of syscall arguments
to the trapframe registers.
Matthew Dillon [Mon, 24 Sep 2018 17:33:25 +0000 (10:33 -0700)]
kernel - Macro additional builtin's
* Macro memcpy, memset, and memmove. Move from libkern to
systm.h.
* Adjust prototypes, add _xxx versions, adjust a few bits of
code that need the related function pointers.
* Scrap hacks in zlib.c that converted memset and memmove.
Matthew Dillon [Mon, 24 Sep 2018 17:29:32 +0000 (10:29 -0700)]
kernel - Remove lwkt_msg from sysunion in syscall code
* The lmsg field (lwkt_msg) is no longer used in the
sysunion union, remove it. Should not result in any
material changes to code generation.
Matthew Dillon [Mon, 24 Sep 2018 17:26:23 +0000 (10:26 -0700)]
kernel - Work around bogus gcc errors
* gcc warns of possibly uninitialized variables when using the
builtins in two situations where the variables are, in fact,
initialized for the code path.
* Not really gcc's fault, the code was too complex for its
analysis.
* Zero the variables to fix the warning.
Matthew Dillon [Mon, 24 Sep 2018 17:25:23 +0000 (10:25 -0700)]
kernel - Fix bug in mpt_scsi_tgt_status()
* Function overwrote the 'rsp' pointer instead of zero'ing a
portion of the rsp target.
Matthew Dillon [Mon, 24 Sep 2018 15:52:07 +0000 (08:52 -0700)]
kernel - Optimize kmalloc() + bzero()
* Optimize the common case where kmalloc is called with constant
flags of M_ZERO|M_WAITOK (and not M_NULLOK), and size, and
issue the bzero() independently. This allows the bzero() to
be optimized.
Suggested-by: mjg
Matthew Dillon [Sun, 23 Sep 2018 22:42:26 +0000 (15:42 -0700)]
kernel - Optimize bcopy, bzero, memset
* Use __builtin_memset() for bzero() and __builtin_memmove()
for bcopy().
- Must use _bcopy in a few places where GCC complains about
structural punning. Even casting doesn't help.
- GCC's __builtin_memset() and __builtin_memmove() has a side
effect where it assumes that the pointer arguments cannot be
NULL. In fact, they can be NULL when the byte count is 0.
This assumption by GCC causes later unrelated conditionals
on the pointers against NULL to be improperly optimized-out.
We had to fix one place where this blew the system up.
* Implement memset() in assembly (remove from libkern).
* Implement memmove() in assembly (remove from libkern).
Matthew Dillon [Sun, 23 Sep 2018 19:11:57 +0000 (12:11 -0700)]
kernel - Fix serious bug in virtio
* virtio_blk.c was destroy the buffer cache base global
in vtblk_write_dump().
Located-by: gcc8, bcopy -> memcpy inline optimization complained.
Matthew Dillon [Sun, 23 Sep 2018 18:39:17 +0000 (11:39 -0700)]
kernel - Remove unnecessary cld's
* Remove unnecsesary cld's, ABI requires direction flag to be clear
on entry.
* Keep the cld prior to the ret for the case where we have to std
in bcopy().
Suggested-by: mjg
Matthew Dillon [Sun, 23 Sep 2018 18:35:21 +0000 (11:35 -0700)]
kernel - Refactor copyinstr and copystr
* Replace lodsb/stosb sequence with discrete mov's. Remove related
xchgq and cld.
Suggested-by: mjg
Sascha Wildner [Tue, 25 Sep 2018 12:45:59 +0000 (14:45 +0200)]
kernel/pfsync: Use the correct macros when checking for bpf or CARP.
Similar to
5b7f73c4a34bc9105fb3f29fce8161e3b8dce5ea.
Note that pfsync is currently lacking userland support (in ifconfig
at least) so this commit won't affect anyone.
Aaron LI [Tue, 25 Sep 2018 12:30:58 +0000 (20:30 +0800)]
rc.d/pflog - Be quiet when check if modules are loaded
This rc script was missed from tuxillo's commit (
0dfdc028b39).
Sascha Wildner [Tue, 25 Sep 2018 12:40:43 +0000 (14:40 +0200)]
kernel/pflog: Fix a recently introduced regression.
The recently added #ifdef (in
a6ccd68b08eff10c57551f8fe92f39a5b8ae6c48)
used the wrong name (NBPFILTER) and thereby effectively disabled the
bpfattach.
Fix it to the right name (NBPF), include the necessary use_bpf.h and
while here, also fix another such case for detaching.
Reported-by: Peeter Must
Sascha Wildner [Tue, 25 Sep 2018 07:28:15 +0000 (09:28 +0200)]
kernel/acpi: Some improvements in acpi_eval_osc().
* If ACPI_OSC_QUERY_SUPPORT is set, return the results in the buffer
that was passed for further processing.
* Rename related flags/masks to better names and update comments in the
header file.
Sascha Wildner [Mon, 24 Sep 2018 08:03:15 +0000 (10:03 +0200)]
kernel/assym: Remove V_FORWARDED_{HITS,INTS,MISSES}.
All usage was removed in our tree in 2003 and 2005:
V_FORWARDED_{HITS,MISSES} in
cb973d1510c62c9b0a2e26530585a2c50672efa3
V_FORWARDED_INTS in
477d3c1cb94fc723c033f6ad0897a6a3d65046b6
François Tigeot [Sun, 23 Sep 2018 13:41:47 +0000 (15:41 +0200)]
drm/ttm: convert to the reservation api
François Tigeot [Sun, 23 Sep 2018 13:30:35 +0000 (15:30 +0200)]
drm/linux: Implement more reservation objects code
Aaron LI [Sun, 23 Sep 2018 04:26:33 +0000 (12:26 +0800)]
dumpon(8): Make error messages clearer
Before this patch, when a dump device is already configured, dumpon(8)
only complains with 'Device busy', which isn't helpful. Now, dumpon(8)
will tell whether the dump device is already configured or whether need
to run 'dumpoff' first.
Always show verbose information. The utility still accepts the '-v'
option for backward compatibility, but don't mention the option in the
man page anymore.
Bugs: https://bugs.dragonflybsd.org/issues/3092
Aaron LI [Sat, 22 Sep 2018 12:57:52 +0000 (20:57 +0800)]
dumpon(8): Add "dumpoff" variant to be "dumpon off"
"dumpon off" doesn't seem to be a good command, so let's add the "dumpoff"
variant that just acts as "dumpon off", similar to "swapoff".
Thanks to swildner for the initial patch.
See also: https://bugs.dragonflybsd.org/issues/3092#note-2
Sascha Wildner [Sat, 22 Sep 2018 18:54:40 +0000 (20:54 +0200)]
libc/stdtime: Remove some #ifdef checks for TM_{GMTOFF,ZONE}.
We don't override those and use the defaults from private.h.
While here, clean up the CFLAGS of zdump(8) and zic(8). Most of this
isn't needed.
Sascha Wildner [Sat, 22 Sep 2018 10:55:13 +0000 (12:55 +0200)]
kernel: Remove orphaned externs.
Imre Vadász [Fri, 21 Sep 2018 14:00:35 +0000 (16:00 +0200)]
iwm - Remove unused TX_CMD_NEXT_FRAME_*
Taken-From: Linux git
b1e06c65fb69c5e3fddcd91987561e225eaa9bfa
Imre Vadász [Fri, 21 Sep 2018 13:58:54 +0000 (15:58 +0200)]
iwm - Remove unused REPLY_MAX
Taken-From: Linux git
e4eb275ac5cfe71686612d929a9829345b2a4ada
Imre Vadász [Fri, 21 Sep 2018 11:43:11 +0000 (13:43 +0200)]
iwm - Update alive response handling, add v4 and remove old versions.
François Tigeot [Sat, 22 Sep 2018 08:28:23 +0000 (10:28 +0200)]
drm/ttm: Rename ttm_mem_global.spin to ttm_mem_global.lock
It was named so in Linux in the first place.
François Tigeot [Sat, 22 Sep 2018 08:07:31 +0000 (10:07 +0200)]
drm/ttm: Use mutex_lock/mutex_unlock
Sascha Wildner [Fri, 21 Sep 2018 21:23:18 +0000 (23:23 +0200)]
kernel/drm: Actually enable -Werror.
When using compile-with, we have to specify this manually using the
${WERROR} variable which reacts to the NO_WERROR option.
Sascha Wildner [Fri, 21 Sep 2018 19:34:01 +0000 (21:34 +0200)]
kernel: Remove some obsolete commented out code.
Matthew Dillon [Fri, 21 Sep 2018 17:26:42 +0000 (10:26 -0700)]
kernel - Temporarily change WORLD_ALTCOMPILER default in master
* Temporarily change to 'all' to ensure that gcc50 gets built.
Some ports appear to need libraries in /usr/lib/gcc50.
* Will be changed back to 'gcc47' once the ports issue is resolved.
Sascha Wildner [Thu, 20 Sep 2018 17:36:47 +0000 (19:36 +0200)]
In several standard headers, harmonize checks for legacy defines etc.
When something goes away in a certain issue of the standard, always
check with < $standard, not <= $previous_standard. Also, uniformly
check for __XSI_VISIBLE or __POSIX_VISIBLE being > 0 in these cases.
While here, fix a small nit in <sys/wait.h>: wait3() was removed
from Issue 6, but the requirement to define the rusage structure was
removed from Issue 7.
Sascha Wildner [Thu, 20 Sep 2018 17:28:34 +0000 (19:28 +0200)]
<glob.h>: GLOB_NOSYS was removed from Issue 7 of the standard.
Imre Vadász [Wed, 6 Jun 2018 21:32:36 +0000 (23:32 +0200)]
iwm - Fix race during detach, where a callout is left after driver is gone.
Imre Vadász [Thu, 24 May 2018 21:05:10 +0000 (23:05 +0200)]
if_iwm - Stop iwm_watchdog callout when idle.
Sascha Wildner [Thu, 20 Sep 2018 09:01:10 +0000 (11:01 +0200)]
Makefile_upgrade.inc: Handle some recently added files better.
<bus/pccard/cardinfo.h> is one of 4 headers that were removed in
3aef805084f3d031ffbf02b8a00333a755c4677c so add them all.
<linux/linux_input.h> was never in our tree, so it is outside of
Makefile_upgrade.inc's scope.
Sascha Wildner [Thu, 20 Sep 2018 08:22:23 +0000 (10:22 +0200)]
<sys/endian.h>: Use basic integer types.
We might at some point stop including <sys/types.h> too, in favor of
<machine/stdint.h>, but I first need to test which ports assume that
<sys/types.h> comes in with <sys/endian.h>.
Sascha Wildner [Thu, 20 Sep 2018 08:15:02 +0000 (10:15 +0200)]
<fnmatch.h>: FNM_NOSYS was removed from Issue 7 of the standard.
Imre Vadász [Wed, 5 Sep 2018 19:59:55 +0000 (21:59 +0200)]
nfs - Avoid memory leakage when unloading the nfs module.
* This adds some missing objcache_destroy and hashdestroy calls in the nfs
module unload codepath.
Matthew Dillon [Wed, 19 Sep 2018 23:51:50 +0000 (16:51 -0700)]
kernel - Fix early boot interrupt race
* Fix a null pointer dereference panic due to an interrupt
race during early boot. Interrupts are enabled before
intr_block is allocated, so intr_block can be NULL.
* Refactor the kmalloc() for intr_block to only allocate the
space needed for ncpus.
François Tigeot [Wed, 19 Sep 2018 18:07:35 +0000 (20:07 +0200)]
drm/ttm: Use Linux kobjects
* Reducing differences with Linux
* Changes based on Linux commit
ecff665f5e3f1c6909353e00b9420e45ae23d995
"drm/ttm: make ttm reservation calls behave like reservation calls"
François Tigeot [Wed, 19 Sep 2018 17:52:15 +0000 (19:52 +0200)]
drm/linux: Implement more kobject parts
Matthew Dillon [Wed, 19 Sep 2018 07:05:28 +0000 (00:05 -0700)]
kernel - Bump sysctl default limits for unix domain sockets
* Bump all default limits for unix domain sockets to 65536.
In particular, this increases limits for datagrams from absurdly
small values (2048 byte packet size limit).
* Fixes wpa_supplicant (reported by ivadasz).
* Requires further testing.
Matthew Dillon [Wed, 19 Sep 2018 06:53:36 +0000 (23:53 -0700)]
kernel - Introduce separate sysctls for seqpacket limits
* Add net.local.seqpacket.maxseqpacket, previously used the same
default as net.local.stream.sendspace.
* Add net.local.seqpacket.recvspace, previously used the same
default as net.local.stream.recvspace.
* Default is 57344 bytes (unchanged from before)
Taken-from: FreeBSD
Matthew Dillon [Tue, 18 Sep 2018 20:03:38 +0000 (13:03 -0700)]
kernel - Fix sio lockup
* Fix crit-v-com_lock order. Critical sections must be entered before
com_lock, and exited after com_unlock. This fixes an issue where
crit_exit() was executing complex code with com_lock still held,
potentially deadlocking against sio when processing pending interrupts.
François Tigeot [Tue, 18 Sep 2018 19:24:09 +0000 (21:24 +0200)]
drm/ttm: Use Linux memory management functions
Reducing differences with the Linux code base.
Sascha Wildner [Mon, 17 Sep 2018 20:09:52 +0000 (22:09 +0200)]
<sys/semaphore.h>: Move the include guard check below the copyright.
Sascha Wildner [Sun, 16 Sep 2018 15:16:57 +0000 (17:16 +0200)]
Update the pciconf(8) database.
September 12, 2018 snapshot from https://pci-ids.ucw.cz
François Tigeot [Sun, 16 Sep 2018 07:28:44 +0000 (09:28 +0200)]
drm/linux: Increase coverage of the page protection APIs
François Tigeot [Sun, 16 Sep 2018 07:20:37 +0000 (09:20 +0200)]
drm/linux: use pgprot_t
Matthew Dillon [Sat, 15 Sep 2018 04:45:20 +0000 (21:45 -0700)]
build - Remove cvs tags from COPYRIGHT
* Remove cvs tags from COPYRIGHT. An manual install will print the
content of the COPYRIGHT file during boot, there's no need to display
an old $FreeBSD tag.
Sascha Wildner [Fri, 14 Sep 2018 07:27:29 +0000 (09:27 +0200)]
newsyslog.conf: Fix an age old typo that caused weekly.log to rotate wrongly.
weekly.log's rotation isn't triggered by size.
Sascha Wildner [Sun, 9 Sep 2018 20:57:48 +0000 (22:57 +0200)]
kernel: Add some missing __printflike()s.
Sascha Wildner [Sun, 9 Sep 2018 19:09:10 +0000 (21:09 +0200)]
kernel: More adjustments to fix -Wint-in-bool-context warnings.
François Tigeot [Sat, 8 Sep 2018 12:26:15 +0000 (14:26 +0200)]
drm: Sync drm/drmP.h with Linux 4.7.10
Remove most generic kernel includes, in order to avoid Linux/DragonFly
keyword clashes as much as possible in the future.
François Tigeot [Sat, 8 Sep 2018 05:19:30 +0000 (07:19 +0200)]
drm: Add more Linux include files
François Tigeot [Fri, 7 Sep 2018 05:59:43 +0000 (07:59 +0200)]
drm: Use a dedicated .h file for configuration options
With-advice-from: swildner
Eitan Adler [Thu, 6 Sep 2018 01:44:21 +0000 (01:44 +0000)]
bsd-family-tree: add NetBSD 7.2
Also correct the origin of NetBSD 8.0, which was not derived from 7.x.
Obtained from: NetBSD
Sascha Wildner [Thu, 6 Sep 2018 00:57:10 +0000 (02:57 +0200)]
kernel: Fix some -Wint-in-bool-context warnings.
I.e., stop treating integers like booleans. In ix(4) I commented out
a problematic function that returns bool but tries to return -1 if
there was an error.
Imre Vadász [Tue, 4 Sep 2018 20:47:17 +0000 (22:47 +0200)]
kernel - Avoid a race between dfly_schedulerclock and usched_dfly_cpu_init.
* This race was repeatedly occuring during startup, running with multiple
virtual cpu cores in qemu (using TCG emulation on a DragonFly host).
Sascha Wildner [Tue, 4 Sep 2018 22:00:00 +0000 (00:00 +0200)]
kernel/gcc80: Add -Werror to the kernel and module builds.
Antonio Huete Jimenez [Tue, 4 Sep 2018 14:23:52 +0000 (07:23 -0700)]
nrelease/Makefile: Use net/isc-dhcp44-server
Sascha Wildner [Tue, 4 Sep 2018 07:59:53 +0000 (09:59 +0200)]
gcc80: Fix manual page links for the primary compiler.
Taken-from: zrj
Sascha Wildner [Tue, 4 Sep 2018 07:38:01 +0000 (09:38 +0200)]
gcc80: Clean up two Makefiles a bit (no functional change).
Based-on: zrj's work
Sascha Wildner [Tue, 4 Sep 2018 06:38:59 +0000 (08:38 +0200)]
More gcc80 adjustments.
Nothing spectacular.
Taken-from: zrj
Markus Pfeiffer [Mon, 3 Sep 2018 23:29:36 +0000 (23:29 +0000)]
kernel: unbreak buildkernel
Sascha Wildner [Mon, 3 Sep 2018 20:15:57 +0000 (22:15 +0200)]
gcc80: Enable -Werror for gcc80. Temporarily lower libpam's WARNS to 2.
The Resedacea upgrade introduced a warning which I'll fix later.
Matthew Dillon [Mon, 3 Sep 2018 20:14:54 +0000 (13:14 -0700)]
kernel - Fix missing brelse() in error path
* Fix missing brelse() in nvtruncbuf() in error path
Reported-by: myu
Matthew Dillon [Mon, 3 Sep 2018 17:25:35 +0000 (10:25 -0700)]
World - Change default compiler from gcc-5 to gcc-8
* Change the default compiler from gcc-5 to gcc-8.
gcc-5 will no longer be built by default. Setting
WORLD_ALTCOMPILER=all will build all three as before.
* Create CC hardlink for gcc80 so dports picks it up.
gcc80 is now the default for dports instead of 50.
* Adjust the Makefile's to make things easier the next time,
though they could still use more work.
Sascha Wildner [Sun, 2 Sep 2018 10:13:13 +0000 (12:13 +0200)]
dfregress(8): Use mkostemp() instead of mktemp() to fix some warnings.
François Tigeot [Sat, 1 Sep 2018 06:34:40 +0000 (08:34 +0200)]
drm/linux: Rewrite READ_ONCE() and WRITE_ONCE()
These macros were broken when used with some complex types like
pointers to pointers.
Matthew Dillon [Thu, 30 Aug 2018 05:10:49 +0000 (22:10 -0700)]
kernel - Fix a third missing wakeup() in kern_lock.c
* Fix a case where an lockmgr LK_EXCLUSIVE call with a
timeout blocks due to existing shared locks. If the
timeout occurs, the exclusive lock request is backed out.
However, if any new shared locks are attempted while
the EXREQ was pending (due to the exclusive priority
mechanism), those threads will block. The backout code
was not waking the blocked threads up for this situation.
* Fixed by issuing the wakeup() unconditionally for this
case. This is not a heavily traveled code path as locks
with timeouts rarely reach the actual timeout.
Aaron LI [Thu, 30 Aug 2018 13:36:07 +0000 (21:36 +0800)]
if_tun: Disallow to destroy an opened device
When a tun device (created via 'ifconfig') is opened, disallow to destroy
it (e.g., ifconfig destroy). Otherwise, a panic occurs when the caller
closes the device, since it has been already destroyed.
Following the previous fix to if_tap.
Aaron LI [Thu, 30 Aug 2018 13:13:27 +0000 (21:13 +0800)]
if_tap: Disallow to destroy an opened device
When a tap device (created via 'ifconfig') is opened, disallow to destroy
it (e.g., ifconfig destroy). Otherwise, a panic occurs when the caller
closes the device, since it has been already destroyed.
Test case:
[A]% ifconfig tap0 create
[B]% # run a program that opens '/dev/tap0' and keep it running
[A]% ifconfig tap0 destroy
[B]% # exit the program which will then close '/dev/tap0'
=> panic!
In addition:
* Add an assertion to tapclose() to assert the device must exist.
* Return EINVAL instead of ENOIX when try to destroy an manually created
tap device.
* Improve the function description a bit.
Matthew Dillon [Wed, 29 Aug 2018 17:11:34 +0000 (10:11 -0700)]
vkernel64 - Fix build
* Add missing CPUID_TO_APICID() macro which vm_page.c now needs.
Reminded-by: swildner
Matthew Dillon [Sun, 26 Aug 2018 18:52:59 +0000 (11:52 -0700)]
kernel - Fix startup race in usched_dfly
* Use a master configuration lock for usched_dfly's thread
creation, ensuring that no thread tries to check dfly_pcpu[]
until the whole thing has been initialized.
* Fixes occassional panic in usched_dfly on boot on many-cores
systems due to a lower-numbered usched thread triggering before
dfly_pcpu is completely initialized.
Matthew Dillon [Sat, 25 Aug 2018 17:10:08 +0000 (10:10 -0700)]
tmpfs - Fix rare deadlock
* Fix a deadlock which can occur between umount and tmpfs, and
possibly in other very rare situations.
* tmpfs holds the directory node locked when resolving a directory
entry. This results in a lock order reversal between the
directory's tmpfs_node lock and the vnode being locked.
Fixed by using a NOWAIT/UNLOCK/SLEEPFAIL/RETRY sequence.
Peeter Must [Tue, 28 Aug 2018 13:26:05 +0000 (16:26 +0300)]
kernel/apple_gmux: Unbreak loading i915.
* Commit
183e2373896e4ea605435a6bd8f943e8273bf8cd broke loading i915
on Apple MacBookPro laptops with dual GPUs and the gmux chip. The
reason is that whereas formely drm_init_pdev() and drm_fill_pdev()
where mere bookkeeping routines, the above commit relocates
assignment of irq from drm_drv.c:drm_attach() to drm_fill_pdev().
Since apple_gmux is loaded before i915, and apple_gmux initializes
a pdev structure including an irq for the graphics pci device, the
i915 which is loaded afterwards will get zero for an irq and hence
fails to attach.
* The temporary fix is to disable apple_gmux initializing a pci_dev
structure for bookkeeping purposes. This is not needed at the
moment since the primary purpose of apple_gmux is to switch to iGPU
so the user is not left with a frozen screen after loading i915. We
do not support switching between GPUs yet.
* When and if the initialization of graphics pci devices becomes
independent from the drm subsystem, we can make apple_gmux aware of
the various GPUs in the system.
Matthew Dillon [Fri, 24 Aug 2018 18:29:22 +0000 (11:29 -0700)]
docs - Update tuning.7
* Minor update to tuning.7.
Matthew Dillon [Fri, 24 Aug 2018 07:19:18 +0000 (00:19 -0700)]
kernel - Fix two missing wakeup()s in kern_lock.c
* Fix two cases where a shared lock request could block forever due
to missing wakeups for certain specific combinations of request flags.