dragonfly.git
10 years agolibdmsg - refactor remove hammer2-specific code
Matthew Dillon [Sat, 19 Apr 2014 19:52:38 +0000 (12:52 -0700)]
libdmsg - refactor remove hammer2-specific code

* Remove hammer2-specific code.

* Refactor the callback API to allow the hammer service code to handle
  the H2-specific LNK_CONN commands... mostly VOLCONF.

10 years agoExclude libdmsg temporarily from the build until it is fixed.
Sascha Wildner [Sat, 19 Apr 2014 17:58:44 +0000 (19:58 +0200)]
Exclude libdmsg temporarily from the build until it is fixed.

Requested-by: dillon
10 years agonetinet/in - Fix yet another NULL pointer panic.
Antonio Huete Jimenez [Tue, 15 Apr 2014 14:20:16 +0000 (16:20 +0200)]
netinet/in - Fix yet another NULL pointer panic.

DragonFly-bug: <http://bugs.dragonflybsd.org/issues/2662>
Submitted-by: Vasily Postnicov
This commit closes #2662

10 years agopasswd(1): Allow password changes for PAM users
François Tigeot [Sat, 19 Apr 2014 08:32:03 +0000 (10:32 +0200)]
passwd(1): Allow password changes for PAM users

* passwd(1) previously only allowed changes for local or NIS users, which
  doesn't make sense

* Fixes FreeBSD PR bin/59638
  http://www.freebsd.org/cgi/query-pr.cgi?pr=59638

* Tested with a DragonFly (password change) and a Debian system (login)

10 years agohammer2 - Shift dmsg structures around
Matthew Dillon [Sat, 19 Apr 2014 00:37:12 +0000 (17:37 -0700)]
hammer2 - Shift dmsg structures around

* Shift dmsg structures around so sys/dmsg.h does not contain hammer2-specific
  structures.  Move those structures to hammer2_disk.h

10 years agourtwn.4: Fix synopsis (usb4bsd -> usb).
Sascha Wildner [Thu, 17 Apr 2014 13:21:31 +0000 (15:21 +0200)]
urtwn.4: Fix synopsis (usb4bsd -> usb).

10 years agoDynamic root: Add "/lib" to gold and ld linker search paths
John Marino [Thu, 17 Apr 2014 07:06:17 +0000 (09:06 +0200)]
Dynamic root: Add "/lib" to gold and ld linker search paths

This fixes numerous new dports failures seen during linking.

10 years agomount{,d}(8): Use the pidfile(3) API for handling mountd's PID file.
Sascha Wildner [Wed, 16 Apr 2014 17:40:07 +0000 (19:40 +0200)]
mount{,d}(8): Use the pidfile(3) API for handling mountd's PID file.

Taken-from: FreeBSD

10 years agolibthread_xu - Clean up the red zone on library unload
Matthew Dillon [Wed, 16 Apr 2014 17:01:14 +0000 (10:01 -0700)]
libthread_xu - Clean up the red zone on library unload

* If the main program is not linked against -pthread but dynamically
  loads a shared library that is via dlopen(), then dlclose()'s it,
  libthread_xu leaves red-zone and cached thread stacks dangling.

  The second attempt to (indirectly) load libthread_xu then fails with a
  red-zone panic.

* Add a destructor for libthread_xu to unmap the red-zone and to clean out
  any cached thread stacks.

* Note that neither libthread_xu nor most other large libraries are designed
  to be unloaded.  That is, even if loading/unloading works, numerous libraries
  will almost certainly leak memory.  This change prevents the fatal error but
  doesn't fix the general memory leakage problem.

  IMHO Only libraries designed to be unloadable should be unloaded.

Reported-by: Vasily Postnicov <shamaz.mazum@gmail.com>
10 years agoFix a number of typos in messages and manual pages.
Sascha Wildner [Wed, 16 Apr 2014 16:34:59 +0000 (18:34 +0200)]
Fix a number of typos in messages and manual pages.

10 years agoinitrd: Fix installation during make release
François Tigeot [Wed, 16 Apr 2014 08:47:14 +0000 (10:47 +0200)]
initrd: Fix installation during make release

* mkinitrd needs to know ramdisk images are to be installed in
  ${DESTDIR}/boot/kernel and not just /boot/kernel

* ${DESTDIR}/boot/kernel also has to exist first. Create it with
  mtree(8)

10 years agoloader/acpi: Fix/remove some comments and remove a misleading error msg.
Sascha Wildner [Tue, 15 Apr 2014 20:10:29 +0000 (22:10 +0200)]
loader/acpi: Fix/remove some comments and remove a misleading error msg.

10 years agoacpi: machdep.acpi_root should have the RSDP, so taking that should be fine.
Sascha Wildner [Tue, 15 Apr 2014 20:07:27 +0000 (22:07 +0200)]
acpi: machdep.acpi_root should have the RSDP, so taking that should be fine.

10 years agokernel/acpi: In the OS dependent layer, sync the debug code w/ FreeBSD.
Sascha Wildner [Tue, 15 Apr 2014 19:28:49 +0000 (21:28 +0200)]
kernel/acpi: In the OS dependent layer, sync the debug code w/ FreeBSD.

* Remove an unused function.

* Enter the debugger only when ACPI_DEBUG is set.

* Fix indent and whitespace.

10 years agoinitrd: Not everyone keeps their source in /usr/src.
Sascha Wildner [Tue, 15 Apr 2014 19:24:05 +0000 (21:24 +0200)]
initrd: Not everyone keeps their source in /usr/src.

10 years agounits(1): Sync the manual page with FreeBSD too.
Sascha Wildner [Tue, 15 Apr 2014 16:53:57 +0000 (18:53 +0200)]
units(1): Sync the manual page with FreeBSD too.

While here, add back units.c's SVN ID.

10 years agoDynamic root: Remove old libraries from /usr/lib
François Tigeot [Tue, 15 Apr 2014 08:06:38 +0000 (10:06 +0200)]
Dynamic root: Remove old libraries from /usr/lib

10 years agoUpdate the pciconf(8) database.
Sascha Wildner [Tue, 15 Apr 2014 07:33:22 +0000 (09:33 +0200)]
Update the pciconf(8) database.

April 14, 2014 snapshot from http://pciids.sourceforge.net/

10 years agounits(1): bring in latest changes from FreeBSD
Eitan Adler [Mon, 14 Apr 2014 22:40:55 +0000 (15:40 -0700)]
units(1): bring in latest changes from FreeBSD

In the interest of further compatibility with GNU units this brings in:
: -U for units file
: -v for verbose
: -V for version
: libedit support
:  -f support for multiple files

And other additional improvements.

Note that this introduces a breaking change from prior: -V and -v have been swapped (and a new -v has been added).

10 years agoFix typo
YONETANI Tomokazu [Mon, 14 Apr 2014 21:51:29 +0000 (06:51 +0900)]
Fix typo

10 years agounits(1): update to the latest library from FreeBSD
Eitan Adler [Mon, 14 Apr 2014 20:58:32 +0000 (13:58 -0700)]
units(1): update to the latest library from FreeBSD

This brings some new units along with enhanced compatibility with GNU units(1).

10 years agokernel: Sync ACPICA with Intel's version 20140325.
Sascha Wildner [Mon, 14 Apr 2014 21:06:12 +0000 (23:06 +0200)]
kernel: Sync ACPICA with Intel's version 20140325.

As far as I can see, the most important change is a fix for the auto-
serialization of control methods so that the currently executing AML
SyncLevel is ignored when invoking such a method. This fixes an issue
seen in some systems showing AE_AML_MUTEX exceptions since 20140214
which had to set hw.acpi.auto_serialize_methods to 0 to work around
the issue.

This was actually reported for DragonFly by Andrey Oktyabrskiy (see
http://lists.dragonflybsd.org/pipermail/users/2014-February/109376.html).

See sys/contrib/dev/acpica/changes.txt for a complete list of all
changes.

10 years agobuildsystem: Fix libfoo.so links for /lib libraries
François Tigeot [Mon, 14 Apr 2014 10:20:43 +0000 (12:20 +0200)]
buildsystem: Fix libfoo.so links for /lib libraries

* When installing to a non-default location by using DESTDIR on the make
  installworld command line, /usr/lib/libfoo.so links pointed to wrong
  locations

* DESTDIR is used both as an installworld parameter and internally by the
  build system and these two cases expect different behaviors

* Symlinks locations in /usr/obj must be relative to the host (builder)
  filesystem namespace
  libc.so -> /usr/obj/usr/src/world_x86_64/lib/libc.so

* Symlinks locations in the final destination directory must be relative to
  the target world filesystem namespace
  libc.so -> /lib/libc.so

* The symlinks themselves must be absolute in order to not break
  installations where /usr is a symlink

Inspired-by: FreeBSD's historical transition to /lib
10 years agoDynamic root: Move required libraries to /lib
François Tigeot [Sun, 13 Apr 2014 07:03:10 +0000 (09:03 +0200)]
Dynamic root: Move required libraries to /lib

* Add /lib to the standard run-time loader library search path

* Ensure libxxx.so symbolic links stay in /usr/lib, the build
  tools won't pick them up in /lib

10 years agoDynamic root: Build /bin and /sbin dynamically
François Tigeot [Sun, 13 Apr 2014 07:01:55 +0000 (09:01 +0200)]
Dynamic root: Build /bin and /sbin dynamically

* Introduce a NO_DYNAMICROOT variable for people wanting to keep
  fully static /bin and /sbin directories

* Keep building /sbin/init statically

* Keep a few other binaries static to avoid moving too many libraries
  to /lib and/or creating many symlinks.
  Those few binaries do not handle user names and thus don't need to be
  NSS aware/dynamically linked.

* In particular, keeping udevd static allow us to avoid moving libpthread
  and its associated links to libc_r or libthread_xu

10 years agoDynamic root: Move ld-elf.so.2 to /libexec
François Tigeot [Sat, 12 Apr 2014 06:41:54 +0000 (08:41 +0200)]
Dynamic root: Move ld-elf.so.2 to /libexec

* Install it first to avoid breaking upgrades for systems previously
  having it located in /usr/libexec. install(1), beeing a dynamic binary,
  needs it at runtime.

* Since ld-elf.so.2's path is embedded in ELF binaries, also create a
  symbolic link in the old location to support existing binaries.

* Code to handle chflags attributes obtained from FreeBSD.

10 years agoDynamic root: Create /lib and /libexec
François Tigeot [Sat, 12 Apr 2014 06:18:31 +0000 (08:18 +0200)]
Dynamic root: Create /lib and /libexec

Make the installer also install these directories

10 years agobuildworld - Make auto-backup smarter.
Matthew Dillon [Fri, 11 Apr 2014 21:37:13 +0000 (14:37 -0700)]
buildworld - Make auto-backup smarter.

* Do not try to auto-backup the world if the backup location is
  read-only.

10 years agoCreate and install an initial ramdisk image
François Tigeot [Fri, 11 Apr 2014 19:33:30 +0000 (21:33 +0200)]
Create and install an initial ramdisk image

* This initrd can be used to mount encrypted filesystems or as a
  minimal rescue system

* Existing initrd.img files will be removed by make upgrade; the
  new ramdisk images are compressed and named initrd.img.gz

10 years agokernel/acpi: Add back another needed include. That should be all.
Sascha Wildner [Fri, 11 Apr 2014 10:06:41 +0000 (12:06 +0200)]
kernel/acpi: Add back another needed include. That should be all.

10 years agokernel/acpi: Add back two includes which are needed.
Sascha Wildner [Fri, 11 Apr 2014 07:55:39 +0000 (09:55 +0200)]
kernel/acpi: Add back two includes which are needed.

10 years agokernel/acpi: Move strstr() to libkern.
Sascha Wildner [Thu, 10 Apr 2014 21:39:21 +0000 (23:39 +0200)]
kernel/acpi: Move strstr() to libkern.

While here, clean up unneeded includes from acdragonfly.h too.

10 years agoAdd some manual pages for the ACPICA utilities provided by Intel.
Sascha Wildner [Thu, 10 Apr 2014 19:07:10 +0000 (21:07 +0200)]
Add some manual pages for the ACPICA utilities provided by Intel.

For now, just list the options and their descriptions (taken from the
usages).

10 years agoRemove the acpisrc utility which is for ACPICA distribution maintenance.
Sascha Wildner [Thu, 10 Apr 2014 18:23:08 +0000 (20:23 +0200)]
Remove the acpisrc utility which is for ACPICA distribution maintenance.

This is not necessary in base. In the unlikely case that anyone ever
needed it, we can bring it back.

10 years agonetinet/ip - Avoid a NULL pointer dereference.
Antonio Huete Jimenez [Thu, 10 Apr 2014 13:17:04 +0000 (15:17 +0200)]
netinet/ip - Avoid a NULL pointer dereference.

- Before checking for packets on broadcast addresses, see if there
  is actually a ifnet associated with the mbuf being handled.

FreeBSD-SVN: 130685
DragonFly-bug: <http://bugs.dragonflybsd.org/issues/2660>
Reported-and-Found-by: Vasily Postnicov
This commit closes #2660

10 years agodevd.conf: Comment some entries where we lack support in one way or the other.
Sascha Wildner [Thu, 10 Apr 2014 08:18:13 +0000 (10:18 +0200)]
devd.conf: Comment some entries where we lack support in one way or the other.

We'll gradually uncomment them again once they are known to work.

10 years agokernel/bwn: Replace callout_drain calls. Replace a tsleep by DELAY.
Imre Vadasz [Wed, 9 Apr 2014 22:48:16 +0000 (00:48 +0200)]
kernel/bwn: Replace callout_drain calls. Replace a tsleep by DELAY.

* Adjusting local #include statements to conform to style(9).

* callout_drain calls are replaced by callout_stop_sync.

* Reverting a DELAY -> tsleep replacement.

10 years agomkinitrd(8): gzip newly produced images
François Tigeot [Thu, 10 Apr 2014 06:15:09 +0000 (08:15 +0200)]
mkinitrd(8): gzip newly produced images

The space savings can be considerable with the current 15MB ramdisk images
beeing reduced to 3.9MB once compressed.

10 years agoloader - unset correct kenv for 'r'ecovery ramdisk mode
Matthew Dillon [Thu, 10 Apr 2014 01:26:04 +0000 (18:26 -0700)]
loader - unset correct kenv for 'r'ecovery ramdisk mode

* We have to unset vfs.root.real_root instead of lunset vfs.real_root.

* This will properly drop the loader into the recovery ramdisk without
  trying to do any crypt setup or access the root disk in any way (other
  than what it needs to get /boot stuff).

10 years agomount - Generate correct argv[0] for crunches
Matthew Dillon [Thu, 10 Apr 2014 01:12:43 +0000 (18:12 -0700)]
mount - Generate correct argv[0] for crunches

* The crunchgen consolidated binary uses argv[0] to determine which program
  to actually run.  The 'mount' program was putting the vfstype in argv[0]
  instead of "mount_<vfstype>".

* This caused crunchgen to run 'hammer' instead of 'mount_hammer'.

* Fixes installer encrypted installs with hammer roots.

10 years agokernel - Add mandatory config hooks delay
Matthew Dillon [Wed, 9 Apr 2014 23:49:12 +0000 (16:49 -0700)]
kernel - Add mandatory config hooks delay

* Add a mandatory 5-second minimum delay for config hooks.

  This fixes an issue with U4B's very late port probing.  Essentially the
  other disk devices (aka AHCI) can completely finish probing and attaching
  devices before USB even knows there's a stick in a port.  The result is
  that the run_interrupt_driven_config_hooks() routine thinks that all
  disk devices have attached and does not wait at all.

  In addition, usb devices tend to probe near dead last, making the problem
  worse.  The kernel tries to mount the root device the instant after
  the usb pci probe.

* This is a hack, but to really fix it requires a great deal of surgery in
  the U4B USB stack.

10 years agodloader: Add a rescue ramdisk boot option
François Tigeot [Wed, 9 Apr 2014 21:39:31 +0000 (23:39 +0200)]
dloader: Add a rescue ramdisk boot option

10 years agoinitrd: Add password databases
François Tigeot [Wed, 9 Apr 2014 21:28:39 +0000 (23:28 +0200)]
initrd: Add password databases

10 years agoinitrd: Create a home directory, initialize $HOME
François Tigeot [Wed, 9 Apr 2014 14:48:28 +0000 (16:48 +0200)]
initrd: Create a home directory, initialize $HOME

10 years agoinitrd: Add various /etc files
François Tigeot [Wed, 9 Apr 2014 21:26:28 +0000 (23:26 +0200)]
initrd: Add various /etc files

* /etc/motd submitted by Matthew Dillon <dillon@apollo.backplane.com>

10 years agomkinitrd(8): Stop copying regular binaries to the ramdisk
François Tigeot [Wed, 9 Apr 2014 21:13:48 +0000 (23:13 +0200)]
mkinitrd(8): Stop copying regular binaries to the ramdisk

* initrd binaries are specially tailored versions and don't necessarily
  work in the same way as regular ones

* In fact, regular binaries from newer DragonFly systems are expected to
  use dynamic libraries and won't work at all in the fully static environment
  of the ramdisk

10 years agoinitrd: Add wpa_supplicant
François Tigeot [Wed, 9 Apr 2014 15:56:50 +0000 (17:56 +0200)]
initrd: Add wpa_supplicant

Submitted-by: Matthew Dillon <dillon@apollo.backplane.com>
10 years agoinitrd: Add various binaries and scripts
François Tigeot [Wed, 9 Apr 2014 15:30:44 +0000 (17:30 +0200)]
initrd: Add various binaries and scripts

* Crunch bin and sbin commands with some usr.bin and usr.sbin binaries into
  /bin and /sbin respectively, we don't want to maintain a /usr directory

* Some of the symbols cryptsetup and tcplay use conflict with others used
  by regular /sbin binaries, crunch them separately

* lvm's libraries conflict even more, build it as a separate static binary

10 years agoinitrd: Remount / read-write
François Tigeot [Wed, 9 Apr 2014 15:04:55 +0000 (17:04 +0200)]
initrd: Remount / read-write

10 years agoinitrd: Run a rescue shell if vfs.real_root is not set
François Tigeot [Wed, 9 Apr 2014 14:54:52 +0000 (16:54 +0200)]
initrd: Run a rescue shell if vfs.real_root is not set

10 years agomini_init: Don't call exit(3), catch SIGTERM
François Tigeot [Wed, 9 Apr 2014 10:54:23 +0000 (12:54 +0200)]
mini_init: Don't call exit(3), catch SIGTERM

* During a reboot sequence, all processes are routinely killed.

* Sadly, if init dies, the kernel panics.

* Try to avoid this situation by ignoring SIGTERM and not explicitely
  calling exit(3) if the child process dies and the chrooting sequence
  fails.

10 years agoRemove NOLINT from a couple of Makefiles (we don't have it).
Sascha Wildner [Wed, 9 Apr 2014 19:16:27 +0000 (21:16 +0200)]
Remove NOLINT from a couple of Makefiles (we don't have it).

10 years agobwn.4: There is no 'firmware' kernel option in DragonFly.
Sascha Wildner [Wed, 9 Apr 2014 17:08:54 +0000 (19:08 +0200)]
bwn.4: There is no 'firmware' kernel option in DragonFly.

10 years agoinitrd: Move mini_init sources to share/initrd/
François Tigeot [Wed, 9 Apr 2014 07:36:31 +0000 (09:36 +0200)]
initrd: Move mini_init sources to share/initrd/

10 years agoinitrd: Move existing files to an etc/ subdirectory
François Tigeot [Wed, 9 Apr 2014 07:32:23 +0000 (09:32 +0200)]
initrd: Move existing files to an etc/ subdirectory

10 years agomkinitrd(8): Optimize newfs for size
François Tigeot [Tue, 8 Apr 2014 20:25:15 +0000 (22:25 +0200)]
mkinitrd(8): Optimize newfs for size

10 years agocrunchgen(1): Stop adding underscores to symbols
François Tigeot [Tue, 8 Apr 2014 19:16:13 +0000 (21:16 +0200)]
crunchgen(1): Stop adding underscores to symbols

* The configuration file has provisions to manually specify a few symbols
  to keep public.

* Unfortunately this feature was rendered useless by crunchgen itself,
  which prepended an underscore character before each symbol in the call
  to crunchide(1).

10 years agobsd.crunchgen.mk: Add a mechanism to keep handpicked symbols
François Tigeot [Tue, 8 Apr 2014 19:14:48 +0000 (21:14 +0200)]
bsd.crunchgen.mk: Add a mechanism to keep handpicked symbols

10 years agobsd.crunchgen.mk: Change paths
François Tigeot [Tue, 8 Apr 2014 19:10:33 +0000 (21:10 +0200)]
bsd.crunchgen.mk: Change paths

This file is intended to be used from src/share/initrd/
and not src/rescue/ like on FreeBSD.

10 years agoRemove the RELEASE_CRUNCH build variable
François Tigeot [Tue, 8 Apr 2014 18:12:00 +0000 (20:12 +0200)]
Remove the RELEASE_CRUNCH build variable

* It was used to specially craft binaries for use with PicoBSD in the
  distant past.

* The conditional code paths it enables have not been maintained for
  more than a decade and are of dubious value.

* At this point it's best to just remove it.

10 years agocryptsetup: Fix a compilation warning
François Tigeot [Tue, 8 Apr 2014 15:27:21 +0000 (17:27 +0200)]
cryptsetup: Fix a compilation warning

Submitted-by: Matthew Dillon <dillon@apollo.backplane.com>
10 years agokernel/bwn: Remove an unnecessary call to ieee80211_start_all
Imre Vadasz [Tue, 8 Apr 2014 08:42:17 +0000 (10:42 +0200)]
kernel/bwn: Remove an unnecessary call to ieee80211_start_all

* Fixes a bug when the firmware is not found.

10 years agoin6pcb: in6_pcbsetport -> in6_pcbsetlport; no functional changes
Sepherosa Ziehau [Sat, 5 Apr 2014 13:08:13 +0000 (21:08 +0800)]
in6pcb: in6_pcbsetport -> in6_pcbsetlport; no functional changes

10 years agoinpcb: Add comment about saved inpcbport
Sepherosa Ziehau [Sat, 5 Apr 2014 12:59:06 +0000 (20:59 +0800)]
inpcb: Add comment about saved inpcbport

10 years agoinpcb: Add macros to get/release/assert port token
Sepherosa Ziehau [Sat, 5 Apr 2014 12:51:36 +0000 (20:51 +0800)]
inpcb: Add macros to get/release/assert port token

10 years agomake upgrade: Add more files for cleaner switching between USB stacks.
Sascha Wildner [Tue, 8 Apr 2014 11:19:46 +0000 (13:19 +0200)]
make upgrade: Add more files for cleaner switching between USB stacks.

10 years agolibu4bhid: Add missing MLINKS.
Sascha Wildner [Tue, 8 Apr 2014 10:14:25 +0000 (12:14 +0200)]
libu4bhid: Add missing MLINKS.

10 years agoUpdate files for OpenSSL-1.0.1g import.
Peter Avalos [Tue, 8 Apr 2014 01:26:13 +0000 (18:26 -0700)]
Update files for OpenSSL-1.0.1g import.

10 years agoMerge branch 'vendor/OPENSSL'
Peter Avalos [Tue, 8 Apr 2014 01:21:14 +0000 (18:21 -0700)]
Merge branch 'vendor/OPENSSL'

10 years agoImport OpenSSL-1.0.1g.
Peter Avalos [Tue, 8 Apr 2014 00:59:53 +0000 (17:59 -0700)]
Import OpenSSL-1.0.1g.

o Fix for CVE-2014-0160
o Add TLS padding extension workaround for broken servers.
o Fix for CVE-2014-0076
o Don't include gmt_unix_time in TLS server and client random values
o Fix for TLS record tampering bug CVE-2013-4353
o Fix for TLS version checking bug CVE-2013-6449
o Fix for DTLS retransmission bug CVE-2013-6450

10 years agonetwork/pf - Avoid a possible bad pointer access.
Antonio Huete Jimenez [Mon, 7 Apr 2014 22:26:53 +0000 (00:26 +0200)]
network/pf - Avoid a possible bad pointer access.

- Make sure new pfi_kif structures are zeroed on allocation.
- A panic was hit when pfi_instance_add() tried to access a bad ifp
  pointer (i.e. when using non-existing iface names in pf.conf)

10 years agonetwork/gif - Correctly clear route cache on destroy.
Antonio Huete Jimenez [Mon, 7 Apr 2014 07:37:56 +0000 (09:37 +0200)]
network/gif - Correctly clear route cache on destroy.

RTFREE() requires that the route is freed in the CPU it belongs to.
Migrating to the target CPU *before* calling it and returning to the
original CPU afterwards seems to do the trick.

Ok: @sephe

10 years agohammer - Fix missing reltoken
Matthew Dillon [Sun, 6 Apr 2014 22:59:08 +0000 (15:59 -0700)]
hammer - Fix missing reltoken

* Fix a missing token release on hmp->fs_token.

Reported-by: joris
10 years agobwn.4: Comment out another bwi(4) reference.
Sascha Wildner [Sun, 6 Apr 2014 12:52:27 +0000 (14:52 +0200)]
bwn.4: Comment out another bwi(4) reference.

10 years agokernel/drm: Add a missing include
Markus Pfeiffer [Sun, 6 Apr 2014 10:09:49 +0000 (11:09 +0100)]
kernel/drm: Add a missing include

Include sys/devfs.h in drm_vm.h and correct the use of
devfs_get_cdevpriv.

Reported-By: Sascha Wildner <saw@online.de>
10 years agokernel/run: Add missing unlock.
Sascha Wildner [Sat, 5 Apr 2014 22:58:00 +0000 (00:58 +0200)]
kernel/run: Add missing unlock.

10 years agobmake - Always pass the jobs pipe descriptor
Matthew Dillon [Sat, 5 Apr 2014 19:48:59 +0000 (12:48 -0700)]
bmake - Always pass the jobs pipe descriptor

* bmake currently requires a .MAKE target dependency to induce the passing
  of the jobs pipe descriptor to sub-jobs (aka sub-makes).  This requirement
  was lost due to a bug in bmake where it's F_SETFD fcntl was being run on
  the wrong descriptor.  This was recently fixed in bmake and exposed this
  new problem.

* bmake might be run with the MAKEFLAGS environment intact but not be passed
  the jobs descriptor.  While bmake creates a new fresh jobs descriptor in
  this case, it would remain an issue if some other parent program happened
  to use a pipe descriptor with the same fd number.

* bmake or intermediate build programs might not be run with a .MAKE target
  dependency, causing sub-bmakes to run an excessive number of concurrent
  jobs.

* The question is whether we can really safely require this new behavior
  or whether we should revert to the prior behavior.

  FreeBSD modified the default to be the prior behavior of always passing
  the jobs pipe descriptor and added a new .MAKE* directive to override it,
  but I don't see how this helps matters when the default really needs to be
  the always-pass behavior anyway.

  The only other solution is to use a filesystem-visible pipe (filesystem fifo
  in /tmp), which the old make used.  But this often results in a lot of cruft
  building up in /tmp from ^C's and/or system crashes.  This solution is the
  most compatible with expectations, frankly.

* For now revert to the prior behavior of always passing the jobs pipe
  descriptor.  This does a better job of guarenteeing that the descriptor
  number remains intact through multiple fork/execs.

10 years agorun.4: D1 is an mdoc macro, so we have to escape it :)
Sascha Wildner [Sat, 5 Apr 2014 18:22:32 +0000 (20:22 +0200)]
run.4: D1 is an mdoc macro, so we have to escape it :)

10 years agobwn: fixing performance problems and an RX buffer overflow problem
Imre Vadasz [Thu, 3 Apr 2014 12:16:48 +0000 (14:16 +0200)]
bwn: fixing performance problems and an RX buffer overflow problem

* Commenting a bwn_shm_write_2 call that destroys performance especially
  when sending.  This call is also commented in Linux's b43 driver.

* Handling Overflows of the RX buffer in bwn by just dropping all entries.
  With 256 slots in the RX buffer this overflow will almost never happen in
  practice.

10 years agobwn: Porting from FreeBSD
Imre Vadasz [Thu, 27 Mar 2014 20:24:28 +0000 (21:24 +0100)]
bwn: Porting from FreeBSD

* Adding bwn and siba_bwn to sys/conf/files and to the X86_64_GENERIC kernel
  configuration.

* Replacing BWN_LOCK, BWN_UNLOCK, BWN_ASSERT_SERIALIZED with
  wlan_global_serializer.

* Increasing some alignments from 4K to 8K and some from 1 byte to 4 bytes.

* Changing slot counts for RX and TX from 64 to 256, which is the same size
  as used by b43 in Linux.

* Allow overriding the BWN_TXRING_SLOTS and BWN_RXRING_SLOTS values in the
  kernel configuration.

* Some style fixes. Removing unneeded NULL checks.

* Replace a DELAY(50000) with tsleep.

* Can't use kmalloc to allocate memory for dma like in FreeBSD and Linux.

* A few typo and grammar fixes in the bwn.4 manpage.

10 years agobwn: Import from FreeBSD
Imre Vadasz [Thu, 27 Mar 2014 20:12:23 +0000 (21:12 +0100)]
bwn: Import from FreeBSD

* bwn depends on siba_bwn, importing that code as well

* Including the bwn.4 manpage, but not siba.4

* In FreeBSD the siba driver lives in a separate directory. Since we only
  need the siba_bwn part we just put it below sys/dev/netif/bwn.

10 years agokernel/drm: use devfs_*_cdevpriv functions
Markus Pfeiffer [Thu, 3 Apr 2014 23:47:32 +0000 (00:47 +0100)]
kernel/drm: use devfs_*_cdevpriv functions

drm relied on a custom hack to implement those functions, this hack
has now been removed, and the devfs based functions are used.

10 years agoinpcb/in6pcb: Split port token
Sepherosa Ziehau [Tue, 25 Mar 2014 12:50:53 +0000 (20:50 +0800)]
inpcb/in6pcb: Split port token

The original single local port space is devided into ncpus2 local port
space groups.  We denote local port space group as PG(N), N=[0, ncpus2).

Property of PG(N):
- PG(N) only contains local ports matching following condition:
  (host_order(port) & ncpus2_mask) == N
- PG(N) is protected by its own token.

On explicit local port bind(2) path and accept(2) path, PG(N) is selected
by using the local port already available (accept(2)) or supplied
(bind(2)):
    N = host_order(port) & ncpus2_mask

On implicit local port selection path (bind(2) and connect(2)), PG(N) is
selected and used in the following way:
    N = mycpuid;
    N1 = N;
again:
    if (find free port in PG(N)) {
        DONE;
    } else {
        N = (N + 1) & ncpus2_mask;
        if (N != N1)
            goto again;
        FAILED;
    }

PG(N) is now recorded in inpcb struct, so when inpcb is destroyed, we
know which port space group it should use.

On i7-3770 w/ Intel 82599ES, using tools/kq_connect_client:
Port token contention rate on each hyperthread is reduced from 120K/s to
40K/s.  Admittedly the contention rate is still high but it is much
better than before.

Now the major source of port token contention is the contention between
implicit local port select path and inpcb destroy path.  There may be a
way to choose local port which could hash the inpcb to the current CPU;
this needs more investigation.

10 years ago<sys/cdefs.h>: Make CTASSERT() kernel only (again).
Sascha Wildner [Sat, 5 Apr 2014 07:43:33 +0000 (09:43 +0200)]
<sys/cdefs.h>: Make CTASSERT() kernel only (again).

When I moved it from <sys/systm.h> to <sys/cdefs.h> to have it near
_Static_assert's definition, I overlooked that <sys/systm.h> is a
kernel-only header.

Since there are ports which define their own CTASSERT (such as openjdk),
make ours kernel-only again.

Reported-by: marino
10 years agokernel/802_11: Fix a panic in RUN -> AUTH -> RUN FSM transition.
Sascha Wildner [Fri, 4 Apr 2014 21:40:59 +0000 (23:40 +0200)]
kernel/802_11: Fix a panic in RUN -> AUTH -> RUN FSM transition.

When ratectl_node_init() is called and ni_rctls is already allocated,
use that pointer.

This is FreeBSD's r207323.

Pointed-out-by: Imre Vadasz <imre@vdsz.com>
Tested-by: Markus Pfeiffer <markus.pfeiffer@morphism.de>
10 years agokernel/802_11: Release the WLAN serializer around if_detach().
Sascha Wildner [Fri, 4 Apr 2014 18:20:10 +0000 (20:20 +0200)]
kernel/802_11: Release the WLAN serializer around if_detach().

This should fix all crashes we are seeing upon kldunload of WLAN
drivers.

In-discussion-with-and-tested-by: ivadasz, jh32, sephe
10 years agokernel/ath: Grab the WLAN serializer around ieee80211_ifdetach().
Sascha Wildner [Fri, 4 Apr 2014 18:16:01 +0000 (20:16 +0200)]
kernel/ath: Grab the WLAN serializer around ieee80211_ifdetach().

Reported-by: Imre Vadasz <imre@vdsz.com>
10 years agoFix buildkernel (missing include).
Sascha Wildner [Fri, 4 Apr 2014 13:35:20 +0000 (15:35 +0200)]
Fix buildkernel (missing include).

Reported-by: luxh
10 years agokernel/802_11: More ratectl fixes (fixes an ath(4) panic).
Sascha Wildner [Fri, 4 Apr 2014 08:07:53 +0000 (10:07 +0200)]
kernel/802_11: More ratectl fixes (fixes an ath(4) panic).

Set the default rate control algorithm to NONE instead of AMRR and
add some missing ieee80211_ratectl_node_init()s which I had overlooked
earlier.

Reported-by: Johannes Hofmann <johannes.hofmann@gmx.de>
Tested-by: Imre Vadasz <imre@vdsz.com>
10 years agokernel - bring acpi_thinkpad in sync with FreeBSD r246128
Markus Pfeiffer [Thu, 3 Apr 2014 22:06:19 +0000 (23:06 +0100)]
kernel - bring acpi_thinkpad in sync with FreeBSD r246128

Submitted-By: Sascha Wildner <saw@online.de>
10 years agoAdd ident string to acpi_thinkpad module
Markus Pfeiffer [Thu, 3 Apr 2014 21:36:40 +0000 (22:36 +0100)]
Add ident string to acpi_thinkpad module

10 years agols(1): Restore the traditional behavior of -f implying -a.
Sascha Wildner [Thu, 3 Apr 2014 07:21:04 +0000 (09:21 +0200)]
ls(1): Restore the traditional behavior of -f implying -a.

OpenBSD's commit msg:

------
restore the traditional behavior of -f implying -a; apparently Keith Bostic
forgot to restore it when the -f flag was put back on 2nd of September 1989,
after being removed on 16th of August as a consequence of issues getting it
working over NFS, so deviation from traditional UNIX behavior in all BSDs
looks like an historical accident; as a side effect, this change accommodates
behavior of this option to IEEE Std 1003.1-2008 (``POSIX.1'').

joint work with jmc@ (who found the inaccuracy in our implementation),
schwarze@ (who provided a detailed tracking of historical facts) and millert@

ok millert@, schwarze@
------

The same patch has been pushed to NetBSD and FreeBSD too.

Submitted-by: Igor Sobrado
Taken-from:   OpenBSD

10 years agoMove ieee80211_ratectl_node_init() from drivers into ieee80211.
Sascha Wildner [Thu, 3 Apr 2014 07:10:23 +0000 (09:10 +0200)]
Move ieee80211_ratectl_node_init() from drivers into ieee80211.

This fixes the amrr_node_deinit() panics we were getting after my
recent ratectl commit broke it (it was trying to kfree a NULL
pointer).

It should also fix hostap mode for run(4) e.g.

This commit is essentially FreeBSD's r217511.

Pointed-out-by: Imre Vadasz <imre@vdsz.com>
Taken-from:     FreeBSD

10 years agoRevert "wlan - Allow NULL field in amrr_node_deinit()"
Sascha Wildner [Thu, 3 Apr 2014 07:00:42 +0000 (09:00 +0200)]
Revert "wlan - Allow NULL field in amrr_node_deinit()"

This reverts commit d68ce29fbc7cb83d080f0abb8790151cd6fec598.

10 years agowlan - Allow NULL field in amrr_node_deinit()
Matthew Dillon [Thu, 3 Apr 2014 02:09:55 +0000 (19:09 -0700)]
wlan - Allow NULL field in amrr_node_deinit()

* Allow a NULL field in amrr_node_deinit(), prevent kfree() from being
  called with NULL, which DragonFly explicitly does not allow.

10 years agoloader - Add slowprint() debugging helper
Matthew Dillon [Wed, 2 Apr 2014 21:41:00 +0000 (14:41 -0700)]
loader - Add slowprint() debugging helper

* Add a slowprint() function and command to enable it
  to help trace out problems.

* Used for recent debugging but calls are not intended to be permanently
  resident in the code.  Leave the infrastructure in place for future
  debugging.

10 years agolibstand - Fix excessive memory use by hammer2 module
Matthew Dillon [Wed, 2 Apr 2014 21:38:54 +0000 (14:38 -0700)]
libstand - Fix excessive memory use by hammer2 module

* Don't try to dynamically allocate 64KB for each open file.  Just use
  the same static media buffer that normal operations use.

  This fixes some severe heap fragmentation and out-of-memory issues
  when a lot (20+) modules are specified in /boot/loader.conf that
  can cause the boot loader to fail.

* Add getheap() to retrieve heap stats.

10 years agokernel - Fix mid-kernel-boot lockups due to module order
Matthew Dillon [Wed, 2 Apr 2014 19:24:57 +0000 (12:24 -0700)]
kernel - Fix mid-kernel-boot lockups due to module order

* Sometimes the kernel would just lock up for no apparent reason.  Changing
  the preloaded module set (even randomly) could effect the behavior.

* The problem turned out to be an issue with kernel modules needing to
  temporarily migrate to another cpu (such as when installing a SWI or
  other interrupt handler).  If the idle thread on cpu 0 had not yet
  bootstrapped, lwkt_switch_return() would not be called properly and
  the LWKT cpu migration code would never schedule on the target cpu.

* Fix the problem by handling the idle thread bootstrap case for cpu 0
  properly in pc64.

10 years agoboot - boot loader fixes
Matthew Dillon [Wed, 2 Apr 2014 19:22:50 +0000 (12:22 -0700)]
boot - boot loader fixes

* Clarify some issues in comments.

* Don't trust the bios memory boundary, start 1K below it.

* Always bounce, not just for floppies.  This should help with situations
  when loading kernels and modules beyond the 16MB mark.

* Add some debugging memory commands

10 years agocrunch: We use .Mt for mail addresses.
Sascha Wildner [Wed, 2 Apr 2014 17:56:03 +0000 (19:56 +0200)]
crunch: We use .Mt for mail addresses.