]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoAdd a comment that to clarify how to determine the amount of received DDP
jhb [Thu, 10 Sep 2015 21:41:11 +0000 (21:41 +0000)]
Add a comment that to clarify how to determine the amount of received DDP
data.

Reviewed by: np
Differential Revision: https://reviews.freebsd.org/D3619

8 years agoDo not hold the process around the vm_fault() call from the trap()s.
kib [Thu, 10 Sep 2015 17:46:48 +0000 (17:46 +0000)]
Do not hold the process around the vm_fault() call from the trap()s.
The only operation which is prevented by the hold is the kernel stack
swapout for the faulted thread, which should be fine to allow.

Remove useless checks for NULL curproc or curproc->p_vmspace from the
trap_pfault() wrappers on x86 and powerpc.

Reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoReimplement CTL High Availability.
mav [Thu, 10 Sep 2015 12:40:31 +0000 (12:40 +0000)]
Reimplement CTL High Availability.

CTL HA functionality was originally implemented by Copan many years ago,
but large part of the sources was never published.  This change includes
clean room implementation of the missing code and fixes for many bugs.

This code supports dual-node HA with ALUA in four modes:
 - Active/Unavailable without interlink between nodes;
 - Active/Standby with second node handling only basic LUN discovery and
reservation, synchronizing with the first node through the interlink;
 - Active/Active with both nodes processing commands and accessing the
backing storage, synchronizing with the first node through the interlink;
 - Active/Active with second node working as proxy, transfering all
commands to the first node for execution through the interlink.

Unlike original Copan's implementation, depending on specific hardware,
this code uses simple custom TCP-based protocol for interlink.  It has
no authentication, so it should never be enabled on public interfaces.

The code may still need some polishing, but generally it is functional.

Relnotes: yes
Sponsored by: iXsystems, Inc.

8 years agoRemove unused target and initiator IDs.
mav [Thu, 10 Sep 2015 10:46:21 +0000 (10:46 +0000)]
Remove unused target and initiator IDs.

8 years agoZero out a local variable also when PURIFY is not defined.
tuexen [Thu, 10 Sep 2015 10:23:23 +0000 (10:23 +0000)]
Zero out a local variable also when PURIFY is not defined.
This silence a warning brought up by valgrind whenever if_nametoindex
is used. This was already discussed in PR 166483, but the code
committed in r234329 guards the initilization with #ifdef PURIFY.
Therefore, valgrind still complains. Since this code is not performance
critical, always zero out the local variable to silence valgrind.

PR: 166483
Discussed with: eadler@
MFC after: 4 weeks

8 years agoDisable CTL_IO_DELAY feature.
mav [Thu, 10 Sep 2015 09:27:22 +0000 (09:27 +0000)]
Disable CTL_IO_DELAY feature.

It is too developer-oriented to be enabled by default.

8 years agoRemove SIOCGDRLST_IN6 and SIOCGPRLST_IN6 forgotten in the previous commit.
hrs [Thu, 10 Sep 2015 08:37:03 +0000 (08:37 +0000)]
Remove SIOCGDRLST_IN6 and SIOCGPRLST_IN6 forgotten in the previous commit.

MFC after: 3 days

8 years agoUpdate USB quirk.
hselasky [Thu, 10 Sep 2015 07:36:54 +0000 (07:36 +0000)]
Update USB quirk.

MFC after: 1 month
PR: 202968

8 years agoUse read to parse a line instead of set.
hrs [Thu, 10 Sep 2015 06:56:56 +0000 (06:56 +0000)]
Use read to parse a line instead of set.

MFC after: 3 days

8 years ago- Add uid check.
hrs [Thu, 10 Sep 2015 06:55:28 +0000 (06:55 +0000)]
- Add uid check.
- Report delay<0 as a warning.

MFC after: 3 days

8 years agoUpdate only static routes when an interface is specified. This fixed
hrs [Thu, 10 Sep 2015 06:47:23 +0000 (06:47 +0000)]
Update only static routes when an interface is specified.  This fixed
a bad side-effect reported in PR 202144.

PR: 202144
MFC after: 3 days

8 years ago- Remove #ifdef HAVE_POLL_H.
hrs [Thu, 10 Sep 2015 06:40:28 +0000 (06:40 +0000)]
- Remove #ifdef HAVE_POLL_H.
- Use nitems().

MFC after: 3 days

8 years ago- Remove SIOCGDRLST_IN6 and SIOCGPRLST_IN6. These are quite old APIs and
hrs [Thu, 10 Sep 2015 06:31:24 +0000 (06:31 +0000)]
- Remove SIOCGDRLST_IN6 and SIOCGPRLST_IN6.  These are quite old APIs and
  there is no consumer now.

MFC after: 3 days

8 years ago- Remove SIOCGDRLST_IN6 and SIOCGPRLST_IN6. These are quite old APIs and
hrs [Thu, 10 Sep 2015 06:29:18 +0000 (06:29 +0000)]
- Remove SIOCGDRLST_IN6 and SIOCGPRLST_IN6.  These are quite old APIs and
  there is no consumer now.

- Simplify first and duplicate LLA check.

MFC after: 3 days

8 years agoDo not add IN6_IFF_TENTATIVE when ND6_IFF_NO_DAD.
hrs [Thu, 10 Sep 2015 06:10:30 +0000 (06:10 +0000)]
Do not add IN6_IFF_TENTATIVE when ND6_IFF_NO_DAD.

MFC after: 3 days

8 years agoRemove IN6_IFF_NOPFX. This flag was no longer used.
hrs [Thu, 10 Sep 2015 06:08:42 +0000 (06:08 +0000)]
Remove IN6_IFF_NOPFX.  This flag was no longer used.

MFC after: 3 days

8 years ago- Remove GIF_{SEND,ACCEPT}_REVETHIP.
hrs [Thu, 10 Sep 2015 05:59:39 +0000 (05:59 +0000)]
- Remove GIF_{SEND,ACCEPT}_REVETHIP.
- Simplify EADDRNOTAVAIL and EAFNOSUPPORT conditions.

MFC after: 3 days

8 years agoAlso make kern.maxfilesperproc a boot time tunable.
adrian [Thu, 10 Sep 2015 04:05:58 +0000 (04:05 +0000)]
Also make kern.maxfilesperproc a boot time tunable.

Auto-tuning threshold discussions aside, it turns out that if you want
to lower this on say, rather memory-packed machines, you either set maxusers
or kern.maxfiles, or you set it in sysctl.  The former is a non-exact
way to tune this; the latter doesn't actually affect anything in the
startup scripts.

This first occured because I wondered why the hell screen would take upwards
of 10 seconds to spawn a new screen.  I then found python doing the same
thing during fork/exec of child processes - it calls close() on each FD
up to the current openfiles limit.  On a 1TB machine this is like, 26 million
FDs per process.  Ugh.

So:

* This allows it to be set early in /boot/loader.conf;
* It can be used to work around the ridiculous situation of
  screen, python, etc doing a close() on potentially millions of FDs
  even though you only have four open.

Tested:

* 4GB, 32GB, 64GB, 128GB, 384GB, 1TB systems with autotune, ensuring
  screen and python forking doesn't result in some pretty hilariously
  bad behaviour.

TODO:

* Note that the default login.conf sets openfiles-cur to unlimited,
  effectively obeying kern.maxfilesperproc.  Perhaps we should fix
  this.

* .. and even if we do, we need to also ensure that daemons get
  a soft limit of something reasonable and capped - they can request
  more FDs themselves.

MFC after: 1 week
Sponsored by: Norse Corp, Inc.

8 years agoUse _exit() instead of exit() in child processes created during tests.
jhb [Wed, 9 Sep 2015 22:54:07 +0000 (22:54 +0000)]
Use _exit() instead of exit() in child processes created during tests.

Suggested by: kib

8 years agoAdd a test to verify that a traced process sees its original parent via
jhb [Wed, 9 Sep 2015 22:42:26 +0000 (22:42 +0000)]
Add a test to verify that a traced process sees its original parent via
getppid() after a debugger process that is not the parent has attached.

Reviewed by: kib (earlier version)
Differential Revision: https://reviews.freebsd.org/D3615

8 years agoProperly size the children[] arrays in the follow fork tests.
jhb [Wed, 9 Sep 2015 21:18:10 +0000 (21:18 +0000)]
Properly size the children[] arrays in the follow fork tests.

8 years agoFor open("name", O_DIRECTORY | O_CREAT), do not try to create the
kib [Wed, 9 Sep 2015 19:31:08 +0000 (19:31 +0000)]
For open("name", O_DIRECTORY | O_CREAT), do not try to create the
named node, open(2) cannot create directories.  But do allow the flag
combination to succeed if the directory already exists.

Declare the open("name", O_DIRECTORY | O_CREAT | O_EXCL) always
invalid for the same reason, since open(2) cannot create directory.

Note that there is an argument that O_DIRECTORY | O_CREAT should be
invalid always, regardless of the target directory existence or
O_EXCL.  The current fix is conservative and allows the call to
succeed in the situation where it succeeded before the patch.

Reported by: Tom Ridge <freebsd@tom-ridge.com>
Reviewed by: rwatson
PR:  202892
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agofix compare argument for address type.
takawata [Wed, 9 Sep 2015 13:24:39 +0000 (13:24 +0000)]
fix compare argument for address type.

Submitted by: issei10193 (via Twitter)

8 years agoRework copyinstr to:
andrew [Wed, 9 Sep 2015 11:51:14 +0000 (11:51 +0000)]
Rework copyinstr to:
 * Fail when the length passed in is 0
 * Remove an unneeded increment of the count on success
 * Return ENAMETOOLONG when the input pointer is too long

Sponsored by: ABT Systems Ltd

8 years ago- Fix SIGSEGV when sa == NULL. NULL check in getnameinfo_inet()
hrs [Wed, 9 Sep 2015 09:19:07 +0000 (09:19 +0000)]
- Fix SIGSEGV when sa == NULL.  NULL check in getnameinfo_inet()
  did not work as expected.

- Simplify afdl table lookup.

MFC after: 3 days

8 years agoAdd new USB ID.
hselasky [Wed, 9 Sep 2015 07:04:00 +0000 (07:04 +0000)]
Add new USB ID.

MFC after: 1 month
PR: 202968

8 years agoRemove a check which caused spurious SIGSEGV on usermode access to the
kib [Wed, 9 Sep 2015 06:19:33 +0000 (06:19 +0000)]
Remove a check which caused spurious SIGSEGV on usermode access to the
mapped address without valid pte installed, when parallel wiring of
the entry happen.  The entry must be copy on write.  If entry is COW
but was already copied, and parallel wiring set
MAP_ENTRY_IN_TRANSITION, vm_fault() would sleep waiting for the
MAP_ENTRY_IN_TRANSITION flag to clear.  After that, the fault handler
is restarted and vm_map_lookup() or vm_map_lookup_locked() trip over
the check.  Note that this is race, if the address is accessed after
the wiring is done, the entry does not fault at all.

There is no reason in the current kernel to disallow write access to
the COW wired entry if the entry permissions allow it.  Initially this
was done in r24666, since that kernel did not supported proper
copy-on-write for wired text, which was fixed in r199869.  The r251901
revision re-introduced the r24666 fix for the current VM.

Note that write access must clear MAP_ENTRY_NEEDS_COPY entry flag by
performing COW.  In reverse, when MAP_ENTRY_NEEDS_COPY is set in
vmspace_fork(), the MAP_ENTRY_USER_WIRED flag is cleared.  Put the
assert stating the invariant, instead of returning the error.

Reported and debugging help by: peter
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agow(1) is not setgid binary since r53279, so remove the setgid() call.
delphij [Wed, 9 Sep 2015 05:17:04 +0000 (05:17 +0000)]
w(1) is not setgid binary since r53279, so remove the setgid() call.

Reviewed By: wollman
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3541

8 years agoAdd PVR identifier for E6500, from the reference.
jhibbits [Wed, 9 Sep 2015 03:15:25 +0000 (03:15 +0000)]
Add PVR identifier for E6500, from the reference.

8 years agoCorrect setting R92C_TDECTRL_BLK_DESC_NUM_M bit.
kevlo [Wed, 9 Sep 2015 01:51:38 +0000 (01:51 +0000)]
Correct setting R92C_TDECTRL_BLK_DESC_NUM_M bit.

8 years agoRevert r287578. This patch requires more review.
jkim [Tue, 8 Sep 2015 23:17:02 +0000 (23:17 +0000)]
Revert r287578.  This patch requires more review.

Requested by: adrian

8 years agoCorrectly case FreeBSD in my entry in the tips file
allanjude [Tue, 8 Sep 2015 22:51:10 +0000 (22:51 +0000)]
Correctly case FreeBSD in my entry in the tips file

Submitted by: feld
Approved by: wblock (mentor)
Differential Revision: https://reviews.freebsd.org/D3601

8 years agoAdd an additional check to service(8) -e incase rcvar is blank
allanjude [Tue, 8 Sep 2015 22:50:17 +0000 (22:50 +0000)]
Add an additional check to service(8) -e incase rcvar is blank

Approved by: bapt (mentor)
X-MFC-With: 287576
Differential Revision: https://reviews.freebsd.org/D3604

8 years agoRemove extra debug that crept in
bapt [Tue, 8 Sep 2015 22:24:20 +0000 (22:24 +0000)]
Remove extra debug that crept in

8 years agoImplement pubkey support for the bootstrap
bapt [Tue, 8 Sep 2015 21:25:36 +0000 (21:25 +0000)]
Implement pubkey support for the bootstrap

Note that to not interfer with finger print it expects a signature on pkg itself
which is named pkg.txz.pubkeysign

To genrate it:
echo -n "$(sha256 -q pkg.txz)" | openssl dgst -sha256 -sign /thekey \
    -binary -out ./pkg.txz.pubkeysig

Note the "echo -n" which prevent signing the '\n' one would get otherwise

PR: 202622
MFC after: 1 week

8 years agoEnable 802.11n support.
jkim [Tue, 8 Sep 2015 21:04:33 +0000 (21:04 +0000)]
Enable 802.11n support.

PR: 164102

8 years agoSort and remove duplicate compiler flags.
jkim [Tue, 8 Sep 2015 20:41:47 +0000 (20:41 +0000)]
Sort and remove duplicate compiler flags.

MFC after: 3 days

8 years agoservice(8) -e does not respect /etc/rc.conf.d/* entries
allanjude [Tue, 8 Sep 2015 20:22:51 +0000 (20:22 +0000)]
service(8) -e does not respect /etc/rc.conf.d/* entries

PR: 173454
Submitted by: giantlock@gmail.com (original patch)
Approved by: bapt (mentor)
MFC after: 1 week
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3600

8 years agoRemove duplicate entry for Sierra Wireless Aircard 875
garga [Tue, 8 Sep 2015 20:07:32 +0000 (20:07 +0000)]
Remove duplicate entry for Sierra Wireless Aircard 875

Approved by: loos
MFC after: 3 days
Sponsored by: Rubicon Communications (Netgate)

8 years ago- Fix Sierra MC7354 ID from a bad copy/paste, correct ID is 68C0
garga [Tue, 8 Sep 2015 19:57:02 +0000 (19:57 +0000)]
- Fix Sierra MC7354 ID from a bad copy/paste, correct ID is 68C0

Approved by: loos
Obtained from: pfSense
MFC after: 3 days
Sponsored by: Rubicon Communications (Netgate)

8 years agodrm/ttm: Drain taskqueue if taskqueue_cancel_timeout() returned an error
dumbbell [Tue, 8 Sep 2015 19:41:19 +0000 (19:41 +0000)]
drm/ttm: Drain taskqueue if taskqueue_cancel_timeout() returned an error

Before, this was done if `pending` was true. This is not what the
manpage suggests and not what was done elsewhere in the same file.

8 years agoFix indentation, no functional changes
bapt [Tue, 8 Sep 2015 19:25:15 +0000 (19:25 +0000)]
Fix indentation, no functional changes

8 years agoEnable mincore_test on arm64, we now have a working pmap_mincore.
andrew [Tue, 8 Sep 2015 18:44:12 +0000 (18:44 +0000)]
Enable mincore_test on arm64, we now have a working pmap_mincore.

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

8 years agoAdd support for pmap_mincore on arm64 by walking the page tables to find
andrew [Tue, 8 Sep 2015 18:41:06 +0000 (18:41 +0000)]
Add support for pmap_mincore on arm64 by walking the page tables to find
the details for the requested address.

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

8 years agoThe swap pager is compatible with direct dispatch. It does its own
imp [Tue, 8 Sep 2015 17:47:56 +0000 (17:47 +0000)]
The swap pager is compatible with direct dispatch. It does its own
locking and doesn't sleep. Flag the consumer we create as such. In
addition, decrement the in flight index when we have an out of memory
error after having incremented it previously. This would have
prevented swapoff from working if the swap pager ever hit a resource
shortage trying to swap out something (the swap in path always waits
for a bio, so won't have this issue). Simplify the close logic by
abandoning the use of private and initializing the index to 1 and
dropping that reference when we previously set private.

Also, set sw_id only while sw_dev_mtx is held. This should only affect
swapping to a vnode, as opposed to a geom whose close always sets it to
NULL with sw_dev_mtx held.

Differential Review: https://reviews.freebsd.org/D3547

8 years agoAllow us to set the console device tree node. This is needed as not all
andrew [Tue, 8 Sep 2015 16:06:04 +0000 (16:06 +0000)]
Allow us to set the console device tree node. This is needed as not all
vendor supplied device trees contain the needed properties for us to select
the correct uart to use as the kernel console.

An example of this would be to add the following to loader.conf.
hw.fdt.console="/smb/uart@f7113000"

The intention of this is slightly different than the existing
hw.uart.console option. The new option will mean the boot serial
configuration will be derived from the device node, while the existing
option expects the user to configure all this themselves.

Further work is planned to allow the uart configuration to be set based on
the stdout-path property devicetree bindings.

Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D3559

8 years agoisci: check return value of pci_alloc_msix()
jimharris [Tue, 8 Sep 2015 16:05:18 +0000 (16:05 +0000)]
isci: check return value of pci_alloc_msix()

Certain VM guest types (VMware, Xen) do not support MSI, so pci_alloc_msix()
always fails.  isci(4) was not properly detecting the allocation failure,
and would try to proceed with MSIx resource initialization rather than
reverting to INTx.

Reported and tested by: Bradley W. Dutton (brad-fbsd-stable@duttonbros.com)
MFC after: 3 days
Sponsored by: Intel

8 years agoisci: explicitly enable/disable PCI busmaster
jimharris [Tue, 8 Sep 2015 15:59:55 +0000 (15:59 +0000)]
isci: explicitly enable/disable PCI busmaster

BIOS always enables PCI busmaster on the isci device, which effectively
worked around this omission.  But when passing the isci device through
to a guest VM, the hypervisor will disable busmaster and isci will not
work without calling pci_enable_busmaster().

MFC after: 3 days
Sponsored by: Intel

8 years agoMake it possible to use acl_create_entry_np(3) to use first entry to an
trasz [Tue, 8 Sep 2015 14:52:14 +0000 (14:52 +0000)]
Make it possible to use acl_create_entry_np(3) to use first entry to an
empty ACL, and to append an entry to an ACL.

Submitted by: sef@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRevert r286984 (adding opt_random.h to sys/modules/zfs/Makefile)
ngie [Tue, 8 Sep 2015 08:54:40 +0000 (08:54 +0000)]
Revert r286984 (adding opt_random.h to sys/modules/zfs/Makefile)

opt_random.h is no longer needed/referenced in the kernel build

X-MFC with: r287558

8 years agoRemove opt_random.h header pollution from sys/random.h by moving
ngie [Tue, 8 Sep 2015 08:50:28 +0000 (08:50 +0000)]
Remove opt_random.h header pollution from sys/random.h by moving
RANDOM_LOADABLE and RANDOM_YARROW's definitions from opt_random.h to
opt_global.h

This unbreaks `make depend` in sys/modules with multiple drivers (tmpfs, etc)
after r286839

X-MFC with: r286839
Reviewed by: imp
Submitted by: lwhsu
Differential Revision: D3486

8 years agoStyle. Use ANSI definition, wrap long lines, no initialization in
kib [Tue, 8 Sep 2015 08:48:53 +0000 (08:48 +0000)]
Style.  Use ANSI definition, wrap long lines, no initialization in
declaration for locals.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoIn the pthread_once(), if the initializer has already run, then the
kib [Tue, 8 Sep 2015 08:41:07 +0000 (08:41 +0000)]
In the pthread_once(), if the initializer has already run, then the
calling thread is supposed to see accesses issued by the initializer.
This means that the read of the once_control->state variable should
have an acquire semantic.  Use atomic_thread_fence_acq() when the
value read is ONCE_DONE, instead of straightforward atomic_load_acq(),
to only put a barrier when needed (*).

On the other hand, the updates of the once_control->state with the
intermediate progress state do not need to synchronize with other
state accesses, remove _acq suffix.

Reviewed by: alc (previous version)
Suggested by: alc (*)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoEnable TSF timer in monitor mode.
kevlo [Tue, 8 Sep 2015 08:06:20 +0000 (08:06 +0000)]
Enable TSF timer in monitor mode.

Tested on RT5370, sta mode.
Submitted by: Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision: https://reviews.freebsd.org/D3591

8 years agoAdd TSF field into TX/RX radiotap headers
kevlo [Tue, 8 Sep 2015 08:02:14 +0000 (08:02 +0000)]
Add TSF field into TX/RX radiotap headers

Tested on RT5370, sta mode.
Submitted by: Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision: https://reviews.freebsd.org/D3590

8 years agoFix comparison in run_key_set_cb().
kevlo [Tue, 8 Sep 2015 07:53:10 +0000 (07:53 +0000)]
Fix comparison in run_key_set_cb().

Tested on RT5370, sta mode.

Submitted by: Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision: https://reviews.freebsd.org/D3589

8 years ago- Remove empty key_update_* functions.
kevlo [Tue, 8 Sep 2015 07:50:35 +0000 (07:50 +0000)]
- Remove empty key_update_* functions.
- Hide "struct ieee80211_node *" -> "struct run_node *" casting behind
  RUN_NODE() macro.
- Simplify IEEE80211_HAS_ADDR4 macro definition
- Fix a comment (desn't -> doesn't)

Submitted by: Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision: https://reviews.freebsd.org/D3588

8 years agoTo simplify upcoming changes to the inactive queue scan, change the code
alc [Tue, 8 Sep 2015 04:18:57 +0000 (04:18 +0000)]
To simplify upcoming changes to the inactive queue scan, change the code
so that there is only one place where pages are freed and only one place
where pages are moved to the tail of the queue.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division

8 years agoUpdate DTrace nfs scripts to track the proper provider names.
gnn [Tue, 8 Sep 2015 00:30:10 +0000 (00:30 +0000)]
Update DTrace nfs scripts to track the proper provider names.

Submitted by: Alex Burlyga

8 years agoDon't call enable_all_rings if the adapter has been freed.
adrian [Mon, 7 Sep 2015 23:16:39 +0000 (23:16 +0000)]
Don't call enable_all_rings if the adapter has been freed.

This is a subtle use-after-free race that results in some very undesirable
hang behaviour.

Reviewed by: pkelsey
Obtained from: Kip Macy, NextBSD (https://github.com/NextBSD/NextBSD/commit/91a9bd1dbb33dafb41684d054e59d73976de9654)

8 years agoFix off-by-one bugs.
loos [Mon, 7 Sep 2015 21:59:11 +0000 (21:59 +0000)]
Fix off-by-one bugs.

While here, only set the GPIO pin state for output pins.

Pointy hat to: loos
Sponsored by: Rubicon Communications (Netgate)

8 years agoIn libz's inflateMark(), avoid left-shifting a negative integer, which
dim [Mon, 7 Sep 2015 20:55:14 +0000 (20:55 +0000)]
In libz's inflateMark(), avoid left-shifting a negative integer, which
is undefined.

Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D3344
MFC after: 3 days

8 years agofd: make rights a mandatory argument to fgetvp_rights
mjg [Mon, 7 Sep 2015 20:05:56 +0000 (20:05 +0000)]
fd: make rights a mandatory argument to fgetvp_rights

The only caller already always passes rights.

8 years agofd: make the common case in filecaps_copy work lockless
mjg [Mon, 7 Sep 2015 20:02:56 +0000 (20:02 +0000)]
fd: make the common case in filecaps_copy work lockless

The filedesc lock is only needed if ioctls caps are present, which is a
rare situation. This is a step towards reducing the scope of the filedesc
lock.

8 years agoAs expected, things aren't as simple as hoped. Consequently, we have
marcel [Mon, 7 Sep 2015 17:56:49 +0000 (17:56 +0000)]
As expected, things aren't as simple as hoped. Consequently, we have
no option but to use the smbios information to fill in the blanks.
It's a good thing UGA is a protocol of the past and GOP has all the
info we need.

Anyway, the logic has been tweaked a little to get the easier bits
of information up front. This includes the resolution and the frame
buffer address. Then we look at the smbios information and define
expected values as well as the missing bits (frame buffer offset and
stride). If the values obtained match the expect values, we fill in
the blanks and return. Otherwise we use the existing detection logic
to figure it out.

Rename the environment variables from uga_framebuffer abd uga_stride
to hw.efifb.address and hw.efifb.stride. The latter names are more
in line with other variable names.

We currently have hardcoded settings for:
1.  Mid-2007 iMac (iMac7,1)
2.  Late-2007 MacBook (MacBook3,1)

8 years agoFollow-up to r287442: Move sysctl to compiled-once file
cem [Mon, 7 Sep 2015 16:44:28 +0000 (16:44 +0000)]
Follow-up to r287442: Move sysctl to compiled-once file

Avoid duplicate sysctl nodes.

Found by: tijl
Approved by: markj (mentor)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3586

8 years agoUse load-acquire semantics while waiting for td_lock to be released. The
andrew [Mon, 7 Sep 2015 14:01:18 +0000 (14:01 +0000)]
Use load-acquire semantics while waiting for td_lock to be released. The
store should have release semantics and will have due to the dsb above it
so add a comment to explain this. [1]

While here update the code to not reload the current thread, it's already
in a register, we just need to not trash it.

Suggested by: kib [1]
Sponsored by: ABT Systems Ltd

8 years agoRFC 4960 requires that packets containing an INIT chunk bundled with
tuexen [Mon, 7 Sep 2015 14:00:38 +0000 (14:00 +0000)]
RFC 4960 requires that packets containing an INIT chunk bundled with
another chunk are silently discarded. Do so, instead of sending an
ABORT.

MFC after: 1 week

8 years agoAdd two new portal group options "tag" and "foreign".
mav [Mon, 7 Sep 2015 13:43:05 +0000 (13:43 +0000)]
Add two new portal group options "tag" and "foreign".

They are going to be useful in clustered setups.

8 years agoWhen dropping to EL1 ensure we have written to all special registers by
andrew [Mon, 7 Sep 2015 10:13:14 +0000 (10:13 +0000)]
When dropping to EL1 ensure we have written to all special registers by
moving the instruction barrier to just before we drop exception level.

Sponsored by: ABT Systems Ltd

8 years agomissed file that should have been included in r287528
allanjude [Mon, 7 Sep 2015 02:00:05 +0000 (02:00 +0000)]
missed file that should have been included in r287528

PR: 184110
Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Approved by: wblock (mentor)

8 years agoDocument the sctp blackhole sysctl MIB
allanjude [Mon, 7 Sep 2015 01:21:56 +0000 (01:21 +0000)]
Document the sctp blackhole sysctl MIB

PR: 184110
Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Reviewed by: wblock
Approved by: wblock (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3528

8 years agoAdd support for receiving flowtype, flowid and RSS bucket information as part of...
adrian [Sun, 6 Sep 2015 20:57:57 +0000 (20:57 +0000)]
Add support for receiving flowtype, flowid and RSS bucket information as part of recvmsg().

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3562

8 years agoReplace rss_m2cpuid with rss_soft_m2cpuid_v4 for ip_direct_nh.nh_m2cpuid,
adrian [Sun, 6 Sep 2015 20:20:48 +0000 (20:20 +0000)]
Replace rss_m2cpuid with rss_soft_m2cpuid_v4 for ip_direct_nh.nh_m2cpuid,
because the RSS hash may need to be recalculated.

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3564

8 years agoRemove last traces of USEPRIVATELIB
bapt [Sun, 6 Sep 2015 20:17:14 +0000 (20:17 +0000)]
Remove last traces of USEPRIVATELIB

8 years agoPrefer pciids database from ports if present
bapt [Sun, 6 Sep 2015 20:05:29 +0000 (20:05 +0000)]
Prefer pciids database from ports if present

Given the pciids database on ports is updated more often than the one in base
prefer this version if present, otherwise read the one from base.

MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D3391

8 years agoParallelize the usr.sbin/ntp subdirectory build
ngie [Sun, 6 Sep 2015 18:58:33 +0000 (18:58 +0000)]
Parallelize the usr.sbin/ntp subdirectory build

Articulate all needed dependencies for the subdirectories

MFC after: 1 week

8 years agoFix inverted output re: stack protection no-execute flag in procstat(1)
allanjude [Sun, 6 Sep 2015 17:47:03 +0000 (17:47 +0000)]
Fix inverted output re: stack protection no-execute flag in procstat(1)

PR: 196110
Submitted by: Joerg Pernfuss <code.jpe@gmail.com>
Approved by: bapt (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3576

8 years agoUpdate lldb's FREEBSD-Xlist to match reality.
dim [Sun, 6 Sep 2015 11:48:50 +0000 (11:48 +0000)]
Update lldb's FREEBSD-Xlist to match reality.

8 years agoAllow LUN options modification via CTL_LUNREQ_MODIFY.
mav [Sun, 6 Sep 2015 11:23:01 +0000 (11:23 +0000)]
Allow LUN options modification via CTL_LUNREQ_MODIFY.

Not all changes take effect, but that is a different question.

8 years agoMove setting of media parameters inside open routines.
mav [Sun, 6 Sep 2015 09:54:56 +0000 (09:54 +0000)]
Move setting of media parameters inside open routines.

This is preparation for possibility to open/close media several times
per LUN life cycle.  While there, rename variables to reduce confusion.
As additional bonus this allows to open read-only media, such as ZFS
snapshots.

8 years agoTrack changes to kern.maxvnodes and appropriately increase or decrease
mckusick [Sun, 6 Sep 2015 05:50:51 +0000 (05:50 +0000)]
Track changes to kern.maxvnodes and appropriately increase or decrease
the size of the name cache hash table (mapping file names to vnodes)
and the vnode hash table (mapping mount point and inode number to vnode).
An appropriate locking strategy is the key to changing hash table sizes
while they are in active use.

Reviewed by: kib
Tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D2265
MFC after:   2 weeks

8 years agoReduce diff with linux 3.8.13 on i915 headers
bapt [Sat, 5 Sep 2015 23:22:59 +0000 (23:22 +0000)]
Reduce diff with linux 3.8.13 on i915 headers

8 years agoYet another fix for gcc 4.2
bapt [Sat, 5 Sep 2015 22:33:40 +0000 (22:33 +0000)]
Yet another fix for gcc 4.2

8 years agoRemove extra i++
bapt [Sat, 5 Sep 2015 21:55:01 +0000 (21:55 +0000)]
Remove extra i++

Reported by: allanjude@

8 years agoRevert last two commits to em(4)/igb(4). Reports are coming in that
sbruno [Sat, 5 Sep 2015 21:12:19 +0000 (21:12 +0000)]
Revert last two commits to em(4)/igb(4).  Reports are coming in that
this breaks initialization and reads from EEPROM on boot/driver load.

r287469 is being reverted as a dependancy on r287467

8 years agoFix build error on gcc platforms
allanjude [Sat, 5 Sep 2015 19:28:41 +0000 (19:28 +0000)]
Fix build error on gcc platforms

Approved by: bapt (mentor)

8 years agoAuto-detect the UGA frame buffer and stride on a MacBook. We're
marcel [Sat, 5 Sep 2015 18:24:51 +0000 (18:24 +0000)]
Auto-detect the UGA frame buffer and stride on a MacBook. We're
striking a delicate balance between exhaustive searching and
banking on assumptions. The environment variables can be used
as a fall-back anyway. With this change, all known and tested
Macs with only UGA should have a working console out of the
box... for now...

8 years agoEliminate pointless requeueing of pages from terminated objects. These
alc [Sat, 5 Sep 2015 17:34:49 +0000 (17:34 +0000)]
Eliminate pointless requeueing of pages from terminated objects.  These
pages will have left the inactive queue before the page daemon performs
its next scan.  Also, ignore references to pages from terminated objects.
This allows the clean pages to be freed a little sooner.

Move some comments to their proper place, i.e., next to the code that
they describe, and update other nearby comments.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd ddb show commands to print the special registers and to ask the
andrew [Sat, 5 Sep 2015 17:29:07 +0000 (17:29 +0000)]
Add ddb show commands to print the special registers and to ask the
hardware to perform address translation for us. These are useful to help
track down what caused us to enter the debugger.

Sponsored by: ABT Systems Ltd

8 years agoIntroduce libxo to procstat(1)
allanjude [Sat, 5 Sep 2015 17:02:01 +0000 (17:02 +0000)]
Introduce libxo to procstat(1)

Reviewed by: rodrigc, bapt
Approved by: marcel (mentor)
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2446

8 years agoFix build with gcc 4.2
bapt [Sat, 5 Sep 2015 16:59:30 +0000 (16:59 +0000)]
Fix build with gcc 4.2

Reported by: kib

8 years agoDo not pass lle to nd6_ns_output(). Use newly-added
melifaro [Sat, 5 Sep 2015 14:14:03 +0000 (14:14 +0000)]
Do not pass lle to nd6_ns_output().  Use newly-added
  nd6_llinfo_get_holdsrc() to extract desired IPv6 source
  from holdchain and pass it to the nd6_ns_output().

8 years agoDo not consume extra reference. This is a bug in r287479.
kib [Sat, 5 Sep 2015 12:28:18 +0000 (12:28 +0000)]
Do not consume extra reference.  This is a bug in r287479.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoCross reference sesutil(8) and ses(4)
bapt [Sat, 5 Sep 2015 10:29:47 +0000 (10:29 +0000)]
Cross reference sesutil(8) and ses(4)

Submitted by: trasz
MFC after: 1 month (with r287473)

8 years agoUse Jenkins hash for TCP syncache.
glebius [Sat, 5 Sep 2015 10:15:19 +0000 (10:15 +0000)]
Use Jenkins hash for TCP syncache.

o Unlike xor, in Jenkins hash every bit of input affects virtually
  every bit of output, thus salting the hash actually works. With
  xor salting only provides a false sense of security, since if
  hash(x) collides with hash(y), then of course, hash(x) ^ salt
  would also collide with hash(y) ^ salt. [1]
o Jenkins provides much better distribution than xor, very close to
  ideal.

TCP connection setup/teardown benchmark has shown a 10% increase
with default hash size, and with bigger hashes that still provide
possibility for collisions. With enormous hash size, when dataset is
by an order of magnitude smaller than hash size, the benchmark has
shown 4% decrease in performance decrease, which is expected and
acceptable.

Noticed by: Jeffrey Knockel <jeffk cs.unm.edu> [1]
Benchmarks by: jch
Reviewed by: jch, pkelsey, delphij
Security: strengthens protection against hash collision DoS
Sponsored by: Nginx, Inc.

8 years agoDeclare the writes around the call to VFS_SYNC() in
kib [Sat, 5 Sep 2015 08:48:24 +0000 (08:48 +0000)]
Declare the writes around the call to VFS_SYNC() in
softdep_ast_cleanup_proc().

Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoDo not skip entries without LLE_VALID flag.
melifaro [Sat, 5 Sep 2015 06:24:00 +0000 (06:24 +0000)]
Do not skip entries without LLE_VALID flag.
This one fixes showing incomplete entries in ndp -an.

MFC after: 2 weeks

8 years agoMake in6ifa_ifpwithaddr() take const param.
melifaro [Sat, 5 Sep 2015 05:54:09 +0000 (05:54 +0000)]
Make in6ifa_ifpwithaddr() take const param.
Remove unneded DECONST from in6_lltable_rtcheck().

8 years agoConstantify lookup key in ifa_ifwith* functions.
melifaro [Sat, 5 Sep 2015 05:33:20 +0000 (05:33 +0000)]
Constantify lookup key in ifa_ifwith* functions.
Some places in our network stack already have const
arguments (like if_output() routines and LLE functions).

Code using ifa_ifwith (and similar functins) along with
LLE/_output functions is currently bound to use tricks
like __DECONST(). Provide a cleaner way by making sockaddr
lookup key really constant.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3464