Commit Graph

212895 Commits

Author SHA1 Message Date
Ed Schouten
07acf54b4b Add missing types and constants to <netdb.h>.
According to POSIX, the netdb.h header must also provide in_addr_t and
in_port_t. It should also provide IPPORT_RESERVED. Copy over the
necessary bits from <netinet/in.h> to achieve that.
2016-05-30 13:37:11 +00:00
Michael Tuexen
7b7f31e6cf Fix a byte order issue for the scope stored in the SCTP cookie.
MFC after:	1 week
2016-05-30 11:18:39 +00:00
Sepherosa Ziehau
496d023db3 hyperv/et: Allow Hyper-V event timer be disabled
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6599
2016-05-30 09:44:17 +00:00
Sepherosa Ziehau
6072b2511c hyperv/et: Device renaming; consistent w/ other Hyper-V utils
While I'm here, prefix function names w/ vmbus, since unlike Hyper-V
timecounter, Hyper-V event timer will not work w/o vmbus.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6598
2016-05-30 09:35:36 +00:00
Sepherosa Ziehau
3f07976a64 hyperv: Move timer frequency definition to common place.
And cleanup event timer period settings.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6597
2016-05-30 09:20:08 +00:00
Ed Schouten
049342a994 Add missing restrict keywords to lio_listio(). 2016-05-30 09:18:12 +00:00
Michael Gmelin
0ba5622d8c Fix ig4 operation for certain machines
Some machine BIOSes use the I2C bus and leave it in a state that causes
interrupts to not work properly due to a pending interrupt having been
latched.

Refactor the code a bit to clear pending interrupts when I2C is enabled.
This fixes the primary problem.

Also fix a possible race condition in the interrupt handler where the
interrupt was being cleared after reading the status instead of before.

Reported by:	pfg
Reviewed by:	jhb
Approved by:	jhb
Obtained from:	DragonFly BSD
Differential Revision:	https://reviews.freebsd.org/D6586
2016-05-30 09:05:24 +00:00
Sepherosa Ziehau
efe8791a64 hyperv/et: Make sure only one event timer will be registered
This nullifies the need to use softc.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6591
2016-05-30 08:50:33 +00:00
Sepherosa Ziehau
430d28dbb3 hyperv/vmbus: Move SINT settings to vmbus_var.h
While I'm here remove the event timer's dependency on hv_vmbus_priv.h

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6574
2016-05-30 08:42:35 +00:00
Sepherosa Ziehau
d7bc16443e hyperv/et: Fix STIMER0 operations.
- Make sure that STIMER0 is disabled before writting to it, since
  writing to an enabled STIMER will result in undefined behaviour.
- It is unnecessary to reconfigure STIMER0 upon each et_start().
- Make sure that MSR_HV_REF_TIME_COUNT will not return 0, since
  writing 0 to STIMER_COUNT will disable the target STIMER.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6573
2016-05-30 08:25:09 +00:00
Ed Schouten
611c29bab9 Add missing declaration of ino_t.
POSIX requires that <dirent.h> provides ino_t in the XSI case. In our
case, this wasn't being exposed, as d_ino is a macro that expands to
d_fileno that is an uint32_t, not an ino_t.
2016-05-30 07:50:57 +00:00
Sepherosa Ziehau
cb2404b4ad bge: Support 5717 C0, which is almost same as 5720 A0
PR:		209758
Obtained from:	DragonFlyBSD d79f5d8f5fe94cd6769207b2901422977d502bc0
MFC after:	1 week
2016-05-30 06:49:01 +00:00
Dimitry Andric
22dfc4860f Bump __FreeBSD_cc_version after r300974. 2016-05-30 06:44:10 +00:00
Jamie Gritton
ee8d6bd352 Mark jail(2), and the sysctls that it (and only it) uses as deprecated.
jail(8) has long used jail_set(2), and those sysctl only cause confusion.
2016-05-30 05:21:24 +00:00
Sepherosa Ziehau
5cfd97e823 mbuf: Add a flag for M_HASHTYPE_ to indicate the type has hash properties
This flag has not been used, and drivers setting M_HASHTYPE_OPAQUE have
not been converted as of this commit.

Reviewed by:	hps, gallatin (early version)
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6406
2016-05-30 04:48:06 +00:00
Sepherosa Ziehau
425b763928 tcp: Don't prematurely drop receiving-only connections
If the connection was persistent and receiving-only, several (12)
sporadic device insufficient buffers would cause the connection be
dropped prematurely:
Upon ENOBUFS in tcp_output() for an ACK, retransmission timer is
started.  No one will stop this retransmission timer for receiving-
only connection, so the retransmission timer promises to expire and
t_rxtshift is promised to be increased.  And t_rxtshift will not be
reset to 0, since no RTT measurement will be done for receiving-only
connection.  If this receiving-only connection lived long enough
(e.g. >350sec, given the RTO starts from 200ms), and it suffered 12
sporadic device insufficient buffers, i.e. t_rxtshift >= 12, this
receiving-only connection would be dropped prematurely by the
retransmission timer.

We now assert that for data segments, SYNs or FINs either rexmit or
persist timer was wired upon ENOBUFS.  And don't set rexmit timer
for other cases, i.e. ENOBUFS upon ACKs.

Discussed with:	lstewart, hiren, jtl, Mike Karels
MFC after:	3 weeks
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5872
2016-05-30 03:31:37 +00:00
Kurt Lidl
f9e7d7e1a3 Remove extraneous altq header files
At some point during stable/10, the headers altq_codel.h and
altq_fairq.h where added to /usr/include/altq, before all of altq
was moved to /usr/include/net/altq.

Reviewed by:	rpaulo
Approved by:	rpaulo
Differential Revision:	https://reviews.freebsd.org/D6596
2016-05-30 02:09:19 +00:00
Baptiste Daroussin
e936bb40df Regenerate timedef:
For Russian:
- Convert AM/PM which are badly formatted in CLDR to replace it by the proper
  cyrillic
- Add a dependency on Text::Iconv so non unicode get the proper encoding for
  AM/PM
- fix the date format having 'r.,' and convert it to 'r.' (also fixed in Bulgarian)

For All:
- Use complete Day of Week instead of the abbreviated one

Reported by:	ache
2016-05-29 22:28:39 +00:00
Baptiste Daroussin
70f0a8136c Add more hacks to correct CLDR data
For Russian:
- Convert AM/PM which are badly formatted in CLDR to replace it by the proper
  cyrillic
- Add a dependency on Text::Iconv so non unicode get the proper encoding for
  AM/PM
- fix the date format having 'r.,' and convert it to 'r.' (also fixed in Bulgarian)

For All:
- Use complete Day of Week instead of the abbreviated one

Reported by:	ache
2016-05-29 22:27:42 +00:00
Dimitry Andric
f8789c6b84 Pull in r269908 from upstream llvm trunk (by James Molloy):
[VectorUtils] Fix nasty use-after-free

  In truncateToMinimalBitwidths() we were RAUW'ing an instruction then
  erasing it. However, that intruction could be cached in the map we're
  iterating over. The first check is "I->use_empty()" which in most
  cases would return true, as the (deleted) object was RAUW'd first so
  would have zero use count. However in some cases the object could
  have been polluted or written over and this wouldn't be the case.
  Also it makes valgrind, asan and traditionalists who don't like their
  compiler to crash sad.

  No testcase as there are no externally visible symptoms apart from a
  crash if the stars align.

  Fixes PR26509.

This should fix crashes when building a number of ports on arm64.

Reported by:	andrew
2016-05-29 20:54:16 +00:00
Enji Cooper
98a7b0ba5c Follow up to r300932
In the event MK_INET6 != no in userspace, but is disabled in the
kernel, or if there aren't any IPv6 addresses configured in userspace
(for lo0 and all physical interfaces), rpcbind would terminate
immediately instead of silently failing on

Skip over the IPv6 block to its respective cleanup with freeifaddrs if
creating the socket failed instead of terminating rpcbind immediately

MFC after: 6 days
X-MFC with: r300932
Reported by: O. Hartmann <ohartman@zedat.fu-berlin.de>
Sponsored by: EMC / Isilon Storage Division
2016-05-29 20:28:01 +00:00
Mark Johnston
5656b5057e Fix rpcbind init after r300941.
- getaddrinfo() sets res = NULL on failure and freeaddrinfo() always
  dereferences its argument, so we should only free the address list after
  a successful call.
- Address a second potential leak caused by getaddrinfo(AF_INET6)
  overwriting the address list returned by getaddrinfo(AF_INET).

X-MFC-With:	r300941
2016-05-29 19:46:34 +00:00
Konstantin Belousov
6180f50bbb Stop inlining the struct ucond definition into struct pthread_cond.
This avoids unneccessary casts and make the calls to _thr_ucond_*()
functions less questionable.

The c_spare field was not included into struct pthread_cond, so the
change modifies libthr ABI for shared condvars.  But since an off-page
does not legitimately contains any other data past the struct
pthread_cond, the change keeps shared condvars from pre- and post-
changed libthr compatible.  Also note that the whole struct ucond was
never copied in or out by kernel.

For private condvars, the privately allocated memory was never exposed
outside libthr.

Sponsored by:	The FreeBSD Foundation
2016-05-29 19:35:55 +00:00
Jilles Tjoelker
60404ec965 Remove non-history libkse references and fix PTHREAD_PROCESSES_PRIVATE typo. 2016-05-29 18:25:11 +00:00
Zbigniew Bodek
01ed3219b9 Improve ARM debug_monitor for SMP machines
- Reset debug architecture and enable monitor for secondary
  CPUs in init_secondary() rather than when configuring watchpoint, etc.
- Disable HW debugging capabilities when one of the CPU cores fails
  to set up.
- Use dbg_capable() in a more atomic manner to avoid any mismatch
  between CPUs.

Differential Revision: https://reviews.freebsd.org/D6009
2016-05-29 17:35:38 +00:00
Zbigniew Bodek
9ae1207bcf Fix debug_monitor code for older ARMs (ARM11)
- Enable monitor mode prior to accessing watchpoint
  registers for v6, v6.1 architectures.
- Fix configuration scheme for v6, v6.1 and v7 Debug Archs
- Enable monitor unconditionally and for good instead
  of enabling and disabling it (needed for single stepping
  on on v6/v6.1)

Tested on RPI-B and Arndale

Differential Revision: https://reviews.freebsd.org/D6008
2016-05-29 17:33:49 +00:00
Dimitry Andric
4a8240ec66 Stop exposing the C11 _Atomic() macro in <sys/cdefs.h>, when compiling
for C++.  It clashes with the one in libc++'s <atomic> header.

(Previously, the _Atomic() macro was defined in <stdatomic.h>, which is
only for use with C11, but for various reasons it was moved to its
current location in r251804.)

Discussed with:	bdrewery, ed
MFC after:	2 weeks
2016-05-29 17:32:19 +00:00
Colin Percival
696c3895ae Retune SHA2 code for improved performance on CPUs with more ILP and
a preference for memory load instructions over large code footprints
with embedded immediate variables.

On amd64 CPUs from 2007-2008 there is not a significant change, but
amd64 CPUs from 2009-2010 get roughly 10% more throughput with this
code; amd64 CPUs from 2011-2012 get roughly 15% more throughput; and
AMD64 CPUs from 2013-2015 get 20-25% more throughput.  The Raspberry
Pi 2 increases its throughput by 6-8%.

Sponsored by:	Tarsnap Backup Inc.
Performance tested by:	allanjude
MFC after:	3 weeks
2016-05-29 17:26:40 +00:00
Andrey A. Chernov
b8ac3f201d Micro optimize: C standard guarantees that right shift for unsigned value
fills left bits with zero, and we have exact 32bit unsigned value
(uint32_t), so there is no reason to add "& 0x7fffffff" here.

MFC after:      1 week
2016-05-29 16:39:28 +00:00
Ed Schouten
a25e1dd4df Replace local prototype of basename() with an inclusion of <libgen.h>.
libiberty currently defines the prototype for basename() itself instead
of using <libgen.h>. It still uses the BSD-style prototype instead of
the POSIX one, meaning that if FreeBSD would switch over to the POSIX
one, you wouldn't be able to use libiberty.h and libgen.h in a single
source file. It turns out that kgdb does this. Patch up libiberty to
just include <libgen.h>.

I'm currently talking to upstream to see whether we can come up with a
more complete solution that could be integrated, but for our
unmaintained copy of GDB in base, let's just apply the simplest
workaround possible.

Reviewed by:	pfg
Differential Revision:	https://reviews.freebsd.org/D6631
2016-05-29 16:10:01 +00:00
Konstantin Belousov
9f790a1756 Do not leak the vm object lock when swap reservation failed, in
vm_object_coalesce().

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-05-29 15:46:19 +00:00
Jilles Tjoelker
764be64b12 _umtx_op(2): Note deprecation of UMTX_OP_MUTEX_WAKE. 2016-05-29 15:02:55 +00:00
Jilles Tjoelker
8e44e0ab19 _umtx_op(2),thr_*(2): Various spelling, grammar and mdoc fixes. 2016-05-29 14:16:23 +00:00
Andrey A. Chernov
44f8773834 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes
reading hard.

2) Instead of doing range transformation in each and every function here,
do it single time directly in do_rand(). One "mod" operation overhead is not
a big deal, but the code looks nicer and possible future functions additions
or PRNG change do not miss range transformations neither have unneeded ones.

3) Use POSIX argument types for visible functions (cosmetic).

MFC after:      1 week
2016-05-29 13:57:06 +00:00
Ed Schouten
864a391104 Fix style of the libgen.h header.
- Remove unneeded declarations of removed/unimplemented features.
- Add missing tab after #define.
- Add missing ! before trailing comment.
2016-05-29 12:21:54 +00:00
Andrey A. Chernov
e44ffdb207 1) Unifdef USE_WEAK_SEEDING it is too obsolete to support and makes reading
harder.

2) ACM paper require seed to be in [1, 2^31-2] range, so use the same range
shifting as already done for rand(3). Also protect srandomdev() + TYPE_0 case
(non default) from negative seeds.

3) Don't check for valid "type" range in setstate(), it is always valid as
calculated. Instead add a check that rear pointer not exceeed end pointer.

MFC after:      1 week
2016-05-29 11:54:09 +00:00
Ed Schouten
c200e14277 Invoke the dirname() function in a POSIX compliant way.
POSIX requires that the argument of dirname() is of type "char *". In
other words, the input buffer can be modified by the function to store
the directory name.

Pull a copy of the string before calling dirname(). We don't care about
freeing up the memory afterwards, as this is done at the very bottom of
main(), right before the program terminates.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D6628
2016-05-29 10:41:27 +00:00
Michal Meloun
74bf497550 ARM GIC: Allow to setup interrupt without configuration data.
In some cases, like for PCI devices, only interrupt numbers are enumerated
from HW. In this case, use INTR_foo_CONFORM as level and trigger values.
2016-05-29 07:39:56 +00:00
Don Lewis
9a81299340 Now that PIE is free of runtime floating point, revert r300853 to
reconnect PIE to the build.
2016-05-29 07:29:35 +00:00
Don Lewis
fe4b5f6659 Cast some expressions that multiply a long long constant by a
floating point constant to int64_t.  This avoids the runtime
conversion of the the other operand in a set of comparisons from
int64_t to floating point and doing the comparisions in floating
point.

Suggested by:	lidl
Submitted by:	Rasool Al-Saadi <ralsaadi@swin.edu.au>
MFC after:	2 weeks (with r300779)
2016-05-29 07:23:56 +00:00
Enji Cooper
4eb767eab0 Staticize variables only used in rpcbind.c
This is some low hanging fruit necessary for making this WARNS?= 6 clean

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2016-05-29 07:01:12 +00:00
Enji Cooper
370b69af0f Remove unnecessary caller_uaddr != NULL test before calling free on it
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2016-05-29 06:29:22 +00:00
Bryan Drewery
76c5029cdf Libcompat: Swap CXX/CFLAGS.
This is the same as done for the native build in r300770 to ensure that
the libc++ build reads from SYSROOT/usr/include/c++/v1 before reading
from SYSROOT/usr/include.
2016-05-29 06:20:36 +00:00
Bryan Drewery
f661dbee81 GCC External: Revert r300886, r300904, r300917, r300918
The fix in r300873 is mostly enough.  A fix for lib32 will be
committed.separately.
2016-05-29 06:20:15 +00:00
Enji Cooper
3f78f0a950 Remove a useless if (x != NULL) check before calling free on allocated_uaddr
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2016-05-29 06:01:18 +00:00
Enji Cooper
b07f123b60 Don't leak res in network_init(..)
Call freeaddrinfo on it after it's been used

MFC after: 1 week
Reported by: Coverity
CID: 1225050
Sponsored by: EMC / Isilon Storage Division
2016-05-29 05:55:21 +00:00
Enji Cooper
d9082519b6 Remove yacc and the yacc tests if MK_TOOLCHAIN == no
yacc's install is conditional based on MK_TOOLCHAIN != no

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-29 04:56:48 +00:00
Enji Cooper
482537c7a2 Use require.progs with bc instead of require.files with /usr/bin/bc
This will make things more flexible if the program path changes in the future,
and the test in and of itself doesn't call /usr/bin/bc -- it just calls bc

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-29 04:50:49 +00:00
Enji Cooper
5c46b7343e Remove the sa(8) tests if MK_ACCT == no when "make delete-old" is run
sa(8) is conditionally installed based on MK_ACCT != no today

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-29 04:47:10 +00:00
Enji Cooper
36873e7926 Remove the etcupdate tests if MK_RCS == no when "make delete-old" is run
etcupdate is conditionally installed based on MK_RCS != no today

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-29 04:43:24 +00:00