]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoEnsure that the IPPROTO_TCP level socket options
Michael Tuexen [Wed, 14 Sep 2016 14:48:00 +0000 (14:48 +0000)]
Ensure that the IPPROTO_TCP level socket options
* TCP_KEEPINIT
* TCP_KEEPINTVL
* TCP_KEEPIDLE
* TCP_KEEPCNT
always always report the values currently used when getsockopt()
is used. This wasn't the case when the sysctl-inherited default
values where used.
Ensure that the IPPROTO_TCP level socket option TCP_INFO has the
TCPI_OPT_ECN flag set in the tcpi_options field when ECN support
has been negotiated successfully.

Reviewed by: rrs, jtl, hiren
MFC after: 1 month
Differential Revision: 7833

8 years agoUse the MI macro TRAPF_USERMODE() instead of open-coded checks for
Bruce Evans [Wed, 14 Sep 2016 12:57:40 +0000 (12:57 +0000)]
Use the MI macro TRAPF_USERMODE() instead of open-coded checks for
SEL_UPL and sometimes PSL_VM.  This is just a style change on amd64,
but on i386 it fixes 1 unimportant place where the PSL_VM check was
missing and starts fixing 1 important place where the PSL_VM check
had a logic error.

Fix logic errors in treating vm86 bioscall mode as kernel mode.  The
main place checked all the necessary flags, but put the necessary
parentheses for the PSL_VM and PCB_VM86CALL checks in the wrong
place.  The broken case is only reached if a vm86 bioscall uses a
%cs which is nonzero mod 4, but that is unusual -- most bios calls
start with %cs = 0xc000 or 0xf000 and rarely change it.  Another
place was missing the check for PCB_VM86CALL, but was only reachable
if there are bugs virtualizing PSL_I.

Add a macro TF_HAS_STACKREGS() and use this instead of converting
open-coded checks of SEL_UPL, etc. to TRAPF_USERMODE() when we only
care about whether the frame has stack registers.  This fixes 3
places in my recent fix for register variables in vm86 mode where I
messed up the PSL_VM check and cleans up other places.

8 years agoImprove USB polling mode by not locking any mutexes, asserting any
Hans Petter Selasky [Wed, 14 Sep 2016 12:07:34 +0000 (12:07 +0000)]
Improve USB polling mode by not locking any mutexes, asserting any
mutexes or using any callouts when active.

Trying to lock a mutex when KDB is active or the scheduler is stopped
can result in infinite wait loops. The same goes for calling callout
related functions which in turn lock mutexes.

If the USB controller at which a USB keyboard is connected is idle
when KDB is entered, polling the USB keyboard via USB will always
succeed. Else polling may fail depending on which state the USB
subsystem and USB interrupt handler is in. This is unavoidable unless
KDB can wait for USB interrupt threads to complete before stalling the
CPU(s).

Tested by: Bruce Evans <bde@freebsd.org>
MFC after: 4 weeks

8 years agoUse proper argument order for calloc(3).
Edward Tomasz Napierala [Wed, 14 Sep 2016 11:20:58 +0000 (11:20 +0000)]
Use proper argument order for calloc(3).

MFC after: 1 month

8 years agoMake the callout structure in the boot loader's kernel shim more
Hans Petter Selasky [Wed, 14 Sep 2016 11:16:00 +0000 (11:16 +0000)]
Make the callout structure in the boot loader's kernel shim more
similar to the kernel one.

MFC after: 1 week

8 years agohyperv/hn: Fix some ifnet settings
Sepherosa Ziehau [Wed, 14 Sep 2016 09:17:00 +0000 (09:17 +0000)]
hyperv/hn: Fix some ifnet settings

- ifnet.if_mtu does not require explicit setting.
- ifnet.if_hdrlen must be set after ether_ifattach().

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

8 years agohyperv/hn: Remove the FreeBSD_version check for TSO configuration
Sepherosa Ziehau [Wed, 14 Sep 2016 08:59:13 +0000 (08:59 +0000)]
hyperv/hn: Remove the FreeBSD_version check for TSO configuration

It is available on both stable/10 and stable/11. This eases future MFCs
to stable/10.

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

8 years agohyperv/hn: Bring in shims from stable/10
Sepherosa Ziehau [Wed, 14 Sep 2016 08:48:08 +0000 (08:48 +0000)]
hyperv/hn: Bring in shims from stable/10

This eases future MFCs to stable/10.

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

8 years agohyperv/hn: Use sx for the main lock.
Sepherosa Ziehau [Wed, 14 Sep 2016 08:33:08 +0000 (08:33 +0000)]
hyperv/hn: Use sx for the main lock.

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

8 years agohyperv/hn: Cleanup hn_ioctl.
Sepherosa Ziehau [Wed, 14 Sep 2016 08:24:01 +0000 (08:24 +0000)]
hyperv/hn: Cleanup hn_ioctl.

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

8 years agohyperv/hn: Function renaming: hn_ifinit -> hn_init
Sepherosa Ziehau [Wed, 14 Sep 2016 08:08:45 +0000 (08:08 +0000)]
hyperv/hn: Function renaming: hn_ifinit -> hn_init

No functional changes.

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

8 years agohyperv/hn: Deprecate hn_softc_t
Sepherosa Ziehau [Wed, 14 Sep 2016 08:00:30 +0000 (08:00 +0000)]
hyperv/hn: Deprecate hn_softc_t

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

8 years agohyperv/hn: Remove unused softc field
Sepherosa Ziehau [Wed, 14 Sep 2016 06:47:25 +0000 (06:47 +0000)]
hyperv/hn: Remove unused softc field

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

8 years agohyperv/vmbus: Make sure that the sub-channel count is valid.
Sepherosa Ziehau [Wed, 14 Sep 2016 06:30:14 +0000 (06:30 +0000)]
hyperv/vmbus: Make sure that the sub-channel count is valid.

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

8 years agohyperv/hn: Pull RSS key and indirect table setup up.
Sepherosa Ziehau [Wed, 14 Sep 2016 06:15:45 +0000 (06:15 +0000)]
hyperv/hn: Pull RSS key and indirect table setup up.

This paves the way for the dynamic RSS key and indirect table setting.

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

8 years agoSwitch from .CURDIR to the simpler, more legible SRCTOP.
Cy Schubert [Wed, 14 Sep 2016 01:47:01 +0000 (01:47 +0000)]
Switch from .CURDIR to the simpler, more legible SRCTOP.

Suggested by: emaste
X-MFC-with: upcoming amd upgrade

8 years agonet80211: improve error checking in ieee80211_parse_{wpa,rsn}()
Andriy Voskoboinyk [Tue, 13 Sep 2016 22:59:38 +0000 (22:59 +0000)]
net80211: improve error checking in ieee80211_parse_{wpa,rsn}()

- Add few checks for group/pairwise ciphers into
ieee80211_parse_{wpa,rsn}().
- Split error code and cipher value in wpa_cipher() / rsn_cipher(); current
hack with (1 << 32) does not work - it's 1, not 0 (detected by CSA).
- Return IEEE80211_REASON_UNSUPP_RSN_IE_VERSION instead of
IEEE80211_REASON_IE_INVALID when version field is not equal to RSN_VERSION.

Tested with wpi(4) / urtwn(4) (HOSTAP mode).

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D7887

8 years agoAvoid clobbering existing value of META_COOKIE_TOUCH
Simon J. Gerraty [Tue, 13 Sep 2016 22:17:25 +0000 (22:17 +0000)]
Avoid clobbering existing value of META_COOKIE_TOUCH

8 years agoFix swap tables between sets when this functional is enabled.
Andrey V. Elsukov [Tue, 13 Sep 2016 18:16:15 +0000 (18:16 +0000)]
Fix swap tables between sets when this functional is enabled.

We have 6 opcode rewriters for table opcodes. When `set swap' command
invoked, it is called for each rewriter, so at the end we get the same
result, because opcode rewriter uses ETLV type to match opcode. And all
tables opcodes have the same ETLV type. To solve this problem, use
separate sets handler for one opcode rewriter. Use it to handle TEST_ALL,
SWAP_ALL and MOVE_ALL commands.

PR: 212630
MFC after: 1 week

8 years agoAdd a missing opt_ddb.h include from places that include debug_moditor.h
Andrew Turner [Tue, 13 Sep 2016 16:20:31 +0000 (16:20 +0000)]
Add a missing opt_ddb.h include from places that include debug_moditor.h
to fix the build.

Obtained from: ABT Systems Ltd
X-MFC with: r305771
Sponsored by: The FreeBSD Foundation

8 years agoFix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on
Andrew Turner [Tue, 13 Sep 2016 15:45:22 +0000 (15:45 +0000)]
Fix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on
DDB, and is unused when it's disabled.

Obtained from: ABT Systems Ltd
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoAdd a comment on the #endif related to the guards
Baptiste Daroussin [Tue, 13 Sep 2016 15:41:05 +0000 (15:41 +0000)]
Add a comment on the #endif related to the guards

Reported by: tsoome

8 years agoRemove code that crept in r305125 by accident
Baptiste Daroussin [Tue, 13 Sep 2016 15:37:23 +0000 (15:37 +0000)]
Remove code that crept in r305125 by accident

Reported by: tsoome

8 years agoAdd a warning about a known erratum we have observed on ThunderX pass 1.1.
Andrew Turner [Tue, 13 Sep 2016 14:10:49 +0000 (14:10 +0000)]
Add a warning about a known erratum we have observed on ThunderX pass 1.1.
As this is evaluation hardware with only a few users, and there is a lack
of information add a warning when booting on this hardware.

Reported by: cognet
Obtained from: ABT Systems Ltd
MFC after: Instant
Sponsored by: The FreeBSD Foundation

8 years agohyperv/hn: Reorganize synthetic parts attach code.
Sepherosa Ziehau [Tue, 13 Sep 2016 05:54:31 +0000 (05:54 +0000)]
hyperv/hn: Reorganize synthetic parts attach code.

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

8 years agohyperv/hn: Regroup synthetic parts attach code.
Sepherosa Ziehau [Tue, 13 Sep 2016 05:41:13 +0000 (05:41 +0000)]
hyperv/hn: Regroup synthetic parts attach code.

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

8 years agohyperv/hn: Reorganize channel attach/detach code.
Sepherosa Ziehau [Tue, 13 Sep 2016 05:27:36 +0000 (05:27 +0000)]
hyperv/hn: Reorganize channel attach/detach code.

This paves the way for further attach/detach code reorganization.

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

8 years agoAdd another badly-needed simple example to the pw(8) man page.
Warren Block [Tue, 13 Sep 2016 02:18:29 +0000 (02:18 +0000)]
Add another badly-needed simple example to the pw(8) man page.

8 years agonet80211: fix possible panic in adhoc mode (INIT -> RUN state transition).
Andriy Voskoboinyk [Mon, 12 Sep 2016 23:00:31 +0000 (23:00 +0000)]
net80211: fix possible panic in adhoc mode (INIT -> RUN state transition).

In case if there is already running interface, a second non-sta
interface will omit scanning, going directly to RUN state. Handle
this case for adhoc mode appropriately.

Tested with RTL8821AU, 2 vaps in IBSS mode.

8 years agofd: add fget_cap and fget_cap_locked primitives
Mariusz Zaborski [Mon, 12 Sep 2016 22:46:19 +0000 (22:46 +0000)]
fd: add fget_cap and fget_cap_locked primitives

They can be used to obtain capabilities along with a referenced fp.

Reviewed by: mjg@

8 years agoFixup whitespace, repace space with a tab.
Cy Schubert [Mon, 12 Sep 2016 19:31:14 +0000 (19:31 +0000)]
Fixup whitespace, repace space with a tab.

X-MFC-with: Upcoming amd update.

8 years agoRemove explicit device_verbose() from the t4iov driver detach routine
John Baldwin [Mon, 12 Sep 2016 18:07:06 +0000 (18:07 +0000)]
Remove explicit device_verbose() from the t4iov driver detach routine
now that this case is handled generically.

8 years agoMake device_quiet() an attachment property.
John Baldwin [Mon, 12 Sep 2016 18:06:42 +0000 (18:06 +0000)]
Make device_quiet() an attachment property.

In particular, reset the DF_QUIET flag when detaching from a device so
that a driver that marks a device quiet doesn't dictate policy for a
different driver that may claim the device in the future.

Reviewed by: rpokala, wblock
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7803

8 years agoRemove semicolon from the end of the macro definition
Oleksandr Tymoshenko [Mon, 12 Sep 2016 17:29:20 +0000 (17:29 +0000)]
Remove semicolon from the end of the macro definition

Reported by: hans

8 years agourtwn: fix possible driver hang when beacon miss is detected.
Andriy Voskoboinyk [Mon, 12 Sep 2016 16:46:14 +0000 (16:46 +0000)]
urtwn: fix possible driver hang when beacon miss is detected.

8 years agoFix typo in comment.
Konstantin Belousov [Mon, 12 Sep 2016 16:44:21 +0000 (16:44 +0000)]
Fix typo in comment.

MFC after: 3 days

8 years agoAdd SMP support for MTI Malta 34kf CPU.
Ruslan Bukin [Mon, 12 Sep 2016 16:38:51 +0000 (16:38 +0000)]
Add SMP support for MTI Malta 34kf CPU.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoRemove CUBIEBOARD kernel config file.
Emmanuel Vadot [Mon, 12 Sep 2016 16:13:27 +0000 (16:13 +0000)]
Remove CUBIEBOARD kernel config file.
Every Allwinner board should either use ALLWINNER (SMP) or ALLWINER_UP kernel
config files.

MFC after: 2 week

8 years agoUse "generic" ALLWINNER_UP kernel config for Cubieboard release.
Emmanuel Vadot [Mon, 12 Sep 2016 16:10:47 +0000 (16:10 +0000)]
Use "generic" ALLWINNER_UP kernel config for Cubieboard release.

Reviewed by: gjb
MFC after: 2 week

8 years agobspatch: remove superfluous newlines from errx strings
Ed Maste [Mon, 12 Sep 2016 14:28:38 +0000 (14:28 +0000)]
bspatch: remove superfluous newlines from errx strings

8 years agohyperv/hn: Pull ether address and link status extraction up.
Sepherosa Ziehau [Mon, 12 Sep 2016 06:12:28 +0000 (06:12 +0000)]
hyperv/hn: Pull ether address and link status extraction up.

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

8 years agohyperv/hn: Reorganize RNDIS attach
Sepherosa Ziehau [Mon, 12 Sep 2016 05:59:39 +0000 (05:59 +0000)]
hyperv/hn: Reorganize RNDIS attach

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

8 years agohyperv/hn: Reorganize sub-channel allocation.
Sepherosa Ziehau [Mon, 12 Sep 2016 05:37:44 +0000 (05:37 +0000)]
hyperv/hn: Reorganize sub-channel allocation.

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

8 years agohyperv/hn: Function rename.
Sepherosa Ziehau [Mon, 12 Sep 2016 05:28:50 +0000 (05:28 +0000)]
hyperv/hn: Function rename.

- Minor style changes.
- Nuke unnecessary indirection.
- Nuke unapplied comment.

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

8 years agoReport the Silicon Revisions for the AM335x SoCs correctly.
Warner Losh [Mon, 12 Sep 2016 05:19:56 +0000 (05:19 +0000)]
Report the Silicon Revisions for the AM335x SoCs correctly.

8 years agohyperv/hn: Rename chimney sending buffer connect/disconnect functions.
Sepherosa Ziehau [Mon, 12 Sep 2016 05:18:30 +0000 (05:18 +0000)]
hyperv/hn: Rename chimney sending buffer connect/disconnect functions.

Minor cleanup and wording in error messages.

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

8 years agohyperv/hn: Rename RXBUF connect/disconnect functions.
Sepherosa Ziehau [Mon, 12 Sep 2016 05:09:45 +0000 (05:09 +0000)]
hyperv/hn: Rename RXBUF connect/disconnect functions.

Minor cleanup and wording in error messages.

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

8 years ago[ath_hal] quieten a bit of the boot messages - this stuff has been working for a...
Adrian Chadd [Mon, 12 Sep 2016 04:58:59 +0000 (04:58 +0000)]
[ath_hal] quieten a bit of the boot messages - this stuff has been working for a while.

8 years agox86: Use sx lock for interrupt sources.
Sepherosa Ziehau [Mon, 12 Sep 2016 04:57:58 +0000 (04:57 +0000)]
x86: Use sx lock for interrupt sources.

- Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long
  call chain.  For msi_assign_cpu, mutex makes complex PCI bridge
  drivers more tricky, e.g. sleep can note be called, etc, it will
  be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI
  pass-through.
- It is not used on any hot code path nor non-sleepable context, so
  sx should have the same effect as mutex.

PIC list is still protected by mutex to keep suspend/resume work.

Discussed with: jhb
Reviewed by: jhb
MFC after: 3 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7784

8 years ago[ath] set the relevant TOA/TOD locationing bits when trying to do locationing.
Adrian Chadd [Mon, 12 Sep 2016 04:55:13 +0000 (04:55 +0000)]
[ath] set the relevant TOA/TOD locationing bits when trying to do locationing.

* Don't do RTS/CTS - experiments show that we get ACK frames for each of them
  and this ends up causing the timestamps to look all funny.
* Set the HAL_TXDESC_POS bit, so the AR9300 HAL sets up the hardware to return
  location and CSI information.

8 years ago[ath] tweak the TX EDMA debugging a bit.
Adrian Chadd [Mon, 12 Sep 2016 04:50:40 +0000 (04:50 +0000)]
[ath] tweak the TX EDMA debugging a bit.

I've used this to debug some amusing issues with the EDMA code.

Tested:

* AR9380, STA mode
* AR9380, TDMA mode (master, slave)

8 years agoCleanup evdev support for TI ADC/TS
Oleksandr Tymoshenko [Mon, 12 Sep 2016 01:18:25 +0000 (01:18 +0000)]
Cleanup evdev support for TI ADC/TS

- evdev_set_methods call is not required if actual methods are no-ops
- evdev_set_serial is also optional if there is no meaningful input device
    identifier
- evdev_set_id on the other hand is mandatory, so set virtual bus with
    dummy vendor/product/version

Suggested by: Vladimir Kondratiev

8 years agocxgbe(4): Catch up with the rename of tlscaps -> cryptocaps. TLS is one
Navdeep Parhar [Mon, 12 Sep 2016 00:15:40 +0000 (00:15 +0000)]
cxgbe(4): Catch up with the rename of tlscaps -> cryptocaps.  TLS is one
of the capabilities of the crypto engine in T6.

Sponsored by: Chelsio Communications

8 years agocxgbe(4): Add support for additional port types and link speeds.
Navdeep Parhar [Sun, 11 Sep 2016 23:08:57 +0000 (23:08 +0000)]
cxgbe(4): Add support for additional port types and link speeds.

Sponsored by: Chelsio Communications.

8 years agoioat(4): Start poll timer when descriptors are released to HW
Conrad Meyer [Sun, 11 Sep 2016 20:15:41 +0000 (20:15 +0000)]
ioat(4): Start poll timer when descriptors are released to HW

Rather than when the software creates the descriptors.

Sponsored by: Dell EMC Isilon

8 years agoioat(4): De-spam ioat_process_events KTR logs
Conrad Meyer [Sun, 11 Sep 2016 20:14:19 +0000 (20:14 +0000)]
ioat(4): De-spam ioat_process_events KTR logs

Sponsored by: Dell EMC Isilon

8 years agoAdd more obsolete files
Antoine Brodin [Sun, 11 Sep 2016 19:51:32 +0000 (19:51 +0000)]
Add more obsolete files

8 years agoAdd evdev support to TI ADC/touchscreen driver
Oleksandr Tymoshenko [Sun, 11 Sep 2016 19:08:21 +0000 (19:08 +0000)]
Add evdev support to TI ADC/touchscreen driver

Add generic evdev support to touchscreen part of ti_adc: two absolute
coordinates + button touch to indicate pen position. Pressure value
reporting is not implemented yet.

Tested on: Beaglebone Black + 4DCAPE-43T + tslib

8 years agoDirectly set the O_NONBLOCK flags via open(2)
Baptiste Daroussin [Sun, 11 Sep 2016 18:58:44 +0000 (18:58 +0000)]
Directly set the O_NONBLOCK flags via open(2)

8 years agoAdd evdev protocol implementation
Oleksandr Tymoshenko [Sun, 11 Sep 2016 18:56:38 +0000 (18:56 +0000)]
Add evdev protocol implementation

evdev is a generic input event interface compatible with Linux
evdev API at ioctl level. It allows using unmodified (apart from
header name) input evdev drivers in Xorg, Wayland, Qt.

This commit has only generic kernel API. evdev support for individual
hardware drivers like ukbd, ums, atkbd, etc. will be committed later.

Project was started by Jakub Klama as part of GSoC 2014. Jakub's
evdev implementation was later used as a base, updated and finished
by Vladimir Kondratiev.

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: adrian, hans
Differential Revision: https://reviews.freebsd.org/D6998

8 years agocxgbe(4): Rename the debug_flags driver tunable/sysctl to dflags.
Navdeep Parhar [Sun, 11 Sep 2016 18:05:37 +0000 (18:05 +0000)]
cxgbe(4): Rename the debug_flags driver tunable/sysctl to dflags.
Tunables that end with _flags are special.

Sponsored by: Chelsio Communications

8 years agocxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6.
Navdeep Parhar [Sun, 11 Sep 2016 17:57:53 +0000 (17:57 +0000)]
cxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6.

Sponsored by: Chelsio Communications

8 years agocxgbe(4): Use smaller min/max bursts for fl descriptors with a T6.
Navdeep Parhar [Sun, 11 Sep 2016 17:51:17 +0000 (17:51 +0000)]
cxgbe(4): Use smaller min/max bursts for fl descriptors with a T6.

Sponsored by: Chelsio Communications

8 years agoMFV r268120:
Allan Jude [Sun, 11 Sep 2016 17:48:06 +0000 (17:48 +0000)]
MFV r268120:
  4936 lz4 could theoretically overflow a pointer with a certain input

  illumos/illumos-gate@58d0718061c87e3d647c891ec5281b93c08dba4e

Reviewed by: delphij
MFC after: 2 weeks
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D7850

8 years agoMark libifconfig as private until the API/ABI is stable
Allan Jude [Sun, 11 Sep 2016 17:44:35 +0000 (17:44 +0000)]
Mark libifconfig as private until the API/ABI is stable

libifconfig is still experimental and under active development.
To avoid making any ABI promises, mark the library as private

Suggested by: bapt
Reviewed by: kp

8 years agocxgbe(4): Update the pad_boundary calculation for T6, which has a
Navdeep Parhar [Sun, 11 Sep 2016 17:22:54 +0000 (17:22 +0000)]
cxgbe(4): Update the pad_boundary calculation for T6, which has a
different range of boundaries.

Sponsored by: Chelsio Communications

8 years agocxgbe(4): Use correct macro for header length with T6 ASICs. This
Navdeep Parhar [Sun, 11 Sep 2016 16:11:51 +0000 (16:11 +0000)]
cxgbe(4): Use correct macro for header length with T6 ASICs.  This
affects the transmit of the VF driver only.

Sponsored by: Chelsio Communications

8 years agocxgbe(4): Set up fl_starve_threshold2 accurately for T6.
Navdeep Parhar [Sun, 11 Sep 2016 16:06:17 +0000 (16:06 +0000)]
cxgbe(4): Set up fl_starve_threshold2 accurately for T6.

Sponsored by: Chelsio Communications

8 years agoAdd FPU_KERN_NOCTX flag to the fpu_kern_enter() function on amd64.
Konstantin Belousov [Sun, 11 Sep 2016 09:14:07 +0000 (09:14 +0000)]
Add FPU_KERN_NOCTX flag to the fpu_kern_enter() function on amd64.

The flag specifies that the block which uses FPU must be executed in
critical section, i.e. take no context switches, and does not need an
FPU save area during the execution.

It is intended to be applied around fast and short code pathes where
save area allocation is impossible or undesirable, due to context or
due to the relative cost of calculation vs. allocation.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agocap_enter.2: describe flag returned by cap_getmode
Ed Maste [Sun, 11 Sep 2016 01:11:47 +0000 (01:11 +0000)]
cap_enter.2: describe flag returned by cap_getmode

Previously the flag returned by cap_getmode was not described explicitly
in the man page.

Reviewed by: wblock
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7822

8 years agoa10_mmc: Remove completly the PIO code now all access is done by DMA.
Emmanuel Vadot [Sat, 10 Sep 2016 17:45:35 +0000 (17:45 +0000)]
a10_mmc: Remove completly the PIO code now all access is done by DMA.
Rename registers as in the manual.
Do a hard reset of the controller before a soft one.
Since DMA is always used remove dependancy on allwinner_soc_family, it was used
to differentiate SoC as the fdt compatible string were the same.

Tested on A10, A20, H3 and A64.

Reviewed by: jmcneill
Differential Revision: https://reviews.freebsd.org/D6868

8 years agoVarious changes to pmap_ts_referenced()
Alan Cox [Sat, 10 Sep 2016 16:49:25 +0000 (16:49 +0000)]
Various changes to pmap_ts_referenced()

Move PMAP_TS_REFERENCED_MAX out of the various pmap implementations and
into vm/pmap.h, and describe what its purpose is.  Eliminate the archaic
"XXX" comment about its value.  I don't believe that its exact value, e.g.,
5 versus 6, matters.

Update the arm64 and riscv pmap implementations of pmap_ts_referenced()
to opportunistically update the page's dirty field.

On amd64, use the PDE value already cached in a local variable rather than
dereferencing a pointer again and again.

Reviewed by: kib, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D7836

8 years agocache: improve scalability by introducing bucket locks
Mateusz Guzik [Sat, 10 Sep 2016 16:29:53 +0000 (16:29 +0000)]
cache: improve scalability by introducing bucket locks

An array of bucket locks is added.

All modifications still require the global cache_lock to be held for
writing. However, most readers only need the relevant bucket lock and in
effect can run concurrently to the writer as long as they use a
different lock. See the added comment for more details.

This is an intermediate step towards removal of the global lock.

Reviewed by: kib
Tested by: pho

8 years agoSwitch random_get_pseudo_bytes() shim to arc4rand().
Alexander Motin [Sat, 10 Sep 2016 09:37:41 +0000 (09:37 +0000)]
Switch random_get_pseudo_bytes() shim to arc4rand().

Our shim for Solaris random_get_bytes() uses read_random(), that looks
reasonable, since it guaranties reliably seeded random data.  On the other
side Solaris random_get_pseudo_bytes() does not provide this guarantie,
and its original Solaris implementation is equivalent to our arc4rand(),
using software crypto without stressing slower hardware RNG.

8 years agoFix build
Konstantin Belousov [Sat, 10 Sep 2016 09:00:12 +0000 (09:00 +0000)]
Fix build

8 years agoAdd ehci to the MPC85XX build
Justin Hibbits [Sat, 10 Sep 2016 01:09:58 +0000 (01:09 +0000)]
Add ehci to the MPC85XX build

Many QorIQ and MPC85xx SoCs have USB support, so add it to the kernel.

MFC after: 1 week

8 years agowait: Do not copyout uninitialized status/rusage/wrusage.
Jilles Tjoelker [Fri, 9 Sep 2016 21:58:48 +0000 (21:58 +0000)]
wait: Do not copyout uninitialized status/rusage/wrusage.

If wait4() or wait6() return 0 because of WNOHANG, the status, rusage and
wrusage information should not be returned.

PR: 212048
Reported by: Casey Lucas
MFC after: 2 weeks

8 years agolocks: add backoff for spin mutexes and thread lock
Mateusz Guzik [Fri, 9 Sep 2016 19:13:02 +0000 (19:13 +0000)]
locks: add backoff for spin mutexes and thread lock

Reviewed by: jhb

8 years agoFix regression from r304644 which could cause .WAITs in SUBDIR to be ignored.
Bryan Drewery [Fri, 9 Sep 2016 18:49:45 +0000 (18:49 +0000)]
Fix regression from r304644 which could cause .WAITs in SUBDIR to be ignored.

This was possible if a STANDALONE_SUBDIR_TARGET item came in
SUBDIR_TARGETS before 'all', which would then cause SUBDIR to
have all .WAIT's removed.

Sponsored by: Dell EMC Isilon

8 years agoANSIfy uipc_syscalls.c
Ed Maste [Fri, 9 Sep 2016 17:40:26 +0000 (17:40 +0000)]
ANSIfy uipc_syscalls.c

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7839

8 years agocxgbe(4): Avoid a NULL dereference in the clearstats ioctl handler.
Navdeep Parhar [Fri, 9 Sep 2016 17:15:16 +0000 (17:15 +0000)]
cxgbe(4): Avoid a NULL dereference in the clearstats ioctl handler.
Port softc's are not initialized when the adapter is in recovery mode.

8 years agoFix spelling in comment.
Brooks Davis [Fri, 9 Sep 2016 16:18:44 +0000 (16:18 +0000)]
Fix spelling in comment.

Submitted by: brueffer

8 years agoPass the trap type and code down from db_trap() to db_stop_at_pc() so
Bruce Evans [Fri, 9 Sep 2016 15:53:42 +0000 (15:53 +0000)]
Pass the trap type and code down from db_trap() to db_stop_at_pc() so
that the latter can easily determine what the trap type actually is
after callers are fixed to encode the type unambigously.

ddb currently barely understands breakpoints, and it treats all
non-breakpoints as single-step traps.  This works OK for stopping
after every instruction when single-stepping, but is broken for
single-stepping with a count > 1 (especially with a large count).
ddb needs to stop on the first non-single-step trap while single-
stepping.  Otherwise, ddb doesn't even stop the first time for
fatal traps and external breakpoints like the one in kdb_enter().

8 years agoAdd support for SMP on MIPS Malta platform.
Ruslan Bukin [Fri, 9 Sep 2016 14:50:44 +0000 (14:50 +0000)]
Add support for SMP on MIPS Malta platform.
Tested in QEMU on Malta32, Malta64.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoFix stopping when the specified breakpoint count is reached. The
Bruce Evans [Fri, 9 Sep 2016 14:09:50 +0000 (14:09 +0000)]
Fix stopping when the specified breakpoint count is reached.  The
countdown was done correctly, but the action when the count was not
reduced to 0 was to fall through to generic code which almost always
stopped.

8 years agoGive the full syntax of the 'count' arg for all commmands that support
Bruce Evans [Fri, 9 Sep 2016 13:23:07 +0000 (13:23 +0000)]
Give the full syntax of the 'count' arg for all commmands that support
it.  This arg is most interesting for the 'break' command where it
never worked, and for the step command where it is powerful but too
fragile to use much.

Give the full syntax of the 'addr' arg for these commands and some
others.  Rename it from 'address' for the generic command.

Fix description of how 'count' is supposed to work for the 'break'
command.

Don't (mis)describe the syntax of the comma for the 'step' command.

Expand the description for the generic command.

Give the full syntax for the 'examine' command.  It was also missing
the possible values for the modifier.

Fix mdoc syntax error for the 'search' command.

Remove FUD about consequences of not having a trap handler for the
'search' command.

8 years agonullfs: plug vnode ref leak in null_vptocnp
Mateusz Guzik [Fri, 9 Sep 2016 10:40:55 +0000 (10:40 +0000)]
nullfs: plug vnode ref leak in null_vptocnp

The lower vnode is already referenced and nodeget is supposed to consume
the reference. Thus the extra vref call was causing a leak.

Reported by: pho
Reviewed by: kib
MFC after: 1 week

8 years agocxgbe(4): Do not prescreen frames before attempting LRO.
Navdeep Parhar [Fri, 9 Sep 2016 07:34:14 +0000 (07:34 +0000)]
cxgbe(4): Do not prescreen frames before attempting LRO.

Sponsored by: Chelsio Communications

8 years agoProperly patch up dirname()/basename() calls to not clobber ent->log.
Ed Schouten [Fri, 9 Sep 2016 07:10:50 +0000 (07:10 +0000)]
Properly patch up dirname()/basename() calls to not clobber ent->log.

It turns out that we had a couple of more calls to dirname()/basename()
in newsyslog(8) that assume the input isn't clobbered. This is bad,
because it apparently breaks log rotation now that the new dirname()
implementation has been merged.

Fix this by first copying the input and then calling
dirname()/basename(). While there, improve the naming of variables in
this function a bit.

Reported by: Ryan Steinmetz, gjb
Reviewed by: bdrewery, allanjude
Differential Revision: https://reviews.freebsd.org/D7838

8 years ago[gpio] include intr.h when building with INTRNG.
Adrian Chadd [Fri, 9 Sep 2016 04:54:41 +0000 (04:54 +0000)]
[gpio] include intr.h when building with INTRNG.

Trying to build a MIPS platform that uses INTRNG needs this
for this to work right in gpiobusvar.h :

#ifdef INTRNG
struct intr_map_data_gpio {
        struct intr_map_data    hdr;
...
};
#endif

8 years ago[net80211] add in ToA/ToD based location mbuf tags for some experimenting.
Adrian Chadd [Fri, 9 Sep 2016 04:47:48 +0000 (04:47 +0000)]
[net80211] add in ToA/ToD based location mbuf tags for some experimenting.

8 years ago[ath_hal] fixes for finer grain timestamping, some 11n macros
Adrian Chadd [Fri, 9 Sep 2016 04:45:25 +0000 (04:45 +0000)]
[ath_hal] fixes for finer grain timestamping, some 11n macros

* change the HT_RC_2_MCS to do MCS0..23
* Use it when looking up the ht20/ht40 array for bits-per-symbol
* add a clk_to_psec (picoseconds) routine, so we can get sub-microsecond
  accuracy for the math
* .. and make that + clk_to_usec public, so higher layer code that is
  returning clocks (eg the ANI diag routines, some upcoming locationing
  experiments) can be converted to microseconds.

Whilst here, add a comment in ar5416 so i or someone else can revisit the
latency values.

8 years agoCorrect the type of db_cmd_loop_done.
Justin Hibbits [Fri, 9 Sep 2016 04:16:53 +0000 (04:16 +0000)]
Correct the type of db_cmd_loop_done.

On big endian hardware that uses 1 byte bool a type mismatch of bool vs int will
cause the least signifcant byte of db_cmd_loop_done to be set, but the MSB to be
read, and read as 0.  This causes ddb to stay in an infinite loop.

MFC after: 1 week

8 years agoMissed part of patch
Simon J. Gerraty [Fri, 9 Sep 2016 02:02:13 +0000 (02:02 +0000)]
Missed part of patch

8 years agoUpdate to latest dirdeps.mk
Simon J. Gerraty [Fri, 9 Sep 2016 01:21:35 +0000 (01:21 +0000)]
Update to latest dirdeps.mk

Take advantage of new bmake feature to only consider Makefile.depend
as invalidating DIRDEPS_CACHE.

When bootstrapping allow more filtering via .MAKE.DEPENDFILE_BOOTSTRAP_SED

Move some comments back to where they make sense.

meta.sys.mk: add META_COOKIE_TOUCH and META_NOPHONY to better handle some
targets in meta mode vs non-meta mode.
Also use .MAKE.META.IGNORE_PATHS to ignore mtime of makefiles - which do
not matter in meta mode.

8 years agoUpdate to bmake-20170818
Simon J. Gerraty [Fri, 9 Sep 2016 01:09:39 +0000 (01:09 +0000)]
Update to bmake-20170818

This version has some new knobs for dealing with troublesome targets
in meta mode.

8 years agoImport bmake-20160818
Simon J. Gerraty [Thu, 8 Sep 2016 23:49:33 +0000 (23:49 +0000)]
Import bmake-20160818

Interesting changes:

  o meta.c: move handling of .MAKE.META.IGNORE_* to meta_ignore()
    so we can call it before adding entries to missingFiles.
    Thus we do not track files we have been told to ignore.
  o meta_oodate: apply .MAKE.META.IGNORE_FILTER (if defined) to
    pathnames, and skip if the expansion is empty.
    Useful for dirdeps.mk when checking DIRDEPS_CACHE.
  o meta.c: remove all missingFiles entries that match a deleted
    dir.
  o main.c: set .ERROR_CMD if possible.

8 years agoReduce duplicate NOASM and PSEUDO definitions
Brooks Davis [Thu, 8 Sep 2016 22:38:20 +0000 (22:38 +0000)]
Reduce duplicate NOASM and PSEUDO definitions

The initial value of NOASM is nearly the same in all cases and the
initial value of PSEUDO is the same in all cases so reduce duplication
(and hopefully, future merge conflicts) by machine independent defaults.

Also document the PSEUDO variable.

Reviewed by: jhb, kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D7820

8 years agoAdd new directories added in r305626 to fix "make installworld".
Jung-uk Kim [Thu, 8 Sep 2016 21:59:34 +0000 (21:59 +0000)]
Add new directories added in r305626 to fix "make installworld".

8 years agointro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)).
Jilles Tjoelker [Thu, 8 Sep 2016 21:50:03 +0000 (21:50 +0000)]
intro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)).

MFC after: 1 week