freebsd.git
7 years agoNote that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD
ngie [Sat, 14 Jan 2017 01:01:02 +0000 (01:01 +0000)]
Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD

MFC after: 12 days
X-MFC with: r305358
Sponsored by: Dell EMC Isilon

7 years agoRemove deprecated fgetsock() and fputsock().
glebius [Fri, 13 Jan 2017 22:16:41 +0000 (22:16 +0000)]
Remove deprecated fgetsock() and fputsock().

7 years agoTrim a few comments on platforms that did not implement mmap of /dev/kmem.
jhb [Fri, 13 Jan 2017 21:52:53 +0000 (21:52 +0000)]
Trim a few comments on platforms that did not implement mmap of /dev/kmem.

After r307332, no platforms implement mmap for /dev/kmem, so the lack of
it for these platforms is no longer unique.

7 years agoUpdate the shm_open.2 man page to reflect objective reality.
wblock [Fri, 13 Jan 2017 19:41:02 +0000 (19:41 +0000)]
Update the shm_open.2 man page to reflect objective reality.

PR: 215612
Submitted by: rwatson
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9066

7 years agoUse getsock_cap() instead of deprecated fgetsock().
glebius [Fri, 13 Jan 2017 18:36:46 +0000 (18:36 +0000)]
Use getsock_cap() instead of deprecated fgetsock().

Reviewed by: Daniel Braniss <danny cs.huji.ac.il>

7 years agoCorrect the comments about how much buffer is allocated.
ian [Fri, 13 Jan 2017 17:03:23 +0000 (17:03 +0000)]
Correct the comments about how much buffer is allocated.

7 years agoUse getsock_cap() instead of deprecated fgetsock().
glebius [Fri, 13 Jan 2017 16:54:44 +0000 (16:54 +0000)]
Use getsock_cap() instead of deprecated fgetsock().

Reviewed by: tuexen

7 years agofstyp.8: Move initial exFAT blurb to the -u section
cem [Fri, 13 Jan 2017 16:46:01 +0000 (16:46 +0000)]
fstyp.8: Move initial exFAT blurb to the -u section

Didn't notice the second list in r312003.

Reported by: trasz@

7 years agoCheck tty_gone() after allocating IO buffers. The tty lock has to be
ian [Fri, 13 Jan 2017 16:37:38 +0000 (16:37 +0000)]
Check tty_gone() after allocating IO buffers.  The tty lock has to be
dropped then reacquired due to using M_WAITOK, which opens a window in
which the tty device can disappear.  Check for this and return ENXIO
back up the call chain so that callers can cope.

This closes a race where TF_GONE would get set while buffers were being
allocated as part of ttydev_open(), causing a subsequent call to
ttydevsw_modem() later in ttydev_open() to assert.

Reported by: pho
Reviewed by: kib

7 years agolibgcc_s: add libc DT_NEEDED to fix underlinking
emaste [Fri, 13 Jan 2017 15:17:25 +0000 (15:17 +0000)]
libgcc_s: add libc DT_NEEDED to fix underlinking

PR: 216012
Reported by: jbeich
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agoEnsure that the buffer length and the length provided in the IPv4
tuexen [Fri, 13 Jan 2017 10:55:26 +0000 (10:55 +0000)]
Ensure that the buffer length and the length provided in the IPv4
header match when using a raw socket to send IPv4 packets and
providing the header. If they don't match, let send return -1
and set errno to EINVAL.

Before this patch is was only enforced that the length in the header
is not larger then the buffer length.

PR: 212283
Reviewed by: ae, gnn
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9161

7 years agoImprove CAM_CDB_POINTER support.
mav [Fri, 13 Jan 2017 08:31:55 +0000 (08:31 +0000)]
Improve CAM_CDB_POINTER support.

MFC after: 2 weeks

7 years agoPurge varargs.h in favor of stdarg.h.
hrs [Fri, 13 Jan 2017 08:01:27 +0000 (08:01 +0000)]
Purge varargs.h in favor of stdarg.h.

7 years ago[net80211] add a macro to check this configuration option.
adrian [Fri, 13 Jan 2017 07:24:58 +0000 (07:24 +0000)]
[net80211] add a macro to check this configuration option.

7 years ago[net80211] begin laying the groundwork for drivers to do their own sequence number...
adrian [Fri, 13 Jan 2017 07:08:14 +0000 (07:08 +0000)]
[net80211] begin laying the groundwork for drivers to do their own sequence number management.

I added IEEE80211_TX_LOCK() a few years ago because there were races between
seqno allocation, driver queuing and crypto IV allocation.  This meant that
they'd appear out of sequence and the receiver would drop them, leading to
terrible performance or flat out traffic hangs.

This flag should be set by drivers that do their own sequence number
allocation for all frames it needs to happen for, including beacon frames.

Eventually this should lead to the driver taking care of locking for
allocating seqno and other traffic-triggered events (eg addba setup.)

7 years ago[net80211] Initial VHT node upgrade/downgrade support and initial IE parsing.
adrian [Fri, 13 Jan 2017 07:02:04 +0000 (07:02 +0000)]
[net80211] Initial VHT node upgrade/downgrade support and initial IE parsing.

This is the bulk of the magic to start enabling VHT channel negotiation.
It is absolutely, positively not yet even a complete VHT wave-1 implementation.

* parse IEs in scan, assoc req/resp, probe req/resp;
* break apart the channel upgrade from the HT IE parsing - do it after the
  VHT IEs are parsed;
* (dirty! sigh) add channel width decision making in ieee80211_ht.c htinfo_update_chw().
  This is the main bit where negotiated channel promotion through IEs occur.
* Shoehorn in VHT node init ,teardown, rate control, etc calls like the HT
  versions;
* Do VHT channel adjustment where appropriate

Tested:

* monitor mode, ath10k port
* STA mode, ath10k port - VHT20, VHT40, VHT80 modes

TODO:

* IBSS;
* hostap;
* (ignore mesh, wds for now);
* finish 11n state engine - channel width change, opmode notifications, SMPS, etc;
* VHT basic rate negotiation and acceptance criteria when scanning, associating, etc;
* VHT control/management frame handling (group managment and operating mode being
  the two big ones);
* Verify TX/RX VHT rate negotiation is actually working correctly.

Whilst here, add some comments about seqno allocation and locking.  To achieve
the full VHT rates I need to push seqno allocation into the drivers and
finally remove the IEEE80211_TX_LOCK() I added years ago to fix issues. :/

7 years ago[net80211] initial, somewhat incomplete VHT channel setup code and attach path.
adrian [Fri, 13 Jan 2017 06:53:56 +0000 (06:53 +0000)]
[net80211] initial, somewhat incomplete VHT channel setup code and attach path.

This sets up:

* vht capabilities in vaps;
* calls vht_announce to announce VHT capabilities if any;
* sets up vht20, vht40 and vht80 channels, assuming the regulatory code
  does the right thing with 80MHz available ranges;
* adds support to the ieee80211_add_channel_list_5ghz() code to populate
  VHT channels, as this is the API my ath10k driver is using;
* add support for the freq1/freq2 field population and lookup that
  VHT channels require.

The VHT80 code assumes that the regulatory domain already has limited VHT80
bands to, well, 80MHz wide chunks.

7 years ago- Add static for functions and variables with internal linkage.
hrs [Fri, 13 Jan 2017 06:22:49 +0000 (06:22 +0000)]
- Add static for functions and variables with internal linkage.
- Quiet down -Wcast-align warnings.
- Remove dead code.

There is no functionality change.

7 years agofmaxmin_test still fails with clang 3.9.x.. bypass the test
ngie [Fri, 13 Jan 2017 04:21:09 +0000 (04:21 +0000)]
fmaxmin_test still fails with clang 3.9.x.. bypass the test

MFC after: 3 days
PR: 208703
Sponsored by: Dell EMC Isilon

7 years agoUse dfr-01-xfat.img.bz2, not dfr-01-xfat.dd.bz2 (the latter
ngie [Fri, 13 Jan 2017 04:04:48 +0000 (04:04 +0000)]
Use dfr-01-xfat.img.bz2, not dfr-01-xfat.dd.bz2 (the latter
case was the full disk image from the website, which was never
checked in to svn)

Regardless, the testcase still fails

PR: 214908
Sponsored by: Dell EMC Isilon

7 years agoAdd testcase for exFAT that currently fails
ngie [Fri, 13 Jan 2017 04:02:09 +0000 (04:02 +0000)]
Add testcase for exFAT that currently fails

Disk image obtained from:
http://www.cfreds.nist.gov/dfr-images/dfr-01-xfat.dd.bz2 -- was ripped off the
first GPT partition and verified to be a FAT-like partition with file(1)/hexdump.

This testcase currently fails

PR: 214908
Sponsored by: Dell EMC Isilon

7 years agoAdd license preamble for r286964; credit to asomers
ngie [Fri, 13 Jan 2017 03:42:51 +0000 (03:42 +0000)]
Add license preamble for r286964; credit to asomers

While here, clean up trailing whitespace

MFC after: 3 days
Sponsored by: Dell EMC Isilon

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: 1368374, 1368375
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