dragonfly.git
7 years agoinpcb: Don't rely on ncpus2 for local port allocation.
Sepherosa Ziehau [Wed, 12 Apr 2017 16:46:17 +0000 (00:46 +0800)]
inpcb: Don't rely on ncpus2 for local port allocation.

7 years agosbin/hammer: Make some readonly pointer args const
Tomohiro Kusumi [Wed, 12 Apr 2017 20:24:04 +0000 (23:24 +0300)]
sbin/hammer: Make some readonly pointer args const

7 years agosbin/*hammer: Use typedef'd for struct zone_stat*
Tomohiro Kusumi [Wed, 12 Apr 2017 18:55:45 +0000 (21:55 +0300)]
sbin/*hammer: Use typedef'd for struct zone_stat*

This is a part of series of commits started from 21e9e7d5ff in 2016.
This is for userspace.

Some ugliness in const pointer in hammer_print_zone_stat()
(but note that HAMMER originally had bunch of pointer typedefs).

7 years agosbin/*hammer: Use typedef'd for struct cache_info*
Tomohiro Kusumi [Wed, 12 Apr 2017 18:39:58 +0000 (21:39 +0300)]
sbin/*hammer: Use typedef'd for struct cache_info*

This is a part of series of commits started from 21e9e7d5ff in 2016.
This is for userspace.

7 years agosbin/*hammer: Use typedef'd for struct buffer_info*
Tomohiro Kusumi [Wed, 12 Apr 2017 18:35:14 +0000 (21:35 +0300)]
sbin/*hammer: Use typedef'd for struct buffer_info*

This is a part of series of commits started from 21e9e7d5ff in 2016.
This is for userspace.

7 years agosbin/*hammer: Use typedef'd for struct volume_info*
Tomohiro Kusumi [Wed, 12 Apr 2017 18:25:51 +0000 (21:25 +0300)]
sbin/*hammer: Use typedef'd for struct volume_info*

This is a part of series of commits started from 21e9e7d5ff in 2016.
This is for userspace.

7 years agosbin/hammer: Cleanup prototypes
Tomohiro Kusumi [Wed, 12 Apr 2017 16:14:26 +0000 (19:14 +0300)]
sbin/hammer: Cleanup prototypes

7 years agosbin/hammer: Add /* not reached */ (missing ones in 052fd72b)
Tomohiro Kusumi [Wed, 12 Apr 2017 15:58:52 +0000 (18:58 +0300)]
sbin/hammer: Add /* not reached */ (missing ones in 052fd72b)

Some comments for errx(3) were missing in 052fd72b which was intended
to do this for all err(3)/errx(3) in sbin/hammer/*.c.

7 years agosound - Delete devfs clone handler for /dev/dsp and /dev/mixer on unload.
Imre Vadász [Wed, 12 Apr 2017 20:52:23 +0000 (22:52 +0200)]
sound - Delete devfs clone handler for /dev/dsp and /dev/mixer on unload.

* This makes sound work again after unloading and then reloading the
  sound(4) module.

* Only add the devfs clone handler, when the preceeding make_dev() was
  successful.

7 years agoRevert "kernel - Spread IPIs out to more priority levels"
Matthew Dillon [Fri, 7 Apr 2017 15:57:04 +0000 (08:57 -0700)]
Revert "kernel - Spread IPIs out to more priority levels"

This commit seems to be causing a performance regression on VMs.
Since it didn't fix a particular bug (was just supposed to make
things more robust), revert it for now.

Reported-by: tkusumi
This reverts commit f240042b9f9bcfdacd70499659fcc5f55d5e49ab.

7 years agodrm/linux: Add reinit_completion()
Peeter Must [Wed, 12 Apr 2017 11:42:04 +0000 (14:42 +0300)]
drm/linux: Add reinit_completion()

7 years agokernel - Temporarily set the default machdep.pmap_nx_enable to 0
Matthew Dillon [Wed, 12 Apr 2017 18:55:09 +0000 (11:55 -0700)]
kernel - Temporarily set the default machdep.pmap_nx_enable to 0

* Until we work out some issues, temporarily set the default
  machdep.pmap_nx_enable to 0.

* NOTE: This is a loader tunable only.

7 years agoRevert "libc: Add temporary (get|set)affinity DF404.0 symbols"
John Marino [Wed, 12 Apr 2017 13:19:24 +0000 (08:19 -0500)]
Revert "libc: Add temporary (get|set)affinity DF404.0 symbols"

This reverts commit 3c2537818c14aaba122a276020143cd4b92d2cbc.

As indicated in the original commit, the (get|set)affinity DF404.0
symbols were temporary and limited to the 4.7 development branch.
Now that 4.8 has been officially released, remove them as they
have served their purpose.  By now, all software built on 4.7
should have been rebuilt and thus nothing depends on the mistake
symbols.

7 years agosbin/hammer: Add /* not reached */ for usage() variants
Tomohiro Kusumi [Tue, 11 Apr 2017 20:51:35 +0000 (23:51 +0300)]
sbin/hammer: Add /* not reached */ for usage() variants

that were originally missing.
Recommended by dillon@.
No diff in sbin/hammer binary when assert(3) is disabled.

7 years agosbin/hammer: Add /* not reached */
Tomohiro Kusumi [Tue, 11 Apr 2017 20:33:47 +0000 (23:33 +0300)]
sbin/hammer: Add /* not reached */

that were originally missing.
Recommended by dillon@.
No diff in sbin/hammer binary when assert(3) is disabled.

7 years agosbin/hammer: Check S_ISREG() if not block device
Tomohiro Kusumi [Tue, 11 Apr 2017 19:23:07 +0000 (22:23 +0300)]
sbin/hammer: Check S_ISREG() if not block device

ioctl(DIOCGPART) failure doesn't mean path is a regfile.

7 years agosbin/hammer: Add is_regfile() (avoid directly using a string literal)
Tomohiro Kusumi [Tue, 11 Apr 2017 19:22:41 +0000 (22:22 +0300)]
sbin/hammer: Add is_regfile() (avoid directly using a string literal)

7 years agoppp - Fix minor overflow in protocol search
Matthew Dillon [Tue, 11 Apr 2017 05:28:36 +0000 (22:28 -0700)]
ppp - Fix minor overflow in protocol search

* Fix a minor redundant expression in sys/net/libalias/alias_irc.c

* Fix a one-byte overflow in cdcontrol.  Not a security issue.

* Fix an overflow in the protocol search.  This can only overflow a
  static array by one element and is not likely able to cause a security
  issue.

Dragonfly-bugs: 3012 (dcb)

7 years agolibtelnet - Fix improper statement construction (not a bug in the binary)
Matthew Dillon [Tue, 11 Apr 2017 05:19:30 +0000 (22:19 -0700)]
libtelnet - Fix improper statement construction (not a bug in the binary)

* libstand hammer1.c - remove extra format element in debugging printf.
  This code is not compiled by the build anyway.

* Fix statement construction in rsaencpwd.c.  The prior code generated
  the desired result (incrementing the ptr), but there was an extra
  ineffective indirection.  Removed the ineffective indirection.

Dragonfly-bugs: 3010 (dcb)

7 years agolibdevstat - Limit sscanf field, fix redundant condition
Matthew Dillon [Tue, 11 Apr 2017 05:13:55 +0000 (22:13 -0700)]
libdevstat - Limit sscanf field, fix redundant condition

* Limit a sscanf field to MAXHOSTNAMELEN - 1.

* Remove a redundant condition already tested by the first part of a
  conditional.

Dragonfly-bugs: 3009 (dcb)

7 years agolibalias - Cleanup unused variable
Matthew Dillon [Tue, 11 Apr 2017 05:06:54 +0000 (22:06 -0700)]
libalias - Cleanup unused variable

* Cleanup an unused variable.

Dragonfly-bugs: 3008 (dcb)

7 years agoopenssh - Fix a broken assignment
Matthew Dillon [Tue, 11 Apr 2017 05:01:03 +0000 (22:01 -0700)]
openssh - Fix a broken assignment

* Fix a broken assignment.  NOTE: OpenSSH master already has this fix.

* Document dangerous sscanf()s, but note that it is not possible for a
  buffer overflow to occur in these cases.

Dragonfly-bugs: 3007 (dcb)

7 years agowindow - Fix Graphics capability enable test
Matthew Dillon [Tue, 11 Apr 2017 04:50:14 +0000 (21:50 -0700)]
window - Fix Graphics capability enable test

* Fix Graphics capability enable test, code type-o, logical OR has to be AND.

Dragonfly-bugs: 3005 (dcb)

7 years agokernel - Fix event preset
Matthew Dillon [Tue, 11 Apr 2017 04:47:51 +0000 (21:47 -0700)]
kernel - Fix event preset

* Enable all events was not enabling all events.  Fix the memset().

Dragonfly-bugs: 3004 (dcb)

7 years agomfiutil - Fix static buffer overflow
Matthew Dillon [Tue, 11 Apr 2017 04:41:43 +0000 (21:41 -0700)]
mfiutil - Fix static buffer overflow

* Fix static buffer that is too small.  Use a dynamic asprintf()
  instead.

Dragonfly-bugs: 3002 (dcb)

7 years agopf: Don't assume # of network procecssing CPUs is power-of-2
Sepherosa Ziehau [Mon, 10 Apr 2017 10:05:04 +0000 (18:05 +0800)]
pf: Don't assume # of network procecssing CPUs is power-of-2

Reviewed-by: dillon@
7 years agotoeplitz: Add comment.
Sepherosa Ziehau [Mon, 10 Apr 2017 10:04:52 +0000 (18:04 +0800)]
toeplitz: Add comment.

7 years agosbin/newfs_hammer: Add /* not reached */ for usage()
Tomohiro Kusumi [Mon, 10 Apr 2017 22:16:24 +0000 (01:16 +0300)]
sbin/newfs_hammer: Add /* not reached */ for usage()

7 years agosbin/mount_hammer: Add /* not reached */
Tomohiro Kusumi [Mon, 10 Apr 2017 22:00:41 +0000 (01:00 +0300)]
sbin/mount_hammer: Add /* not reached */

7 years agosbin/newfs_hammer: Add /* not reached */
Tomohiro Kusumi [Mon, 10 Apr 2017 21:57:35 +0000 (00:57 +0300)]
sbin/newfs_hammer: Add /* not reached */

7 years agosbin/hammer: Partly bring back removed braces from 52e2f1b5
Tomohiro Kusumi [Mon, 10 Apr 2017 17:20:40 +0000 (20:20 +0300)]
sbin/hammer: Partly bring back removed braces from 52e2f1b5

based on comments from dillon@.

(dillon) three types, yah.  (1) multi-line condition in if(), (2) if TRUE or FALSE body spans more than one line, put braces around both
(dillon) (including if a comment is part of the body)

7 years agosbin/newfs_hammer: Partly bring back removed braces from 46689eca
Tomohiro Kusumi [Mon, 10 Apr 2017 16:53:20 +0000 (19:53 +0300)]
sbin/newfs_hammer: Partly bring back removed braces from 46689eca

based on comments from dillon@.

(dillon) three types, yah.  (1) multi-line condition in if(), (2) if TRUE or FALSE body spans more than one line, put braces around both
(dillon) (including if a comment is part of the body)

7 years agosbin/mount_hammer: Partly bring back removed braces from a90e74c5
Tomohiro Kusumi [Mon, 10 Apr 2017 16:46:21 +0000 (19:46 +0300)]
sbin/mount_hammer: Partly bring back removed braces from a90e74c5

based on comments from dillon@.

(dillon) three types, yah.  (1) multi-line condition in if(), (2) if TRUE or FALSE body spans more than one line, put braces around both
(dillon) (including if a comment is part of the body)

7 years agonetisr: Use netisr_ncpus to convert hash to cpuid.
Sepherosa Ziehau [Mon, 10 Apr 2017 05:37:27 +0000 (13:37 +0800)]
netisr: Use netisr_ncpus to convert hash to cpuid.

And factor out netisr_hashlsb() for future use.

7 years agonet: Reorder sysinit a bit.
Sepherosa Ziehau [Mon, 10 Apr 2017 09:06:29 +0000 (17:06 +0800)]
net: Reorder sysinit a bit.

7 years agosbin/hammer: Make info command print a proper error message
Tomohiro Kusumi [Sun, 9 Apr 2017 17:10:25 +0000 (20:10 +0300)]
sbin/hammer: Make info command print a proper error message

Printing a function name of some library makes no sense.

7 years agosbin/hammer: Make info command properly handle non HAMMER path
Tomohiro Kusumi [Sun, 9 Apr 2017 16:46:20 +0000 (19:46 +0300)]
sbin/hammer: Make info command properly handle non HAMMER path

This shouldn't be needed if i/f of libhammer were carefully designed,
but this seems to be the only guaranteed way to detect non HAMMER path,
and print a proper error message that makes sense for UFS, etc.

-- before this commit
 # hammer info /boot
 hammer: libhammer_get_fsinfo     <--- ???

-- with this commit
 # hammer info /boot
 hammer: /boot is probably not a HAMMER filesystem: Inappropriate ioctl for device

7 years agosbin/mount_hammer: Cleanup blocks with a single statement
Tomohiro Kusumi [Sun, 9 Apr 2017 00:05:54 +0000 (03:05 +0300)]
sbin/mount_hammer: Cleanup blocks with a single statement

This commit basically does the same as what Linux kernel's coding
style mentions for braces, which is basically the same with BSDs.
https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst#3-placing-braces-and-spaces

No diff in sbin/mount_hammer/mount_hammer binary when assert(3)
is disabled.

7 years agosbin/newfs_hammer: Cleanup blocks with a single statement
Tomohiro Kusumi [Sun, 9 Apr 2017 00:05:29 +0000 (03:05 +0300)]
sbin/newfs_hammer: Cleanup blocks with a single statement

This commit basically does the same as what Linux kernel's coding
style mentions for braces, which is basically the same with BSDs.
https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst#3-placing-braces-and-spaces

No diff in sbin/newfs_hammer/newfs_hammer binary when assert(3)
is disabled.

7 years agosbin/hammer: Cleanup blocks with a single statement
Tomohiro Kusumi [Sun, 9 Apr 2017 00:04:16 +0000 (03:04 +0300)]
sbin/hammer: Cleanup blocks with a single statement

This commit basically does the same as what Linux kernel's coding
style mentions for braces, which is basically the same with BSDs.
https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst#3-placing-braces-and-spaces

No diff in sbin/hammer/hammer binary when assert(3) is disabled.

7 years agoifpoll: Use netisr_ncpus.
Sepherosa Ziehau [Sun, 9 Apr 2017 05:23:13 +0000 (13:23 +0800)]
ifpoll: Use netisr_ncpus.

7 years agoifpoll: Use SYSINIT to initialize per-cpu ifpoll context.
Sepherosa Ziehau [Sun, 9 Apr 2017 05:20:47 +0000 (13:20 +0800)]
ifpoll: Use SYSINIT to initialize per-cpu ifpoll context.

7 years agosys/vfs/hammer: Add __hammer_crc_get_xxx() for CRC test retry
Tomohiro Kusumi [Sat, 8 Apr 2017 16:53:12 +0000 (19:53 +0300)]
sys/vfs/hammer: Add __hammer_crc_get_xxx() for CRC test retry

On retry, we don't need extra conditionals inlined (once or twice)
from calling hammer_datacrc(), since we know retry uses old crc.

Newly added inline functions are renamed versions of original ones
before 4c09d9c4.

7 years agosys/vfs/hammer: Cleanups on CRC functions
Tomohiro Kusumi [Sat, 8 Apr 2017 16:39:47 +0000 (19:39 +0300)]
sys/vfs/hammer: Cleanups on CRC functions

Just sync style with other part of the same file.

7 years agosys/vfs/hammer: Add comments on volume version 7 CRC (4c09d9c4)
Tomohiro Kusumi [Thu, 6 Apr 2017 23:18:01 +0000 (02:18 +0300)]
sys/vfs/hammer: Add comments on volume version 7 CRC (4c09d9c4)

There's no official documentation on this, but shouldn't be necessary
as CRC change does nothing directly to users.

7 years agoinpcb: Use netisr_ncpus for listing inpcbs.
Sepherosa Ziehau [Sat, 8 Apr 2017 06:38:06 +0000 (14:38 +0800)]
inpcb: Use netisr_ncpus for listing inpcbs.

7 years agosyncache: Use netisr_ncpus instead of ncpus2
Sepherosa Ziehau [Sat, 8 Apr 2017 05:52:02 +0000 (13:52 +0800)]
syncache: Use netisr_ncpus instead of ncpus2

7 years agosyncache: Cache align per-cpu data.
Sepherosa Ziehau [Sat, 8 Apr 2017 05:51:15 +0000 (13:51 +0800)]
syncache: Cache align per-cpu data.

7 years agoipdemux: Use netisr_ncpus instead of ncpus2.
Sepherosa Ziehau [Sat, 8 Apr 2017 05:36:23 +0000 (13:36 +0800)]
ipdemux: Use netisr_ncpus instead of ncpus2.

7 years agoinet6: Restore mbuf hash after defragmentation.
Sepherosa Ziehau [Sat, 8 Apr 2017 13:26:40 +0000 (21:26 +0800)]
inet6: Restore mbuf hash after defragmentation.

Reported-by: zach
7 years agoipfrag: Max # of frags per-cpu should use ncpus instead of ncpus2.
Sepherosa Ziehau [Sat, 8 Apr 2017 02:10:15 +0000 (10:10 +0800)]
ipfrag: Max # of frags per-cpu should use ncpus instead of ncpus2.

7 years agoinet: Use netisr_ncpus for ifdetach inet processing.
Sepherosa Ziehau [Sat, 8 Apr 2017 02:01:24 +0000 (10:01 +0800)]
inet: Use netisr_ncpus for ifdetach inet processing.

7 years agoBump __DragonFly_version
John Marino [Fri, 7 Apr 2017 19:12:02 +0000 (14:12 -0500)]
Bump __DragonFly_version

There have been several signficant changes recently, including the
relocation of the signal trampline, a new KERN_PROC_SIGTRAMP sysctl,
the implementation of the NX (no-execute) pmap bit and the
machdep.pmap_nx_enable TUNABLE.

7 years agoarp: Group llinfo and timer together.
Sepherosa Ziehau [Fri, 7 Apr 2017 07:27:06 +0000 (15:27 +0800)]
arp: Group llinfo and timer together.

7 years agoarp: Ignore ARP probes by default.
Sepherosa Ziehau [Fri, 7 Apr 2017 07:15:44 +0000 (15:15 +0800)]
arp: Ignore ARP probes by default.

ARP probes are widely used by Cisco switches.

7 years agoarp: ARP entry list should be initialized on all available CPUs.
Sepherosa Ziehau [Fri, 7 Apr 2017 06:30:38 +0000 (14:30 +0800)]
arp: ARP entry list should be initialized on all available CPUs.

7 years agodrm: Include opt_drm.h so that 'options VGA_SWITCHEROO' will be seen by vga_switcheroo.h.
Peeter Must [Wed, 5 Apr 2017 13:18:49 +0000 (16:18 +0300)]
drm: Include opt_drm.h so that 'options VGA_SWITCHEROO' will be seen by vga_switcheroo.h.

7 years agonet: Make netisr_ncpus sysctl read-only.
Sepherosa Ziehau [Wed, 5 Apr 2017 05:52:28 +0000 (13:52 +0800)]
net: Make netisr_ncpus sysctl read-only.

7 years agonet: Define # of cpus for network processing.
Sepherosa Ziehau [Wed, 5 Apr 2017 05:44:24 +0000 (13:44 +0800)]
net: Define # of cpus for network processing.

Ease ncpus2 -> ncpus transition.

7 years agonet: netisr_cpu -> netisr_threads; no functional changes.
Sepherosa Ziehau [Tue, 4 Apr 2017 09:22:45 +0000 (17:22 +0800)]
net: netisr_cpu -> netisr_threads; no functional changes.

7 years agonet: Get rid of ifnet threads.
Sepherosa Ziehau [Mon, 3 Apr 2017 14:34:34 +0000 (22:34 +0800)]
net: Get rid of ifnet threads.

7 years agoipfw3: Reduce dependency on ifnet threads.
Sepherosa Ziehau [Mon, 3 Apr 2017 14:16:37 +0000 (22:16 +0800)]
ipfw3: Reduce dependency on ifnet threads.

Prepare to get rid of them.

7 years agoipfw: Reduce dependency on ifnet threads.
Sepherosa Ziehau [Mon, 3 Apr 2017 13:38:20 +0000 (21:38 +0800)]
ipfw: Reduce dependency on ifnet threads.

Prepare to get rid of them.

7 years agobridge: Reduce dependency on ifnet threads.
Sepherosa Ziehau [Mon, 3 Apr 2017 09:27:16 +0000 (17:27 +0800)]
bridge: Reduce dependency on ifnet threads.

Prepare to get rid of them.

7 years agovlan: Reduce dependency on ifnet threads.
Sepherosa Ziehau [Sun, 2 Apr 2017 13:55:51 +0000 (21:55 +0800)]
vlan: Reduce dependency on ifnet threads.

Prepare to get rid of them.

7 years agoipflow: Reduce dependency on ifnet threads.
Sepherosa Ziehau [Sun, 2 Apr 2017 13:27:35 +0000 (21:27 +0800)]
ipflow: Reduce dependency on ifnet threads.

Prepare to get rid of them.

7 years agonet: Reduce dependency on ifnet threads.
Sepherosa Ziehau [Sun, 2 Apr 2017 12:42:52 +0000 (20:42 +0800)]
net: Reduce dependency on ifnet threads.

Prepare to get rid of them.

7 years agokernel - Implement NX (3) - cleanup
Matthew Dillon [Tue, 4 Apr 2017 17:57:40 +0000 (10:57 -0700)]
kernel - Implement NX (3) - cleanup

* Cleanup extra PROT_EXEC's.

7 years agokernel - Implement machdep.pmap_nx_enable TUNABLE
Matthew Dillon [Tue, 4 Apr 2017 17:46:57 +0000 (10:46 -0700)]
kernel - Implement machdep.pmap_nx_enable TUNABLE

* Implement machdep.pmap_nx_enable TUNABLE.  You can set this to 0
  in /boot/loader.conf to disable the NX feature.

* Also conditionalize on the cpu feature bit being present.

7 years agobsd-family-tree: Sync with FreeBSD (DragonFly 4.8.0, macOS 10.12).
Sascha Wildner [Tue, 4 Apr 2017 11:50:35 +0000 (13:50 +0200)]
bsd-family-tree: Sync with FreeBSD (DragonFly 4.8.0, macOS 10.12).

7 years agoReally ensure that our world/kernel are built under POSIX locale ("C").
Sascha Wildner [Tue, 4 Apr 2017 11:49:28 +0000 (13:49 +0200)]
Really ensure that our world/kernel are built under POSIX locale ("C").

dedd9a18e4bbd4f206f9d7f4dba97b92a85e5d49 used LANG but that won't
override any LC_* that are already set.

7 years agokernel - Implement NX (2)
Matthew Dillon [Mon, 3 Apr 2017 23:18:39 +0000 (16:18 -0700)]
kernel - Implement NX (2)

* Flesh out NX implementation for main kernel.

* Implement NX support for the vkernel.

7 years agokernel - Implement NX
Matthew Dillon [Mon, 3 Apr 2017 20:38:56 +0000 (13:38 -0700)]
kernel - Implement NX

* Implement the NX (no-execute) pmap bit.

* Shift sigtramp down to a page-bound and protect it prot|VM_PROT_EXECUTE.

* Map the rest of the user stack VM_PROT_READ|VM_PROT_WRITE without
  VM_PROT_EXECUTE.

7 years agoif_vtnet - Add back vtnet_tx_size variable for now, to fix build.
Imre Vadász [Sun, 2 Apr 2017 20:17:26 +0000 (22:17 +0200)]
if_vtnet - Add back vtnet_tx_size variable for now, to fix build.

7 years agosbin/hammer: Remove local variables only used within assert(3)
Tomohiro Kusumi [Sun, 2 Apr 2017 18:45:44 +0000 (21:45 +0300)]
sbin/hammer: Remove local variables only used within assert(3)

These are bothering compile with assert(3) disabled.
Assertions are still there, but local variables are removed.

7 years agolibc/libpthread: Inject threadsafe locking callbacks for rtld.
Imre Vadász [Sun, 2 Apr 2017 11:50:15 +0000 (13:50 +0200)]
libc/libpthread: Inject threadsafe locking callbacks for rtld.

* Make rtld thread-safe. Add lib/libthread_xu/thread/thr_rtld.c
  to the build and use it to inject pthread based locking callbacks
  for rtld.

* In rtld_lock.c, do the thread_mask_clear(lock->mask); after releasing
  the actual lock, to avoid deadlocks when rtld is called recursively
  from the pthread locking callbacks.
  XXX An alternative solution for this issue would be, to flag the
      libpthread dynamic library as bind_now to avoid the recursive rtld
      calls.

7 years agoif_vtnet - Remove vtnet_{rx,tx}_size variables. Change rx_header padding.
Imre Vadász [Mon, 6 Mar 2017 21:21:40 +0000 (22:21 +0100)]
if_vtnet - Remove vtnet_{rx,tx}_size variables. Change rx_header padding.

* With a padding of 2 bytes, struct vtnet_rx_header will be 12 bytes now,
  which should be correct to ensure the 4 byte alignment of the frame
  payload, when mergeable Rx buffers are not negotiated.

7 years agovirtio_blk - No need to negotiate unused (and legacy) VIRTIO_BLK_F_BARRIER.
Imre Vadász [Sun, 2 Apr 2017 10:25:00 +0000 (12:25 +0200)]
virtio_blk - No need to negotiate unused (and legacy) VIRTIO_BLK_F_BARRIER.

7 years agoif_vtnet - Default to link up, when VIRTIO_NET_F_STATUS is not negotiated.
Imre Vadász [Sun, 12 Mar 2017 21:01:08 +0000 (22:01 +0100)]
if_vtnet - Default to link up, when VIRTIO_NET_F_STATUS is not negotiated.

7 years agovirtio_blk - Clean up some unneeded functionalities.
Imre Vadász [Sat, 18 Feb 2017 23:19:09 +0000 (00:19 +0100)]
virtio_blk - Clean up some unneeded functionalities.

* Get rid of remaining code for handling the B_ORDERED flag.
  B_ORDERED doesn't even exist anymore in DragonFly.

* Get rid of sc->vtblk_req_ready request list. We can just use
  bioqdisksort() to add a request - that we failed to enqueue ino the
  virtqueue - back into the bioq.

* Rename req->vbr_bp field to req->vbr_bio.

* Switch vtblk_req_free list from TAILQ to SLIST. A small optimization,
  none of the additional features of the TAILQ are needed here.

7 years agovirtio: Replace one cpu_mfence() by cpu_lfence(), and one by cpu_sfence().
Imre Vadász [Mon, 13 Feb 2017 19:16:14 +0000 (20:16 +0100)]
virtio: Replace one cpu_mfence() by cpu_lfence(), and one by cpu_sfence().

* The cpu_mfence() in virtqueue_dequeue() can be replaced by cpu_lfence(),
  since we only need to make sure that we read the vq->vq_ring.used->idx
  value before reading any other entries from the vq->vq_ring.used ring.

* The cpu_mfence() in vq_ring_update_avail() can be replaced by
  cpu_sfence(), since no one else is writing to the vq->vq_ring.avail
  struct.

7 years agovirtio - Get rid of nop {vtblk/vtnet}_modevent methods.
Imre Vadász [Sat, 11 Mar 2017 18:19:41 +0000 (19:19 +0100)]
virtio - Get rid of nop {vtblk/vtnet}_modevent methods.

7 years agokernel - Fix broken wakeup in crypto code
Matthew Dillon [Sat, 1 Apr 2017 23:43:28 +0000 (16:43 -0700)]
kernel - Fix broken wakeup in crypto code

* Depending on which crypto driver is being used and the crypto load,
  the crp_sleep variable for the wrong tdinfo is tested to determine
  whether a wakeup is needed or not.  This can result in the crypto thread
  not being woken up when new work is pending.

* Can cause the crypto subsystem to stall indefinitely, in particular
  during a normal shutdown,

Reported-by: jh32
7 years agoFix some cases where an index was used before its limits check.
Sascha Wildner [Fri, 31 Mar 2017 14:58:37 +0000 (16:58 +0200)]
Fix some cases where an index was used before its limits check.

Dragonfly-bugs: 2998, 2999, 3000, 3001

7 years agolibkvm: Fix char pointer dereference.
Sascha Wildner [Fri, 31 Mar 2017 13:18:28 +0000 (15:18 +0200)]
libkvm: Fix char pointer dereference.

7 years agousr.sbin/Makefile: Fix sorting.
Sascha Wildner [Fri, 31 Mar 2017 07:08:18 +0000 (09:08 +0200)]
usr.sbin/Makefile: Fix sorting.

7 years agouefi.8: Leave the .Dd.
Sascha Wildner [Fri, 31 Mar 2017 07:03:30 +0000 (09:03 +0200)]
uefi.8: Leave the .Dd.

7 years agoPartly revert "uefi.8: Extend SEE ALSO and fix HISTORY."
Sascha Wildner [Fri, 31 Mar 2017 06:58:21 +0000 (08:58 +0200)]
Partly revert "uefi.8: Extend SEE ALSO and fix HISTORY."

This partly reverts commit 2bd356f2144fabf57cc538aa4ebb0a70c1baacc9.

UEFI boot support as such was indeed added in 4.5. 4.7 only added
support to the installer.

7 years agouefi.8: Extend SEE ALSO and fix HISTORY.
Sascha Wildner [Fri, 31 Mar 2017 06:53:40 +0000 (08:53 +0200)]
uefi.8: Extend SEE ALSO and fix HISTORY.

7 years agoefisetup.8: Some mdoc improvements.
Sascha Wildner [Fri, 31 Mar 2017 06:53:11 +0000 (08:53 +0200)]
efisetup.8: Some mdoc improvements.

7 years agoefisetup(8): Fix permissions in the tree.
Sascha Wildner [Fri, 31 Mar 2017 06:52:41 +0000 (08:52 +0200)]
efisetup(8): Fix permissions in the tree.

7 years agomdoc: Fix manlint warning in efisetup.8
Sascha Wildner [Fri, 31 Mar 2017 06:52:06 +0000 (08:52 +0200)]
mdoc: Fix manlint warning in efisetup.8

7 years ago<sys/libkern.h>: Fix whitespace/indent, remove arg names in prototypes.
Sascha Wildner [Fri, 31 Mar 2017 06:35:01 +0000 (08:35 +0200)]
<sys/libkern.h>: Fix whitespace/indent, remove arg names in prototypes.

7 years ago<machine/stdint.h>: Check __cplusplus first.
Sascha Wildner [Fri, 31 Mar 2017 06:27:58 +0000 (08:27 +0200)]
<machine/stdint.h>: Check __cplusplus first.

Avoids -Wundef warnings when compiling C++ (which does not define
__STDC_VERSION__).

7 years agotest/vkernel - Add MAKE_JOBS
Antonio Huete Jimenez [Thu, 30 Mar 2017 23:43:08 +0000 (01:43 +0200)]
test/vkernel - Add MAKE_JOBS

7 years agonrelease - Show MAKE_JOBS in help
Antonio Huete Jimenez [Thu, 30 Mar 2017 23:27:05 +0000 (01:27 +0200)]
nrelease - Show MAKE_JOBS in help

7 years agovkernel - Fix build
Antonio Huete Jimenez [Thu, 30 Mar 2017 22:54:24 +0000 (00:54 +0200)]
vkernel - Fix build

7 years agomixer - Fix sscanf() overflow
Matthew Dillon [Thu, 30 Mar 2017 21:04:14 +0000 (14:04 -0700)]
mixer - Fix sscanf() overflow

* Fix %s buffer sizes in sscanf().

Reported-by: dcb
7 years agogcore - fix overflow in sscanf
Matthew Dillon [Thu, 30 Mar 2017 21:02:47 +0000 (14:02 -0700)]
gcore - fix overflow in sscanf

* Fix an overflow which can occur in the sscanf() used to parse
  /proc/*/map

Reported-by: dcb
7 years agocamcontrol - non-critical fgetc() cleanup
Matthew Dillon [Thu, 30 Mar 2017 20:53:05 +0000 (13:53 -0700)]
camcontrol - non-critical fgetc() cleanup

* fgetc() returns int, check EOF against int return, not char.

Reported-by: dcb