Commit Graph

203538 Commits

Author SHA1 Message Date
Hiroki Sato
f74237f5b6 - Remove #ifdef HAVE_POLL_H.
- Use nitems().

MFC after:	3 days
2015-09-10 06:40:28 +00:00
Hiroki Sato
e3884653f6 - Remove SIOCGDRLST_IN6 and SIOCGPRLST_IN6. These are quite old APIs and
there is no consumer now.

MFC after:	3 days
2015-09-10 06:31:24 +00:00
Hiroki Sato
d0bec2c522 - 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
2015-09-10 06:29:18 +00:00
Hiroki Sato
1fce58fc62 Do not add IN6_IFF_TENTATIVE when ND6_IFF_NO_DAD.
MFC after:	3 days
2015-09-10 06:10:30 +00:00
Hiroki Sato
3ba7e4ce9c Remove IN6_IFF_NOPFX. This flag was no longer used.
MFC after:	3 days
2015-09-10 06:08:42 +00:00
Hiroki Sato
b1c250ff3f - Remove GIF_{SEND,ACCEPT}_REVETHIP.
- Simplify EADDRNOTAVAIL and EAFNOSUPPORT conditions.

MFC after:	3 days
2015-09-10 05:59:39 +00:00
Adrian Chadd
32766cd281 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.
2015-09-10 04:05:58 +00:00
John Baldwin
b98cb919de Use _exit() instead of exit() in child processes created during tests.
Suggested by:	kib
2015-09-09 22:54:07 +00:00
John Baldwin
368b2b1c76 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
2015-09-09 22:42:26 +00:00
John Baldwin
479b610db5 Properly size the children[] arrays in the follow fork tests. 2015-09-09 21:18:10 +00:00
Konstantin Belousov
9e18c9eb27 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
2015-09-09 19:31:08 +00:00
Takanori Watanabe
05e526fb5a fix compare argument for address type.
Submitted by: issei10193 (via Twitter)
2015-09-09 13:24:39 +00:00
Andrew Turner
8fe99e427f 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
2015-09-09 11:51:14 +00:00
Hiroki Sato
f9f9625d18 - Fix SIGSEGV when sa == NULL. NULL check in getnameinfo_inet()
did not work as expected.

- Simplify afdl table lookup.

MFC after:	3 days
2015-09-09 09:19:07 +00:00
Hans Petter Selasky
b28014dd0b Add new USB ID.
MFC after:	1 month
PR:		202968
2015-09-09 07:04:00 +00:00
Konstantin Belousov
b8db977617 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
2015-09-09 06:19:33 +00:00
Xin LI
ab9cee11d6 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
2015-09-09 05:17:04 +00:00
Justin Hibbits
dbaeb0610b Add PVR identifier for E6500, from the reference. 2015-09-09 03:15:25 +00:00
Kevin Lo
b904ffbde5 Correct setting R92C_TDECTRL_BLK_DESC_NUM_M bit. 2015-09-09 01:51:38 +00:00
Jung-uk Kim
1db13cd689 Revert r287578. This patch requires more review.
Requested by:	adrian
2015-09-08 23:17:02 +00:00
Allan Jude
2f717d09f1 Correctly case FreeBSD in my entry in the tips file
Submitted by:	feld
Approved by:	wblock (mentor)
Differential Revision:	https://reviews.freebsd.org/D3601
2015-09-08 22:51:10 +00:00
Allan Jude
1289db4899 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
2015-09-08 22:50:17 +00:00
Baptiste Daroussin
4c79e0d6c1 Remove extra debug that crept in 2015-09-08 22:24:20 +00:00
Baptiste Daroussin
61acb4582f 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
2015-09-08 21:25:36 +00:00
Jung-uk Kim
6c2f0c65c8 Enable 802.11n support.
PR:		164102
2015-09-08 21:04:33 +00:00
Jung-uk Kim
c3eac7e2b4 Sort and remove duplicate compiler flags.
MFC after:	3 days
2015-09-08 20:41:47 +00:00
Allan Jude
32047ac5fb 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
2015-09-08 20:22:51 +00:00
Renato Botelho
22a5bb4c2a Remove duplicate entry for Sierra Wireless Aircard 875
Approved by:	loos
MFC after:	3 days
Sponsored by:	Rubicon Communications (Netgate)
2015-09-08 20:07:32 +00:00
Renato Botelho
5effc557d5 - 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)
2015-09-08 19:57:02 +00:00
Jean-Sébastien Pédron
7bead7ac28 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.
2015-09-08 19:41:19 +00:00
Baptiste Daroussin
b50756c759 Fix indentation, no functional changes 2015-09-08 19:25:15 +00:00
Andrew Turner
b5e4c5c456 Enable mincore_test on arm64, we now have a working pmap_mincore.
PR:		202307
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2015-09-08 18:44:12 +00:00
Andrew Turner
384dd3be15 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
2015-09-08 18:41:06 +00:00
Warner Losh
9e3e3fe5b3 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
2015-09-08 17:47:56 +00:00
Andrew Turner
d5ad1d0d6d 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
2015-09-08 16:06:04 +00:00
Jim Harris
854c31980e 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
2015-09-08 16:05:18 +00:00
Jim Harris
c16120409b 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
2015-09-08 15:59:55 +00:00
Edward Tomasz Napierala
45d55945fd 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
2015-09-08 14:52:14 +00:00
Enji Cooper
e945651a90 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
2015-09-08 08:54:40 +00:00
Enji Cooper
7afd9bf059 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
2015-09-08 08:50:28 +00:00
Konstantin Belousov
b684727b07 Style. Use ANSI definition, wrap long lines, no initialization in
declaration for locals.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-09-08 08:48:53 +00:00
Konstantin Belousov
3e7e67c08d 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
2015-09-08 08:41:07 +00:00
Kevin Lo
599acbbcd8 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
2015-09-08 08:06:20 +00:00
Kevin Lo
ef9c07684c 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
2015-09-08 08:02:14 +00:00
Kevin Lo
3257f9021a 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
2015-09-08 07:53:10 +00:00
Kevin Lo
de7eb46ed4 - 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
2015-09-08 07:50:35 +00:00
Alan Cox
27a9fb2fc2 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
2015-09-08 04:18:57 +00:00
George V. Neville-Neil
c1eb4109f3 Update DTrace nfs scripts to track the proper provider names.
Submitted by:	Alex Burlyga
2015-09-08 00:30:10 +00:00
Adrian Chadd
15b1492c9b 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 (91a9bd1dbb)
2015-09-07 23:16:39 +00:00
Luiz Otavio O Souza
c80b6ca937 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)
2015-09-07 21:59:11 +00:00