Commit Graph

199200 Commits

Author SHA1 Message Date
Gleb Smirnoff
772e66a6fc Move ALTQ from contrib to net/altq. The ALTQ code is for many years
discontinued by its initial authors. In FreeBSD the code was already
slightly edited during the pf(4) SMP project. It is about to be edited
more in the projects/ifnet. Moving out of contrib also allows to remove
several hacks to the make glue.

Reviewed by:	net@
2015-04-16 20:22:40 +00:00
Neel Natu
7c0b0b9ad3 Prefer 'vcpu_should_yield()' over checking 'curthread->td_flags' directly.
MFC after:	1 week
2015-04-16 20:15:47 +00:00
Neel Natu
77afcadd51 If the number of guest vcpus is less than '1' then flag it as an error.
MFC after:	1 week
2015-04-16 20:11:49 +00:00
Ed Maste
8b25059d94 Set MACHINE_ARCH to aarch64 for arm64
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2015-04-16 19:23:08 +00:00
Craig Rodrigues
800be1b6f9 In the version of gcc in the FreeBSD tree, this modification was made to
the compiler in svn r242182:

#if STDC_HOSTED
#include <mm_malloc.h>
#endif

A similar change was done to clang in the FreeBSD tree in svn r218893:

However, for external gcc toolchains, this patch is not in the compiler's header
file.

This patch to FreeBSD's aesni code allows compilation with an external
gcc toolchain.

Differential Revision: https://reviews.freebsd.org/D2285
Reviewed by:  jmg, dim
Approved by:  dim
2015-04-16 17:42:52 +00:00
Brooks Davis
d3f649def3 Fix a minor function definition inconsistancy.
MFC after:	3 days
2015-04-16 15:35:17 +00:00
Brooks Davis
757a876f36 Make it harder to specify invalid LIBADD by causing values without
corresponding DPADD_<lib> variables to produce a useful error message.

Differential Revision:	https://reviews.freebsd.org/D2295
Reviewed by:	bapt
Sponsored by:	DARPA, AFRL
2015-04-16 15:34:22 +00:00
John Baldwin
3b2fd85e29 Remove THRMISC_VERSION. The thrmisc structure doesn't include a version
number, so this wasn't used (and can't easily be added).  If at some point
we want to extend thrmisc, we will probably need to just add a new note
type and ensure that the new type includes a version number.

Discussed with:	kib
MFC after:	2 weeks
2015-04-16 12:58:51 +00:00
Ed Maste
95f23d6e36 compiler_rt: add floatunsitf for arm64
It provides unsigned integer to quad-precision conversion.

Sponsored by:	The FreeBSD Foundation
2015-04-16 12:54:28 +00:00
Julien Charbon
5571f9cf81 Fix an old and well-documented use-after-free race condition in
TCP timers:
 - Add a reference from tcpcb to its inpcb
 - Defer tcpcb deletion until TCP timers have finished

Differential Revision:	https://reviews.freebsd.org/D2079
Submitted by:		jch, Marc De La Gueronniere <mdelagueronniere@verisign.com>
Reviewed by:		imp, rrs, adrian, jhb, bz
Approved by:		jhb
Sponsored by:		Verisign, Inc.
2015-04-16 10:00:06 +00:00
Kevin Lo
c3358f4ed2 Enable LDO to 2.5V before efuse r/w action in order to prevent
incorrect mac address read from efuse.

Reported by:	swills
Tested by:	rpaulo and myself on RPi
2015-04-16 07:40:01 +00:00
Tijl Coosemans
969dfbc7f3 Fix build after r281550 when WITHOUT_ICONV is defined.
Reported by:	adrian
MFC after:	2 weeks
2015-04-16 07:17:00 +00:00
Enji Cooper
f95c930e67 Fix race when testing for ETXTBSY writing to ${n0} (process image) by making
sure the process has been started beforehand with pgrep

pkill the process afterwards to make sure it's dead when the unlink is run
(not strictly required, but I was being conservative)

MFC after: 1 week
Reviewed by: Darius O'Conner, mjohnston
Sponsored by: EMC / Isilon Storage Division
2015-04-16 03:35:47 +00:00
Marcelo Araujo
546afaf83d Remove duplicate header entry. 2015-04-16 02:44:37 +00:00
Bryan Drewery
90e8186404 Remove extra flags from r250462.
MFC after:	1 week
2015-04-16 02:24:40 +00:00
Ed Maste
bbfcc42e41 vidcontrol: make size argument optional again for syscons
r273544 changed the -f option allow no arguments in vt mode (used to
reset the font back to the default), but broke the optionality of the
size argument for syscons. Drop the required argument from syscons'
optstring for -f so the optional argument handler works the same way
for both syscons and vt.

Reported by:	bde
Sponsored by:	The FreeBSD Foundation
2015-04-16 01:47:05 +00:00
Xin LI
8f990792fc Verify if the saved hostid is still the same and update if
it was changed.

Sponsored by:	iXsystems, Inc.
Obtained from:	FreeNAS (trueos commit 0abb740)
2015-04-15 21:48:06 +00:00
Allan Jude
8bf2dccec4 Fix syntax errors in conditions for new features in freebsd-update
Differential Revision:	https://reviews.freebsd.org/D1550
Submitted by:	kmoore
Approved by:	delphij
Obtained from:	PCBSD
MFC after:	1 week
X-MFC-With:	279571
Sponsored by:	ScaleEngine Inc.
2015-04-15 20:55:43 +00:00
Rick Macklem
dda11d4ab9 File systems that do not use the buffer cache (such as ZFS) must
use VOP_FSYNC() to perform the NFS server's Commit operation.
This patch adds a mnt_kern_flag called MNTK_USES_BCACHE which
is set by file systems that use the buffer cache. If this flag
is not set, the NFS server always does a VOP_FSYNC().
This should be ok for old file system modules that do not set
MNTK_USES_BCACHE, since calling VOP_FSYNC() is correct, although
it might not be optimal for file systems that use the buffer cache.

Reviewed by:	kib
MFC after:	2 weeks
2015-04-15 20:16:31 +00:00
Tycho Nightingale
3b65fbe4d1 Prior to aborting due to an ioport error, it is always interesting to
see what the guest's %rip is.

Reviewed by:	grehan
2015-04-15 18:49:03 +00:00
Neel Natu
1a688aa53e Fix handling of BUS_PROBE_NOWILDCARD in 'device_probe_child()'.
Device probe value of BUS_PROBE_NOWILDCARD should be treated specially only
if the device has a fixed devclass. Otherwise it should be interpreted just
as if the driver doesn't want to claim the device.

Prior to this change a device that was not claimed explicitly by its driver
would remain "attached" to the driver that returned BUS_PROBE_NOWILDCARD.
This would bump up the reference on 'driver->refs' and its 'dev->ops' would
point to the 'driver->ops'. When the driver is subsequently unloaded the
'dev->ops->cls' is left pointing to freed memory.

This fixes an easily reproducible #GP fault caused by loading and unloading
vmm.ko multiple times.

Differential Revision:	https://reviews.freebsd.org/D2294
Reviewed by:	imp, jhb
Discussed with:	rstone
Reported by:	Leon Dang (ldang@nahannisys.com)
MFC after:	2 weeks
2015-04-15 16:22:05 +00:00
George V. Neville-Neil
6332e4cc38 Minor change to the macros to make sure that if an AF is passed that is neither AF_INET6 nor AF_INET that we don't touch random bits of memory.
Differential Revision:	https://reviews.freebsd.org/D2291
2015-04-15 14:46:45 +00:00
Andrew Turner
731b28fb31 Enter a critical section when storing the vfp registers, we don't want to
be preempted here as this will enter back into this function, but the
hardware could be in an inconsistant state, and the vfp unit will be off
when switced back to this function.

Sponsored by:	The FreeBSD Foundation
2015-04-15 14:30:07 +00:00
Andrew Turner
899b27a318 Use the correct value to get the offset of the objects tls data.
Sponsored by:	The FreeBSD Foundation
2015-04-15 14:20:12 +00:00
Andrew Turner
2db317ca85 Ensure the userland thread and floating-point state has been saved before
copying the pcb. These values may have been changed just before the call
to fork and without a call to cpu_switch, where they would have been saved.

Sponsored by:	The FreeBSD Foundation
2015-04-15 14:18:25 +00:00
Tijl Coosemans
4ee4d5917b Point to the right location where __FreeBSD_version numbers are documented. 2015-04-15 09:39:52 +00:00
Edward Tomasz Napierala
1c73bcab8e Rewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). This
adds missing jail and MAC checks.

Differential Revision:	https://reviews.freebsd.org/D2193
Reviewed by:	kib@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-04-15 09:13:11 +00:00
Tijl Coosemans
1243a98e38 Remove the const qualifier from iconv(3) to comply with POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html

Adjust all code that calls iconv.

PR:		199099
Exp-run by:	antoine
MFC after:	2 weeks
2015-04-15 09:09:20 +00:00
Konstantin Belousov
3de3815469 Implement support -z global linker option. It marks the shared object
as always participating in the global symbols namespace, regardless of
the way the object was brought into the process address space.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-04-15 08:16:34 +00:00
Konstantin Belousov
316b384343 Implement support for binary to requesting specific stack size for the
initial thread.  It is read by the ELF image activator as the virtual
size of the PT_GNU_STACK program header entry, and can be specified by
the linker option -z stack-size in newer binutils.

The soft RLIMIT_STACK is auto-increased if possible, to satisfy the
binary' request.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-04-15 08:13:53 +00:00
Baptiste Daroussin
03c57bd0de Correctly set LC_COLLATE into setenv
Submitted by:	jbeich
2015-04-15 06:57:47 +00:00
Rui Paulo
420827da5b snd_hda: add support for the Lenovo X1 20BS model.
This requires a patch to redirect the output to a separate DAC when
the headphones are used.  While there, add device strings for Intel
Broadwell HDA controllers and Realtek ALC292 codecs.

MFC after:	1 week
2015-04-15 05:24:39 +00:00
Neel Natu
22fc8b974d Initialize 'error' before use.
Reported by:	Coverity Scan
CID:		1249748, 1249747, 1249751, 1249749
MFC after:	1 week
2015-04-15 05:04:42 +00:00
Adrian Chadd
3e217461e6 Fix RSS build - netisr input / NETISR_IP_DIRECT is used here. 2015-04-15 00:57:21 +00:00
Xin LI
c1c4677aec When reading in the original file name from gzip header, we read
in PATH_MAX + 1 bytes from the file.  In r281500, strrchr() is
used to strip possible path portion of the file name to mitigate
a possible attack.  Unfortunately, strrchr() expects a buffer
that is NUL-terminated, and since we are processing potentially
untrusted data, we can not assert that be always true.

Solve this by reading in one less byte (now PATH_MAX) and
explicitly terminate the buffer after the read size with NUL.

Reported by:	Coverity
CID:		1264915
X-MFC-with:	281500
MFC after:	13 days
2015-04-15 00:07:21 +00:00
Ed Maste
a04eaf906b Increase vt font limits to allow use of GNU Unifont
PR:		199438
Submitted by:	Ting-Wei Lan <lantw44@gmail.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-04-14 19:18:34 +00:00
Kristof Provost
3d1bbe5fa0 pf: Fix forwarding detection
If the direction is not PF_OUT we can never be forwarding. Some input packets
have rcvif != ifp (looped back packets), which lead us to ip6_forward() inbound
packets, causing panics.

Equally, we need to ensure that packets were really received and not locally
generated before trying to ip6_forward() them.

Differential Revision:	https://reviews.freebsd.org/D2286
Approved by:		gnn(mentor)
2015-04-14 19:07:37 +00:00
Xin LI
a7c4ad3926 Eliminate unused headers. 2015-04-14 18:13:55 +00:00
Alan Somers
738fd16625 Initialize async_arg_ptr in xpt_async when called with async_code
AC_ADVINFO_CHANGED.

Without this change, newly inserted hard disks won't always have their
physical path device nodes created.  The problem reproduces most readily
when attaching a large number of disks at once.

Differential Revision:	https://reviews.freebsd.org/D2290
Reviewed by:	mav, imp
MFC after:	2 weeks
Sponsored by:	Spectra Logic
2015-04-14 16:33:33 +00:00
George V. Neville-Neil
3085e1216e Document internal interface types which are specific to FreeBSD. 2015-04-14 15:21:20 +00:00
George V. Neville-Neil
916e17fd56 I can find no reason to allow packets with both SYN and FIN bits
set past this point in the code. The packet should be dropped and
not massaged as it is here.

Differential Revision:  https://reviews.freebsd.org/D2266
Submitted by: eri
Sponsored by: Rubicon Communications (Netgate)
2015-04-14 14:43:42 +00:00
George V. Neville-Neil
63bf240482 When a kernel has DEVICE_POLLING turned on but no drivers have
the capability do not try to take the mutex at all.

Replaces misbegotten attempt from reverted commit 281276

Pointed out by: glebius
Sponsored by: Rubicon Communications (Netgate)
Differential Revision:	https://reviews.freebsd.org/D2262
2015-04-14 14:22:34 +00:00
Andrew Turner
3f06facc8a * Remove the wfi when the efi loader returns, it's unneeded and is not
available on older designs.
* Enable the efi loader on arm
2015-04-14 14:15:14 +00:00
Andrew Turner
0cafabf97f Add support for arm64 to loader.efi and boot1.efi
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2015-04-14 13:55:01 +00:00
Andrew Turner
30dd368aa7 Fix the arm64 MACHINE_CPUARCH value in the efi fdt glue code.
Sponsored by:	The FreeBSD Foundation
2015-04-14 10:41:57 +00:00
Andrew Turner
c93a8403be Use MACHINE in the efi loader when it is what we mean, it may not be the
same as MACHINE_CPUARCH, it just happened to be the case the architectures
this code currently supports.

Sponsored by:	The FreeBSD Foundation
2015-04-14 10:40:37 +00:00
Andrew Turner
da713b9ed2 Disable truss, gprof, and lint on arm64, they don't build.
Sponsored by:	The FreeBSD Foundation
2015-04-14 10:15:58 +00:00
Eitan Adler
340bde8178 ipcs: fix builds that use gcc
gcc gets annoyed by duplicate declarations

Reported by:	sbruno
Reviewed by:	sbruno
2015-04-14 04:52:52 +00:00
Randall Stewart
b132edb56f Fix my stupid restoral of old code.. must be c_iflags now.
Thanks jhb for catching my stupidity...
MFC after:	3 days
2015-04-14 00:02:39 +00:00
Randall Stewart
07a2df5d83 Restore the two lines accidentally deleted that allow CALLOUT_DIRECT to be
specifed in the flags.

Thanks Mark Johnston for noticing this ;-o

MFC after:	3 days
2015-04-13 23:06:13 +00:00