dragonfly.git
6 years agorcp(1): Staticize.
Sascha Wildner [Sat, 9 Dec 2017 07:57:02 +0000 (08:57 +0100)]
rcp(1): Staticize.

6 years agopwd(1): Staticize, remove void cast.
Sascha Wildner [Sat, 9 Dec 2017 07:47:50 +0000 (08:47 +0100)]
pwd(1): Staticize, remove void cast.

6 years agoAdd dports-download-check target
Pierre-Alain TORET [Wed, 29 Nov 2017 09:16:42 +0000 (10:16 +0100)]
Add dports-download-check target

Signed-off-by: Pierre-Alain TORET <pierre-alain.toret@protonmail.com>
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/3053>

6 years agodrm/radeon: Prevent a crash on load with newer drm code
François Tigeot [Fri, 8 Dec 2017 21:57:34 +0000 (22:57 +0100)]
drm/radeon: Prevent a crash on load with newer drm code

* The existing drm/radeon code base contained an invalid unlock/lock
  sequence in radeon_irq_kms_init() which caused the kernel to crash
  during driver initialization with the drm code base from Linux 4.8

* Fixed by replacing the problematic function with its version from
  Linux 4.8

6 years agokernel/evdev: Fix Makefile permission.
Sascha Wildner [Fri, 8 Dec 2017 14:45:08 +0000 (15:45 +0100)]
kernel/evdev: Fix Makefile permission.

6 years agokernel - Add evdev support to kbdmux, ukbd and ums
Peeter Must [Fri, 8 Dec 2017 12:17:22 +0000 (14:17 +0200)]
kernel - Add evdev support to kbdmux, ukbd and ums

* Allows kbdmux, ukbd and ums to send input events to evdev if kernel
  is built with evdev support.

* The sysctl kern.evdev.rcpt_mask determines which drivers are allowed
  to send events to evdev. Its default value is 3, meaning that kbdmux
  and sysmouse are enabled. Since the latter is not yet supported, one
  might want to change the value to 6 (kbdmux and ums) until sysmouse
  will be added.

Obtained-from: FreeBSD

6 years agokernel - Bring in evdev from FreeBSD
Peeter Must [Fri, 8 Dec 2017 10:43:27 +0000 (12:43 +0200)]
kernel - Bring in evdev from FreeBSD

* This is a port of evdev, the generic input event interface, from
  FreeBSD. Wikipedia: "Evdev generalizes raw input events from device
  drivers and makes them available through character devices in the
  /dev/input/ directory."

* It is currently considered experimental since in rare cases it may cause
  kernel crash when a device, e.g. usb mouse or keyboard, is detached
  while a userland program reading from the corresponding input/eventX
  device.

* In order to enable evdev, kernel needs to be rebuilt with 'device evdev'
  and 'options EVDEV_SUPPORT'. For debugging, add 'options EVDEV_DEBUG'.

* At present, only ums, kbd and kbdmux can send events to their respective
  input/eventX devices. More drivers will be added in due course. The sysctl
  kern.evdev.rcpt_mask determines which drivers send events to evdev.

6 years agokernel - Fix crash when cdev is destroyed
Peeter Must [Fri, 8 Dec 2017 09:53:22 +0000 (11:53 +0200)]
kernel - Fix crash when cdev is destroyed

* If a device is destroyed while a userland program is blocked
  in a read() or device ioctl, the underlying node will be deleted.
  Returning EIO will prevent kernel from crashing.

* This is a temporary hack until a better solution is found.

6 years agotmpfs - Correct some timestamp update issues
Matthew Dillon [Fri, 8 Dec 2017 02:20:49 +0000 (18:20 -0800)]
tmpfs - Correct some timestamp update issues

* write() was updating ACCESSED and MODIFIED when it should only
  be updating MODIFIED.

* unlink() (aka rm) was updating CHANGE, ACCESSED, and MODIFIED
  which would be visible if a file has multiple links.  It should
  only update the CHANGE time.

* rmdir() was doing the same thing as UNLINKED.  Fixed this too,
  but the bug would not be readily visible anyway since directories
  cannot be hardlinked.  However, fstat() on an open descriptor
  would still reveal it.

6 years agoddb.4: Document i command addition.
zrj [Thu, 7 Dec 2017 09:06:17 +0000 (11:06 +0200)]
ddb.4: Document i command addition.

While there, document call and reset commands too.

6 years agokernel - Improve contiguous DMA memory allocation
Matthew Dillon [Thu, 7 Dec 2017 03:09:20 +0000 (19:09 -0800)]
kernel - Improve contiguous DMA memory allocation

* vm_page_alloc_contig() will use vm_page_alloc() for degenerate
  requests instead of the free page reserve.  This case often
  occurs when called from kmem_alloc_attr().

* vm_contig_pg_alloc() will scan the VM page queues first for
  unrestricted memory requests, falling back to vm_page_alloc_contig()
  if this fails.

  vm_contig_pg_alloc() will call vm_page_alloc_contig() first if the
  memory request has an address range restriction, falling back to
  a VM page queue scan if it fails.

* This should hopefully reduce instances where device drivers probed
  prior to e.g. NATA eat up all available low-memory DMA space,
  leaving none for NATA (or other drivers) that might need low-memory
  DMA space.

6 years agokernel - Fix ranging test in memory probe, adjust memory test (2)
Matthew Dillon [Wed, 6 Dec 2017 18:51:28 +0000 (10:51 -0800)]
kernel - Fix ranging test in memory probe, adjust memory test (2)

* Correct bug in ranging test commit.

6 years agokernel - Fix vmstats.v_dma_pages
Matthew Dillon [Wed, 6 Dec 2017 08:23:16 +0000 (00:23 -0800)]
kernel - Fix vmstats.v_dma_pages

* Fix an atomic adjustment on v_dma_pages that we believe was
  messing it up, due to not sign-extended a negation of an unsigned
  field.

Reported-by: swildner
6 years agokernel - Fix hw.usermem, hw.physmem, hw.availpages
Matthew Dillon [Wed, 6 Dec 2017 07:00:22 +0000 (23:00 -0800)]
kernel - Fix hw.usermem, hw.physmem, hw.availpages

* Fix the hw.usermem, hw.physmem, and hw.availpages sysctls.
  Some of these were improperly 32-bit sysctls when they need
  to be 64-bits, causing silly values to be returned on
  machines with more than 2G of ram.

Reported-by: zrj
6 years agokernel - Adjust vfs.nbuf, kern.maxvnodes, and debug.max_softdeps counts
Matthew Dillon [Wed, 6 Dec 2017 04:11:51 +0000 (20:11 -0800)]
kernel - Adjust vfs.nbuf, kern.maxvnodes, and debug.max_softdeps counts

* Cap some system limits on machines with tons of memory.

* vfs.nbuf is capped at roughly 350,000 buffer cache buffers.  This
  also caps buffer cache data to approximately 11G.

  The reason for this is to avoid wiring too much physical memory in
  the default configuration since programs might want to use the
  memory fo r other purposes.  Buffer cache buffers provide very fast
  access when reading data from cached vnodes, but the new KVABIO ABI
  will soon allow us to acquire and dispose of such buffers more
  efficiently, increasing the efficiency of accessing data cached via
  the block device and making long-term caching via vnode-backed
  buffers somewhat less important.

* kern.maxvnodes is capped at approximately 3 million vnodes.  This
  can be set higher at run-time via a sysctl, if desired.

  NOTE: Our go-to filesystems are designed to or can be set to cache
file data via the block device instead of the vnode, which is
preferable on systems with lots of memory.  vnode caching is
still important, but a bit less so now than in prior years.

* debug.max_softdeps is capped at 1000000, because even a million
  is an obscenely high value for softdep structures.

6 years agokernel - Fix ranging test in memory probe, adjust memory test
Matthew Dillon [Wed, 6 Dec 2017 02:17:53 +0000 (18:17 -0800)]
kernel - Fix ranging test in memory probe, adjust memory test

* Fix a ranging test in the memory probe code.  The 'incr' value can
  potentially skip over blacked-out areas of memory and thus accidently
  include them in the range.

* We no longer exhaustively test memory.  Instead, just test the first
  and last page for each range.

6 years agokernel - add 'i' command to ddb
Matthew Dillon [Tue, 5 Dec 2017 23:29:00 +0000 (15:29 -0800)]
kernel - add 'i' command to ddb

* Add the 'i' command, which just issues a cpu_invltlb() on the
  current cpu.  Useful when testing MMU/PMAP issues.

6 years agoefisetup - Correct bugs
Matthew Dillon [Tue, 5 Dec 2017 22:40:22 +0000 (14:40 -0800)]
efisetup - Correct bugs

* nvme0 was hardwired in one place, use ${drive}.  This fixes
  issues with efisetup not working on e.g. drives other than nvme0.

* Use -f in the newfs_hammer to avoid complaints about small
  partition sizes.

6 years agodrm/linux: Improve linux/pci.h
François Tigeot [Tue, 5 Dec 2017 20:52:31 +0000 (21:52 +0100)]
drm/linux: Improve linux/pci.h

* Add pci_get_drvdata and pci_set_drvdata()

* Add pci_register_driver()

6 years agofdc(4): Check return error from isa_dma_init().
zrj [Tue, 5 Dec 2017 10:49:16 +0000 (12:49 +0200)]
fdc(4): Check return error from isa_dma_init().

Must have been a bad sector in
0bc821c68ba308f17d4f0a7bfd300c432d575a09

Reported-by: dcb <https://bugs.dragonflybsd.org/issues/3108>
6 years agokernel/ipfw3: Minimal K&R cleanup.
Sascha Wildner [Tue, 5 Dec 2017 09:46:57 +0000 (10:46 +0100)]
kernel/ipfw3: Minimal K&R cleanup.

6 years agolibcipher: Minimal K&R cleanup.
Sascha Wildner [Tue, 5 Dec 2017 09:45:11 +0000 (10:45 +0100)]
libcipher: Minimal K&R cleanup.

6 years agolibcrypt: K&R cleanup.
Sascha Wildner [Tue, 5 Dec 2017 09:43:43 +0000 (10:43 +0100)]
libcrypt: K&R cleanup.

6 years agolibcrypt: Remove some __STDC__ checks.
Sascha Wildner [Tue, 5 Dec 2017 09:43:16 +0000 (10:43 +0100)]
libcrypt: Remove some __STDC__ checks.

6 years agortld - Fix ifunc relocations
Matthew Dillon [Tue, 5 Dec 2017 08:14:20 +0000 (00:14 -0800)]
rtld - Fix ifunc relocations

* ifunc relocations had a bug that caused an immediate seg-fault.
  Apparently this type of relocation is not used very much, we've
  never encountered it before.  But the qemu port uses it.

* Fix the bug.  Basically missing lockstate and the top level in
  rtld was expected to hold the bind lock.

6 years agoRemove some orphaned externs.
Sascha Wildner [Tue, 5 Dec 2017 08:05:52 +0000 (09:05 +0100)]
Remove some orphaned externs.

6 years agokernel - Correct vm_map_entry_reserve() call depth issue w/vkernel
Matthew Dillon [Mon, 4 Dec 2017 23:43:13 +0000 (15:43 -0800)]
kernel - Correct vm_map_entry_reserve() call depth issue w/vkernel

* vm_map was making vaddr tests against VM_MAX_USER_ADDRESS to
  determine when to call vm_map_entry_reserve().  This test works
  fine on real hardware but will not work properly for a vkernel.

* Instead, just use td_nest_count to prevent excessive recursion,
  or test against &kernel_map when necessary.

* Fixes SIGILL in vkernel due to stack overflow.

Reported-by: tuxillo
6 years agolibc - Adjust comment
Matthew Dillon [Mon, 4 Dec 2017 20:26:47 +0000 (12:26 -0800)]
libc - Adjust comment

* Adjust comment for dmalloc.c

6 years agodebug - Adjust kmapinfo
Matthew Dillon [Mon, 4 Dec 2017 20:25:27 +0000 (12:25 -0800)]
debug - Adjust kmapinfo

* Use formatnum() for kmapinfo's segment size output when
  printing EMPTY segments.  This makes the output more readable.

6 years agokernel - Expand physical memory support to 64TB
Matthew Dillon [Mon, 4 Dec 2017 07:50:07 +0000 (23:50 -0800)]
kernel - Expand physical memory support to 64TB

* Make NKPML4E truly programmable and change the default from 1
  PDP page to 16 PDP pages.  This increases KVM from 512G to
  8TB, which should be enough to accomodate a maximal 64TB
  configuration.

  Note that e.g. 64TB of physical ram certainly requires more
  than one kernel PDP page, since the vm_page_array alone
  would require around 2TB, never mind everything else!

  PDP entries in the PML4E (512 total @ 512GB per entry):
256 User space
112 (unused, avail for NKPML4E)
128 DMAP (64TB max physical memory)
 16 KVM NKPML4E default (8TB) (recommend 64 max)

* Increase the DMAP from 64 PDP pages to 128 PDP pages, allowing
  support for up to 64TB of physical memory.

* Changes the meaning of KPML4I from being 'the index of the only
  PDP page in the PML4e' to 'the index of the first PDP page in
  the PML4e'.  There are NKPML4E PDP pages starting at index KPML4I.

* NKPDPE can now exceed 512.  This is calculated to be the maximmum
  number of PD pages needed for KVM, which is now (NKPML4E*NPDPEPG-1).

  We now pre-allocate and populate only enough PD pages to accomodate
  the page tables we are pre-installing.  Those, in turn, are calculated
  to be sufficient for bootstrapping mainly vm_page_array and a large
  initial set of pv_entry structures.

* Remove nkpt, it was not being used any more.

6 years agokernel - Remove DISABLE_PSE option and related code
Matthew Dillon [Mon, 4 Dec 2017 03:06:03 +0000 (19:06 -0800)]
kernel - Remove DISABLE_PSE option and related code

* Remove the DISABLE_PSE option and related code.  Note that the pmap
  code was already forcing DISABLE_PSE since we are 64-bit only and
  the pmap code never supported PSE anyway.

6 years agovmstat(8): Change few printf formats for -s.
zrj [Mon, 4 Dec 2017 10:02:16 +0000 (12:02 +0200)]
vmstat(8): Change few printf formats for -s.

Catch up with b7ea2f3f550021bfaabd8ed8d50b54c157fb55bf

6 years agoFix mdoc issues in various manual pages.
Sascha Wildner [Mon, 4 Dec 2017 08:25:32 +0000 (09:25 +0100)]
Fix mdoc issues in various manual pages.

6 years agokernel - Expand page count fields to 64 bits
Matthew Dillon [Mon, 4 Dec 2017 01:14:15 +0000 (17:14 -0800)]
kernel - Expand page count fields to 64 bits

* 32 bit page count fields limit us to 8TB of ram.  Expand to allow
  up to the DMAP limit (32TB).  Do an initial pass on various page
  count fields and change them from int's to long's or vm_pindex_t's.

* Fix a 32-bit overflow in the pv_entry initialization code.

  pv_entry_max = shpgperproc * maxproc + vm_page_array_size;
  2000 * 1046516 + pages_of_phys_memory;

  maxproc is 1046516 @ 512GB.  This calculation overflows its 32
  bit signed variable somewhere between 256G and 512G of ram.  This
  can lead to a zinitna() allocation in pvzone that is much too
  large.

Reported-by: zrj
6 years agotest/vkernel - Add hammer2 support
Antonio Huete Jimenez [Mon, 4 Dec 2017 00:55:05 +0000 (16:55 -0800)]
test/vkernel - Add hammer2 support

- Fix fstab and loader.conf settings.

6 years agodrm/linux: Implement sort()
François Tigeot [Sun, 3 Dec 2017 10:31:41 +0000 (11:31 +0100)]
drm/linux: Implement sort()

6 years agodrm/linux: Fix linux/dma-mapping.h compilation...
François Tigeot [Sun, 3 Dec 2017 09:32:58 +0000 (10:32 +0100)]
drm/linux: Fix linux/dma-mapping.h compilation...

... with the drm/i915 codebase from Linux 4.8

* Move functions from .h to .c files in order to hide their implementations

* This avoids leaking DragonFly headers to Linux code or Linux headers
  to DragonFly code with associated bad side-effects like type redefinitions

6 years agodrm/linux: Add i2c_get_adapdata and i2c_set_adapdata()
François Tigeot [Sun, 3 Dec 2017 07:15:04 +0000 (08:15 +0100)]
drm/linux: Add i2c_get_adapdata and i2c_set_adapdata()

6 years agodrm/linux: Add system_unbound_wq
François Tigeot [Sun, 3 Dec 2017 06:37:04 +0000 (07:37 +0100)]
drm/linux: Add system_unbound_wq

6 years agosyscons: Unbreak compile w/o splash
Sepherosa Ziehau [Sat, 2 Dec 2017 17:13:43 +0000 (01:13 +0800)]
syscons: Unbreak compile w/o splash

6 years agohammer2 - Fix indefinite dirty chains due to rename
Matthew Dillon [Sat, 2 Dec 2017 19:06:30 +0000 (11:06 -0800)]
hammer2 - Fix indefinite dirty chains due to rename

* Do not call cache_setunresolved() on tnch before calling
  cache_rename().  Doing so prevents cache_rename() from properly
  setting VREF_FINALIZE on the vnode.  Since the deleted inode is
  no longer in the chain hierarchy the related chains can remain
  dirty indefinitely (until the vnode is reused or the filesystem
  is unmounted).

* This fixes inmem dirty chain accounting and 'chnmem' stalls.

6 years agohammer2 - optimize hammer2_pfs_memory_wakeup()
Matthew Dillon [Sat, 2 Dec 2017 19:05:58 +0000 (11:05 -0800)]
hammer2 - optimize hammer2_pfs_memory_wakeup()

* Optimize hammer2_pfs_memory_wakeup() to use fetchadd instead of
  cmpset, reducing contention.

6 years agohammer2 - Fix rename race
Matthew Dillon [Sat, 2 Dec 2017 09:02:59 +0000 (01:02 -0800)]
hammer2 - Fix rename race

* Fix a rename race in hammer2 which can result in unwanted namecache
  overloading.  When this occurs, a rename operation can wind up
  deleting the same inode more than once.

* This fixes a "hammer2_chain_getparent: no parent" panic in H2.

Reported-by: kerma
6 years agotop(1): Avoid segfaults on systems with more cores.
zrj [Sat, 2 Dec 2017 17:44:42 +0000 (19:44 +0200)]
top(1): Avoid segfaults on systems with more cores.

Fixes segfaults on 110 cpu core setup for top -M usage.

6 years agosystat(1): Print VNODE PAGER.
zrj [Sat, 2 Dec 2017 17:41:04 +0000 (19:41 +0200)]
systat(1): Print VNODE PAGER.

Looks a bit better.

6 years agohammer2(8): Document cleanup command.
zrj [Sat, 2 Dec 2017 17:40:08 +0000 (19:40 +0200)]
hammer2(8): Document cleanup command.

While there, do some misc whitespace cleanup.

6 years agokernel/vfs: Avoid diagnostic line breaks.
zrj [Sat, 2 Dec 2017 17:38:46 +0000 (19:38 +0200)]
kernel/vfs: Avoid diagnostic line breaks.

6 years ago<sys/systm.h>: Remove bcopyb() prototype.
Sascha Wildner [Sat, 2 Dec 2017 11:49:45 +0000 (12:49 +0100)]
<sys/systm.h>: Remove bcopyb() prototype.

It was a i386 specific function which was removed in f4c88b0b86f1810.

Reported-by: zrj
6 years agopthread_join.3: Document pthread_timedjoin_np() (taken from FreeBSD).
Sascha Wildner [Sat, 2 Dec 2017 08:55:05 +0000 (09:55 +0100)]
pthread_join.3: Document pthread_timedjoin_np() (taken from FreeBSD).

6 years agopthread_mutex_*.3: Add {get,set}prioceiling to SEE ALSO.
Sascha Wildner [Sat, 2 Dec 2017 07:57:03 +0000 (08:57 +0100)]
pthread_mutex_*.3: Add {get,set}prioceiling to SEE ALSO.

6 years agopf.os: Add OpenBSD:6.1
Eitan Adler [Sat, 2 Dec 2017 06:24:18 +0000 (22:24 -0800)]
pf.os: Add OpenBSD:6.1

Obtained From: OpenBSD

6 years agokernel - Increase syscons history buffer size
Matthew Dillon [Sat, 2 Dec 2017 02:56:06 +0000 (18:56 -0800)]
kernel - Increase syscons history buffer size

* Increase syscons history from 4 screens to 10 screens
  (4*rows to 10*rows).

6 years agokernel - Fix CAM unit allocation race
Matthew Dillon [Sat, 2 Dec 2017 02:52:27 +0000 (18:52 -0800)]
kernel - Fix CAM unit allocation race

* Fix an issue where multiple targets can sometimes allocate the
  same unit when probed asynchronously.  The search and insertion
  functions were being independently locked.

6 years agoRevert "Remove advertising clause from pr(1)"
Eitan Adler [Fri, 1 Dec 2017 21:29:50 +0000 (13:29 -0800)]
Revert "Remove advertising clause from pr(1)"

This reverts commit 4586ab4e1609825eb2d4503c92578933c3479239.

See https://www.mail-archive.com/svn-src-all@freebsd.org/msg153666.html

6 years agosyscons - Partly implement FBIO_BLANK ioctl, for display powersaving.
Imre Vadász [Sat, 25 Nov 2017 17:25:54 +0000 (18:25 +0100)]
syscons - Partly implement FBIO_BLANK ioctl, for display powersaving.

* Only implement the parts relevant for display powersaving when a KMS
  graphics driver is loaded. Adjust the existing V_DISPLAY_* constant
  definitions to match the corresponding definitions in FreeBSD.

6 years agoMinor fixes to pr(1)
Eitan Adler [Thu, 30 Nov 2017 08:02:23 +0000 (00:02 -0800)]
Minor fixes to pr(1)

Obtained-from: FreeBSD

6 years agoAdd 'const' where appropriate in pr(1)
Eitan Adler [Thu, 30 Nov 2017 07:45:12 +0000 (23:45 -0800)]
Add 'const' where appropriate in pr(1)

6 years agoRemove advertising clause from pr(1)
Eitan Adler [Thu, 30 Nov 2017 07:35:33 +0000 (23:35 -0800)]
Remove advertising clause from pr(1)

Permitted by https://www.freebsd.org/copyright/license.html
Renumber 4->3 to be consistent with other files

6 years agoAdd static to variables in pr(1)
Eitan Adler [Thu, 30 Nov 2017 06:59:17 +0000 (22:59 -0800)]
Add static to variables in pr(1)

6 years agolibpthread: Document some more functions.
Sascha Wildner [Thu, 30 Nov 2017 07:26:00 +0000 (08:26 +0100)]
libpthread: Document some more functions.

Specifically:

pthread_condattr_getclock()           (Taken-from: FreeBSD)
pthread_condattr_getpshared()         (Taken-from: FreeBSD)
pthread_condattr_setclock()           (Taken-from: FreeBSD)
pthread_condattr_setpshared()         (Taken-from: FreeBSD)
pthread_mutex_getprioceiling()        (Taken-from: NetBSD)
pthread_mutex_setprioceiling()        (Taken-from: NetBSD)
pthread_mutexattr_getpshared()
pthread_mutexattr_setpshared()

6 years agolibpthread: Add pthread_mutex_timedlock() reference to some manual pages.
Sascha Wildner [Thu, 30 Nov 2017 07:12:32 +0000 (08:12 +0100)]
libpthread: Add pthread_mutex_timedlock() reference to some manual pages.

6 years agolibpthread: Sort a few things in the Makefile.
Sascha Wildner [Thu, 30 Nov 2017 06:55:18 +0000 (07:55 +0100)]
libpthread: Sort a few things in the Makefile.

6 years agogames: Make benefits for the glorious curses lib.
zrj [Wed, 29 Nov 2017 15:58:14 +0000 (17:58 +0200)]
games: Make benefits for the glorious curses lib.

Consolidate all private ncurses handling in top level Makefile.inc in games/.
Will simplify upcoming base ncurses library update.

While there, perfom the same for private crypto lib even if it a single case.

6 years agofortune(6): Pre-emptive CENSORSHIP.
zrj [Wed, 29 Nov 2017 15:36:41 +0000 (17:36 +0200)]
fortune(6): Pre-emptive CENSORSHIP.

First let's get it straight. It is censorship and let's not sugar coat it.

The FO has fallen, N is falling and naturally we are next.
I'm only doing this to prevent certain discussions taking place on the mailing
lists or irc over the holidays and to explictly show irony of all this ${thing}.
It is SAD to see that various projects went from technical to being PC infested.
So much for being the flagmans of OSS developments & examples to other projects.
                   (slow ironic clapping insert here)
Such slabnij individuals with "hurt feelings" always are causing developers to
get distracted from their hacking on source or making hardware work properly.
Also, these actions opens up the door wider for "other" topics into discussions.

I'm not going to mention the name of certain evil* person so that this would not
get "flagged". Absurdity is already way beyond any reasonable levels. Clearly
there are some perpetually offended snoflakes, who have nothing better to do
other than look for ways to get offended or to trigger other people in real life
and over the internet. Why not just choose one? If someone wants to let some
accumulated steam off, there are places over the internet where one can have a
constructive conversation about certain topics. If you can not handle the raw,
unredacted, straight opinions, you must be new there, please kindly go back to
reddit safe spaces. Just do *not* bring those talks over into the projects!
It is very likely that not everybody feels the same or even cares.
This is literally "Look what you made me do!", so here we go.

I'm going to consider cookies removal *only* and *only* if some things are
declared illegal by the country/state law with a reference to look it up where
it clearly states what is illegal to quote (including if that applies to the
translated text variants). No "probably" stuff. Either it's illegal or it's not.
If you are not sure, you should consult with your country/state lawyers first.

By going trough MSM and lists it is clear that some find offensive *not* the
quotes by itself but the mere mention of certain letter combinations. Since I do
not share identical ideology as most westerners (I was born in 19 88, USSR, and
with collapse of Soviet union and 19 91 events my fundation is a different myth)
I'm expanding "grep ${pattern} datfiles/fortune" to include Stalin for lulz too.
Many Lithuanians and Ukrainians find "admirating" that historic figure offensive
too, mainly because of "free" trips to Siberia, brothers and sisters separated
from parents, etc. Still it is not for me to judge the history nor rewrite it.

For now I'm keeping all Communism/Capitalism cookies just as a satire. But I'm
moving the qoute by Adolfo Guzman too, cause "sorry it matched the patternTM".
Doing this solves the following issues:
  * does not single out any specific individual (just a pattern right?);
  * clearly expresses irony and shows how some are so biased and have no
    understanding that their actions have consequences.

If for some reason you still find something offensive, check out "man 6 fortune"
for "-o" flag. Of course, if (for some reason) you do not want the potentially
"offensive" aphorisms on your disk, you can opt out:
  * echo 'INSTALL_OFFENSIVE_FORTUNES=NO\!\!\!\!' >> /etc/make.conf
  * standard buildworld/installworld
  * make upgrade
and problem solved.

If still find things like fortune(6), hangman(6), pig(6) or maybe even tetris(6)
"offensive", set NO_GAMES=YES and get rid of all games distrib (I don't judge).
Since we are source based distribution (and no, BSD does *not* stand for Binary
Software Distribution) we provide installation images just for convenience. We
do not support binary base upgrades, only the standard source tree build ones.

To be clear, I had some of these fortune cookies added over a year ago in:
 6c5aea60b8d9d163c6caa536036e82e7472b84bc and nobody so far complained about it.
It is still very strange that previously those were OK. So what has changed now?

What if I'm offended by software bugs? Should I remove that sofware or try to
fix it? What if someone is offended by the license say GPL, CDDL or even Apache?
So far censorship applies only to games/fortune/.

All of this is just something to think about & no further talks will take place.
Respect others and respect yourself. Also, don't get offended to get offended.
I can only hope that infinity will forgive me, but this needs to be done.

6 years agokernel: Make floppies work again.
zrj [Tue, 28 Nov 2017 11:44:44 +0000 (13:44 +0200)]
kernel: Make floppies work again.

Revive the old x86 32bit only fdc(4) driver, it only needs just a few changes.
The fdc was never ported to work on x86_64 DragonFly, so rather than remove it
together with its manpage, fix few things and hook it to LINT64 config so that
we would keep track the state of it and not keep it in a dusty corner of sys/.

On modern x86_64 systems fdc($) has little value and it is getting harder and
harder to find floppy drives that work or even the motherboards that still have
the FDD headers to hook the 34pin ribbon cable, but I feel nostalgic about the
scratching noises the floppy drive makes while performing the operations.
So went through all storage closets and find one that works, blew out all the
accumulated dusts, cleaned the magnetic heads with a folder paper tissue good.
The hardest part was to find a floppy disk. Only could find just a single one
stashed away deep on the floor of a very old safe under heeps of old documents.

For fdc(4) to actually work, some adjustmens to isa_dma.c were needed because
of how ISA bus probing is done in platform/pc64/x86_64/autoconf.c. To work
around the exhaustion of low DMA memory before it gets to isa_probe_children()
now try to preallocate contiguous buffer of 512KB and free it just before the
probe of ISA bus. This should help any legacy ISA drivers(including ppc(4))
or even some of more picky drivers that are not built in into the kernel.

For case where isa_dmainit() would still fail to allocate the buffer fitting
the requirements, have added the safety checks and explicit fallback to non
DMA mode by setting the FDC_NODMA flag to avoid panics on "bad bounce buffer".
Floppy drive would not work properly, but it is this versus a panic. There are
other issues too. For some reason some files tend to be read with stripes of
zeros, but write operations seems to work. Same floppy is readable on linux.

Currently can not debug the issue cause my floppy had seen better days:
_# time dd if=/dev/fd0 of=/tmp/recover.img conv=sync,noerror
...
dd: /dev/fd0: Input/output error
2880+0 records in
2880+0 records out
1474560 bytes transferred in 80.723953 secs (18267 bytes/sec)

while dmesg:
fd0: hard error reading offset 00000000ae00 for 512 (ST0 40<abnrml> ST1 20<bad_crc> ST2 20<bad_crc> cyl 2 hd 0 sec 16)
fd0: hard error reading offset 00000000f600 for 512 (ST0 40<abnrml> ST1 1<no_am> ST2 1<no_dam> cyl 3 hd 0 sec 16)
fd0: hard error reading offset 000000113800 for 512 (ST0 40<abnrml> ST1 20<bad_crc> ST2 20<bad_crc> cyl 61 hd 0 sec 9)
fd0: hard error reading offset 000000115c00 for 512 (ST0 44<abnrml,top_head> ST1 4<sec_not_fnd> ST2 10<wrong_cyl> cyl 61 hd 1 sec 9)
fd0: hard error reading offset 00000011a400 for 512 (ST0 44<abnrml,top_head> ST1 4<sec_not_fnd> ST2 0 cyl 62 hd 1 sec 9)
fd0: hard error reading offset 00000011ec00 for 512 (ST0 44<abnrml,top_head> ST1 4<sec_not_fnd> ST2 0 cyl 63 hd 1 sec 9)
fd0: hard error reading offset 000000123400 for 512 (ST0 44<abnrml,top_head> ST1 4<sec_not_fnd> ST2 0 cyl 64 hd 1 sec 9)
fd0: hard error reading offset 000000127c00 for 512 (ST0 44<abnrml,top_head> ST1 4<sec_not_fnd> ST2 0 cyl 65 hd 1 sec 9)

Given the state of my single floppy I cannot even do a proper newfs_msdos(8).
So maybe someone who has a collection of good floppies could give it a go.

While there, hook old musycc(4) driver to LINT64, it was fixed in:
906779c3d1e064e55bb019342ad6c1621cc04399

6 years agolibarchive: Revert commit that was not meant to be pushed.
Sascha Wildner [Tue, 28 Nov 2017 19:13:35 +0000 (20:13 +0100)]
libarchive: Revert commit that was not meant to be pushed.

6 years agolibc/nls: Use current locale (set by thread).
Sascha Wildner [Tue, 28 Nov 2017 18:34:23 +0000 (19:34 +0100)]
libc/nls: Use current locale (set by thread).

It was global locale always previously.

Taken-from:  FreeBSD (r304755)
Reported-by: xenu (also provided a test case)
6 years agodrm/linux: Add vmalloc_user() and vfree()
François Tigeot [Tue, 28 Nov 2017 17:21:03 +0000 (18:21 +0100)]
drm/linux: Add vmalloc_user() and vfree()

6 years agoix: Add missing source to conf/files.
zrj [Tue, 28 Nov 2017 14:41:49 +0000 (16:41 +0200)]
ix: Add missing source to conf/files.

Missed in 6150453f26f6ee01b60ce647b20bc8afcfc71c8e

6 years agoix: Sync with Intel's ix-3.2.17.
Sepherosa Ziehau [Sat, 11 Nov 2017 22:26:56 +0000 (06:26 +0800)]
ix: Sync with Intel's ix-3.2.17.

- Add several new chips.
- Add software workaround for 82598 errata #26.

6 years agodrm/linux: Add or improve various header files
François Tigeot [Mon, 27 Nov 2017 18:03:25 +0000 (19:03 +0100)]
drm/linux: Add or improve various header files

6 years agodrm/linux: Remove debugging messages
François Tigeot [Mon, 27 Nov 2017 09:22:32 +0000 (10:22 +0100)]
drm/linux: Remove debugging messages

6 years agokernel - Bring in definition of _IOWINT from FreeBSD.
Peeter Must [Mon, 27 Nov 2017 11:25:09 +0000 (13:25 +0200)]
kernel - Bring in definition of _IOWINT from FreeBSD.

* This is needed for evdev.

Obtained-from: FreeBSD

6 years agotcpdump(8): Reconfigure a bit after NO_CRYPT removal.
Sascha Wildner [Sun, 26 Nov 2017 13:11:17 +0000 (14:11 +0100)]
tcpdump(8): Reconfigure a bit after NO_CRYPT removal.

6 years agoRemove faith(4) and faithd(8) from the tree.
Sascha Wildner [Sat, 25 Nov 2017 21:01:12 +0000 (22:01 +0100)]
Remove faith(4) and faithd(8) from the tree.

FreeBSD did that 3 years ago (r274331). Quoting from their commit msg:

-----8<-----
It looks like industry have chosen different (and more traditional)
stateless/stateful NAT64 as translation mechanism. Last non-trivial
commits to both faith(4) and faithd(8) happened more than 12 years
ago, so I assume it is time to drop RFC3142 in FreeBSD.
----->8-----

Some more info here:

https://lists.freebsd.org/pipermail/freebsd-net/2014-October/040224.html

Discussed-with: sephe

6 years agoautofs: Add "noatime" to auto_master
Tomohiro Kusumi [Sat, 25 Nov 2017 18:02:47 +0000 (20:02 +0200)]
autofs: Add "noatime" to auto_master

FreeBSD@GitHub 708d95a2d6 e5253222e9

Note that in DragonFly "noatime" was never added to -media map.
("noatime" in -media map existed only for 1 day in FreeBSD)

6 years agoautofs: Add etc/autofs/include_nis
Tomohiro Kusumi [Sat, 25 Nov 2017 17:53:20 +0000 (19:53 +0200)]
autofs: Add etc/autofs/include_nis

FreeBSD@GitHub e9b93842e9

6 years agoautofs: Import FreeBSD@GitHub 7e6cabd06e
Tomohiro Kusumi [Sat, 25 Nov 2017 14:09:02 +0000 (16:09 +0200)]
autofs: Import FreeBSD@GitHub 7e6cabd06e

6 years agolock.9: lockcount() and lockcountnb() were removed in 3b6a19b26fb9c0e7918.
Sascha Wildner [Sat, 25 Nov 2017 14:20:17 +0000 (15:20 +0100)]
lock.9: lockcount() and lockcountnb() were removed in 3b6a19b26fb9c0e7918.

6 years agoRemove some duplicated includes.
Sascha Wildner [Sat, 25 Nov 2017 13:51:09 +0000 (14:51 +0100)]
Remove some duplicated includes.

6 years agohier.7: Adjust for recent changes.
Sascha Wildner [Sat, 25 Nov 2017 13:40:05 +0000 (14:40 +0100)]
hier.7: Adjust for recent changes.

6 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sat, 25 Nov 2017 13:39:47 +0000 (14:39 +0100)]
Update the pciconf(8) database.

October 21, 2017 snapshot from http://pciids.sourceforge.net/

6 years agokernel - Get rid of old KDSETRAD keyboard ioctl, and some __i386__ kbd code.
Imre Vadász [Fri, 24 Nov 2017 19:19:50 +0000 (20:19 +0100)]
kernel - Get rid of old KDSETRAD keyboard ioctl, and some __i386__ kbd code.

* The KDSETREPEAT ioctl was implemented as a replacement more than 18 years
  ago in 1999 (FreeBSD svn r44628).

6 years agomount_{smbfs,std,udf}: Use MOPT_NULL.
Sascha Wildner [Fri, 24 Nov 2017 15:24:40 +0000 (16:24 +0100)]
mount_{smbfs,std,udf}: Use MOPT_NULL.

6 years agoreboot.2: Remove obsolete BUGS section.
Sascha Wildner [Thu, 23 Nov 2017 20:18:13 +0000 (21:18 +0100)]
reboot.2: Remove obsolete BUGS section.

6 years agolibc - Use O_CLOEXEC in srandomdev()
Matthew Dillon [Wed, 22 Nov 2017 18:00:33 +0000 (10:00 -0800)]
libc - Use O_CLOEXEC in srandomdev()

* Specify O_CLOEXEC in srandomdev() to avoid descriptor leakages
  if called during a concurrent threaded fork().

6 years agoRemove various former kernel config options for good.
Sascha Wildner [Wed, 22 Nov 2017 14:06:23 +0000 (15:06 +0100)]
Remove various former kernel config options for good.

6 years agokernel: Remove old SHOW_BUSYBUFS kernel configuration option.
Sascha Wildner [Wed, 22 Nov 2017 13:47:44 +0000 (14:47 +0100)]
kernel: Remove old SHOW_BUSYBUFS kernel configuration option.

It was removed in 5e13112632fcc46beba13acf879e178aba56391c.

6 years agokernel: Remove <sys/inflate.h> inclusion from files that don't need it.
zrj [Wed, 22 Nov 2017 06:26:59 +0000 (08:26 +0200)]
kernel: Remove <sys/inflate.h> inclusion from files that don't need it.

The <sys/inflate.h> is only needed for:
 * sys/kern/imgact_gzip.c
 * sys/kern/inflate.c

6 years agoinet6: Remove few unneeded <net/zlib.h> headers.
zrj [Tue, 21 Nov 2017 15:57:31 +0000 (17:57 +0200)]
inet6: Remove few unneeded <net/zlib.h> headers.

No functional change.

6 years agokqueue: Fix kqueue(2) EVFILT_FS section
Tomohiro Kusumi [Tue, 21 Nov 2017 21:28:02 +0000 (23:28 +0200)]
kqueue: Fix kqueue(2) EVFILT_FS section

Fix 05d3db1bc901548d6335d701c773c537d4ef42fd.

EVFILT_FS filter currently does not use ident. It can be any value
to catch mount/umount.

FreeBSD kqueue(2) man page doesn't have description on EVFILT_FS
by the way, while the code was taken from FreeBSD for mount/umount.

6 years agokmalloc.9: Remove some obsolete information.
Sascha Wildner [Tue, 21 Nov 2017 14:24:22 +0000 (15:24 +0100)]
kmalloc.9: Remove some obsolete information.

6 years agoRevert "kprintf.9: Remove unneeded header."
Sascha Wildner [Tue, 21 Nov 2017 07:25:48 +0000 (08:25 +0100)]
Revert "kprintf.9: Remove unneeded header."

This reverts commit dbb5d235a84b2aa354a9d5745aa6a02ac9a26c50.

The header was actually useful because <sys/syslog.h> has the
priority definitions.

6 years agokprintf.9: Remove unneeded header.
Sascha Wildner [Tue, 21 Nov 2017 07:09:29 +0000 (08:09 +0100)]
kprintf.9: Remove unneeded header.

Reported-by: zrj
6 years agoRemove unused <{cpu,machine}/coredump.h> header.
Sascha Wildner [Mon, 20 Nov 2017 06:55:32 +0000 (07:55 +0100)]
Remove unused <{cpu,machine}/coredump.h> header.

6 years agovkernel - Sync to recent API changes (3)
Matthew Dillon [Sat, 18 Nov 2017 19:01:47 +0000 (11:01 -0800)]
vkernel - Sync to recent API changes (3)

* Fix va page offset in returned value.

6 years agovkernel - Sync to recent API changes (2)
Matthew Dillon [Sat, 18 Nov 2017 18:43:37 +0000 (10:43 -0800)]
vkernel - Sync to recent API changes (2)

* Refactor uservtophys() to use vm_fault_page().  The pmap
  lookup isn't going to work coupled with the fuword style
  test because the vkernel's copyin/copyout/fuword/etc code
  doesn't fault the underlying page into the pmap.

6 years agovkernel - Sync to recent API changes
Matthew Dillon [Sat, 18 Nov 2017 18:13:01 +0000 (10:13 -0800)]
vkernel - Sync to recent API changes

* Add uservtophys() to the vkernel code.  This is a bit of a quick hack
  but it should work.  It won't be efficient, though.

* vkernel compiles again and appears to run ok.

6 years agokernel - Fix vclean assertion due to short-cut taken by TMPFS
Matthew Dillon [Sat, 18 Nov 2017 17:08:45 +0000 (09:08 -0800)]
kernel - Fix vclean assertion due to short-cut taken by TMPFS

* Allow a vnode being destroyed to have a dirty VM object.  TMPFS
  doesn't bother to cleanup VM objects when destroying file nodes
  (e.g. when a file that is no longer referenced is removed), and
  can leave dirty pages present in the underlying object.

* Fixes occassional kernel assertions related to tmpfs (that only
  tend to occur with specific use cases).

Reported-by: zrj
6 years agolibc/citrus: Catch a NULL pointer earlier, check for empty string later.
Sascha Wildner [Sat, 18 Nov 2017 12:30:57 +0000 (13:30 +0100)]
libc/citrus: Catch a NULL pointer earlier, check for empty string later.

This fixes a gcc8 warning.

Taken-from: NetBSD (Revisions 1.20-1.22)