dragonfly.git
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)

6 years agoRemove the NO_CRYPT build option.
Sascha Wildner [Sat, 18 Nov 2017 12:01:04 +0000 (13:01 +0100)]
Remove the NO_CRYPT build option.

It has been broken for a long time without anyone complaining about and
we don't want to maintain it either.

In-discussion-with: zrj

6 years ago<sys/indefinite2.h>: Fix header name.
Sascha Wildner [Sat, 18 Nov 2017 01:32:47 +0000 (02:32 +0100)]
<sys/indefinite2.h>: Fix header name.

This is never reached (<sys/globaldata.h> comes in via <sys/indefinite.h>
as it seems), but fix anyway.

6 years agokernel: Remove some semicolons at the end of macro definitions.
Sascha Wildner [Fri, 17 Nov 2017 17:44:54 +0000 (18:44 +0100)]
kernel: Remove some semicolons at the end of macro definitions.

6 years agokernel: Remove some unnecessary semicolons.
Sascha Wildner [Fri, 17 Nov 2017 17:35:23 +0000 (18:35 +0100)]
kernel: Remove some unnecessary semicolons.

6 years agokernel: Remove two final \ in macro definitions.
Sascha Wildner [Fri, 17 Nov 2017 17:34:14 +0000 (18:34 +0100)]
kernel: Remove two final \ in macro definitions.

6 years agoLTO: Disable safety feature.
zrj [Fri, 17 Nov 2017 12:40:56 +0000 (14:40 +0200)]
LTO: Disable safety feature.

No longer can reproduce boot issue in the padlock/padlock_rng codes.
The -flto-partition=one can be supplied together with -flto as needed.

6 years agoLTO: Pass CFLAGS to compiler for kernel module linking too.
zrj [Fri, 17 Nov 2017 10:50:35 +0000 (12:50 +0200)]
LTO: Pass CFLAGS to compiler for kernel module linking too.

Forgot to git add it in fa8104330967fab6248da216251a4382b39b1dab.
Linker still could link LTO'ed *.o objects, because ld is invoked by cc
with explicitly passed -plugin option that loads the liblto_plugin.so.
This only slightly changes how LTO is performed on kernel modules.

Note: this will need to be adjusted for clang -flto compatibility
when I will update the clangb version in git module.

Reported-by: dillon
6 years agogcc47: Backport static initialization acceptance.
zrj [Fri, 17 Nov 2017 10:21:09 +0000 (12:21 +0200)]
gcc47: Backport static initialization acceptance.

I only backporting these so that failing to accept drm/i915 _MMIO() stuff
would *not* be used as an argument to remove gcc47 alternative compiler
from base, just because "oh look it does not compile the i915.ko".
The gcc47 is likely the last C compiler compilable with C compiler able
to bootstrap the c++ compiler that is used on x86_64 anymore.
If anyone has/works on simple C compiler that could boostrap modern gcc,
you know where I hanging out and I gladly replace gcc47 with it in base.

It only takes few lines to accept updated drm/i915 "features".
It still warns with -pedantic:
/usr/src/sys/dev/drm/i915/intel_pm.c:3925:3: warning: initializer element is not constant [-pedantic]
/usr/src/sys/dev/drm/i915/intel_pm.c:3925:3: warning: (near initialization for 'wm0_pipe_reg[0]') [-pedantic]
/usr/src/sys/dev/drm/i915/intel_pm.c:3926:3: warning: initializer element is not constant [-pedantic]
/usr/src/sys/dev/drm/i915/intel_pm.c:3926:3: warning: (near initialization for 'wm0_pipe_reg[1]') [-pedantic]
/usr/src/sys/dev/drm/i915/intel_pm.c:3927:3: warning: initializer element is not constant [-pedantic]
/usr/src/sys/dev/drm/i915/intel_pm.c:3927:3: warning: (near initialization for 'wm0_pipe_reg[2]') [-pedantic]
...
So far i915 is the only place in kernel that does this, please lets keep it at this.

Check C99 Standard: Section 6.7.8 for more info.

Taken-from: gcc trunk (216416 + 216440 revisions)

6 years agotftp(1): Avoid symbol conflict with ncurses.
zrj [Fri, 17 Nov 2017 10:17:27 +0000 (12:17 +0200)]
tftp(1): Avoid symbol conflict with ncurses.

The usr.bin/tftp/main.c: int trace;
while lib_trace.c: void trace(const unsigned int){};
This breaks -flto -static link against LTO'ed libncurses.a.

Fix it by just renaming: s/trace/tftp_trace/g.

6 years agoftp(1): Avoid symbol conflict with ncurses.
zrj [Fri, 17 Nov 2017 10:03:18 +0000 (12:03 +0200)]
ftp(1): Avoid symbol conflict with ncurses.

The contrib/tnftp/src/ftp_var.h: GLOBAL int trace;
while lib_trace.c: void trace(const unsigned int){};
This breaks -flto -static link against LTO'ed libncurses.a.

Since it is in contrib code, just -Dtrace it.

6 years agobackgammon(6): Avoid symbol issue with ncurses lib.
zrj [Fri, 17 Nov 2017 09:20:44 +0000 (11:20 +0200)]
backgammon(6): Avoid symbol issue with ncurses lib.

The backgammon(6) has: back.k: extern int raw;
while in ncurses tinfo/lib_raw.c: int raw(void){}.

This breaks -flto -static link against LTO'ed libncurses.a.
So just rename backgammon global raw to bgraw.

Just for the fun of it, note that init.c: struct termios bgraw;
NetBSD already have it fixed in games/backgammon/.
Also still not clear how to do with c5e1790f6b.

6 years agoFix some trailing whitespace in sys/conf and sys/config.
Sascha Wildner [Fri, 17 Nov 2017 08:02:47 +0000 (09:02 +0100)]
Fix some trailing whitespace in sys/conf and sys/config.

Submitted-by: zrj
6 years agobanner(1): Remove (void) casts.
zrj [Thu, 16 Nov 2017 13:28:59 +0000 (15:28 +0200)]
banner(1): Remove (void) casts.

Forgot about these. Sorry.

6 years agogames: Remove (void) casts.
zrj [Thu, 16 Nov 2017 13:27:21 +0000 (15:27 +0200)]
games: Remove (void) casts.

No functional change.

6 years agofortune(6): Add few fortunes.
zrj [Thu, 16 Nov 2017 12:38:47 +0000 (14:38 +0200)]
fortune(6): Add few fortunes.

6 years agoBring in OpenBSD's tetris(6).
zrj [Thu, 16 Nov 2017 12:31:47 +0000 (14:31 +0200)]
Bring in OpenBSD's tetris(6).

Will be handy to test upcoming ncurses update.

Taken-from: OpenBSD

6 years agoBring in OpenBSD's boggle(6).
zrj [Thu, 16 Nov 2017 12:27:33 +0000 (14:27 +0200)]
Bring in OpenBSD's boggle(6).

As per README, stuff is addictive!

Pointed-by: Thierry
Taken-from: OpenBSD

6 years agonewfs_hammer.8: Fix up the HISTORY section.
Sascha Wildner [Wed, 15 Nov 2017 19:38:16 +0000 (20:38 +0100)]
newfs_hammer.8: Fix up the HISTORY section.

Reported-by: kerma (Michael)
6 years agocpdup(1): Whitespace cleanup.
zrj [Tue, 14 Nov 2017 20:30:57 +0000 (22:30 +0200)]
cpdup(1): Whitespace cleanup.

No functional change.

6 years agobtools: Strip host lib deps for bin/cpdup.
zrj [Tue, 14 Nov 2017 19:25:48 +0000 (21:25 +0200)]
btools: Strip host lib deps for bin/cpdup.

Disable last libmd.a user in btools.
MD5 functionality (cpdup -m) for buildworld is redundant.

6 years agobtools: Strip libmd dep for usr.bin/sort.
zrj [Tue, 14 Nov 2017 22:25:35 +0000 (00:25 +0200)]
btools: Strip libmd dep for usr.bin/sort.

Implement SORT_RANDOM option and do not use if BOOTSTRAPPING.
This option is useless for a buildworld/buildkernel.

This allows to have sort(1) that only depends on libc.

6 years agobtools: Strip libpthread dep for usr.bin/sort.
zrj [Tue, 14 Nov 2017 18:41:00 +0000 (20:41 +0200)]
btools: Strip libpthread dep for usr.bin/sort.

This is one in particular was annoying me for long. It has a potential of using
ptreads for sorting speed up. Running parallel sort(1) in various buildworld
places actually can result in less performance on maximum parallel builds due
to interference with other cpu cores and we can not be sure about the state of
host's static libpthread lib. Also, so far I did not noticed any performance
degradation when sort is used without threads support for buildworld purposes.
This utility (in btools case) is compiled statically so bringing whole pthreads
static lib into memory has a bigger penalty then in most cases sorting anyway.
This a single btools/ctools case that depends on -lpthread. Having a slim,
more stable buildings tools is prefered than dubious compilation speed
enhancements for critical buildworld infrastructure.

The libmd.a dependency will be revemoved in separate patch.

6 years agobtools: Remove usr.bin/bzip2 from the list.
zrj [Tue, 14 Nov 2017 18:04:06 +0000 (20:04 +0200)]
btools: Remove usr.bin/bzip2 from the list.

The bzip2 and its variants are not used during buildworld/buildkernel.
So avoid yet another dependency on host lib (libz2.a).
Only places i could find it referenced were:
  * etc/man.conf - for manpage compression (we only do and trac .gz ones).
  * etc/release  - for compressing the kernel sources (that is outside build
                   and already have a dependencies from DPorts).

6 years agoncurses: Privatize the last public header.
zrj [Tue, 14 Nov 2017 17:01:06 +0000 (19:01 +0200)]
ncurses: Privatize the last public header.

Just move it with rest of privatized ncurses headers. Only user in base is
usr.sbin/installer/dfuife_curses/ and include path is already handled there.
As of this moment we are sure that none of private ncurses bits are used for
bootstrapping the world (non-interactive make/shell scripts redirected to
file should not care about colors anyway or try to format the layout).

No functional change.

6 years agobtools: Remove /bin/csh from the list.
zrj [Tue, 14 Nov 2017 15:47:20 +0000 (17:47 +0200)]
btools: Remove /bin/csh from the list.

Our buildworld infrastructure does not use it (/bin/sh is used).
The csh is quite a complicated shell (ncurses, crypto deps).
One place less to trip while upgrading to newer releases.
This should simplify all the private libs handling.

6 years agobtools: Do not link with LIBEDIT for bin/sh.
zrj [Tue, 14 Nov 2017 15:42:31 +0000 (17:42 +0200)]
btools: Do not link with LIBEDIT for bin/sh.

The -DNO_HISTORY already disables all libprivate_edit functionality and
libncurses is only a dep for libedit. Simply remove extra dependencies.
Keeps btools slim and cleaner.

6 years agoncurses: Hook in fully bootstrapped tic_next.
zrj [Tue, 14 Nov 2017 15:25:55 +0000 (17:25 +0200)]
ncurses: Hook in fully bootstrapped tic_next.

This hopefully will allow for better future bootstraps better and w/o hacks.
Problem with tic(1) is his special knowledge through <progs.priv.h> header.
Because it is not a standard application (that uses only public headers) we
simply cannot expect to just compile three new main sources sources + link
with previously built libncurses.a from older release. Also, tic(1) during
buildworld builds terminfo binary database for the *new* ncurses lib version
and not for the *old* one. So full bootstrap is in order.

Note, share/terminfo database can still be built by a world installed tic(1).

6 years agoncurses: Add hostprog variant of tic.
zrj [Tue, 14 Nov 2017 12:23:22 +0000 (14:23 +0200)]
ncurses: Add hostprog variant of tic.

Tic(1) uses some of internal bits of ncurses implementation.
  * For now include a basic set of libncurses.
  * Link this tic with wide version of ncurses.
  * Adjust sources a bit for future reference.

6 years agoncurses: Move in panel handling to Makefile.sources.
zrj [Tue, 14 Nov 2017 09:24:44 +0000 (11:24 +0200)]
ncurses: Move in panel handling to Makefile.sources.

While there, install panel.h header only from a single place.
Previously it was installing it from both libpanel and libpanelw.
The libpanelw lib is currently unused in the world tree, while the
libpanel is only used by installer.

No functional change.

6 years agoncurses: Separate generators and sources list.
zrj [Mon, 13 Nov 2017 17:12:40 +0000 (19:12 +0200)]
ncurses: Separate generators and sources list.

Keeps everything concentrated outside libncurses lib.
Add a bit of source sorting too.

No functional change, just moving stuff around.