freebsd.git
8 years agoFix regression: report again if a username already exists when creating it
bapt [Sun, 2 Aug 2015 12:54:15 +0000 (12:54 +0000)]
Fix regression: report again if a username already exists when creating it

8 years agoRemove dead code
bapt [Sun, 2 Aug 2015 12:48:36 +0000 (12:48 +0000)]
Remove dead code

8 years agoRewrite parsing subcommands arguments of pw(8)
bapt [Sun, 2 Aug 2015 12:47:50 +0000 (12:47 +0000)]
Rewrite parsing subcommands arguments of pw(8)

Now each subcommands checks its arguments in a dedicated functions.

This helps improving input validation, code readability/maintainability
While here:
- Add a -y option to pw userdel/usermod so it can maintain NIS servers if
  nispasswd is not defined in pw.conf(5)
- Allow pw -r <rootdir> to remove directory with userdel -r
- Fix bug when renaming a user which was not renaming the user name it groups
  it is a member of.
- Only parse pw.conf(5) when needed.

8 years agoProperly handle IPV6_NEXTHOP socket option in selectroute().
ae [Sun, 2 Aug 2015 12:40:56 +0000 (12:40 +0000)]
Properly handle IPV6_NEXTHOP socket option in selectroute().

 o remove disabled code;
 o if nexthop address is link-local, use embedded scope zone id to
   determine outgoing interface;
 o properly fill ro_dst before doing route lookup;
 o remove LLE lookup, instead check rt_flags for RTF_GATEWAY bit.

Sponsored by: Yandex LLC

8 years agoRemove redundant check.
ae [Sun, 2 Aug 2015 11:58:24 +0000 (11:58 +0000)]
Remove redundant check.

8 years agoAdd removed tests to ObsoleteFiles.inc
bapt [Sun, 2 Aug 2015 02:23:30 +0000 (02:23 +0000)]
Add removed tests to ObsoleteFiles.inc

Submitted by: ngie

8 years agoFix a couple of markup typos.
jhb [Sun, 2 Aug 2015 02:00:20 +0000 (02:00 +0000)]
Fix a couple of markup typos.

MFC after: 2 weeks

8 years agoRename busdma_sync() to busdma_sync_range() and rename the
marcel [Sun, 2 Aug 2015 01:09:30 +0000 (01:09 +0000)]
Rename busdma_sync() to busdma_sync_range() and rename the
base and size parameters to ofs and len (resp). Add a new
busdma_sync() that makes the entire MD coherent.

8 years agoRegenerate after r286174.
markj [Sun, 2 Aug 2015 00:56:16 +0000 (00:56 +0000)]
Regenerate after r286174.

8 years agoAdd a src.conf option to build and install the DTrace test suite.
markj [Sun, 2 Aug 2015 00:37:33 +0000 (00:37 +0000)]
Add a src.conf option to build and install the DTrace test suite.

Reviewed by: gnn, ngie
Differential Revision: https://reviews.freebsd.org/D3195

8 years agoRemove netbsd tests on pw(8)
bapt [Sun, 2 Aug 2015 00:33:34 +0000 (00:33 +0000)]
Remove netbsd tests on pw(8)

First they are redundant with the tests we currently have on pw(8)
Second they to modify the host database instead of being self contained withing
the test directory

8 years agoDon't hardcode the module or function component of lockstat probes.
markj [Sun, 2 Aug 2015 00:24:21 +0000 (00:24 +0000)]
Don't hardcode the module or function component of lockstat probes.

MFC after: 1 week

8 years ago- Remove hardcoded paths for the perl executable.
markj [Sun, 2 Aug 2015 00:23:18 +0000 (00:23 +0000)]
- Remove hardcoded paths for the perl executable.
- Rather than assuming that a process is listening on 127.0.0.1:22, use
  nc(1) to find an available port and bind to it for the duration of the
  test.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agomark this function as deprecated, and put the warning first, since I
jmg [Sun, 2 Aug 2015 00:22:14 +0000 (00:22 +0000)]
mark this function as deprecated, and put the warning first, since I
doubt most people will read to the end...  Note the use of sys/cdefs.h
for pre-C11 compilers...

I didn't included a note about being compatibile w/ userland since a
C11 feature should be obviously usable in userland...

Suggested by: imp

8 years agoPerform bounds checking when constructing a format string.
markj [Sun, 2 Aug 2015 00:18:48 +0000 (00:18 +0000)]
Perform bounds checking when constructing a format string.

This was detected by the FORTIFY_SOURCE build.

PR: 201657
Reported by: pfg
MFC after: 2 weeks

8 years agoconvert to C11's _Static_assert, and pull in sys/cdefs.h for
jmg [Sun, 2 Aug 2015 00:15:52 +0000 (00:15 +0000)]
convert to C11's _Static_assert, and pull in sys/cdefs.h for
compatibility w/ older non-C11 compilers...

passed make tinerdbox..

Suggested by: imp

8 years agoAvoid dereferencing curthread->td_proc->p_cred in DTrace probe context.
markj [Sun, 2 Aug 2015 00:11:56 +0000 (00:11 +0000)]
Avoid dereferencing curthread->td_proc->p_cred in DTrace probe context.

When a process is exiting, there is a narrow window where p_cred may be
NULL while its threads are still executing. Specifically, the last thread
to exit a process sets the process state to PRS_ZOMBIE with the proc
spinlock held and then calls thread_exit(). thread_exit() drops the spin
lock, permitting the process to be reaped and thus causing its cred struct
to be released. However, the exiting thread may still cause DTrace probes
to fire by calling sched_throw(), resulting in a double fault if such a
probe enabling attempts to access the GID or UID DIF variables.

The thread's cred reference is not susceptible to this race since it is not
released until after the thread has exited.

MFC after: 1 week

8 years agoDon't modify curthread->td_locks unless INVARIANTS is enabled.
markj [Sun, 2 Aug 2015 00:03:08 +0000 (00:03 +0000)]
Don't modify curthread->td_locks unless INVARIANTS is enabled.

This field is only used in a KASSERT that verifies that no locks are held
when returning to user mode. Moreover, the td_locks accounting is only
correct when LOCK_DEBUG > 0, which is implied by INVARIANTS.

Reviewed by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3205

8 years agoSet output pin initial value based on pin's pinmux pullup/pulldown setup
gonzo [Sat, 1 Aug 2015 23:10:36 +0000 (23:10 +0000)]
Set output pin initial value based on pin's pinmux pullup/pulldown setup

Some of FDT blobs for AM335x-based devices use pinmux pullup/pulldown
flag to setup initial GPIO ouputp value, e.g. 4DCAPE-43 sets LCD DATAEN
signal this way. It works for Linux because Linux driver does not enforce
pin direction until after it's requested by consumer. So input with pullup
flag set acts as output with GPIO_HIGH value

Reviewed by: loos

8 years agorc.subr: Allow rc.conf.d with multi-directory local_startup.
jilles [Sat, 1 Aug 2015 22:00:25 +0000 (22:00 +0000)]
rc.subr: Allow rc.conf.d with multi-directory local_startup.

I also changed ${...%*/rc.d} to ${...%/rc.d} since the shortest match always
has an empty string for the asterisk.

PR: 201641
Submitted by: Jamie Landeg-Jones (original version)
MFC after: 1 week

8 years agoFree mbufs when busdma loading fails.
hselasky [Sat, 1 Aug 2015 20:40:37 +0000 (20:40 +0000)]
Free mbufs when busdma loading fails.

Reviewed by: erj, sbruno
MFC after: 1 month

8 years ago- Add myself to the calendar.freebsd. (fix typo in r286160)
junovitch [Sat, 1 Aug 2015 17:48:35 +0000 (17:48 +0000)]
- Add myself to the calendar.freebsd. (fix typo in r286160)

Approved by: delphij (mentor)
Differential Revision: https://reviews.FreeBSD.org/D3265

8 years ago- Add myself to the committers-ports.dot and add my mentor relationship.
junovitch [Sat, 1 Aug 2015 17:29:52 +0000 (17:29 +0000)]
- Add myself to the committers-ports.dot and add my mentor relationship.
- Add myself to the calendar.freebsd.

Approved by: delphij (mentor)
Differential Revision: https://reviews.FreeBSD.org/D3265

8 years agouse : instead of true...
jmg [Sat, 1 Aug 2015 17:27:47 +0000 (17:27 +0000)]
use : instead of true...

Change file file to file1 file2, partly for igor, and partly because
it's odd to pass the same file to a command twice..

8 years agoClear P_TRACED before reparenting a detached process back to its
jhb [Sat, 1 Aug 2015 16:27:52 +0000 (16:27 +0000)]
Clear P_TRACED before reparenting a detached process back to its
original parent. Otherwise the debugee will be set as an orphan of
the debugger.

Add tests for tracing forks via PT_FOLLOW_FORK.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D2809

8 years agoRemove things that crept in after badly checked revert
bapt [Sat, 1 Aug 2015 12:20:55 +0000 (12:20 +0000)]
Remove things that crept in after badly checked revert

8 years agoPartial revert of r286152
bapt [Sat, 1 Aug 2015 12:18:48 +0000 (12:18 +0000)]
Partial revert of r286152

More work needed on the cli validation

8 years agoFix build
bapt [Sat, 1 Aug 2015 11:52:48 +0000 (11:52 +0000)]
Fix build

8 years agoFix formatting of new code
bapt [Sat, 1 Aug 2015 11:31:59 +0000 (11:31 +0000)]
Fix formatting of new code
Fix sorting or errstr
Remove useless initialisation or errstr

Reported by: bde

8 years agoRevert r286148
bapt [Sat, 1 Aug 2015 10:40:17 +0000 (10:40 +0000)]
Revert r286148

8 years agoValidate expiration days and password days from commmand line and pw.conf
bapt [Sat, 1 Aug 2015 10:25:55 +0000 (10:25 +0000)]
Validate expiration days and password days from commmand line and pw.conf

8 years agoValidate the max_uid/max_gid boundaries and entry type in pw.conf
bapt [Sat, 1 Aug 2015 10:10:13 +0000 (10:10 +0000)]
Validate the max_uid/max_gid boundaries and entry type in pw.conf

8 years agoCast uid/git to uintmax_t when using printf-like functions so the size of
bapt [Sat, 1 Aug 2015 09:55:47 +0000 (09:55 +0000)]
Cast uid/git to uintmax_t when using printf-like functions so the size of
uid/gid size remains a implementation detail

8 years agoHandle +:*:: the same way we handle +::: when checking group file
bapt [Sat, 1 Aug 2015 08:39:55 +0000 (08:39 +0000)]
Handle +:*:: the same way we handle +::: when checking group file

The first is what the documentation recommands for NIS client

8 years agoUse strtoumax instead of strtoul
bapt [Sat, 1 Aug 2015 08:35:20 +0000 (08:35 +0000)]
Use strtoumax instead of strtoul

8 years agoAllow CloudABI processes to create shared memory objects.
ed [Sat, 1 Aug 2015 07:51:48 +0000 (07:51 +0000)]
Allow CloudABI processes to create shared memory objects.

Summary:
Use the newly created `kern_shm_open()` function to create objects with
just the rights that are actually needed.

Reviewers: jhb, kib

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D3260

8 years agoAdd kern_shm_open().
ed [Sat, 1 Aug 2015 07:21:14 +0000 (07:21 +0000)]
Add kern_shm_open().

This allows you to specify the capabilities that the new file descriptor
should have. This allows us to create shared memory objects that only
have the rights we're interested in.

The idea behind restricting the rights is that it makes it a lot easier
for CloudABI to get consistent behaviour across different operating
systems. We only need to make sure that a shared memory implementation
consistently implements the operations that are whitelisted.

Approved by: kib
Obtained from: https://github.com/NuxiNL/freebsd

8 years agoBuffer overflow in wall(1).
pfg [Sat, 1 Aug 2015 01:29:55 +0000 (01:29 +0000)]
Buffer overflow in wall(1).

Revert r286102 and apply a cleaner fix.
Tested for overflows by FORTIFY_SOURCE GSoC (with clang).

Suggested by: bde
Reviewed by: Oliver Pinter
Tested by: Oliver Pinter
MFC after: 3 days

8 years agoAdd support for keys that include 4 byte SALT values,
gnn [Fri, 31 Jul 2015 23:40:18 +0000 (23:40 +0000)]
Add support for keys that include 4 byte SALT values,
including GCM and ICM/CTR modes for AES.

Reviewed by: jmg
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)

8 years agoRemove two unnecessary sleeps from the hot path in bpf(4).
loos [Fri, 31 Jul 2015 21:43:27 +0000 (21:43 +0000)]
Remove two unnecessary sleeps from the hot path in bpf(4).

The first one never triggers because bpf_canfreebuf() can only be true for
zero-copy buffers and zero-copy buffers are not read with read(2).

The second also never triggers, because we check the free buffer before
calling ROTATE_BUFFERS().  If the hold buffer is in use the free buffer
will be NULL and there is nothing else to do besides drop the packet.  If
the free buffer isn't NULL the hold buffer _is_ free and it is safe to
rotate the buffers.

Update the comment in ROTATE_BUFFERS macro to match the logic described
here.

While here fix a few typos in comments.

MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)

8 years agoRemove the sleep from the buffer allocation routine.
loos [Fri, 31 Jul 2015 20:25:54 +0000 (20:25 +0000)]
Remove the sleep from the buffer allocation routine.

The buffer must be allocated (or even changed) before the interface is set
and thus, there is no need to verify if the buffer is in use.

MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)

8 years agoDo not allocate the buffers at opening of the descriptor, because once
loos [Fri, 31 Jul 2015 20:02:12 +0000 (20:02 +0000)]
Do not allocate the buffers at opening of the descriptor, because once
the buffer is allocated we are committed to a particular buffer method
(BPF_BUFMODE_BUFFER in this case).

If we are using zero-copy buffers, the userland program must register its
buffers before set the interface.

If we are using kernel memory buffers, we can allocate the buffer at the
time that the interface is being set.

This fix allows the usage of BIOCSETBUFMODE after r235746.

Update the comments to reflect the recent changes.

MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)

8 years agoSummary: Remove unsupported 3des-deriv encryption algorithm from documentation.
gnn [Fri, 31 Jul 2015 17:41:53 +0000 (17:41 +0000)]
Summary: Remove unsupported 3des-deriv encryption algorithm from documentation.

8 years agoUse standard 'THE AUTHOR' license text
emaste [Fri, 31 Jul 2015 16:45:42 +0000 (16:45 +0000)]
Use standard 'THE AUTHOR' license text

Approved by: jmg

8 years agoTry to put the CPU into a low power state if we failed to otherwise halt
andrew [Fri, 31 Jul 2015 15:54:34 +0000 (15:54 +0000)]
Try to put the CPU into a low power state if we failed to otherwise halt
the system.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoLoad the stack in stack_save and stack_save_td. This uses the generalised
andrew [Fri, 31 Jul 2015 15:32:32 +0000 (15:32 +0000)]
Load the stack in stack_save and stack_save_td. This uses the generalised
unwind_frame function to read each stack frame until either the pc or stack
are no longer withing the kernel's address space.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoPull pmspcv (pms(4)) from GENERIC. It has PCI ID conflicts
gjb [Fri, 31 Jul 2015 15:23:48 +0000 (15:23 +0000)]
Pull pmspcv (pms(4)) from GENERIC.  It has PCI ID conflicts
with ahd(4), mvs(4), and likely other drivers.

MFC after: immediately
With hat: re
Sponsored by: The FreeBSD Foundation

8 years agoAdd support for uma_small_alloc and uma_small_free, and make use of these.
andrew [Fri, 31 Jul 2015 14:17:26 +0000 (14:17 +0000)]
Add support for uma_small_alloc and uma_small_free, and make use of these.
This is copied from the amd64 version with minor changes. These should be
merged into a single file as from a quick look there are other copies of
the same file in other parts of the tree.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoAdd memrw. This has had minimal testing, and will likely panic the kernel
andrew [Fri, 31 Jul 2015 13:39:51 +0000 (13:39 +0000)]
Add memrw. This has had minimal testing, and will likely panic the kernel
when trying to read data from outside the DMAP region. I expect this panic
to be from within uiomove_fromphys, which needs to grow support to support
such addresses.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoAdd more atomic_swap_* functions.
andrew [Fri, 31 Jul 2015 13:34:43 +0000 (13:34 +0000)]
Add more atomic_swap_* functions.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoAdd VIRT_IN_DMAP to check if a virtual address is from the DMAP range.
andrew [Fri, 31 Jul 2015 13:32:25 +0000 (13:32 +0000)]
Add VIRT_IN_DMAP to check if a virtual address is from the DMAP range.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoAdd ELF Tool Chain's brandelf(1) to contrib
emaste [Fri, 31 Jul 2015 12:37:40 +0000 (12:37 +0000)]
Add ELF Tool Chain's brandelf(1) to contrib

Noticed by pfg after r286070 (ar and elfdump)

8 years agoFix accidental line wrapping introduced in r286122.
ed [Fri, 31 Jul 2015 10:46:45 +0000 (10:46 +0000)]
Fix accidental line wrapping introduced in r286122.

8 years agoLimit rights on process descriptors.
ed [Fri, 31 Jul 2015 10:21:58 +0000 (10:21 +0000)]
Limit rights on process descriptors.

On CloudABI, the rights bits returned by cap_rights_get() match up with
the operations that you can actually perform on the file descriptor.

Limiting the rights is good, because it makes it easier to get uniform
behaviour across different operating systems. If process descriptors on
FreeBSD would suddenly gain support for any new file operation, this
wouldn't become exposed to CloudABI processes without first extending
the rights.

Extend fork1() to gain a 'struct filecaps' argument that allows you to
construct process descriptors with custom rights. Use this in
cloudabi_sys_proc_fork() to limit the rights to just fstat() and
pdwait().

Obtained from: https://github.com/NuxiNL/freebsd

8 years agoApply erratum for mrs ICC_IAR1_EL1 speculative execution on ThunderX
zbb [Fri, 31 Jul 2015 10:00:45 +0000 (10:00 +0000)]
Apply erratum for mrs ICC_IAR1_EL1 speculative execution on ThunderX

ERRATUM:     22978, 23154
PASS (rev.): 1.0/1.1

Reviewed by:   imp
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3184

8 years agoLimit the number of times we loop inside the DWC OTG poll handler to
hselasky [Fri, 31 Jul 2015 09:12:31 +0000 (09:12 +0000)]
Limit the number of times we loop inside the DWC OTG poll handler to
avoid starving other fast interrupts. Fix a comment while at it.

MFC after: 1 week
Suggested by: Svatopluk Kraus <onwahe@gmail.com>

8 years agoAnsify if_stf.c
ae [Fri, 31 Jul 2015 09:04:22 +0000 (09:04 +0000)]
Ansify if_stf.c

8 years agoRemove unneded #include "opt_inet.h".
ae [Fri, 31 Jul 2015 09:02:28 +0000 (09:02 +0000)]
Remove unneded #include "opt_inet.h".

8 years agoDocument the existence of cloudabi_load and cloudabi64_load.
ed [Fri, 31 Jul 2015 08:45:35 +0000 (08:45 +0000)]
Document the existence of cloudabi_load and cloudabi64_load.

8 years agotemporarily fix build.. This isn't the final fix, and testing is
jmg [Fri, 31 Jul 2015 07:48:08 +0000 (07:48 +0000)]
temporarily fix build..  This isn't the final fix, and testing is
still on going, but it has passed world for mips and powerpc...

I know this has an extra semicolon, but this is the patch that is
tested...

Looks like better fix is to use _Static_assert...

8 years agocxgbe(4): initialize debug_flags from the kernel environment.
np [Fri, 31 Jul 2015 04:50:47 +0000 (04:50 +0000)]
cxgbe(4): initialize debug_flags from the kernel environment.

MFC after: 3 days

8 years agovn_io_fault() handling of the LOR for i/o into the file-backed buffers
kib [Fri, 31 Jul 2015 04:12:51 +0000 (04:12 +0000)]
vn_io_fault() handling of the LOR for i/o into the file-backed buffers
has observable overhead when the buffer pages are not resident or not
mapped.  The overhead comes at least from two factors, one is the
additional work needed to detect the situation, prepare and execute
the rollbacks.  Another is the consequence of the i/o splitting into
the batches of the held pages, causing filesystems see series of the
smaller i/o requests instead of the single large request.

Note that expected case of the resident i/o buffer does not expose
these issues.  Provide a prefaulting for the userspace i/o buffers,
disabled by default.  I am careful of not enabling prefaulting by
default for now, since it would be detrimental for the applications
which speculatively pass extra-large buffers of anonymous memory to
not deal with buffer sizing (if such apps exist).

Found and tested by: bde, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoThe implementation note isn't true anymore..
jmg [Fri, 31 Jul 2015 03:28:02 +0000 (03:28 +0000)]
The implementation note isn't true anymore..

Not that anyone reads it, but those that do, remind them that this
isn't usable in userland...  I can't wait till this doc is wrong..

8 years agoBuffer overflow in wall(1).
pfg [Fri, 31 Jul 2015 01:12:31 +0000 (01:12 +0000)]
Buffer overflow in wall(1).

This affected syslogd, wall and talkd.
Detected by FORTIFY_SOURCE GSoC (with clang).

Submitted by: Oliver Pinter
Differential Revision: https://reviews.freebsd.org/D3254
Reviewed by: delphij, jmg
MFC after: 3 days

8 years agothese are comparing authenticators and need to be constant time...
jmg [Fri, 31 Jul 2015 00:31:52 +0000 (00:31 +0000)]
these are comparing authenticators and need to be constant time...
This could be a side channel attack...  Now that we have a function
for this, use it...

jmgurney/ipsecgcm: 24d704cc and 7f37a14

8 years agoClean up this header file...
jmg [Fri, 31 Jul 2015 00:23:21 +0000 (00:23 +0000)]
Clean up this header file...

use CTASSERTs now that we have them...

Replace a draft w/ RFC that's over 10 years old.

Note that _AALG and _EALG do not need to match what the IKE daemons
think they should be..  This is part of the KABI...  I decided to
renumber AESCTR, but since we've never had working AESCTR mode, I'm
not really breaking anything..  and it shortens a loop by quite
a bit..

remove SKIPJACK IPsec support...  SKIPJACK never made it out of draft
(in 1999), only has 80bit key, NIST recommended it stop being used
after 2010, and setkey nor any of the IKE daemons I checked supported
it...

jmgurney/ipsecgcm: a357a33, c75808b, e008669, b27b6d6

Reviewed by: gnn (earlier version)

8 years agoCorrect IPSec SA statistic keeping
eri [Thu, 30 Jul 2015 20:56:27 +0000 (20:56 +0000)]
Correct IPSec SA statistic keeping

The IPsec SA statistic keeping is used even for decision making on expiry/rekeying SAs.
When there are multiple transformations being done the statistic keeping might be wrong.

This mostly impacts multiple encapsulations on IPsec since the usual scenario it is not noticed due to the code path not taken.

Differential Revision: https://reviews.freebsd.org/D3239
Reviewed by: ae, gnn
Approved by: gnn(mentor)

8 years agoRevert r285125 until rmlocks get fixed.
mjg [Thu, 30 Jul 2015 19:52:43 +0000 (19:52 +0000)]
Revert r285125 until rmlocks get fixed.

Right now there is a chance that sysctl unregister will cause reader to
block on the sx lock associated with sysctl rmlock, in which case kernels
with debug enabled will panic.

8 years agoUse correct number of arguments to semctl() for IPC_RMID.
rodrigc [Thu, 30 Jul 2015 19:44:46 +0000 (19:44 +0000)]
Use correct number of arguments to semctl() for IPC_RMID.

PR: 118292
Submitted by: araujo
Differential Revision: D2669

8 years agoFix a rendering issue in the zfs(8) manual.
gjb [Thu, 30 Jul 2015 19:34:24 +0000 (19:34 +0000)]
Fix a rendering issue in the zfs(8) manual.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoUpdate snd_una description to make it more readable.
hiren [Thu, 30 Jul 2015 19:24:49 +0000 (19:24 +0000)]
Update snd_una description to make it more readable.

Differential Revision: https://reviews.freebsd.org/D3179
Reviewed by: gnn
Sponsored by: Limelight Networks

8 years agoThe kernel option and module are actually called pmspcv.
brueffer [Thu, 30 Jul 2015 19:08:23 +0000 (19:08 +0000)]
The kernel option and module are actually called pmspcv.

MFC after: 3 days

8 years agoAdd GPIO backlight driver compatible with Linux FDT bindings.
gonzo [Thu, 30 Jul 2015 19:04:14 +0000 (19:04 +0000)]
Add GPIO backlight driver compatible with Linux FDT bindings.
Brightness is controlled through sysctl dev.gpiobacklight.X.brightness:
  - any value greater than 0: backlight is on
  - any value less than or equal to  0: backlight is off

FDT bindings docs in Linux tree:
    Documentation/devicetree/bindings/video/backlight/gpio-backlight.txt

8 years agoGet function prototypes for msg, shm, sem functions
rodrigc [Thu, 30 Jul 2015 18:59:01 +0000 (18:59 +0000)]
Get function prototypes for msg, shm, sem functions
from header files.

Differential Revision: D2669

8 years agoib mad: fix an incorrect use of list_for_each_entry
markj [Thu, 30 Jul 2015 18:28:37 +0000 (18:28 +0000)]
ib mad: fix an incorrect use of list_for_each_entry

In tf_dequeue(), if we reach the end of the list without finding a
non-cancelled element, "tmp" will be a pointer into the list head, so the
tmp->canceled check is bogus. Use a flag instead.

Submitted by: Tao Liu <Tao.Liu@isilon.com>
Reviewed by: hselasky
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3244

8 years agoDo not pretend that vm_fault(9) supports unwiring the address. Rename
kib [Thu, 30 Jul 2015 18:28:34 +0000 (18:28 +0000)]
Do not pretend that vm_fault(9) supports unwiring the address.  Rename
the VM_FAULT_CHANGE_WIRING flag to VM_FAULT_WIRE.  Assert that the
flag is only passed when faulting on the wired map entry.  Remove the
vm_page_unwire() call, which should be never reachable.

Since VM_FAULT_WIRE flag implies wired map entry, the TRYPAGER() macro
is reduced to the testing of the fs.object having a default pager.
Inline the check.

Suggested and reviewed by: alc
Tested by: pho (previous version)
MFC after: 1 week

8 years agoMake some variables and functions static.
rodrigc [Thu, 30 Jul 2015 18:08:08 +0000 (18:08 +0000)]
Make some variables and functions static.

8 years agoUpdat the committers graph
allanjude [Thu, 30 Jul 2015 17:02:23 +0000 (17:02 +0000)]
Updat the committers graph

Approved by: marcel (mentor)
Differential Revision: https://reviews.freebsd.org/D3251

8 years agoAdd enough of pmap_page_set_memattr to run gstat. It still needs to split
andrew [Thu, 30 Jul 2015 16:17:44 +0000 (16:17 +0000)]
Add enough of pmap_page_set_memattr to run gstat. It still needs to split
the DMAP 1G pages so we set the attributes only on the specified page.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoImprove comments.
kib [Thu, 30 Jul 2015 15:47:53 +0000 (15:47 +0000)]
Improve comments.

Submitted by: bde
MFC after: 2 weeks

8 years agovfs: fill fallout from r286076
royger [Thu, 30 Jul 2015 15:43:26 +0000 (15:43 +0000)]
vfs: fill fallout from r286076

This right operator is >= not =>.

Reported by: cem

8 years agovfs: fix off-by-one error in vfs_buf_check_mapped
royger [Thu, 30 Jul 2015 15:28:06 +0000 (15:28 +0000)]
vfs: fix off-by-one error in vfs_buf_check_mapped

The check added in r285872 can trigger for valid buffers if the buffer space
used happens to be just after unmapped_buf in KVA space.

Discussed with: kib
Sponsored by: Citrix Systems R&D

8 years agoGCC: Add a new option "-fstack-protector-strong"
pfg [Thu, 30 Jul 2015 14:31:09 +0000 (14:31 +0000)]
GCC: Add a new option "-fstack-protector-strong"

This includes additional functions to be protected: those that
have local array definitions, or have references to local frame
addresses. This is a new option in GCC-4.9 that was relicensed
by Han Shen from Google under GPLv2 for OpenBSD.

Obtained from: OpenBSD (2014-01-14)
MFC after: 2 weeks

8 years agoAdd ARM64TODO markers to unimplemented functionality
emaste [Thu, 30 Jul 2015 14:20:36 +0000 (14:20 +0000)]
Add ARM64TODO markers to unimplemented functionality

Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2389

8 years agoEnable IRQ during syscalls on ARM64
zbb [Thu, 30 Jul 2015 13:59:38 +0000 (13:59 +0000)]
Enable IRQ during syscalls on ARM64

FreeBSD provides a feature called Adaptive Mutexes, which allows
a thread to spin for a while when the mutex is taken instead of
immediately going to sleep. This causes issues when called from
syscall handler if interrupts are masked. If every other core
also attempts to access the same mutex there is a chance that
all of them are spinning on the same lock at the same time.
If interrupts are disabled, no kernel preemtion can occur and
the system becomes unresponsive.

This patch enables interrupts when syscall is being executed
and masks them as soon as it is completed.

Reviewed by:   andrew
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3246

8 years agoRemove obsolete vendor code from Alpine platform support
zbb [Thu, 30 Jul 2015 13:45:34 +0000 (13:45 +0000)]
Remove obsolete vendor code from Alpine platform support

This is a clean-up patch from a serie delivering support for
Annapurna Labs Alpine PoC.
The HAL files have already been added to sys/contrib/alpine-hal
so there is no need for them in the platform directory.
This patch removes obsolete files.

Reviewed by:    andrew
Obtained from:  Semihalf
Sponsored by:   Annapurna Labs
Differential Revision: https://reviews.freebsd.org/D3248

8 years agoAdd ELF Tool Chain's ar(1) and elfdump(1) to contrib
emaste [Thu, 30 Jul 2015 12:41:54 +0000 (12:41 +0000)]
Add ELF Tool Chain's ar(1) and elfdump(1) to contrib

ELF Tool Chain built on FreeBSD's ar and elfdump, but has a number of
improvements and enhancements. Bring them into contrib in order to start
integrating into our build.

8 years agoBuild if_stf(4) module only when both INET and INET6 support are enabled.
ae [Thu, 30 Jul 2015 10:26:43 +0000 (10:26 +0000)]
Build if_stf(4) module only when both INET and INET6 support are enabled.

8 years agoImprove strtounum
bapt [Thu, 30 Jul 2015 06:14:47 +0000 (06:14 +0000)]
Improve strtounum

Fix many style bugs
Better variable naming
Use C99 'restrict' were apropriate
Fix potential errno race

Submitted by: bde

8 years agoDisable blkif indirect segment I/Os in EC2 by default due to performance
cperciva [Thu, 30 Jul 2015 04:01:00 +0000 (04:01 +0000)]
Disable blkif indirect segment I/Os in EC2 by default due to performance
issues on some EC2 instance types.  Users may want to experiment with
removing this from loader.conf and measuring the performance impact on
the EC2 instances they are using.

8 years agoAdd support for Xen blkif indirect segment I/Os. This makes it possible for
cperciva [Thu, 30 Jul 2015 03:50:01 +0000 (03:50 +0000)]
Add support for Xen blkif indirect segment I/Os.  This makes it possible for
the blkfront driver to perform I/Os of up to 2 MB, subject to support from
the blkback to which it is connected and the initiation of such large I/Os
by the rest of the kernel.  In practice, the I/O size is increased from 40 kB
to 128 kB.

The changes to xen/interface/io/blkif.h consist merely of merging updates
from the upstream Xen repository.

In dev/xen/blkfront/block.h we add some convenience macros and structure
fields used for indirect-page I/Os: The device records its negotiated limit
on the number of indirect pages used, while each I/O command structure gains
permanently allocated page(s) for indirect page references and the Xen grant
references for those pages.

In dev/xen/blkfront/blkfront.c we now check in xbd_queue_cb whether a request
is small enough to handle without an indirection page, and either follow the
previous behaviour or use new code for issuing an indirect segment I/O.  In
xbd_connect we read the size of indirect segment I/Os supported by the backend
and select the maximum size we will use; then allocate the pages and Xen grant
references for each I/O command structure.  In xbd_free those grants and pages
are released.

A new loader tunable, hw.xbd.xbd_enable_indirect, can be set to 0 in order to
disable this functionality; it works by pretending that the backend does not
support this feature.  Some backends exhibit a loss of performance with large
I/Os, so users may wish to test with and without this functionality enabled.

Reviewed by: royger
MFC after: 3 days
Relnotes: yes

8 years agoFollow r256586 and rename the kernel version of the Free() macro to
loos [Thu, 30 Jul 2015 02:09:03 +0000 (02:09 +0000)]
Follow r256586 and rename the kernel version of the Free() macro to
R_Free().  This matches the other macros and reduces the chances to clash
with other headers.

This also fixes the build of radix.c outside of the kernel environment.

Reviewed by: glebius

8 years agoUse private cache line for the locked nop in *mb() on i386.
kib [Thu, 30 Jul 2015 00:13:20 +0000 (00:13 +0000)]
Use private cache line for the locked nop in *mb() on i386.

Suggested by: alc
Reviewed by: alc, bde
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoMFamd64 r285934: Remove store/load (= full) barrier from the i386
kib [Wed, 29 Jul 2015 23:59:17 +0000 (23:59 +0000)]
MFamd64 r285934: Remove store/load (= full) barrier from the i386
atomic_load_acq_*().

Noted by: alc (long time ago)
Reviewed by: alc, bde
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoconst'ify an arg that we don't update...
jmg [Wed, 29 Jul 2015 23:37:15 +0000 (23:37 +0000)]
const'ify an arg that we don't update...

8 years agoCleanup includes
bapt [Wed, 29 Jul 2015 23:26:18 +0000 (23:26 +0000)]
Cleanup includes

8 years agoThis patch fixes a problem where, if the NFSv4 server has a previous
rmacklem [Wed, 29 Jul 2015 23:06:30 +0000 (23:06 +0000)]
This patch fixes a problem where, if the NFSv4 server has a previous
unconfirmed clientid structure for the same client on the last hash list,
this old entry would not be removed/deleted. I do not think this bug would have
caused serious problems, since the new entry would have been before the old one
on the list. This old entry would have eventually been scavenged/removed.
Detected while reading the code looking for another bug.

MFC after: 3 days

8 years agoActually set the proper license
bapt [Wed, 29 Jul 2015 22:51:54 +0000 (22:51 +0000)]
Actually set the proper license

Reported by: trasz

8 years agoMK_ELFCOPY_AS_OBJCOPY should be a variable
emaste [Wed, 29 Jul 2015 21:41:15 +0000 (21:41 +0000)]
MK_ELFCOPY_AS_OBJCOPY should be a variable

PR: 201978
Submitted by: O. Hartmann
Differential Revision: https://reviews.freebsd.org/D2887

8 years agonvme: do not notify a consumer about failures that occur during initialization
jimharris [Wed, 29 Jul 2015 21:29:50 +0000 (21:29 +0000)]
nvme: do not notify a consumer about failures that occur during initialization

MFC after: 3 days
Sponsored by: Intel