dragonfly.git
7 years agokernel: Add a port of the Linux 4.8 vga_switcheroo module
François Tigeot [Thu, 23 Mar 2017 09:04:44 +0000 (10:04 +0100)]
kernel: Add a port of the Linux 4.8 vga_switcheroo module

Submitted-by: Peeter Must <karu.pruun@gmail.com>
7 years ago<sys/unistd.h>: Add missing _PC_TIMESTAMP_RESOLUTION.
Sascha Wildner [Thu, 23 Mar 2017 09:18:12 +0000 (10:18 +0100)]
<sys/unistd.h>: Add missing _PC_TIMESTAMP_RESOLUTION.

We don't handle it yet though.

7 years agobuild - Add the 'efisetup' script
Matthew Dillon [Thu, 23 Mar 2017 02:06:57 +0000 (19:06 -0700)]
build - Add the 'efisetup' script

* Add the 'efisetup' script to /usr/sbin.  This script is capable of
  creating a pristine UEFI bootable DragonFlyBSD installation on the
  target drive.  The target drive will be wiped.

  Note that this script does only a basic installation... literally once
  it sets up the partitions it just does an installworld, make distribution,
  and installkernel, and then some minor adjustments to create the initial
  /etc/rc.conf, /etc/fstab, and /boot/loader.conf.

* Requires that you previously did a buildworld and buildkernel
  before running the script.

7 years agokernel - Fix panic in zget() during heavy paging
Matthew Dillon [Thu, 23 Mar 2017 01:43:08 +0000 (18:43 -0700)]
kernel - Fix panic in zget() during heavy paging

* Fix a panic that can occur in zget() when a large number of swap info
  blocks are needed from the swap_zone.

  Fix by reformulation how new items are added to the zone.  This is a
  non-critical code path, but we make it a bit more SMP friendly anyway.

* Use the opportunity to get rid of the VM object ZONE_INTERRUPT uses.
  The two that are left are never destroyed, so there's no need to track
  the pages in an object.

Reported-by: tkusumi
7 years ago<time.h>: Shuffle some prototypes around (no functional change).
Sascha Wildner [Wed, 22 Mar 2017 20:42:31 +0000 (21:42 +0100)]
<time.h>: Shuffle some prototypes around (no functional change).

7 years agoUpdate the pciconf(8) database.
Sascha Wildner [Wed, 22 Mar 2017 19:59:33 +0000 (20:59 +0100)]
Update the pciconf(8) database.

March 16, 2017 snapshot from http://pciids.sourceforge.net/

7 years agobsd-family-tree: Sync with FreeBSD.
Sascha Wildner [Wed, 22 Mar 2017 19:50:10 +0000 (20:50 +0100)]
bsd-family-tree: Sync with FreeBSD.

7 years agoSync zoneinfo database with tzdata2017b from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Wed, 22 Mar 2017 08:18:30 +0000 (09:18 +0100)]
Sync zoneinfo database with tzdata2017b from ftp://ftp.iana.org/tz/releases

Haiti resumed observance of DST in 2017.  (Thanks to Steffen Thorsen.)

7 years agotest - Flesh out randread statistics reporting
Matthew Dillon [Tue, 21 Mar 2017 01:27:34 +0000 (18:27 -0700)]
test - Flesh out randread statistics reporting

* Cleanup the output.  Report the aggregate IOPS, average latency,
  aggregate bandwidth, low and high latencies, and the standard
  deviation for the test on a per-second basis.

* Standard deviation notes:

  68%     Of the samples are within 1 standard deviation, so if the
    reported stddev is 7uS, then 68% of the samples are +/- 7uS
    of the average reported value.

  95.45%    Of the samples are within 2 standard deviations.  +/- 14uS
    in the example.

  99.73%    Of the samples are within 3 standard deviations.  +/- 21uS
    in the example.

7 years agoBring in uefisign(8) example script.
Sascha Wildner [Sun, 19 Mar 2017 20:42:51 +0000 (21:42 +0100)]
Bring in uefisign(8) example script.

It was forgotten in bb7548fd68273597588b57868a739b2d3a8a8d94.

Taken-from: FreeBSD

7 years agoinstaller: Fix the "missing /var/run/sem" issues better.
Sascha Wildner [Sun, 19 Mar 2017 15:34:37 +0000 (16:34 +0100)]
installer: Fix the "missing /var/run/sem" issues better.

* Add -C to the tmpfs mount of /var/run on the USB image. This
  ensures that the USB image itself keeps the ppp/, sem/, and
  wpa_supplicant/ dirs under /var/run.

* Since we do not cpdup /var/run explicitly during installation
  it ends up empty on the installed system. Ensure that it has
  the subdirectories it needs by running mtree on /var.

* It looks like the 1e5a476188185cf1161f4fe3ffc060465562ef0d
  change could be reverted because the issue never was that
  /var/run/sem wasn't existing _after_ make upgrade. The mtree
  in the preceding installworld takes care of it. It doesn't
  hurt either, so just shuffle the commands a bit downwards.

7 years agokernel/mmcsd: Add some dummy values for d_nheads and d_secpertrack.
Sascha Wildner [Sat, 18 Mar 2017 19:51:32 +0000 (20:51 +0100)]
kernel/mmcsd: Add some dummy values for d_nheads and d_secpertrack.

Values taken from nvme(4). newfs_msdos(8) uses these, and the way
we call it from the installer (not specifying them explicitly) broke
installing to an SD card.

Reported-by: Pontus Lundkvist <p@article.se>
7 years agobuild - Validate sshd_config
Matthew Dillon [Fri, 17 Mar 2017 23:59:45 +0000 (16:59 -0700)]
build - Validate sshd_config

* Make sure the default sshd_config contains certain lines
  that we require.  At the moment, this adjustment makes sure
  that the sshd_config file has the correct PasswordAuthentication
  directive.

* Intended to catch snafus when openssh is updated from the vendor.

7 years agosshd - Fix default password authentication (2)
Matthew Dillon [Fri, 17 Mar 2017 22:58:23 +0000 (15:58 -0700)]
sshd - Fix default password authentication (2)

* Oops, last commit had to change it in servconf.c, not readconf.c

7 years agosshd - Fix default password authentication
Matthew Dillon [Fri, 17 Mar 2017 22:47:52 +0000 (15:47 -0700)]
sshd - Fix default password authentication

* The default for PasswordAuthentication somehow got reverted to
  being enabled.

* Disable PasswordAuthentication by default.

* Uncomment PasswordAuthentication in the default sshd_config,
  defaulting to 'no', and always overriding sshd's own defaults.

7 years agokernel/options: EFIRT can go to opt_dontuse.h. No need for opt_efirt.h.
Sascha Wildner [Fri, 17 Mar 2017 21:16:01 +0000 (22:16 +0100)]
kernel/options: EFIRT can go to opt_dontuse.h. No need for opt_efirt.h.

The EFIRT option only enables compilation of whole files.

7 years agodf.1: Fix example for -t. It's null, not nullfs.
Sascha Wildner [Fri, 17 Mar 2017 20:32:57 +0000 (21:32 +0100)]
df.1: Fix example for -t. It's null, not nullfs.

Reported-by: marino
7 years agodrm/linux: Improve vmap/vunmap API, add is_vmalloc_addr()
François Tigeot [Fri, 17 Mar 2017 07:48:29 +0000 (08:48 +0100)]
drm/linux: Improve vmap/vunmap API, add is_vmalloc_addr()

* vmap() and vunmap() only take a single argument

7 years agodrm/linux: Add smp_store_mb()
François Tigeot [Fri, 17 Mar 2017 07:13:38 +0000 (08:13 +0100)]
drm/linux: Add smp_store_mb()

7 years agodrm/linux: Add linux/vga_switcheroo.h
François Tigeot [Thu, 16 Mar 2017 11:32:42 +0000 (12:32 +0100)]
drm/linux: Add linux/vga_switcheroo.h

Submitted-by: Peeter Must <karu.pruun@gmail.com>
7 years agosched_setaffinity.2: Small markup fix.
Sascha Wildner [Thu, 16 Mar 2017 10:37:09 +0000 (11:37 +0100)]
sched_setaffinity.2: Small markup fix.

7 years agoRemove some more duplicate includes in our tree.
Sascha Wildner [Thu, 16 Mar 2017 10:17:36 +0000 (11:17 +0100)]
Remove some more duplicate includes in our tree.

7 years ago<sys/globaldata.h>: Remove duplicate include.
Sascha Wildner [Thu, 16 Mar 2017 09:43:49 +0000 (10:43 +0100)]
<sys/globaldata.h>: Remove duplicate include.

7 years agoUPDATING: Add note for OpenSSH HPN removal
Thomas Nikolajsen [Thu, 16 Mar 2017 06:28:40 +0000 (07:28 +0100)]
UPDATING: Add note for OpenSSH HPN removal

7 years agoCorrect param.h entry for this version.
Justin C. Sherrill [Thu, 16 Mar 2017 01:29:08 +0000 (21:29 -0400)]
Correct param.h entry for this version.

Noticed-by: Thomas Nikolajsen
7 years agodrm/linux: Add linux/hardirq.h
François Tigeot [Wed, 15 Mar 2017 08:36:18 +0000 (09:36 +0100)]
drm/linux: Add linux/hardirq.h

7 years agodrm/linux: Implement hrtimers
François Tigeot [Wed, 15 Mar 2017 07:33:02 +0000 (08:33 +0100)]
drm/linux: Implement hrtimers

This initial implementation is based on callouts and not
highly precise.

It nevertheless works fine with the drm/i915 driver from
Linux 4.7 and will be enough for now.

7 years agokernel: Remove broken DRM_LINUX option
François Tigeot [Tue, 14 Mar 2017 16:23:20 +0000 (17:23 +0100)]
kernel: Remove broken DRM_LINUX option

7 years agodrm/linux: Add READ_ONCE and WRITE_ONCE
François Tigeot [Tue, 14 Mar 2017 09:21:51 +0000 (10:21 +0100)]
drm/linux: Add READ_ONCE and WRITE_ONCE

Obtained-from: FreeBSD

7 years agodrm/linux: Improve linux/workqueue.h
François Tigeot [Tue, 14 Mar 2017 08:18:21 +0000 (09:18 +0100)]
drm/linux: Improve linux/workqueue.h

7 years agodrm/linux: Add u64_to_user_ptr
François Tigeot [Tue, 14 Mar 2017 07:01:06 +0000 (08:01 +0100)]
drm/linux: Add u64_to_user_ptr

7 years agodrm/linux: Add asm/shmparam.h
François Tigeot [Mon, 13 Mar 2017 22:01:51 +0000 (23:01 +0100)]
drm/linux: Add asm/shmparam.h

7 years agodrm/linux: Add pci_bus_read_config_byte and pci_bus_read_config_word
François Tigeot [Mon, 13 Mar 2017 21:28:05 +0000 (22:28 +0100)]
drm/linux: Add pci_bus_read_config_byte and pci_bus_read_config_word

7 years agodrm/linux: Add atomic_andnot()
François Tigeot [Mon, 13 Mar 2017 17:30:17 +0000 (18:30 +0100)]
drm/linux: Add atomic_andnot()

7 years agozone.9: Adjust prototypes for some recent changes.
Sascha Wildner [Mon, 13 Mar 2017 11:21:46 +0000 (12:21 +0100)]
zone.9: Adjust prototypes for some recent changes.

7 years agodrm/linux: Expand linux/kobject.h scope
François Tigeot [Mon, 13 Mar 2017 08:18:15 +0000 (09:18 +0100)]
drm/linux: Expand linux/kobject.h scope

7 years agodrm/linux: Add asm/cpufeatures.h
François Tigeot [Mon, 13 Mar 2017 07:57:47 +0000 (08:57 +0100)]
drm/linux: Add asm/cpufeatures.h

7 years agosbin/hammer: Have consistent naming for volume variables
Tomohiro Kusumi [Thu, 9 Mar 2017 19:32:40 +0000 (21:32 +0200)]
sbin/hammer: Have consistent naming for volume variables

Use *volume.
Userspace is mix of *vol and *volume for no reason.
sys/vfs/hammer is always *volume.

7 years agosbin/hammer: Have consistent naming for buffer variables
Tomohiro Kusumi [Thu, 9 Mar 2017 19:31:51 +0000 (21:31 +0200)]
sbin/hammer: Have consistent naming for buffer variables

Use *buffer.
Userspace is mix of *buf and *buffer for no reason.
sys/vfs/hammer is always *buffer.

7 years agodrm/linux: Add linux/console.h
François Tigeot [Sun, 12 Mar 2017 21:15:16 +0000 (22:15 +0100)]
drm/linux: Add linux/console.h

7 years agodrm/linux: Add cacheflushopt()
François Tigeot [Sun, 12 Mar 2017 20:53:26 +0000 (21:53 +0100)]
drm/linux: Add cacheflushopt()

7 years agoNumbering changes for master -> 4.9. v4.9.0
Justin C. Sherrill [Sun, 12 Mar 2017 01:43:50 +0000 (20:43 -0500)]
Numbering changes for master -> 4.9.

7 years agodrm/linux: fix tasklets
François Tigeot [Thu, 9 Mar 2017 09:20:27 +0000 (10:20 +0100)]
drm/linux: fix tasklets

The set_bit() and clear_bit() macros expect pointers as arguments.

7 years agosys/vfs/hammer: Cleanup hammer_modify_node()
Tomohiro Kusumi [Wed, 8 Mar 2017 19:10:12 +0000 (21:10 +0200)]
sys/vfs/hammer: Cleanup hammer_modify_node()

The only purpose of crcptr was to avoid split into multiple lines
(according to dillon@), but we could do with the same two lines..

7 years agore: Only limited versions of this chip require explicit padding.
Sepherosa Ziehau [Mon, 27 Feb 2017 18:01:21 +0000 (02:01 +0800)]
re: Only limited versions of this chip require explicit padding.

Certain versions of this chip fail to generate correct UDP checksum
on explicitly padded UDP datagrams.

Reported-and-Tested-by: Daniel Bilik
7 years agokernel - Fix cluster_write() inefficiency
Matthew Dillon [Tue, 7 Mar 2017 01:36:48 +0000 (17:36 -0800)]
kernel - Fix cluster_write() inefficiency

* A bug in the cluster code was causing HAMMER to write out 64KB buffers in
  32KB overlapping segments, resulting in data being written to the media
  twice.

* This fix just about doubles HAMMER's sequential write bandwidth.

7 years agoAlways use unix line endings
Eitan Adler [Sun, 5 Mar 2017 18:27:43 +0000 (10:27 -0800)]
Always use unix line endings

7 years agovkernel: Prevent clang optimizing out the traps.
zrj [Thu, 2 Mar 2017 17:44:23 +0000 (19:44 +0200)]
vkernel: Prevent clang optimizing out the traps.

Turns out clang removes non volatile null-pointers. Prevent that.

7 years agowlan: Remove duplicate typedef.
zrj [Thu, 2 Mar 2017 16:14:51 +0000 (18:14 +0200)]
wlan: Remove duplicate typedef.

7 years agoUnbreak VKERNEL64 for clang compatibility.
zrj [Thu, 2 Mar 2017 15:46:09 +0000 (17:46 +0200)]
Unbreak VKERNEL64 for clang compatibility.

7 years agolibc/getnameinfo: Whitespace fix to my last commit.
Sascha Wildner [Sat, 4 Mar 2017 12:08:14 +0000 (13:08 +0100)]
libc/getnameinfo: Whitespace fix to my last commit.

7 years agolibc/getnameinfo: Clean up the comments in getnameinfo_link() a bit.
Sascha Wildner [Sat, 4 Mar 2017 12:00:43 +0000 (13:00 +0100)]
libc/getnameinfo: Clean up the comments in getnameinfo_link() a bit.

7 years agoSync ACPICA with Intel's version 20170303.
Sascha Wildner [Fri, 3 Mar 2017 21:15:04 +0000 (22:15 +0100)]
Sync ACPICA with Intel's version 20170303.

Nothing big, really:

* The licensing information at the start of each source code module has
  been updated. In addition to the Intel license, the dual GPLv2/BSD
  license has been added for completeness. Now, a single version of the
  source code should be suitable for all ACPICA customers. This is the
  major change for this release since it affects all source code modules.

* Fixed two issues with the common asltypes.h header that could cause
  problems in some environments (Kim Jung-uk).

* Disassembler: fixed a regression introduced in 20170224. A fix for a
  memory leak related to resource descriptor tags (names) could fault
  when the disassembler was generated with 64-bit compilers.

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

7 years agoRemove old timezone Pacific/Johnston via 'make upgrade'.
Sascha Wildner [Fri, 3 Mar 2017 15:41:37 +0000 (16:41 +0100)]
Remove old timezone Pacific/Johnston via 'make upgrade'.

7 years agoSync zoneinfo database with tzdata2017a from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Thu, 2 Mar 2017 13:43:55 +0000 (14:43 +0100)]
Sync zoneinfo database with tzdata2017a from ftp://ftp.iana.org/tz/releases

* Mongolia no longer observes DST.  (Thanks to Ganbold Tsagaankhuu.)

* Chile's Region of Magallanes moves from -04/-03 to -03 year-round.
    Its clocks diverge from America/Santiago starting 2017-05-13 at
    23:00, hiving off a new zone America/Punta_Arenas.  Although the
    Chilean government says this change expires in May 2019, for now
    assume it's permanent.  (Thanks to Juan Correa and Deborah
    Goldsmith.)  This also affects Antarctica/Palmer.

* Fix many entries for historical time stamps for Europe/Madrid
    before 1979, to agree with tables compiled by Pere Planesas of the
    National Astronomical Observatory of Spain.  As a side effect,
    this changes some time stamps for Africa/Ceuta before 1929, which
    are probably guesswork anyway.  (Thanks to Steve Allen and
    Pierpaolo Bernardi for the heads-ups, and to Michael Deckers for
    correcting the 1901 transition.)

* Ecuador observed DST from 1992-11-28 to 1993-02-05.
    (Thanks to Alois Treindl.)

* Asia/Atyrau and Asia/Oral were at +03 (not +04) before 1930-06-21.
    (Thanks to Stepan Golosunov.)

* Switch to numeric time zone abbreviations for South America, as
    part of the ongoing project of removing invented abbreviations.
    This avoids the need to invent an abbreviation for the new Chilean
    zone.  Similarly, switch from invented to numeric time zone
    abbreviations for a number of other zones.

* For Alaska time from 1900 through 1967, instead of "CAT" use the
    abbreviation "AST", the abbreviation commonly used at the time
    (Atlantic Standard Time had not been standardized yet).  Use "AWT"
    and "APT" instead of the invented abbreviations "CAWT" and "CAPT".

* Use "CST" and "CDT" instead of invented abbreviations for Macau
    before 1999 and Taiwan before 1938, and use "JST" instead of the
    invented abbreviation "JCST" for Japan and Korea before 1938.

* Move the Pacific/Johnston link from 'australasia' to 'backward',
    since Johnston is now uninhabited.

* africa (Africa/Monrovia): The 1972 transition was on January 7,
    not May 1.  (Shanks was wrong again! and Howse was right.)

* The 'Theory' file now better documents choice of historical time
    zone abbreviations.  (Problems reported by Michael Deckers.)

7 years agodrm/i915: Fix compilation with clang
François Tigeot [Thu, 2 Mar 2017 08:33:57 +0000 (09:33 +0100)]
drm/i915: Fix compilation with clang

* Add back a lost pointer initialization line

* With this change, a clang-built drm/i915 module now works as expected

Submitted-by: zrj
7 years agorc.d - Add option to load kernel modules from rc.conf(5)
Johannes Hofmann [Thu, 2 Mar 2017 06:46:41 +0000 (07:46 +0100)]
rc.d - Add option to load kernel modules from rc.conf(5)

Due to memory limitations in the early boot phase it is not
advisable to load kernel modules that are not strictly necessary
to mount the root file system via loader.conf(5).
Therefore a new rc script "modules" is added that allows loading of
kernel modules from rc.conf(5).

7 years agoxargs.1: Add some words about -r (taken from FreeBSD).
Sascha Wildner [Wed, 1 Mar 2017 21:05:27 +0000 (22:05 +0100)]
xargs.1: Add some words about -r (taken from FreeBSD).

7 years agorc.conf.5: Adjust the memimg documentation a bit.
Sascha Wildner [Wed, 1 Mar 2017 20:06:48 +0000 (21:06 +0100)]
rc.conf.5: Adjust the memimg documentation a bit.

7 years agoClean up the namespace in a number of standard headers.
Sascha Wildner [Wed, 1 Mar 2017 19:36:39 +0000 (20:36 +0100)]
Clean up the namespace in a number of standard headers.

* In most cases, instead of the full load of <sys/types.h>,
  include <machine/stdint.h> which defines the __-types that
  <monetary.h>, <pwd.h>, <search.h>, <strings.h> and <wordexp.h>
  only need.

* Additionally, extend the visibility of the size_t definition
  and adjust WRDE_NOSYS's visibility because it was only in the
  standard up to Issue 6.

* In <time.h>, include <sys/stdint.h> to get at __pid_t too.

* Likewise, include <sys/stdint.h> in <sys/wait.h> and provide
  a definition of pid_t as required.

7 years agoAdjust whitespace in a couple of standard headers (no functional change).
Sascha Wildner [Wed, 1 Mar 2017 19:24:01 +0000 (20:24 +0100)]
Adjust whitespace in a couple of standard headers (no functional change).

In preparation for another round of namespace cleanup.

7 years agorc.conf.5 - Adjust manpage to the last changes.
Antonio Huete Jimenez [Wed, 1 Mar 2017 19:11:15 +0000 (20:11 +0100)]
rc.conf.5 - Adjust manpage to the last changes.

7 years agoxargs - Add dummy -r option
Matthew Dillon [Wed, 1 Mar 2017 18:01:14 +0000 (10:01 -0800)]
xargs - Add dummy -r option

* Add the -r option for GNU compatbility.  This option is the short form
  for the --no-run-if-empty GNU option, which is our default behavior, so
  we do nothing with it other than allow it.

Taken-from: FreeBSD.

7 years agokernel: Remove unused DIRECTIO option (see 12b70cea73eef6a67).
Sascha Wildner [Wed, 1 Mar 2017 12:53:16 +0000 (13:53 +0100)]
kernel: Remove unused DIRECTIO option (see 12b70cea73eef6a67).

7 years agorc.d - Add an option to specify memimg file for vkernels
Antonio Huete Jimenez [Wed, 1 Mar 2017 01:04:30 +0000 (02:04 +0100)]
rc.d - Add an option to specify memimg file for vkernels

- This option defaults to /var/vkernel/memimg.xxxxxx when not specified
  and it tries to provide a memimg file automatically even when non-privileged
  users run vkernels.

- The default directory for memimg files (/var/vkernel) is created if it doesn't
  exist and set to 1777 mode.

7 years agorc.d - Allow vkernel to run as non-root
Antonio Huete Jimenez [Fri, 24 Feb 2017 20:52:39 +0000 (21:52 +0100)]
rc.d - Allow vkernel to run as non-root

7 years agorc.d - Follow up previous commit
Antonio Huete Jimenez [Fri, 24 Feb 2017 15:42:41 +0000 (16:42 +0100)]
rc.d - Follow up previous commit

- unset all variables that could be potentially reused
- Use lowercase in a warn message

7 years agoinstaller: Turn off soft updates for /boot in the UFS install.
Sascha Wildner [Sun, 26 Feb 2017 03:51:04 +0000 (04:51 +0100)]
installer: Turn off soft updates for /boot in the UFS install.

This was missed when we gave the UFS install a separate /boot partition.

Reported-by: ozmage
7 years agoSync ACPICA with Intel's version 20170224.
Sascha Wildner [Sun, 26 Feb 2017 01:28:55 +0000 (02:28 +0100)]
Sync ACPICA with Intel's version 20170224.

* Fixed two issues with the control method return value auto-repair
  feature in the interpreter.

* Fixed an AML interpreter mutex issue during the single stepping
  of control methods in the debugger.

* New iasl(8) -ca option to convert ASL to ASL+.

* Various other fixes in iasl(8).

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

7 years agovmbus.4: It can be compiled into the kernel as well.
Sascha Wildner [Fri, 24 Feb 2017 15:36:57 +0000 (16:36 +0100)]
vmbus.4: It can be compiled into the kernel as well.

7 years agorc.d - Make sure rootimgs are empty for every vkernel
Antonio Huete Jimenez [Fri, 24 Feb 2017 13:38:29 +0000 (14:38 +0100)]
rc.d - Make sure rootimgs are empty for every vkernel

7 years agore: Fix typo for disabling txcsum.
Sepherosa Ziehau [Fri, 24 Feb 2017 01:35:49 +0000 (09:35 +0800)]
re: Fix typo for disabling txcsum.

Submitted-by: Daniel Bilik
7 years ago<sys/procctl.h>: Include <sys/types.h> explicitly for userland.
Sascha Wildner [Thu, 23 Feb 2017 22:18:59 +0000 (23:18 +0100)]
<sys/procctl.h>: Include <sys/types.h> explicitly for userland.

This prepares for more namespace cleanup in standard headers.

7 years agoClean up a bit after the recent ahc/ahd/aic removal.
Sascha Wildner [Wed, 22 Feb 2017 20:10:00 +0000 (21:10 +0100)]
Clean up a bit after the recent ahc/ahd/aic removal.

7 years agomrsas - release devq before freeing the sim.
Matthew Dillon [Wed, 22 Feb 2017 18:49:57 +0000 (10:49 -0800)]
mrsas - release devq before freeing the sim.

* Release the devq before freeing the sim.

7 years agokernel - Add missing bus lock to CAM
Matthew Dillon [Wed, 22 Feb 2017 18:48:48 +0000 (10:48 -0800)]
kernel - Add missing bus lock to CAM

* cam_periph_alloc() was missing a bus lock / unlock sequence around
  a list operation.

7 years agokernel - Improve exec performance
Matthew Dillon [Wed, 22 Feb 2017 18:43:00 +0000 (10:43 -0800)]
kernel - Improve exec performance

* Improves non-shared 32-way-concurrent exec performance for a small
  static binary on the xeon from 92KE/s (92000 execs/sec) to 136KE/s.

* Improves single-threaded test performance from ~4.5KE/s to ~6.5KE/s.
  And for reasons I don't entirely understand, sometimes up to ~8KE/s.

* Several changes here, but the only one that matters for the test is
  that the pv_placemarker_wakeup() code removes a spin_lock/spin_unlock
  pair on the pmap.  I adjusted the code so the pmap spinlock is not
  required for placemarker wakeup operations.

  What I think might have happened here is that this removal also got
  rid of a spin-lock shared/exclusive ping-pong.  Still, the huge
  improvement in performance was not expected.  Even with the removal
  there is still an atomic_swap_long() in the code path.

  My guess is that multiple atomic ops degrade the instruction pipeline
  more than one would otherwise expect due to the multiple memory
  fences.

7 years agokernel - Slightly reduce extra spinlock ops in _pv_alloc()
Matthew Dillon [Wed, 22 Feb 2017 07:55:09 +0000 (23:55 -0800)]
kernel - Slightly reduce extra spinlock ops in _pv_alloc()

* Pre-stage pnew (new pv_entry) using a pcpu cache, avoiding an
  unnecessary spin_unlock/spin_lock sequence in _pv_alloc().

* No real performance improvement measured, but the code is cleaner so
  use it.

7 years agokernel - Add atomic ops features
Matthew Dillon [Wed, 22 Feb 2017 07:51:59 +0000 (23:51 -0800)]
kernel - Add atomic ops features

* Add <atomicop>_xacquire() and <atomicop>_xrelease() to a bunch of
  atomic ops.  Using this API will elide the operation using Intel's
  TSX extensions (the elides are backwards compatible to cpus that do
  not support TSX).

* Note however that preliminary testing using this API in the spin_lock*()
  and pv_*() interfaces has only led to a reduction of performance and not
  to any improvement, so at the moment we do not intend to use it.  But I
  did the work to add the API calls and I don't want to lose it.

7 years agore: Update to Realtek 1.93
Sepherosa Ziehau [Wed, 22 Feb 2017 14:57:08 +0000 (22:57 +0800)]
re: Update to Realtek 1.93

Tested-by: me, Tim Darby
7 years agodrm/linux: Implement tasklets
François Tigeot [Wed, 22 Feb 2017 06:06:04 +0000 (07:06 +0100)]
drm/linux: Implement tasklets

Even though this initial implementation is pretty naive and runs
tasklets synchronously, it appears to nevertheless work fine with
the drm/i915 driver version from Linux 4.7.

7 years agokernel: fix LINT64 build after old SCSI drivers removal
François Tigeot [Tue, 21 Feb 2017 23:46:11 +0000 (00:46 +0100)]
kernel: fix LINT64 build after old SCSI drivers removal

7 years agokernel - Disallow remote growstack from procfs
Matthew Dillon [Tue, 21 Feb 2017 20:32:51 +0000 (12:32 -0800)]
kernel - Disallow remote growstack from procfs

* Do not allow procfs operations to grow the stack of a remote process,
  at least for now, because we are not passing in the struct vmspace *
  pointer, for now.

* Fixes trivial panic caused by ps -e due to the recent addition of
  an assertion to test the condition that failed (the assertion is
  correct).

7 years agobuild - Fix nativekernel build
Matthew Dillon [Tue, 21 Feb 2017 20:32:22 +0000 (12:32 -0800)]
build - Fix nativekernel build

* Fix issue with aic removal, forgot to remove something from the
  nativekernel build target.

7 years agokernel/re: Fix hw.re.phy_mdix_mode tunable.
Sascha Wildner [Tue, 21 Feb 2017 14:24:32 +0000 (15:24 +0100)]
kernel/re: Fix hw.re.phy_mdix_mode tunable.

7 years agoboot - Fix insufficient malloc()s
Matthew Dillon [Tue, 21 Feb 2017 04:22:16 +0000 (20:22 -0800)]
boot - Fix insufficient malloc()s

* Fix two places where not enough buffer space is malloc()d.

7 years agokernel - Remove old SCSI drivers - aic, aic7xxx, ahc, ahd
Matthew Dillon [Tue, 21 Feb 2017 04:05:44 +0000 (20:05 -0800)]
kernel - Remove old SCSI drivers - aic, aic7xxx, ahc, ahd

* Remove these drivers.  They were pinnacles of their time, requiring
  incredibly complex state machines for sequencing old-style SCSI busses.
  CAM was created to support these babies.  But alas, they became obsolete
  many years ago.

* They were from the 32-bit ISA and PCI (not PCIe) PC era.  DragonFlyBSD
  doesn't even boot on those old machines any more, being 64-bit only.

* Also deals with some -j races in the aic sub-build.

7 years agodrm/linux: u64 is unsigned long long
François Tigeot [Mon, 20 Feb 2017 20:42:19 +0000 (21:42 +0100)]
drm/linux: u64 is unsigned long long

* Some basic Linux types were badly defined, causing unnecessary
  differences in various lines of driver code such as kprintf
  statements

* Make u64 and __u64 unsigned long longs like in Linux

* Reduce differences with Linux 4.6 in the generic drm code as well
  as drm/i915 and drm/radeon drivers

* While there, make the include/ directory hierarchy more similar
  to the one in Linux 4.6

7 years agokernel - Expand p_nice effect more, fix %cpu calculation bug
Matthew Dillon [Mon, 20 Feb 2017 05:23:15 +0000 (21:23 -0800)]
kernel - Expand p_nice effect more, fix %cpu calculation bug

* Expand the p_nice effect even more.

* Fix a %cpu calculation bug which could improperly cause the
  lwp->lwp_priority to be reset to its base level, potentially giving
  a cpu-bound process more cpu than intended.

7 years agodrm - Fix major stalls by fixing an improper taskqueue priority
Matthew Dillon [Mon, 20 Feb 2017 05:20:46 +0000 (21:20 -0800)]
drm - Fix major stalls by fixing an improper taskqueue priority

* drm was creating task queues with a LWKT priority of 0, which is
  lower than the priority of a running user thread.

* Fix all cases where improper priorities are passed to
  taskqueue_start_threads().  This fixes major video stalls and glitches
  that occur when other things might be running on the system cpu-bound.

* taskqueue_start_threads() now asserts if the priority passed to it is
  illegal.

7 years agokernel - Fix bug in physio()
Matthew Dillon [Mon, 20 Feb 2017 02:14:17 +0000 (18:14 -0800)]
kernel - Fix bug in physio()

* Fix an integer overflow in physio() when attempting to dd a block size
  >= 2G.  An int was being used instead of size_t.

Reported-by: tpchin
Bug: 2981

7 years agokernel - Support FreeBSD style loader.conf hints for resources
Matthew Dillon [Mon, 20 Feb 2017 01:56:25 +0000 (17:56 -0800)]
kernel - Support FreeBSD style loader.conf hints for resources

* DragonFly uses <device><unit>.<resname>.

* Also support FreeBSD hints which use hint.<device>.<unit>.<resname>.

* Makes it easier for users coming from FreeBSD to bring in sound quirks
  and such.

Reported-by: Damien
7 years agokernel - Fix estcpu calculation
Matthew Dillon [Mon, 20 Feb 2017 00:46:09 +0000 (16:46 -0800)]
kernel - Fix estcpu calculation

* No longer use uload to try to correct estcpu.  It winds up inflating the
  cpu use of other processes that use cpu but are not cpu-bound, creating
  the same estcpu compression problem.  The problem is less pronounced
  without it.

* Remove the uload global.  No longer useful and saves an unnecessary
  cache line ping-pong.

* Refactor how p_nice affects p_priority.  This causes nice levels to have
  a greater effect.

* Make the forkbias programmable with a sysctl and set the default to 1,
  which is a good, safe, all-around default.

7 years agodrm/radeon: Replace some spinlocks by lockmgr locks
François Tigeot [Sun, 19 Feb 2017 20:09:34 +0000 (21:09 +0100)]
drm/radeon: Replace some spinlocks by lockmgr locks

The original Linux code uses struct mutexes instead of spinlocks for
gem.mutex, gpu_clock_mutex and srbm_mutex.

7 years agoRevert "kernel - Reduce priority range from dynamic priority"
Matthew Dillon [Sun, 19 Feb 2017 04:33:34 +0000 (20:33 -0800)]
Revert "kernel - Reduce priority range from dynamic priority"

This reverts commit abc0cda7b4a0a92afab15645d5adfac57af02866.

The change improved how nice ranging works but completely blew up
fork priority reduction, causing parent process dispatches via
fork/exec (such as done by a service or by make) to not immediately
move the child proces to another cpu when the parent has more work
to do.

This caused the kernel build to regress from 3:12 to 3:21 on the
test box, and for the world build to only show minor improvements
instead of more significant improvements.

So revert it for now.  We will improve nice priorities another way.

7 years agokernel/usb4bsd: Add a quirk for the Corsair STRAFE Gaming keyboard.
Sascha Wildner [Sat, 18 Feb 2017 08:52:18 +0000 (09:52 +0100)]
kernel/usb4bsd: Add a quirk for the Corsair STRAFE Gaming keyboard.

Taken-from: FreeBSD

7 years agosdpquery(1): Remove an unneeded explicit -Wno-unused-but-set-variable.
Sascha Wildner [Fri, 17 Feb 2017 21:46:13 +0000 (22:46 +0100)]
sdpquery(1): Remove an unneeded explicit -Wno-unused-but-set-variable.

-Wunused-but-set-variable comes in at WARNS==4 only.

7 years agolibc/nmalloc: Remove some kernel code remains.
Sascha Wildner [Fri, 17 Feb 2017 21:42:28 +0000 (22:42 +0100)]
libc/nmalloc: Remove some kernel code remains.

7 years agokernel - Fix machdep.pmap_mmu_optimize bug
Matthew Dillon [Fri, 17 Feb 2017 21:40:24 +0000 (13:40 -0800)]
kernel - Fix machdep.pmap_mmu_optimize bug

* Fix bug introduced by the recent pv_entry rewrite when MMU segment
  optimization is enabled.

Reported-by: sephe
7 years agoUnbreak vkernel build.
Sascha Wildner [Fri, 17 Feb 2017 21:15:24 +0000 (22:15 +0100)]
Unbreak vkernel build.

Move some hyperv specific but "standard" files into the pc64 specific
'files' file.

Reported-by: tuxillo