]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoFix indentation in dhclient rc.d script
vangyzen [Tue, 31 May 2016 18:40:47 +0000 (18:40 +0000)]
Fix indentation in dhclient rc.d script

7 years agosfxge(4): move definition of the SW events to sfxge.h
arybchik [Tue, 31 May 2016 18:34:39 +0000 (18:34 +0000)]
sfxge(4): move definition of the SW events to sfxge.h

Tx flush done event is defined and Rx-specific header is not a good
place for it.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

7 years agoFix prototype of dbm_open().
ed [Tue, 31 May 2016 18:32:57 +0000 (18:32 +0000)]
Fix prototype of dbm_open().

The last argument of dbm_open() should be a mode_t according to POSIX;
not an int.

Reviewed by: pfg, kib
Differential Revision: https://reviews.freebsd.org/D6650

7 years agosfxge(4): zero should be used as RxQ label in SW event
arybchik [Tue, 31 May 2016 18:31:17 +0000 (18:31 +0000)]
sfxge(4): zero should be used as RxQ label in SW event

The buggy code was using the rxq index but should use the evq label
associated with the rxq. It was missed in r298735.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D6661

7 years agoDocument r300240, net.inet.tcp.ecn.enable now is a three way setting
skreuzer [Tue, 31 May 2016 18:30:33 +0000 (18:30 +0000)]
Document r300240, net.inet.tcp.ecn.enable now is a three way setting

Approved by: re (gjb, implicit, relnotes)

7 years agoDocument r300906, ZFS fault management daemon
skreuzer [Tue, 31 May 2016 18:15:18 +0000 (18:15 +0000)]
Document r300906, ZFS fault management daemon

Approved by: re (gjb, implicit, relnotes)

7 years agoarm_gic_map is a mask not the CPUs ID, there is no need to shift it.
andrew [Tue, 31 May 2016 18:05:17 +0000 (18:05 +0000)]
arm_gic_map is a mask not the CPUs ID, there is no need to shift it.

Pointy-hat to: andrew
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agosfxge(4): regenerate MCDI headers from firmwaresrc .yml
arybchik [Tue, 31 May 2016 18:04:16 +0000 (18:04 +0000)]
sfxge(4): regenerate MCDI headers from firmwaresrc .yml

Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

7 years agoBin interrupts to the correct CPU when we boot on a non-zero CPU.
andrew [Tue, 31 May 2016 17:49:47 +0000 (17:49 +0000)]
Bin interrupts to the correct CPU when we boot on a non-zero CPU.

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

7 years agoifconfig(8) now supports some output formatting options
allanjude [Tue, 31 May 2016 17:30:08 +0000 (17:30 +0000)]
ifconfig(8) now supports some output formatting options

specified by the -f flag or IFCONFIG_FORMAT environment variable, the user
can request that inet4 subnet masks be printed in CIDR or dotted-quad
notation, in addition to the traditional hex output.
inet6 prefixes can be printed in CIDR as well.

For more documentation see the ifconfig(8) man page.

PR: 169072
Requested by: seanc, marcel, brd, many others
Reviewed by: gnn, jhb (earlier version)
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2856

7 years agoUpdate the Security Team member list with the actual
remko [Tue, 31 May 2016 17:23:27 +0000 (17:23 +0000)]
Update the Security Team member list with the actual
members.

Discussed with: glebius

7 years agoFix kernel stack disclosures in the Linux and 4.3BSD compat layers.
glebius [Tue, 31 May 2016 16:56:30 +0000 (16:56 +0000)]
Fix kernel stack disclosures in the Linux and 4.3BSD compat layers.

Submitted by: CTurt
Security: SA-16:20
Security: SA-16:21

7 years agoEnable setting BF_COHERENT on DMA tags. This allows the kernel to start
andrew [Tue, 31 May 2016 16:28:56 +0000 (16:28 +0000)]
Enable setting BF_COHERENT on DMA tags. This allows the kernel to start
using the cache handling functions.

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

7 years ago[ath_hal] rename the MCI state info routine.
adrian [Tue, 31 May 2016 16:08:06 +0000 (16:08 +0000)]
[ath_hal] rename the MCI state info routine.

It's not /really/ "get state".

7 years ago[ath_hal] add support for setting the azimuth timestamp in the outgoing TX payload.
adrian [Tue, 31 May 2016 16:07:15 +0000 (16:07 +0000)]
[ath_hal] add support for setting the azimuth timestamp in the outgoing TX payload.

FYI: This is an unsupported/deprecated feature of the 11n hardware.

7 years ago[ath_hal] reserve a HAL_TXDESC_ bit for azimuth TX timestamp requests.
adrian [Tue, 31 May 2016 16:05:54 +0000 (16:05 +0000)]
[ath_hal] reserve a HAL_TXDESC_ bit for azimuth TX timestamp requests.

7 years agoCosmetics - add missing space after ellipses in shutdown messages.
trasz [Tue, 31 May 2016 15:27:33 +0000 (15:27 +0000)]
Cosmetics - add missing space after ellipses in shutdown messages.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoAdd support for simplex USB MIDI devices, which only provide BULK or
hselasky [Tue, 31 May 2016 15:05:50 +0000 (15:05 +0000)]
Add support for simplex USB MIDI devices, which only provide BULK or
INTERRUPT endpoints for moving data in one direction, like the KeyRig
49 from M-Audio.

Requested by: Ivan Klymenko <fidaj@ukr.net>
MFC after: 1 week

7 years agoMake CMSG_*() work without having NULL available.
ed [Tue, 31 May 2016 13:32:33 +0000 (13:32 +0000)]
Make CMSG_*() work without having NULL available.

The <sys/socket.h> is not supposed to declare NULL, according to POSIX.
Our implementation complies with that, meaning that we need to make sure
that CMSG_*() doesn't use it.

7 years agoImplement _ALIGN() using internal integer types.
ed [Tue, 31 May 2016 13:31:19 +0000 (13:31 +0000)]
Implement _ALIGN() using internal integer types.

The existing version depends on register_t and uintptr_t, which are only
available when including headers such as <sys/types.h>. As this macro is
used by <sys/socket.h>, for example, it should be written in such a way
that it doesn't depend on those types.

7 years agoMake strfmon_l() work without requiring the use of <xlocale.h>.
ed [Tue, 31 May 2016 12:29:21 +0000 (12:29 +0000)]
Make strfmon_l() work without requiring the use of <xlocale.h>.

The strfmon_l() function provided by <xlocale/_monetary.h> is also part
of POSIX 2008's <monetary.h>, so it should be exposed by default.

Change the check used in <monetary.h> to be similar to the one that's
part of <wchar.h>, where we both test for __POSIX_VISIBLE and
_XLOCALE_H_.

7 years agoSet oldfp so the check for fp == oldfp works as expected.
andrew [Tue, 31 May 2016 11:32:09 +0000 (11:32 +0000)]
Set oldfp so the check for fp == oldfp works as expected.

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

7 years agoAdd "iscsictl -e". Among other things, it makes it possible to perform
trasz [Tue, 31 May 2016 11:32:07 +0000 (11:32 +0000)]
Add "iscsictl -e".  Among other things, it makes it possible to perform
discovery without attaching to the targets ("iscsictl -Ad ... -e off"),
and then attach to selected ones ("iscsictl -Mi ... -e on").

PR: 204129
MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6633

8 years agoMove a device_printf under bootverbose where it should have been.
andrew [Tue, 31 May 2016 09:24:16 +0000 (09:24 +0000)]
Move a device_printf under bootverbose where it should have been.

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

8 years agoMark the ThunderX and generic PCI drivers as cache-coherent when we know
andrew [Tue, 31 May 2016 09:15:21 +0000 (09:15 +0000)]
Mark the ThunderX and generic PCI drivers as cache-coherent when we know
this to be the case. This will mean we don't try and handle the cache in
bus_dmamap_sync when it is not needed.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6605

8 years agoAdd missing dependency on <machine/_limits.h>.
ed [Tue, 31 May 2016 08:38:24 +0000 (08:38 +0000)]
Add missing dependency on <machine/_limits.h>.

In r227474, this header file was changed to define SIG_ATOMIC_{MIN,MAX}
in terms of LONG_{MIN,MAX}. Unlike all of the definitions in this header
file, LONG_{MIN,MAX} is provided by <limits.h>. Remove the dependency on
<limits.h> by using __LONG_{MIN,MAX} instead and including
<machine/_limits.h>.

This change is needed to make SIG_ATOMIC_{MIN,MAX} work without
including any other header files.

8 years agoAdd missing dependency on <machine/_limits.h>.
ed [Tue, 31 May 2016 08:36:39 +0000 (08:36 +0000)]
Add missing dependency on <machine/_limits.h>.

This header uses __INT_MIN and __INT_MAX, which is provided by
<machine/_limits.h>. This is needed to make <stdint.h>'s WCHAR_MIN and
WCHAR_MAX work without including other headers as well.

8 years agoCosmetics: add missing space after the ':' in etc/rc.d/random.
trasz [Tue, 31 May 2016 08:31:34 +0000 (08:31 +0000)]
Cosmetics: add missing space after the ':' in etc/rc.d/random.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agor169386 (PR 112515) was incomplete: it treated 307 as an error except
des [Tue, 31 May 2016 08:27:39 +0000 (08:27 +0000)]
r169386 (PR 112515) was incomplete: it treated 307 as an error except
in verbose mode, and did not handle 308 at all.

r241840 (PR 172451) added support for 308, but with the same bug.

Correctly handle both by recognizing them as redirects in all places
where we check the HTTP result code.

PR: 112515 173451 209546
Submitted by: novel@
MFC after: 1 week

8 years agoLet <sched.h> define struct timespec.
ed [Tue, 31 May 2016 08:07:40 +0000 (08:07 +0000)]
Let <sched.h> define struct timespec.

POSIX 2004 doesn't require that this header defines struct timespec, but
does allow it. For FreeBSD, we would at least need a forward declaration
for sched_rr_get_interval().

POSIX 2008 is a bit more demanding, as it now requires that it is
declared. Remove the old forward declaration and include the _timespec.h
header. This should conform to both POSIX 2004 and 2008 now.

8 years agoMake iscsictl(8) error messages more consistent.
trasz [Tue, 31 May 2016 07:49:59 +0000 (07:49 +0000)]
Make iscsictl(8) error messages more consistent.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoStop using the non-standard basename_r() function.
ed [Tue, 31 May 2016 06:45:19 +0000 (06:45 +0000)]
Stop using the non-standard basename_r() function.

This change makes the code use the POSIX basename() function. It has the
advantage that (if implemented correctly), it also imposes no restrict
on the pathname length.

Notice that I haven't added any error handling to the strdup() call. It
looks like none of the other calls to strdup() and malloc() performed by
this utility do it either.

Reviewed by: hrs
Differential Revision: https://reviews.freebsd.org/D6626

8 years agoAdd missing libc includes to fix -Wimplicit-function-declaration warnings
ngie [Tue, 31 May 2016 06:24:09 +0000 (06:24 +0000)]
Add missing libc includes to fix -Wimplicit-function-declaration warnings

MFC after: 2 weeks
Reported by: clang
Sponsored by: EMC / Isilon Storage Division

8 years agohyperv/kvp: Use if_xname.
sephe [Tue, 31 May 2016 06:00:18 +0000 (06:00 +0000)]
hyperv/kvp: Use if_xname.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6641

8 years agohyperv: Move guid2str from vmbus file to hyperv file
sephe [Tue, 31 May 2016 05:43:59 +0000 (05:43 +0000)]
hyperv: Move guid2str from vmbus file to hyperv file

- Use uint8_t for GUID byte array.
- Define GUID string length.
- Break long lines.
- Nuke unnecessary stack variable.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6640

8 years agohyperv/vmbus: White space cleanup
sephe [Tue, 31 May 2016 05:34:46 +0000 (05:34 +0000)]
hyperv/vmbus: White space cleanup

No functional changes

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6637

8 years agohyperv/vmbus: Redefine SynIC message.
sephe [Tue, 31 May 2016 05:18:55 +0000 (05:18 +0000)]
hyperv/vmbus: Redefine SynIC message.

- Avoid unnecessary indirection.
- Avoid bit fields.
- Use __packed.

Reviewed by: Jun Su <junsu microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6636

8 years agohyperv/vmbus: Move global vmbus id array to stack.
sephe [Tue, 31 May 2016 05:10:20 +0000 (05:10 +0000)]
hyperv/vmbus: Move global vmbus id array to stack.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6603

8 years agohyperv/vmbus: Indentation cleanup
sephe [Tue, 31 May 2016 05:01:43 +0000 (05:01 +0000)]
hyperv/vmbus: Indentation cleanup

No functional changes.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6602

8 years ago[ath_hal] add QCA9565 and MCI related registers.
adrian [Tue, 31 May 2016 04:59:00 +0000 (04:59 +0000)]
[ath_hal] add QCA9565 and MCI related registers.

This is required for upcoming MCI fixes.

Obtained from: Linux ath9k

8 years agohyperv/vmbus: Rename ISR functions
sephe [Tue, 31 May 2016 04:47:53 +0000 (04:47 +0000)]
hyperv/vmbus: Rename ISR functions

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6601

8 years ago[ath_hal] migrate the bluetooth definitions out from ah.h / ar9300_freebsd_inc.h.
adrian [Tue, 31 May 2016 04:44:00 +0000 (04:44 +0000)]
[ath_hal] migrate the bluetooth definitions out from ah.h / ar9300_freebsd_inc.h.

The eventual MCI driver side of things needs the MCI bits to live
in the HAL API so we can get to them.

Tested:

* QCA9565, STA mode + bluetooth

8 years ago[ath_hal] add bluetooth coexistence definitions for both legacy and MCI.
adrian [Tue, 31 May 2016 04:35:26 +0000 (04:35 +0000)]
[ath_hal] add bluetooth coexistence definitions for both legacy and MCI.

The legacy bits are just from ah.h; the MCI bits are from the ar9300
HAL "freebsd" extras.

A subsequent commit will include ah_btcoex.h into ah.h and remove
the older defintions.

8 years ago[ath] ensure the right methods / options get overridden for MCI bluetooth coex
adrian [Tue, 31 May 2016 04:17:17 +0000 (04:17 +0000)]
[ath] ensure the right methods / options get overridden for MCI bluetooth coex

It turns out that the srev checks can't be done in the early attach
in ar9300_freebsd.c, because the poweron and srev check hasn't yet
happened.

So:

* Re-add the MCI overrides in attach
* Add QCA9565 (Aphrodite) check for the LNA diversity stuff.

Tested:

* QCA9565, STA mode + bluetooth

8 years agoBump __FreeBSD_version for ZFS's support for SHA-512t256 and Skein
allanjude [Tue, 31 May 2016 04:12:55 +0000 (04:12 +0000)]
Bump __FreeBSD_version for ZFS's support for SHA-512t256 and Skein

8 years agoConnect the SHA-512t256 and Skein hashing algorithms to ZFS
allanjude [Tue, 31 May 2016 04:12:14 +0000 (04:12 +0000)]
Connect the SHA-512t256 and Skein hashing algorithms to ZFS

Support for the new hashing algorithms in ZFS was introduced in r289422
However it was disconnected because FreeBSD lacked implementations of
SHA-512 (truncated to 256 bits), and Skein.

These implementations were introduced in r300921 and r300966 respectively

This commit connects them to ZFS and enabled these new checksum algorithms

This new algorithms are not supported by the boot blocks, so do not use them
on your root dataset if you boot from ZFS.

Relnotes: yes
Sponsored by: ScaleEngine Inc.

8 years agohyperv/vmbus: Process event timer before checking events
sephe [Tue, 31 May 2016 04:10:15 +0000 (04:10 +0000)]
hyperv/vmbus: Process event timer before checking events

And update comment.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6600

8 years ago[ath] add BTCOEX debug section; modify DPRINTF() to take a no-arg format string.
adrian [Tue, 31 May 2016 04:09:17 +0000 (04:09 +0000)]
[ath] add BTCOEX debug section; modify DPRINTF() to take a no-arg format string.

Tested:

* QCA9565, STA mode

8 years agoClarify the explanations for the hostname and FQDN entries.
wblock [Tue, 31 May 2016 00:23:29 +0000 (00:23 +0000)]
Clarify the explanations for the hostname and FQDN entries.

MFC after: 1 week

8 years agoAdd and correct MIPS relocation types
emaste [Mon, 30 May 2016 20:51:51 +0000 (20:51 +0000)]
Add and correct MIPS relocation types

The correct names for R_MIPS_GOT_HI16 and R_MIPS_GOT_LO16 have a _
after GOT. The nonstandard names (R_MIPS_GOTHI16, R_MIPS_GOTLO16) in the
FreeBSD elf_common.h header also had incorrect values and were not used
in the tree, so just remove them.

Add other MIPS relocation types found in FreeBSD/mips64 object files.

Reviewed by: imp, jmallett
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6561

8 years agokeyserv(1): drop useless comparison.
pfg [Mon, 30 May 2016 20:41:55 +0000 (20:41 +0000)]
keyserv(1): drop useless comparison.

Comparing a character array against NULL serves no purpose. In any case
we are always asigning a value just before using the value so obviate
the comparison altogether.

Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D6651

CID: 1008422

8 years agoFix circular dependency created after r287197 between ldconfig and mountcritremote
ngie [Mon, 30 May 2016 19:59:51 +0000 (19:59 +0000)]
Fix circular dependency created after r287197 between ldconfig and mountcritremote

ldconfig is already required by mountcritremote indirectly, as noted by rcorder:

> rcorder: Circular dependency on provision `mountcritremote' in file `ldconfig'.

Having mountcritremote REQUIRE ldconfig breaks dependency ordering.

Making the ldconfig hints be conditionally regenerated from mountcritremote when
remote filesystems are mounted is done after this change, similar to cleanvar
being conditionally called after the change.

Differential Revision: https://reviews.freebsd.org/D6621
PR: 202726
Reviewed by: jilles
Sponsored by: EMC / Isilon Storage Division

8 years agozfsd: minor spelling fix.
pfg [Mon, 30 May 2016 19:32:56 +0000 (19:32 +0000)]
zfsd: minor spelling fix.

8 years agoshare/misc/organization.dot: list myself as the new portmgr-secretary
rene [Mon, 30 May 2016 19:30:41 +0000 (19:30 +0000)]
share/misc/organization.dot: list myself as the new portmgr-secretary

8 years agolibdevdctl: minor spelling fixes.
pfg [Mon, 30 May 2016 19:25:00 +0000 (19:25 +0000)]
libdevdctl: minor spelling fixes.

8 years agoAdd PR_CONNREQUIRED for SOCK_STREAM sockets using SCTP.
tuexen [Mon, 30 May 2016 18:24:23 +0000 (18:24 +0000)]
Add PR_CONNREQUIRED for SOCK_STREAM sockets using SCTP.

This is required to signal connetion setup on non-blocking sockets
via becoming writable. This still allows for implicit connection
setup.

MFC after: 1 week

8 years agoLet dbm's datum::dptr use the right type.
ed [Mon, 30 May 2016 16:52:23 +0000 (16:52 +0000)]
Let dbm's datum::dptr use the right type.

According to POSIX, it should use void *, not char *. Unfortunately, the
dsize field also has the wrong type. It should be size_t. I'm not going
to change that, as that will break the ABI.

Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D6647

8 years agoAdd missing va_list to <wchar.h>.
ed [Mon, 30 May 2016 16:26:34 +0000 (16:26 +0000)]
Add missing va_list to <wchar.h>.

It looks like va_list should always be defined when XSI is enabled. It
moved over to the POSIX base in the 2008 edition.

8 years agoFix the signature of the psignal() function.
ed [Mon, 30 May 2016 13:51:27 +0000 (13:51 +0000)]
Fix the signature of the psignal() function.

POSIX 2008 added the psignal() function which has already been part of
the BSDs for a long time. The only difference is, the POSIX version uses
an 'int' for the signal number, unlike our version which uses an
'unsigned int'. Fix up the function to use an 'int'. This should not
affect the ABI.

8 years agoAdd missing types and constants to <netdb.h>.
ed [Mon, 30 May 2016 13:37:11 +0000 (13:37 +0000)]
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.

8 years agoFix a byte order issue for the scope stored in the SCTP cookie.
tuexen [Mon, 30 May 2016 11:18:39 +0000 (11:18 +0000)]
Fix a byte order issue for the scope stored in the SCTP cookie.

MFC after: 1 week

8 years agohyperv/et: Allow Hyper-V event timer be disabled
sephe [Mon, 30 May 2016 09:44:17 +0000 (09:44 +0000)]
hyperv/et: Allow Hyper-V event timer be disabled

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6599

8 years agohyperv/et: Device renaming; consistent w/ other Hyper-V utils
sephe [Mon, 30 May 2016 09:35:36 +0000 (09:35 +0000)]
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

8 years agohyperv: Move timer frequency definition to common place.
sephe [Mon, 30 May 2016 09:20:08 +0000 (09:20 +0000)]
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

8 years agoAdd missing restrict keywords to lio_listio().
ed [Mon, 30 May 2016 09:18:12 +0000 (09:18 +0000)]
Add missing restrict keywords to lio_listio().

8 years agoFix ig4 operation for certain machines
grembo [Mon, 30 May 2016 09:05:24 +0000 (09:05 +0000)]
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

8 years agohyperv/et: Make sure only one event timer will be registered
sephe [Mon, 30 May 2016 08:50:33 +0000 (08:50 +0000)]
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

8 years agohyperv/vmbus: Move SINT settings to vmbus_var.h
sephe [Mon, 30 May 2016 08:42:35 +0000 (08:42 +0000)]
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

8 years agohyperv/et: Fix STIMER0 operations.
sephe [Mon, 30 May 2016 08:25:09 +0000 (08:25 +0000)]
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

8 years agoAdd missing declaration of ino_t.
ed [Mon, 30 May 2016 07:50:57 +0000 (07:50 +0000)]
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.

8 years agobge: Support 5717 C0, which is almost same as 5720 A0
sephe [Mon, 30 May 2016 06:49:01 +0000 (06:49 +0000)]
bge: Support 5717 C0, which is almost same as 5720 A0

PR: 209758
Obtained from: DragonFlyBSD d79f5d8f5fe94cd6769207b2901422977d502bc0
MFC after: 1 week

8 years agoBump __FreeBSD_cc_version after r300974.
dim [Mon, 30 May 2016 06:44:10 +0000 (06:44 +0000)]
Bump __FreeBSD_cc_version after r300974.

8 years agoMark jail(2), and the sysctls that it (and only it) uses as deprecated.
jamie [Mon, 30 May 2016 05:21:24 +0000 (05:21 +0000)]
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.

8 years agombuf: Add a flag for M_HASHTYPE_ to indicate the type has hash properties
sephe [Mon, 30 May 2016 04:48:06 +0000 (04:48 +0000)]
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

8 years agotcp: Don't prematurely drop receiving-only connections
sephe [Mon, 30 May 2016 03:31:37 +0000 (03:31 +0000)]
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

8 years agoRemove extraneous altq header files
lidl [Mon, 30 May 2016 02:09:19 +0000 (02:09 +0000)]
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

8 years agoRegenerate timedef:
bapt [Sun, 29 May 2016 22:28:39 +0000 (22:28 +0000)]
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

8 years agoAdd more hacks to correct CLDR data
bapt [Sun, 29 May 2016 22:27:42 +0000 (22:27 +0000)]
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

8 years agoPull in r269908 from upstream llvm trunk (by James Molloy):
dim [Sun, 29 May 2016 20:54:16 +0000 (20:54 +0000)]
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

8 years agoFollow up to r300932
ngie [Sun, 29 May 2016 20:28:01 +0000 (20:28 +0000)]
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

8 years agoFix rpcbind init after r300941.
markj [Sun, 29 May 2016 19:46:34 +0000 (19:46 +0000)]
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

8 years agoStop inlining the struct ucond definition into struct pthread_cond.
kib [Sun, 29 May 2016 19:35:55 +0000 (19:35 +0000)]
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

8 years agoRemove non-history libkse references and fix PTHREAD_PROCESSES_PRIVATE typo.
jilles [Sun, 29 May 2016 18:25:11 +0000 (18:25 +0000)]
Remove non-history libkse references and fix PTHREAD_PROCESSES_PRIVATE typo.

8 years agoImprove ARM debug_monitor for SMP machines
zbb [Sun, 29 May 2016 17:35:38 +0000 (17:35 +0000)]
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

8 years agoFix debug_monitor code for older ARMs (ARM11)
zbb [Sun, 29 May 2016 17:33:49 +0000 (17:33 +0000)]
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

8 years agoStop exposing the C11 _Atomic() macro in <sys/cdefs.h>, when compiling
dim [Sun, 29 May 2016 17:32:19 +0000 (17:32 +0000)]
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

8 years agoRetune SHA2 code for improved performance on CPUs with more ILP and
cperciva [Sun, 29 May 2016 17:26:40 +0000 (17:26 +0000)]
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

8 years agoMicro optimize: C standard guarantees that right shift for unsigned value
ache [Sun, 29 May 2016 16:39:28 +0000 (16:39 +0000)]
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

8 years agoReplace local prototype of basename() with an inclusion of <libgen.h>.
ed [Sun, 29 May 2016 16:10:01 +0000 (16:10 +0000)]
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

8 years agoDo not leak the vm object lock when swap reservation failed, in
kib [Sun, 29 May 2016 15:46:19 +0000 (15:46 +0000)]
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

8 years ago_umtx_op(2): Note deprecation of UMTX_OP_MUTEX_WAKE.
jilles [Sun, 29 May 2016 15:02:55 +0000 (15:02 +0000)]
_umtx_op(2): Note deprecation of UMTX_OP_MUTEX_WAKE.

8 years ago_umtx_op(2),thr_*(2): Various spelling, grammar and mdoc fixes.
jilles [Sun, 29 May 2016 14:16:23 +0000 (14:16 +0000)]
_umtx_op(2),thr_*(2): Various spelling, grammar and mdoc fixes.

8 years ago1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes
ache [Sun, 29 May 2016 13:57:06 +0000 (13:57 +0000)]
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

8 years agoFix style of the libgen.h header.
ed [Sun, 29 May 2016 12:21:54 +0000 (12:21 +0000)]
Fix style of the libgen.h header.

- Remove unneeded declarations of removed/unimplemented features.
- Add missing tab after #define.
- Add missing ! before trailing comment.

8 years ago1) Unifdef USE_WEAK_SEEDING it is too obsolete to support and makes reading
ache [Sun, 29 May 2016 11:54:09 +0000 (11:54 +0000)]
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

8 years agoInvoke the dirname() function in a POSIX compliant way.
ed [Sun, 29 May 2016 10:41:27 +0000 (10:41 +0000)]
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

8 years agoARM GIC: Allow to setup interrupt without configuration data.
mmel [Sun, 29 May 2016 07:39:56 +0000 (07:39 +0000)]
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.

8 years agoNow that PIE is free of runtime floating point, revert r300853 to
truckman [Sun, 29 May 2016 07:29:35 +0000 (07:29 +0000)]
Now that PIE is free of runtime floating point,  revert r300853 to
reconnect PIE to the build.

8 years agoCast some expressions that multiply a long long constant by a
truckman [Sun, 29 May 2016 07:23:56 +0000 (07:23 +0000)]
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)

8 years agoStaticize variables only used in rpcbind.c
ngie [Sun, 29 May 2016 07:01:12 +0000 (07:01 +0000)]
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