]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoUpgrade NetBSD tests to 01.11.2017_23.20 snapshot
ngie [Fri, 13 Jan 2017 03:33:57 +0000 (03:33 +0000)]
Upgrade NetBSD tests to 01.11.2017_23.20 snapshot

This contains some new testcases in /usr/tests/...:

- .../lib/libc
- .../lib/libthr
- .../lib/msun
- .../sys/kern

Tested on: amd64, i386
MFC after: 1 month

7 years agofstyp(8): Detect exFAT filesystems
cem [Fri, 13 Jan 2017 02:12:58 +0000 (02:12 +0000)]
fstyp(8): Detect exFAT filesystems

Simply detect the exFAT filesystem name in the Volume Boot Record
(superblock).

PR: 214908
Reported by: <vermaden at interia.pl>

7 years agoIncrease retry count to 100 in r88e_fw_cmd() and r92c_fw_cmd().
kevlo [Fri, 13 Jan 2017 02:11:16 +0000 (02:11 +0000)]
Increase retry count to 100 in r88e_fw_cmd() and r92c_fw_cmd().

7 years agoRemove __nonnull() attributes from x86 machine check architecture.
pfg [Fri, 13 Jan 2017 01:39:19 +0000 (01:39 +0000)]
Remove __nonnull() attributes from x86 machine check architecture.

These are of the few cases where we use the GCC non-null attributes in
non-header code. As part of a review [1] of our use of such attributes we
are replacing such uses of the overly aggressive GCC attribute with clang's
_Nonnull attribute.

In this case the attributes serve little purpose as they just don't
enforce run time checks, If anything the attributes would cause NULL pointer
checks to be ignored but there are no such checks so only effect is
cosmetic.

The references appear to be left over from code development and likely
already fulfilled their purpose.

Reference [1]:
https://reviews.freebsd.org/D9004

Reviewed by: jhb
MFC after: 3 weeks

7 years agoRestructure the tty_drain loop so that device-busy is checked one more time
ian [Thu, 12 Jan 2017 21:18:43 +0000 (21:18 +0000)]
Restructure the tty_drain loop so that device-busy is checked one more time
after tty_timedwait() returns an error only if the error is EWOULDBLOCK;
other errors cause an immediate return.  This fixes the case of the tty
disappearing while in tty_drain().

Reported by: pho

7 years agoFix the contiguity once more.
glebius [Thu, 12 Jan 2017 20:26:02 +0000 (20:26 +0000)]
Fix the contiguity once more.

7 years ago- Fix dereference of NULL pointer which could cause a crash [1]
hrs [Thu, 12 Jan 2017 18:44:58 +0000 (18:44 +0000)]
- Fix dereference of NULL pointer which could cause a crash [1]
- Fix memory leak due to lack of freeaddrinfo() [2]

CID: 1018281 [1]
CID: 1225057 [2]
MFC after: 3 days

7 years agoFix typo in r311971.
kan [Thu, 12 Jan 2017 18:05:12 +0000 (18:05 +0000)]
Fix typo in r311971.

Reported by: ohartmann at walstatt.org

7 years agoPurge surprise change to sys/conf/files for ixgbe(4).
sbruno [Thu, 12 Jan 2017 17:18:25 +0000 (17:18 +0000)]
Purge surprise change to sys/conf/files for ixgbe(4).

Reported by: imp

7 years agolibkern: Remove obsolete 'register' keyword
cem [Thu, 12 Jan 2017 17:02:29 +0000 (17:02 +0000)]
libkern: Remove obsolete 'register' keyword

Sponsored by: Dell EMC Isilon

7 years agoPurge EM_MULTIQUEUE references from the man page for em(4).
sbruno [Thu, 12 Jan 2017 16:44:40 +0000 (16:44 +0000)]
Purge EM_MULTIQUEUE references from the man page for em(4).

7 years agoAllow uart(4) to use MSI interrupts on single-port PCI instances.
bms [Thu, 12 Jan 2017 16:30:27 +0000 (16:30 +0000)]
Allow uart(4) to use MSI interrupts on single-port PCI instances.

Do this here as puc(4) disallows single-port instances; at least
one multi-port PCIe UART chip (in this case, the ASIX MCS9922)
present separate PCI configuration space (functions) for each UART.

Tested using lrzsz and a null-modem cable. The ExpressCard/34
variants containing the MCS9922 should also use MSI with this change.

Reviewed by: jhb, imp, rpokala
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9123

7 years agoFix panic on mb_free_ext() due to NULL destructor.
sbruno [Thu, 12 Jan 2017 16:24:10 +0000 (16:24 +0000)]
Fix panic on mb_free_ext() due to NULL destructor.

This used to happen because of the SET_MBUF_DESTRUCTOR() called
on unregif.

Submitted by: Vincenzo Maffione <v.maffione@gmail.com>

7 years agoFix uninitialized variable CIDs in route6d
asomers [Thu, 12 Jan 2017 16:22:28 +0000 (16:22 +0000)]
Fix uninitialized variable CIDs in route6d

The variables in question are actually return arguments, but it's still good
form to initialize them.

Reported by: Coverity
CID: 979679 979680
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agoFor the main binary, postpone enforcing relro read-only protection
kib [Thu, 12 Jan 2017 15:54:03 +0000 (15:54 +0000)]
For the main binary, postpone enforcing relro read-only protection
until copy relocations are done.

Newer binutils and lld seems to output copy into relro-protected range.

Reported by: Rafael Espц╜ndola via emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agosfxge(4): add sysctl to change MAC stats update period
arybchik [Thu, 12 Jan 2017 15:26:23 +0000 (15:26 +0000)]
sfxge(4): add sysctl to change MAC stats update period

The sysctl controls the period per interface.

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

7 years agoRestore fixup for newer em(4) devices WOL capabilities post iflib integration.
sbruno [Thu, 12 Jan 2017 14:47:44 +0000 (14:47 +0000)]
Restore fixup for newer em(4) devices WOL capabilities post iflib integration.

PR: 208343

7 years agorpcgen(1): Check getrlimit() return for generated code.
pfg [Thu, 12 Jan 2017 14:44:41 +0000 (14:44 +0000)]
rpcgen(1): Check getrlimit() return for generated code.

Obtained from: NetBSD (CVS rev 1.27, 1.28)
MFC after: 1 week

7 years agoDeprecate kernel configuration option EM_MULTIQUEUE now that the em(4)
sbruno [Thu, 12 Jan 2017 14:38:18 +0000 (14:38 +0000)]
Deprecate kernel configuration option EM_MULTIQUEUE now that the em(4)
driver conforms to iflib.

7 years agoReset the EIAC register to include the LINK status bit and restore
sbruno [Thu, 12 Jan 2017 14:28:32 +0000 (14:28 +0000)]
Reset the EIAC register to include the LINK status bit and restore
link up/down notifications.

Submitted by: Franco Fichtner <franco@opnsense.org>

7 years agoAttempt to use the "new" BAR address for newer igb(4) devices. This code
sbruno [Thu, 12 Jan 2017 14:18:52 +0000 (14:18 +0000)]
Attempt to use the "new" BAR address for newer igb(4) devices.  This code
was dropped during the IFLIB migration.

Reported by: olivier
Reviewed by: mmacy@nextbsd.org

7 years agosfxge(4): add tunable to configure MAC stats update period
arybchik [Thu, 12 Jan 2017 13:00:17 +0000 (13:00 +0000)]
sfxge(4): add tunable to configure MAC stats update period

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

7 years agoFix slight type mismatch between so_options defined in sys/socketvar.h
sobomax [Thu, 12 Jan 2017 10:14:54 +0000 (10:14 +0000)]
Fix slight type mismatch between so_options defined in sys/socketvar.h
and tw_so_options defined here which is supposed to be a copy of the
former (short vs u_short respectively).

Switch tw_so_options to be "signed short" to match the type of the field
it's inherited from.

7 years agoAdd __BIT and __BITS macros from NetBSD to help support new testcases
ngie [Thu, 12 Jan 2017 09:01:14 +0000 (09:01 +0000)]
Add __BIT and __BITS macros from NetBSD to help support new testcases

MFC after: 1 week

7 years agoReport random flash storage as non-rotating to GEOM_DISK.
mav [Thu, 12 Jan 2017 08:53:10 +0000 (08:53 +0000)]
Report random flash storage as non-rotating to GEOM_DISK.

While doing it, introduce respective constants in geom_disk.h.

MFC after: 1 week

7 years agoAdd additional testcases missed in r311966
ngie [Thu, 12 Jan 2017 08:46:19 +0000 (08:46 +0000)]
Add additional testcases missed in r311966

7 years agoRemove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile
ngie [Thu, 12 Jan 2017 08:40:52 +0000 (08:40 +0000)]
Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile

This is to enable support in other testcases

Inspired by lib/msun/tests/Makefile .

MFC after: 1 week

7 years agoFix lib/libc/sys/access_test after r311925
ngie [Thu, 12 Jan 2017 08:31:42 +0000 (08:31 +0000)]
Fix lib/libc/sys/access_test after r311925

sys/param.h needs to be #included in order for __FreeBSD_version to be checked

MFC after: 13 days

7 years agoSync ^/vendor/NetBSD/tests/dist with upstream
ngie [Thu, 12 Jan 2017 07:26:39 +0000 (07:26 +0000)]
Sync ^/vendor/NetBSD/tests/dist with upstream

7 years agoCommit updates accepted upstream (NetBSD)
ngie [Thu, 12 Jan 2017 07:21:56 +0000 (07:21 +0000)]
Commit updates accepted upstream (NetBSD)

7 years agog_raid: Prevent tasters from attempting excessively large reads
cem [Thu, 12 Jan 2017 06:58:31 +0000 (06:58 +0000)]
g_raid: Prevent tasters from attempting excessively large reads

Some g_raid tasters attempt metadata reads in multiples of the provider
sectorsize.  Reads larger than MAXPHYS are invalid, so detect and abort
in such situations.

Spiritually similar to r217305 / PR 147851.

PR: 214721
Sponsored by: Dell EMC Isilon

7 years agoRemove writability requirement for single-mbuf, contiguous-range
rpokala [Thu, 12 Jan 2017 06:38:03 +0000 (06:38 +0000)]
Remove writability requirement for single-mbuf, contiguous-range
m_pulldown()

m_pulldown() only needs to determine if a mbuf is writable if it is going to
copy data into the data region of an existing mbuf. It does this to create a
contiguous data region in a single mbuf from multiple mbufs in the chain. If
the requested memory region is already contiguous and nothing needs to
change, the mbuf does not need to be writeable.

Submitted by: Brian Mueller <bmueller@panasas.com>
Reviewed by: bz
MFC after: 1 week
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D9053

7 years agosfxge(4): stats refresh in SW should depend on HW update period
arybchik [Thu, 12 Jan 2017 06:30:44 +0000 (06:30 +0000)]
sfxge(4): stats refresh in SW should depend on HW update period

The period should be taken into account by the function which
refreshes driver stats.

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

7 years agosfxge(4): do not ignore requested MAC stats update period
arybchik [Thu, 12 Jan 2017 06:29:14 +0000 (06:29 +0000)]
sfxge(4): do not ignore requested MAC stats update period

Firmware version which takes PERIOD_MS parameter into account is
required.

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

7 years agoPrint out the number of queues/MSIx vectors.
scottl [Thu, 12 Jan 2017 01:13:05 +0000 (01:13 +0000)]
Print out the number of queues/MSIx vectors.

Sponsored by: Netflix

7 years agoRework tty_drain() to poll the hardware for completion, and restore
ian [Thu, 12 Jan 2017 00:48:06 +0000 (00:48 +0000)]
Rework tty_drain() to poll the hardware for completion, and restore
drain timeout handling to historical freebsd behavior.

The primary reason for these changes is the need to have tty_drain() call
ttydevsw_busy() at some reasonable sub-second rate, to poll hardware that
doesn't signal an interrupt when the transmit shift register becomes empty
(which includes virtually all USB serial hardware).  Such hardware hangs
in a ttyout wait, because it never gets an opportunity to trigger a wakeup
from the sleep in tty_drain() by calling ttydisc_getc() again, after
handing the last of the buffered data to the hardware.

While researching the history of changes to tty_drain() I stumbled across
some email describing the historical BSD behavior of tcdrain() and close()
on serial ports, and the ability of comcontrol(1) to control timeout
behavior.  Using that and some advice from Bruce Evans as a guide, I've
put together these changes to implement the hardware polling and restore
the historical timeout behaviors...

 - tty_drain() now calls ttydevsw_busy() in a loop at 10 Hz to accomodate
   hardware that requires polling for busy state.

 - The "new historical" behavior for draining during close(2) is retained:
   the drain timeout is "1 second without making any progress".  When the
   1-second timeout expires, if the count of bytes remaining in the tty
   layer buffer is smaller than last time, the timeout is extended for
   another second.  Unfortunately, the same logic cannot be extended all
   the way down to the hardware, because the interface to that layer is a
   simple busy/not-busy indication.

 - Due to the previous point, an application that needs a guarantee that
   all data has been transmitted must use TIOCDRAIN/tcdrain(3) before
   calling close(2).

 - The historical behavior of honoring the drainwait setting for TIOCDRAIN
   (used by tcdrain(3)) is restored.

 - The historical kern.drainwait sysctl to control the global default
   drainwait time is restored, but is now named kern.tty_drainwait.

 - The historical default drainwait timeout of 300 seconds is restored.

 - Handling of TIOCGDRAINWAIT and TIOCSDRAINWAIT ioctls is restored
   (this also makes the comcontrol(1) drainwait verb work again).

 - Manpages are updated to document these behaviors.

Reviewed by: bde (prior version)

7 years agopciconf(8): Reallow trailing colon in selectors
cem [Thu, 12 Jan 2017 00:34:37 +0000 (00:34 +0000)]
pciconf(8): Reallow trailing colon in selectors

Reallow device selectors to have a trailing colon, as documented in the
manual page.  This was broken along with some unrelated cleanups in
r295806.

PR: 215979
Reported by: David Boyd <David.Boyd49 at twc.com>
Sponsored by: Dell EMC Isilon

7 years agoEnable the use of ^C and ^S/^Q in DDB.
markj [Thu, 12 Jan 2017 00:22:36 +0000 (00:22 +0000)]
Enable the use of ^C and ^S/^Q in DDB.

This lets one interrupt DDB's output, which is useful if paging is
disabled and the output device is slow.

Submitted by: Anton Rang <rang@acm.org>
Reviewed by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9138

7 years agoInclude sys/systm.h for use of bootverbose. Fixes powerpc MPC85XXSPE build.
ian [Thu, 12 Jan 2017 00:09:31 +0000 (00:09 +0000)]
Include sys/systm.h for use of bootverbose. Fixes powerpc MPC85XXSPE build.

7 years agoGet rid of a compiler warning which I saw too often.
bz [Thu, 12 Jan 2017 00:01:02 +0000 (00:01 +0000)]
Get rid of a compiler warning which I saw too often.
Include netinet/in.h before ip_compat.t which will then check if
IPPROTO_IPIP is defined or not.  Doing it the other way round,
ip_compat.h would not find it defined and netinet/in.h then
redefine it.

7 years agocxgbe/tom: Add VIMAGE support to the TOE driver.
np [Wed, 11 Jan 2017 23:48:17 +0000 (23:48 +0000)]
cxgbe/tom: Add VIMAGE support to the TOE driver.

Active Open:
- Save the socket's vnet at the time of the active open (t4_connect) and
  switch to it when processing the reply (do_act_open_rpl or
  do_act_establish).

Passive Open:
- Save the listening socket's vnet in the driver's listen_ctx and switch
  to it when processing incoming SYNs for the socket.
- Reject SYNs that arrive on an ifnet that's not in the same vnet as the
  listening socket.

CLIP (Compressed Local IPv6) table:
- Add only those IPv6 addresses to the CLIP that are in a vnet
  associated with one of the card's ifnets.

Misc:
- Set vnet from the toepcb when processing TCP state transitions.
- The kernel sets the vnet when calling the driver's output routine
  so t4_push_frames runs in proper vnet context already.  One exception
  is when incoming credits trigger tx within the driver's ithread.  Set
  the vnet explicitly in do_fw4_ack for that case.

MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agortwn: fix R92C_TXDW4_RTSRATE_M definition (0x3f -> 0x1f)
avos [Wed, 11 Jan 2017 23:32:40 +0000 (23:32 +0000)]
rtwn: fix R92C_TXDW4_RTSRATE_M definition (0x3f -> 0x1f)

Submitted by: kevlo

7 years agorpcgen(1): Avoid unused variable warning on generated code.
pfg [Wed, 11 Jan 2017 23:05:29 +0000 (23:05 +0000)]
rpcgen(1): Avoid unused variable warning on generated code.

Avoid "unused variable 'i'" warnings in generated .c files by only
emitting the "int i;" for non-opaque arrays. Opaque arrays use
xdr_opaque() rather than iterating over the array.

Obtained from: OpenBSD (CVS rev 1.28)
MFC after: 1 week

7 years agoreadelf: add S390 relocation types
emaste [Wed, 11 Jan 2017 22:54:04 +0000 (22:54 +0000)]
readelf: add S390 relocation types

From https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html

Reviewed by: bz
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9149

7 years agoRemove obsolete path from fortune(6). This was inadvertantly left over
cperciva [Wed, 11 Jan 2017 22:50:57 +0000 (22:50 +0000)]
Remove obsolete path from fortune(6).  This was inadvertantly left over
when fortune and other games moved from /usr/games to /usr/bin; I am
removing rather than correcting it since we normally do not mention in
the FILES section the paths to programs in /usr/bin/.

PR: 215962
Reported by: Andras Farkas

7 years agoreadelf: add more PPC64 relocation types found in LLVM
emaste [Wed, 11 Jan 2017 21:28:22 +0000 (21:28 +0000)]
readelf: add more PPC64 relocation types found in LLVM

MFC after: 2 weeks
MFC with: r311941
Sponsored by: The FreeBSD Foundation

7 years agoreadelf: add PPC64 relocation types
emaste [Wed, 11 Jan 2017 21:18:14 +0000 (21:18 +0000)]
readelf: add PPC64 relocation types

Reported by: Mark Millard
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9146

7 years agoPretend we support some IOCTLs to not scary upper layers.
mav [Wed, 11 Jan 2017 20:23:45 +0000 (20:23 +0000)]
Pretend we support some IOCTLs to not scary upper layers.

MFC after: 2 weeks

7 years agoUse proper prototypes in struct boot_module_t
dim [Wed, 11 Jan 2017 20:00:24 +0000 (20:00 +0000)]
Use proper prototypes in struct boot_module_t

With clang 4.0.0, we are getting the following warnings about struct
boot_module_t in efi's boot_module.h:

In file included from sys/boot/efi/boot1/ufs_module.c:41:
sys/boot/efi/boot1/boot_module.h:67:14: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        void (*init)();
                    ^
                     void
sys/boot/efi/boot1/boot_module.h:92:16: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        void (*status)();
                      ^
                       void
sys/boot/efi/boot1/boot_module.h:95:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        dev_info_t *(*devices)();
                              ^
                               void
3 errors generated.

Fix this by adding 'void' to the parameter lists.  No functional change.

Reviewed by: emaste, imp, smh
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9144

7 years agoMake EFI_RESERVED_SERVICE a proper prototype
dim [Wed, 11 Jan 2017 19:59:27 +0000 (19:59 +0000)]
Make EFI_RESERVED_SERVICE a proper prototype

With clang 4.0.0, the EFI API header causes the following warning:

In file included from sys/boot/efi/loader/bootinfo.c:43:
In file included from sys/boot/efi/loader/../include/efi.h:52:
sys/boot/efi/include/efiapi.h:534:32: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
(EFIAPI *EFI_RESERVED_SERVICE) (
                               ^

Add VOID to make it into a real prototype.

Reviewed by: imp, emaste, tsoome
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9132

7 years agoRestore v6 offload caps for igb(4) class devices.
sbruno [Wed, 11 Jan 2017 19:29:33 +0000 (19:29 +0000)]
Restore v6 offload caps for igb(4) class devices.

Reported by: tuxen

7 years agocommitters-ports.dot: Add myself
dumbbell [Wed, 11 Jan 2017 19:29:28 +0000 (19:29 +0000)]
committers-ports.dot: Add myself

Approved by: antoine (mentor)
Differential Revision: https://reviews.freebsd.org/D9143

7 years agoDon't include <errno.h> in reloc_elf.c, as it includes <stand.h> just
dim [Wed, 11 Jan 2017 18:47:00 +0000 (18:47 +0000)]
Don't include <errno.h> in reloc_elf.c, as it includes <stand.h> just
after it, which has a conflicting definition of errno.  This leads to
the following warning with clang 4.0.0:

    In file included from sys/boot/common/reloc_elf32.c:6:
    In file included from sys/boot/common/reloc_elf.c:37:
    /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
    extern int errno;
               ^
    sys/sys/errno.h:46:26: note: expanded from macro 'errno'
    #define errno           (* __error())
                                      ^

MFC after: 3 days

7 years agoFix build of usr.bin/tail with GCC
asomers [Wed, 11 Jan 2017 16:09:25 +0000 (16:09 +0000)]
Fix build of usr.bin/tail with GCC

Submitted by: pluknet
Reported by: pluknet
MFC after: 27 days
X-MFC-with: 311895
Sponsored by: Spectra Logic Corp

7 years agoConsolidate __NetBSD__ #ifdef
ngie [Wed, 11 Jan 2017 10:20:35 +0000 (10:20 +0000)]
Consolidate __NetBSD__ #ifdef

MFC after: 3 days

7 years agoImport testcase updates with code contributed back to NetBSD
ngie [Wed, 11 Jan 2017 09:51:34 +0000 (09:51 +0000)]
Import testcase updates with code contributed back to NetBSD

This also (inadvertently) contains an update to
contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases).

MFC after: 2 weeks
In collaboration with: christos@NetBSD.org

7 years agoFix whitespace in comment
ngie [Wed, 11 Jan 2017 09:34:42 +0000 (09:34 +0000)]
Fix whitespace in comment

MFC after: 3 days

7 years agoAdd acpi_if.h and opt_acpi.h to Makefile to unbreak "make depend" with
ngie [Wed, 11 Jan 2017 08:43:58 +0000 (08:43 +0000)]
Add acpi_if.h and opt_acpi.h to Makefile to unbreak "make depend" with
sys/modules/sdhci_acpi

MFC after: 6 days
X-MFC with: r311911
Reported by: Jenkins

7 years agoPull in changes from upstream for lib/libc/{c063,gen,string,sys} to address
ngie [Wed, 11 Jan 2017 08:15:18 +0000 (08:15 +0000)]
Pull in changes from upstream for lib/libc/{c063,gen,string,sys} to address
issues resolved in FreeBSD or support added to testcases

In collaboration with: <christos@NetBSD.org>

7 years agoPartially revert r311236
ngie [Wed, 11 Jan 2017 07:22:21 +0000 (07:22 +0000)]
Partially revert r311236

There's no sense in trying to close a file descriptor from the negative cases
with unlink_test; it's best to ignore these cases.

The mkfifo case does make sense to keep though.

MFC after: 3 days

7 years agoAdd more #ifdef INET and INET6.
hrs [Wed, 11 Jan 2017 07:21:59 +0000 (07:21 +0000)]
Add more #ifdef INET and INET6.

7 years agoFix up r311227
ngie [Wed, 11 Jan 2017 07:17:03 +0000 (07:17 +0000)]
Fix up r311227

Check for creat returning a value != -1, not a non-zero value

MFC after: 3 days
Pointyhat to: ngie
Reported by: Coverity
CID: 1368366

7 years agoMFV r311913:
delphij [Wed, 11 Jan 2017 05:49:39 +0000 (05:49 +0000)]
MFV r311913:

Fix multiple OpenSSH vulnerabilities.

Submitted by: des
Approved by: so

7 years agoForce all TOC references in asm to include '@toc'
jhibbits [Wed, 11 Jan 2017 02:21:34 +0000 (02:21 +0000)]
Force all TOC references in asm to include '@toc'

This reportedly fixes one problem with booting a clang kernel.

PR: kern/215819
Submitted by: Mark Millard <markmi AT dsl-only.net>
MFC after: 2 weeks

7 years ago[sdhci] Add ACPI platform support for SDHCI driver
gonzo [Wed, 11 Jan 2017 01:53:54 +0000 (01:53 +0000)]
[sdhci] Add ACPI platform support for SDHCI driver

- Create ACPI version of SDHCI attach/detach/accessors logic. Some
    platforms (e.g. BayTrail-based Minnowboard) expose SDHCI devices
    via ACPI, not PCI
- Add sdchi_acpi kernel module

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

7 years agoHave DTrace handle faults when dereferencing a lock object pointer.
markj [Wed, 11 Jan 2017 01:18:06 +0000 (01:18 +0000)]
Have DTrace handle faults when dereferencing a lock object pointer.

MFC after: 1 week

7 years agoIgnore LC_SLEEPABLE when testing whether a mutex is adaptive.
markj [Wed, 11 Jan 2017 01:15:55 +0000 (01:15 +0000)]
Ignore LC_SLEEPABLE when testing whether a mutex is adaptive.

MFC after: 1 week

7 years agoFollow r311103: add "pool" to the keywords that rc.d/ntpdate examines to
ian [Wed, 11 Jan 2017 00:14:47 +0000 (00:14 +0000)]
Follow r311103: add "pool" to the keywords that rc.d/ntpdate examines to
find a server address in ntp.conf.

Submitted by: Ronald Klop <ronald@klop.ws>
Pointy hat to: ian

7 years agoRevert r311843, r311667
cem [Wed, 11 Jan 2017 00:02:51 +0000 (00:02 +0000)]
Revert r311843, r311667

As jkim@ points out, it isn't needed.

7 years agoBuild libarchive tests missing in r311899
mm [Tue, 10 Jan 2017 22:01:37 +0000 (22:01 +0000)]
Build libarchive tests missing in r311899

MFC after: 1 week
X-MFC with: r311899

7 years agoMFV r311899:
mm [Tue, 10 Jan 2017 21:59:35 +0000 (21:59 +0000)]
MFV r311899:

Sync libarchive with vendor.

Vendor bugfixes:
#691: Support for SCHILY.xattr extended attributes
#854: Spelling fixes

Multiple fixes in ACL code:
  - prefer acl_set_fd_np() to acl_set_fd()
  - if acl_set_fd_np() fails, do no fallback to acl_set_file()
  - do not warn if trying to write ACLs to a filesystem without ACL support
  - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs

MFC after: 1 week
X-MFC with: r310866

7 years agoCoalesce TLB shootdowns of global PTEs in pmap_advise() on x86.
markj [Tue, 10 Jan 2017 21:52:48 +0000 (21:52 +0000)]
Coalesce TLB shootdowns of global PTEs in pmap_advise() on x86.

We would previously invalidate such entries individually, resulting in more
IPIs than necessary.

Reviewed by: alc, kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9094

7 years agoDo not set BIO_DONE if the BIO specifies a completion handler.
markj [Tue, 10 Jan 2017 21:41:28 +0000 (21:41 +0000)]
Do not set BIO_DONE if the BIO specifies a completion handler.

biowait() will otherwise race with completions of such BIOs. In-tree code
only calls biowait() on BIOs that do not specify a handler, so this change
should not have any functional impact.

Reviewed by: mav
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9070

7 years agoSet CFLAGS correctly for sys/modules/em
sbruno [Tue, 10 Jan 2017 21:21:00 +0000 (21:21 +0000)]
Set CFLAGS correctly for sys/modules/em

Unbreak gcc sparc64 builds (or any gcc build that uses em(4)).

Reported by: lidl@freebsd.org

7 years agoUpdate vendor/libarchive to git 22f2d190639e6bd496a3b82f70c01fba0d38b40a
mm [Tue, 10 Jan 2017 21:18:32 +0000 (21:18 +0000)]
Update vendor/libarchive to git 22f2d190639e6bd496a3b82f70c01fba0d38b40a

Vendor changes:
#691: Support for SCHILY.xattr extended attributes
#854: Spelling fixes

Multiple fixes in ACL code:
  - prefer acl_set_fd_np() to acl_set_fd()
  - if acl_set_fd_np() fails, do no fallback to acl_set_file()
  - do not warn if trying to write ACLs to a filesystem without ACL support
  - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs

7 years agosparc64: add atomic_fcmpset
mjg [Tue, 10 Jan 2017 21:10:20 +0000 (21:10 +0000)]
sparc64: add atomic_fcmpset

Tested on hardware provided by feld.

Reviewed by: marius

7 years agoAdd checks for received mode page length.
mav [Tue, 10 Jan 2017 20:52:44 +0000 (20:52 +0000)]
Add checks for received mode page length.

If our buffer is too small, we may receive part of the page, and should
not try read/write past the end of the buffer.

Reported by: Coverity
CID: 13683741368375
MFC after: 1 week

7 years agoRemove unused __gnu_inline() attribute.
pfg [Tue, 10 Jan 2017 20:44:31 +0000 (20:44 +0000)]
Remove unused __gnu_inline() attribute.

This was meant to be used by a future FORTIFY_SOURCE implementation.
Probably for good, FORTIFY_SOURCE and this particular GCCism were never
well supported by clang or other compilers. Furthermore, the technology
has long since been replaced by either static checkers, sanitizers, or
even just the strong stack protector that was enabled by default.

Drop __gnu_inline to avoid cluttering the headers.

MFC after: 5 days

7 years agoFix memory leaks during "tail -r" of an irregular file
asomers [Tue, 10 Jan 2017 20:43:32 +0000 (20:43 +0000)]
Fix memory leaks during "tail -r" of an irregular file

* Rewrite r_buf to use standard tail queues instead of a hand-rolled
  circular linked list. Free dynamic allocations when done.
* Remove an optimization for the case where the file is a multiple of 128KB
  in size and there is a scarcity of memory.
* Add ATF tests for "tail -r" and its variants.

Reported by: Valgrind
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9067

7 years agoFix typo from change 310985 in ObsoleteFiles.inc
asomers [Tue, 10 Jan 2017 20:37:44 +0000 (20:37 +0000)]
Fix typo from change 310985 in ObsoleteFiles.inc

MFC after: 16 days
X-MFC-With: 310803
Sponsored by: Spectra Logic Corp

7 years agoATFify the geom gate tests.
asomers [Tue, 10 Jan 2017 20:35:09 +0000 (20:35 +0000)]
ATFify the geom gate tests.

This ensures their cleanup routines will be run even if they should timeout.

tests/sys/geom/class/gate/ggate_test.sh
tests/sys/geom/class/gate/Makefile
Add an ATF test with three testcases, one for each TAP test. Use
ATF-style cleanup functions, and convert sleeps to polling loops.

ObsoleteFiles.inc
tests/sys/geom/class/gate/conf.sh
tests/sys/geom/class/gate/1_test.sh
tests/sys/geom/class/gate/2_test.sh
tests/sys/geom/class/gate/3_test.sh
Delete TAP test files

Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8891

7 years agoDo not wait for HA thread shutdown if scheduler is stopped.
mav [Tue, 10 Jan 2017 20:16:16 +0000 (20:16 +0000)]
Do not wait for HA thread shutdown if scheduler is stopped.

This wait loop made system hang on panic instead of reboot.

MFC after: 1 week

7 years ago[efi] Build EFI bits with -fPIC on ARM
gonzo [Tue, 10 Jan 2017 20:15:24 +0000 (20:15 +0000)]
[efi] Build EFI bits with -fPIC on ARM

clang 3.9.0 without -fPIC generates absolute jump table for
switch/case statement which trips boot1.efi and loader.efi
on ARM platform.

Reviewed by: andrew
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9108

7 years ago[efi] Fix .rel.data.* being erroneously merged into .data on ARM
gonzo [Tue, 10 Jan 2017 20:12:07 +0000 (20:12 +0000)]
[efi] Fix .rel.data.* being erroneously merged into .data on ARM

Fix section pattern code to exclude .rel.data.* sections from being
merged into .data. Otherwise relocations in those sections are lost
in final binary

Reviewed by: andrew
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9108

7 years ago[efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start
gonzo [Tue, 10 Jan 2017 20:08:21 +0000 (20:08 +0000)]
[efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start

__bss_end should not be included in .bss zeroing code. Otherwise first 4
bytes of the section that follows .bss (in loader's case it's .sdata) are
overwritten by zero.

Reviewed by: andrew
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9108

7 years agoFix build without IEEE80211_DEBUG.
pluknet [Tue, 10 Jan 2017 19:28:40 +0000 (19:28 +0000)]
Fix build without IEEE80211_DEBUG.

Reported by: many

7 years agoFix acquisition of nested write compat rtld locks.
kib [Tue, 10 Jan 2017 19:26:55 +0000 (19:26 +0000)]
Fix acquisition of nested write compat rtld locks.

Obtaining compat rtld lock in write mode sets process signal mask to
block all signals.  Previous mask is stored in the global variable
oldsigmask.  If a lock is write-locked while another lock is already
write-locked, oldsigmask is overwritten by the total mask and on the
last unlock, all signals except traps appear to be blocked.

Fix this by counting the write-lock nested level, and only storing to
oldsigmask/restoring from it at the outermost level.

Masking signals disables involuntary preemption for libc_r, and there
could be no voluntary context switches in the locked code
(dl_iterate_phdr(3) keeps a lock around user callback, but it was
added long after libc_r was renounced).  Due to this, remembering the
level in the global variable after the lock is obtained should be
safe, because no two libc_r threads can acquire different write locks
in parallel.

PR: 215826
Reported by: kami
Tested by: yamagi@yamagi.org (previous version)
To be reviewed by: kan
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoReplace using of objdump with elfdump
lwhsu [Tue, 10 Jan 2017 18:46:40 +0000 (18:46 +0000)]
Replace using of objdump with elfdump

In-tree objdump is too old to dump new ELF headers.  But for example if we
use: `make CROSS_TOOLCHAIN=riscv64-gcc TARGET_ARCH=riscv64` and do not specify
CROSS_BINUTILS_PREFIX in env, embed_mfs.sh cannot find the correct objdump.
This patch just replaces using of objdump with elfdump to collect needed
information.

Later we may also put an ELFDUMP in CROSSENV and use it in embed_mfs.sh .

Reviewed by: emaste, br
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9062

7 years agoThe iw_cxgb and iw_cxgbe drivers should not use a FreeBSD device_t where
np [Tue, 10 Jan 2017 18:39:53 +0000 (18:39 +0000)]
The iw_cxgb and iw_cxgbe drivers should not use a FreeBSD device_t where
a linuxkpi style device is expected.  If OFED/linuxkpi actually starts
using this field then we'll have to figure out whether to create fake
devices for these drivers or have linuxkpi deal with NULL device.

This mismatch was first reported as part of D6585.

7 years agoUse ANSI C definitions, update comment.
kib [Tue, 10 Jan 2017 17:05:34 +0000 (17:05 +0000)]
Use ANSI C definitions, update comment.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agosfxge(4): avoid unnecessary mbuf data prefetch
arybchik [Tue, 10 Jan 2017 16:25:39 +0000 (16:25 +0000)]
sfxge(4): avoid unnecessary mbuf data prefetch

Unnecessary prefetch just loads HW prefetcher and displaces other
cache entries (which could be really useful).

If we parse mbuf for TSO early and use firmware-assisted TSO, we do not
expect mbuf data access when we compose firmware-assisted TSO (v1 or v2)
option descriptors.  If packet header needs to be linearized or finally
FATSO cannot be used because of, for example, too big header, we do not
care about a bit more performance degradation because of prefetch
absence (it is better to optimize more common case).

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

7 years agoTeach crunchide about EM_S390 to make bootstrapping from future
bz [Tue, 10 Jan 2017 14:40:30 +0000 (14:40 +0000)]
Teach crunchide about EM_S390 to make bootstrapping from future
releases easier unless someone will fix the PR properly.

MFC after: 3 days
PR: 215940

7 years agoAdd acpi_if.h to SRCS so we have it when building ahci_generic.c with ACPI.
andrew [Tue, 10 Jan 2017 13:36:33 +0000 (13:36 +0000)]
Add acpi_if.h to SRCS so we have it when building ahci_generic.c with ACPI.

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

7 years agoAdd an ACPI attachment to the existing ahci_generic driver. This is used
andrew [Tue, 10 Jan 2017 10:56:33 +0000 (10:56 +0000)]
Add an ACPI attachment to the existing ahci_generic driver. This is used
in some arm64 hardware, for example the AMD Opteron A1100.

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

7 years agoFix malloc(M_WAITOK) under mutex, introduced at r311787.
mav [Tue, 10 Jan 2017 10:33:36 +0000 (10:33 +0000)]
Fix malloc(M_WAITOK) under mutex, introduced at r311787.

MFC after: 13 days

7 years agoDiff reduce with upstream by removing signal.h #include
ngie [Tue, 10 Jan 2017 10:27:09 +0000 (10:27 +0000)]
Diff reduce with upstream by removing signal.h #include

MFC after: 3 days

7 years agoMerge ^/vendor/NetBSD/tests/dist@r311868
ngie [Tue, 10 Jan 2017 10:16:59 +0000 (10:16 +0000)]
Merge ^/vendor/NetBSD/tests/dist@r311868

This is the vendor accepted version of ^/head@r311245

MFC after: 3 days

7 years agoMerge the grammar fix for lib/libc/gen/raise_test:raise_stress
ngie [Tue, 10 Jan 2017 10:12:36 +0000 (10:12 +0000)]
Merge the grammar fix for lib/libc/gen/raise_test:raise_stress

MFC after: 3 days

7 years agoImport lib/libc/ttyio/t_ttyio.c,1.3
ngie [Tue, 10 Jan 2017 10:06:15 +0000 (10:06 +0000)]
Import lib/libc/ttyio/t_ttyio.c,1.3

7 years agot_raise: import a minor grammar error fix to diff reduce with NetBSD
ngie [Tue, 10 Jan 2017 10:02:44 +0000 (10:02 +0000)]
t_raise: import a minor grammar error fix to diff reduce with NetBSD