]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoImport Zstandard 1.2.0
Baptiste Daroussin [Sat, 6 May 2017 10:26:40 +0000 (10:26 +0000)]
Import Zstandard 1.2.0

Among new things it is now threaded by default, use zstd -T# to chose the
number of threads not that -T0 will automatically determine the number of
threads based on the number of CPU online.

7 years agoImport Zstandard 1.2.0
Baptiste Daroussin [Sat, 6 May 2017 10:17:59 +0000 (10:17 +0000)]
Import Zstandard 1.2.0
Among changes: threading support is now default and supports freebsd

7 years ago[mediatek] [gpio] add PPS / interrupt support.
Adrian Chadd [Sat, 6 May 2017 06:22:14 +0000 (06:22 +0000)]
[mediatek] [gpio] add PPS / interrupt support.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D9784

7 years ago[mips] [rt2880] Add oldest Ralink MIPS SOC RT2880 support code.
Adrian Chadd [Sat, 6 May 2017 06:20:34 +0000 (06:20 +0000)]
[mips] [rt2880] Add oldest Ralink MIPS SOC RT2880 support code.

* Target module have ic plus etherswitch ip175c.
* Also add etherswitch support code on rt driver.

Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D10336

7 years ago[arm] [rt1310] add initial RT1310 SoC code.
Adrian Chadd [Sat, 6 May 2017 06:14:46 +0000 (06:14 +0000)]
[arm] [rt1310] add initial RT1310 SoC code.

This code base on lpc code. Ralink RT1310 is oem from 5V Technologies.
RT1310 is ARM926EJS(arm5t).

Tested:

* Buffalo WZR2-G300N

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D7238

7 years ago[ar934x] do an ethernet analog reset; apparently some boards don't.
Adrian Chadd [Sat, 6 May 2017 06:09:50 +0000 (06:09 +0000)]
[ar934x] do an ethernet analog reset; apparently some boards don't.

Tested:

* on IOData WN-G300R. may be same as Sitecom WLR-2100.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D10621

7 years ago[mx25l] add new device ids.
Adrian Chadd [Sat, 6 May 2017 06:08:44 +0000 (06:08 +0000)]
[mx25l] add new device ids.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D10621

7 years ago[etherswitch] [e6000sw] fix compile issue under clang/arm
Adrian Chadd [Sat, 6 May 2017 06:07:44 +0000 (06:07 +0000)]
[etherswitch] [e6000sw] fix compile issue under clang/arm

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Approved by: mizhka
Differential Revision: https://reviews.freebsd.org/D10563

7 years ago[ar531x] [if_are] Fix if_are behaviour under high load traffic
Adrian Chadd [Sat, 6 May 2017 06:06:11 +0000 (06:06 +0000)]
[ar531x] [if_are] Fix if_are behaviour under high load traffic

* use ifqmaxlen
* handle (inefficiently for now) meeting padding and alignment requirements for
  transmit mbufs.
* change how TX ring handling is done

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D10557

7 years ago[etherswitch] add manpages for etherswitch supported devices.
Adrian Chadd [Sat, 6 May 2017 06:01:17 +0000 (06:01 +0000)]
[etherswitch] add manpages for etherswitch supported devices.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D10278

7 years ago[ip17x] [etherswitch] fdt away and mii hang workaround on ip17x
Adrian Chadd [Sat, 6 May 2017 05:53:42 +0000 (05:53 +0000)]
[ip17x] [etherswitch] fdt away and mii hang workaround on ip17x

Add workaround mii access because of rt1310 is hang up on etherswitch mii poll.
And FDT away on arm platform.

Tested:

* wzr2-g300n

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D10295

7 years ago[cfi] fix CFI flash reset command for MX29LV320T/B.
Adrian Chadd [Sat, 6 May 2017 05:52:01 +0000 (05:52 +0000)]
[cfi] fix CFI flash reset command for MX29LV320T/B.

MX flash MX29LV320T/B datasheet say reset is 0xf0.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Approved by: mizhka
Differential Revision: https://reviews.freebsd.org/D10177

7 years ago[infineon] [etherswitch] no hardcode tagging port setting at amd6996fc
Adrian Chadd [Sat, 6 May 2017 05:50:07 +0000 (05:50 +0000)]
[infineon] [etherswitch] no hardcode tagging port setting at amd6996fc

Tagging port can set by etherswitchcfg command.

Tested:

* on Netgear_WGR614Cv7

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka

7 years agoFix some "don't build" optimizations from r308599 not working due to a typo.
Bryan Drewery [Sat, 6 May 2017 05:37:36 +0000 (05:37 +0000)]
Fix some "don't build" optimizations from r308599 not working due to a typo.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoImprove blacklist support before upgrading libblacklist
Kurt Lidl [Sat, 6 May 2017 04:17:48 +0000 (04:17 +0000)]
Improve blacklist support before upgrading libblacklist

The locally declared enum of blacklistd actions needs to be
hidden when the soon to be committed changes to libblacklist
are brought into the tree.  Fix the type of the "msg" parameter
to match the library.

There should be no functional changes.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoWhen editing a mode page on a tape drive, do not clear the device
Kenneth D. Merry [Fri, 5 May 2017 21:29:28 +0000 (21:29 +0000)]
When editing a mode page on a tape drive, do not clear the device
specific parameter.

Tape drives include write protect (WP), Buffered Mode and Speed
settings in the device-specific parameter.  Clearing this
parameter on a mode select can have the effect of turning off
write protect or buffered mode, or changing the speed setting of
the tape drive.

Disks report DPO/FUA support via the device specific parameter
for MODE SENSE, but the bit is reserved for MODE SELECT.  So we
clear this for disks (and other non-tape devices) to avoid
potential errors from the target device.

sbin/camcontrol/modeedit.c:
Clear the device-specific parameter in the mode page
header if we're not operating on a tape drive.

MFC after: 3 days
Sponsored by: Spectra Logic

7 years agocxgbe/t4_tom: Per-connection rate limiting for TCP sockets handled by
Navdeep Parhar [Fri, 5 May 2017 20:06:49 +0000 (20:06 +0000)]
cxgbe/t4_tom: Per-connection rate limiting for TCP sockets handled by
the TOE.  For now this capability is always enabled in kernels with
options RATELIMIT.  t4_tom will check if_capenable once the base driver
gets code to support rate limiting for any socket (TOE or not).

This was tested with iperf3 and netperf ToT as they already support
SO_MAX_PACING_RATE sockopt.  There is a bug in firmwares prior to
1.16.45.0 that affects the BSD driver only and results in rate-limiting
at an incorrect rate.  This will resolve by itself as soon as 1.16.45.0
or later firmware shows up in the driver.

Relnotes: Yes
Sponsored by: Chelsio Communications

7 years agoAdd basic programmable early warning error injection to the sa(4) driver.
Kenneth D. Merry [Fri, 5 May 2017 20:00:53 +0000 (20:00 +0000)]
Add basic programmable early warning error injection to the sa(4) driver.

This will help application developers simulate end of tape conditions.

To inject an error in sa0:

sysctl kern.cam.sa.0.inject_eom=1

This will return the next read or write request queued with 0 bytes
written.  Any subsequent writes or reads will go along as usual.

This will also cause the early warning position flag to get set
for the next position query.  So, 'mt status' will show the BPEW
(Beyond Programmable Early Warning) flag on the first query after
an error injection.  After that, the position flags will be as they
are in the underlying tape drive.

Also, update the sa(4) man page to describe tape parameters,
which can be set via 'mt param'.

sys/cam/scsi/scsi_sa.c:
In saregister(), create the inject_eom sysctl variable.

In sastart(), check to see whether inject_eom is set.  If
so, return the read or write with 0 bytes written to
indicate EOM.  Set the set_pews_status flag so that we
fake PEWS status in the next position call for reads, and the
next 3 calls for writes.  This allows the user to see the BPEW
flag one time via 'mt status'.

In sagetpos(), check the set_pews_status flag and fake
PEWS status and decrement the counter if it is set.

share/man/man4/sa.4:
Document the inject_eom sysctl variable.

Document all of the parameters currently supported via
'mt param'.

usr.bin/mt/mt.1:
Point the user to the sa(4) man page for more details on
supported parameters.

MFC after: 3 days
Sponsored by: Spectra Logic

7 years agocxgbe(4): The Tx scheduler initialization either works or doesn't. It
Navdeep Parhar [Fri, 5 May 2017 19:34:05 +0000 (19:34 +0000)]
cxgbe(4): The Tx scheduler initialization either works or doesn't.  It
doesn't need a refresh in either case.

Sponsored by: Chelsio Communications

7 years agoRegent post r317845.
Brooks Davis [Fri, 5 May 2017 18:50:22 +0000 (18:50 +0000)]
Regent post r317845.

MFC after: 1 week
MFC with: r317845
Sponsored by: DARPA, AFRL

7 years agoProvide a freebsd32 implementation of sigqueue()
Brooks Davis [Fri, 5 May 2017 18:49:39 +0000 (18:49 +0000)]
Provide a freebsd32 implementation of sigqueue()

The previous misuse of sys_sigqueue() was sending random register or
stack garbage to 64-bit targets.  The freebsd32 implementation preserves
the sival_int member of value when signaling a 64-bit process.

Document the mixed ABI implementation of union sigval and the
incompability of sival_ptr with pointer integrity schemes.

Reviewed by: kib, wblock
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10605

7 years agoGrammar fixes.
Konstantin Belousov [Fri, 5 May 2017 18:36:41 +0000 (18:36 +0000)]
Grammar fixes.

Noted by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoDefine the scope and purpose of the page.
Konstantin Belousov [Fri, 5 May 2017 18:21:33 +0000 (18:21 +0000)]
Define the scope and purpose of the page.

Submitted by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agobsdgrep: don't ouptut matches with -c, -l, -L
Ed Maste [Fri, 5 May 2017 17:35:05 +0000 (17:35 +0000)]
bsdgrep: don't ouptut matches with -c, -l, -L

Refactoring done in r317703 broke -c, -l, and -L flags implying
suppression of match printing.  Fortunately this is just a matter of not
doing any printing of the resulting matches and context printing was not
broken in this refactoring.

Add some regression tests since this area may still see further
refactoring, include different context flags as well even though they
were not broken in this case.

PR: 219077
Submitted by: Kyle kevans91@ksu.edu
Reported by: markj
Reviewed by: cem, ngie
Differential Revision: https://reviews.freebsd.org/D10607

7 years agoFix some grammar, fix some markup, bump copyright year, provide more
Konstantin Belousov [Fri, 5 May 2017 17:23:57 +0000 (17:23 +0000)]
Fix some grammar, fix some markup, bump copyright year, provide more
exact claims in some cases.

Discussed with: bde (most parts)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoUse pmap_invalidate_cache() to implement wbinvd_on_all_cpus().
Mark Johnston [Fri, 5 May 2017 17:22:00 +0000 (17:22 +0000)]
Use pmap_invalidate_cache() to implement wbinvd_on_all_cpus().

Suggested by: jhb
X-MFC with: r317651

7 years agoShow more fields in the IOCFact message
Scott Long [Fri, 5 May 2017 17:01:54 +0000 (17:01 +0000)]
Show more fields in the IOCFact message

7 years agocxgbe(4): Update the VF device ids too. This should have been part
Navdeep Parhar [Fri, 5 May 2017 16:52:25 +0000 (16:52 +0000)]
cxgbe(4):  Update the VF device ids too.  This should have been part
of r317820.

Reported by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications

7 years agoRelax r317696 locking to not drain taskqueue under the lock.
Alexander Motin [Fri, 5 May 2017 16:51:53 +0000 (16:51 +0000)]
Relax r317696 locking to not drain taskqueue under the lock.

MFC after: 11 days

7 years agoarch(7): add a table of per-arch initial/final FreeBSD version
Ed Maste [Fri, 5 May 2017 16:40:45 +0000 (16:40 +0000)]
arch(7): add a table of per-arch initial/final FreeBSD version

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

7 years agoUFS fs.h: clear warning from use in makefs(1)
Ed Maste [Fri, 5 May 2017 15:26:55 +0000 (15:26 +0000)]
UFS fs.h: clear warning from use in makefs(1)

makefs(1) has a number of signedness warnings (when built with higher
WARNS), most of which can be addressed by careful application of casts
in makefs itself.

There is one case where a signedness warning arises from the blksize
macro, so must be addressed in the macro itself.

Reviewed by: kib, mckusick
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10589

7 years agoIfdef out a redundant if statement when INET6 is disabled.
Cy Schubert [Fri, 5 May 2017 14:34:09 +0000 (14:34 +0000)]
Ifdef out a redundant if statement when INET6 is disabled.

MFC after: 1 week

7 years agoMFV r317581: less v491.
Xin LI [Fri, 5 May 2017 14:33:39 +0000 (14:33 +0000)]
MFV r317581: less v491.

MFC after: 1 month

7 years agoFix for use after free in the LinuxKPI.
Hans Petter Selasky [Fri, 5 May 2017 14:09:44 +0000 (14:09 +0000)]
Fix for use after free in the LinuxKPI.

Background:
The same VM object might be shared by multiple processes and the
mm_struct is usually freed when a process exits.

Grab a reference on the mm_struct while the vmap is in the
linux_vma_head list in case the first process which inserted a VM
object has exited.

Tested by: kwm @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUpgrade to OpenPAM Resedacea.
Dag-Erling Smørgrav [Fri, 5 May 2017 13:31:25 +0000 (13:31 +0000)]
Upgrade to OpenPAM Resedacea.

MFC after: 3 weeks

7 years agoAdd reclaim_pv_chunk on arm64. This is based on the amd64 code so should
Andrew Turner [Fri, 5 May 2017 10:01:27 +0000 (10:01 +0000)]
Add reclaim_pv_chunk on arm64. This is based on the amd64 code so should
operate similarly, other than not needing the delayed invalidation.

It has been tested with artificial injection of vm_page_alloc failures
while running 'sort /dev/zero'.

Reviewed by: alc, kib
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10574

7 years agohyperv/kbd: Channel read expects non-NULL channel argument.
Sepherosa Ziehau [Fri, 5 May 2017 03:28:30 +0000 (03:28 +0000)]
hyperv/kbd: Channel read expects non-NULL channel argument.

MFC after: now
Sponsored by: Microsoft

7 years agocxgbe(4): Update the list of PCIe devices claimed by the driver. At
Navdeep Parhar [Fri, 5 May 2017 00:54:23 +0000 (00:54 +0000)]
cxgbe(4): Update the list of PCIe devices claimed by the driver.  At
this point any board with a T6 should just work.

Obtained from: Chelsio Communications
MFC after: 1 week
Sponsored by: Chelsio Communications

7 years agoReduce synaptics touch sensitivity
Vladimir Kondratyev [Thu, 4 May 2017 23:19:27 +0000 (23:19 +0000)]
Reduce synaptics touch sensitivity

Increase hw.psm.synaptics.min_pressure default value from 16 to 32
to nearly match Linux driver (30-35 hysteresis loop).
This makes libinput tap detection more reliable.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks

7 years agopsm(4): Remove sys/libkern.h header inclusion
Vladimir Kondratyev [Thu, 4 May 2017 23:17:21 +0000 (23:17 +0000)]
psm(4): Remove sys/libkern.h header inclusion

It is already included via sys/systm.h

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoSet predefined logical touchpad sizes for several ancient Elan hw v.2
Vladimir Kondratyev [Thu, 4 May 2017 23:12:45 +0000 (23:12 +0000)]
Set predefined logical touchpad sizes for several ancient Elan hw v.2
models. This change is based on Linux driver.
Determine logical trace size. It used for calculation of touch sizes
in surface units for MT-protocol type B evdev reports.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoReport 3-rd and 4-th fingers as first finger for Elan hw v.2 and v.3 as
Vladimir Kondratyev [Thu, 4 May 2017 23:08:55 +0000 (23:08 +0000)]
Report 3-rd and 4-th fingers as first finger for Elan hw v.2 and v.3 as
Linux does. It should not affect gesture processing in current state as it
ignores finger coords on 3-finger tap detection but it should make evdev
reports looking more Linux-alike.

Reviewed by: gonzo
Approved by: gonzo
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoEnable palm detection on two finger touches for multitouch trackpads.
Vladimir Kondratyev [Thu, 4 May 2017 23:04:52 +0000 (23:04 +0000)]
Enable palm detection on two finger touches for multitouch trackpads.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agopsm(4): reduce cursor jumping on palm detection
Vladimir Kondratyev [Thu, 4 May 2017 23:02:34 +0000 (23:02 +0000)]
psm(4): reduce cursor jumping on palm detection

This is done with discarding pointer movements rather then mouse packets

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoAdjust Elantech palm width threshold to nearly match synaptics defaults
Vladimir Kondratyev [Thu, 4 May 2017 22:53:45 +0000 (22:53 +0000)]
Adjust Elantech palm width threshold to nearly match synaptics defaults

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoReduce default tap_min_queue size for Elan touchpads
Vladimir Kondratyev [Thu, 4 May 2017 22:51:22 +0000 (22:51 +0000)]
Reduce default tap_min_queue size for Elan touchpads

Elan hw v.4 touchpads often sends touchpad release packet right after
touchpad touch one. Most probably this happens due to PS/2 limited bandwith.
Reducing of tap_min_queue size to 1 makes multifinger tap detection
more reliable in this case.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoFix triple-finger taps reported as double-finger for Elan hw v.4 touchpads
Vladimir Kondratyev [Thu, 4 May 2017 22:47:18 +0000 (22:47 +0000)]
Fix triple-finger taps reported as double-finger for Elan hw v.4 touchpads

Wait for all advertised head packets after status packet have been received.
This fixes rare but quite annoying issue in Elan hw v.4 touchpads support
when triple-finger taps are reported as double-finger taps under several
circumstances.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10266

7 years agoPull in r302183 from upstream llvm trunk (by Krzysztof Parzyszek):
Dimitry Andric [Thu, 4 May 2017 21:40:16 +0000 (21:40 +0000)]
Pull in r302183 from upstream llvm trunk (by Krzysztof Parzyszek):

  [PPC] When restoring R30 (PIC base pointer), mark it as <def>

  This happened on the PPC32/SVR4 path and was discovered when building
  FreeBSD on PPC32. It was a typo-class error in the frame lowering
  code.

  This fixes PR26519.

Reported by: Mark Millard
PR: 206990
MFC after: 3 days

7 years agoProvide introduction for the arch(7) manpage.
Konstantin Belousov [Thu, 4 May 2017 21:31:50 +0000 (21:31 +0000)]
Provide introduction for the arch(7) manpage.

Start with some words about linear address space and its layout, then
explain pointers models and ABIs, providing explanation to the
structure of the tables.

Reviewed by: emaste, imp
'Future-proof' cheri wording by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D10596

7 years agoThe nandsim(4) simulator driver doesn't have any protection against
Gleb Smirnoff [Thu, 4 May 2017 20:42:31 +0000 (20:42 +0000)]
The nandsim(4) simulator driver doesn't have any protection against
races at least in its ioctl handler, and at the same time it creates
device entry with 0666 permissions.

To plug possible issues in it:
- Mark it as needing Giant.
- Switch device mode to 0600.

Submitted by: C Turt
Reviewed by: imp
MFC after: 1 week
Security: Possible double free in ioctl handler

7 years agoRevert r317804; apparently I forgot the auto_master syntax.
Edward Tomasz Napierala [Thu, 4 May 2017 19:55:32 +0000 (19:55 +0000)]
Revert r317804; apparently I forgot the auto_master syntax.

MFC after: 2 weeks

7 years agoMake automount(8) error out when the map name is missing.
Edward Tomasz Napierala [Thu, 4 May 2017 19:41:19 +0000 (19:41 +0000)]
Make automount(8) error out when the map name is missing.

MFC after: 2 weeks

7 years agoEnable automounting of exFAT media.
Edward Tomasz Napierala [Thu, 4 May 2017 19:16:36 +0000 (19:16 +0000)]
Enable automounting of exFAT media.

With fstyp(8) being updated to detect exfat in base r312003, it seems
like a good time to add support for auto-mounting SDXC cards -- which
use exfat by default.

The user will need to locally compile and install sysutils/fusefs-exfat
for this to succeed; logs a message to that effect when not installed.

PR: 218743
Submitted by: eborisch+FreeBSD@gmail.com
MFC after: 2 weeks

7 years agoMerge latest version of blacklist sources from NetBSD (@ 20170503)
Kurt Lidl [Thu, 4 May 2017 19:07:37 +0000 (19:07 +0000)]
Merge latest version of blacklist sources from NetBSD (@ 20170503)

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoFix markup in gettytab(5).
Edward Tomasz Napierala [Thu, 4 May 2017 19:01:17 +0000 (19:01 +0000)]
Fix markup in gettytab(5).

Reviewed by: bapt
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10476

7 years agoAdd support for the no-1-8-v and wp-inverted properties in generic SDHCI
Luiz Otavio O Souza [Thu, 4 May 2017 18:56:11 +0000 (18:56 +0000)]
Add support for the no-1-8-v and wp-inverted properties in generic SDHCI
FDT glue.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoAdd the SCSI Solid State Media Log page (0x11) definition.
Kenneth D. Merry [Thu, 4 May 2017 17:23:39 +0000 (17:23 +0000)]
Add the SCSI Solid State Media Log page (0x11) definition.

sys/cam/scsi/scsi_all.h:
Add the SCSI Solid State Media log page (0x11) structure
definition.  This gives the percentage used (in terms of
lifetime flash wear) of an SSD.

MFC after: 3 days
Sponsored by: Spectra Logic

7 years agobnxt: Add support for new Broadcom 100Gb adapter BCM57454
Sean Bruno [Thu, 4 May 2017 15:26:28 +0000 (15:26 +0000)]
bnxt: Add support for new Broadcom 100Gb adapter BCM57454

Submitted by: bhargava.marreddy@broadcom.com
Reviewed by: venkatkumar.duvvuru@broadcom.com
Differential Revision: https://reviews.freebsd.org/D10595

7 years agoAvoid wrapping of the machine-dependent type sizes table, by removing
Konstantin Belousov [Thu, 4 May 2017 11:57:52 +0000 (11:57 +0000)]
Avoid wrapping of the machine-dependent type sizes table, by removing
non-informational sizeof() expressions.  Add some explanatory and
summary sentences.

Noted by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoAdd support for socket option names related to the level IPPROTO_UDPLITE.
Michael Tuexen [Thu, 4 May 2017 07:44:07 +0000 (07:44 +0000)]
Add support for socket option names related to the level IPPROTO_UDPLITE.

7 years agopcicfg: Fix direct calls of pci_cfg{read,write} on systems w/o PCI host bridge.
Sepherosa Ziehau [Thu, 4 May 2017 05:28:46 +0000 (05:28 +0000)]
pcicfg: Fix direct calls of pci_cfg{read,write} on systems w/o PCI host bridge.

Reported by: dexuan@
Reviewed by: jhb@
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D10564

7 years agozfsboot: drvsize() may be unusable on some systems
Toomas Soome [Thu, 4 May 2017 05:26:37 +0000 (05:26 +0000)]
zfsboot: drvsize() may be unusable on some systems

From user report, the errors are seen:
error 1
error 1
gptzfsboot: error 1 lba 4294967288
gptzfsboot: error 1 lba 1
gptzfsboot: no ZFS pools located, can't boot

The first two errors above are from issuing INT13 EAX=0x4800, meaning we
need to check if EDD is available and use EAX=0x800 if not.

For an workaround I'm using the similar idea as in biosdisk.c - first probe
ah=8h, then check if we have EDD.

Note we would like to see the correct disk size info, but we *may*
get away with anything >64MB, so we could at least test 2 zfs pool labels
on whole disk setup and not to freak out the INT13 interface.

If we get away with initial disk probing, then we have partition sizes from
the partition table and we should be able to complete the disk probing.

Note: this update does not provide full fix to all errors, but we get
the drvsize() errors removed.

Reported by: Michael W. Lucas
Reviewed by: julian
Differential Revision: https://reviews.freebsd.org/D10591

7 years agocache: stop holding the ncneg_hot lock across purging
Mateusz Guzik [Thu, 4 May 2017 03:11:59 +0000 (03:11 +0000)]
cache: stop holding the ncneg_hot lock across purging

Only non-hot entries are purged so the lock is not needed in the first place.
This saves one lock/unlock pair.

MFC after: 1 week

7 years agohyperv/kvp: Fix pool direcrory and file permission
Sepherosa Ziehau [Thu, 4 May 2017 01:46:04 +0000 (01:46 +0000)]
hyperv/kvp: Fix pool direcrory and file permission

PR: 209385
MFC after: 2 weeks
Sponsored by: Microsoft

7 years agoMFV r317781:
Martin Matuska [Thu, 4 May 2017 00:04:17 +0000 (00:04 +0000)]
MFV r317781:
Sync libarchive with vendor

Vendor changes (FreeBSD-related):
  PR 897: add test for ZIP archives with invalid EOCD headers
  PR 901: fix invalid renaming of sparse files
  OSS-Fuzz issue 497: remove fallback tree in LZX decoder
  OSS-Fuzz issue 527: rewrite expressions in lz4 filter
  OSS-Fuzz issue 577: fix integer overflow in cpio reader
  OSS-Fuzz issue 862: fix numerc parsing in mtree reader
  OSS-Fuzz issue 1097: fix undefined shift in rar reader
  cpio: various optimizations and memory leak fixes

MFC after: 1 week

7 years agoUpdate vendor/libarchive to git c253f0aae9ac86a617b4f814137e07757df72391
Martin Matuska [Wed, 3 May 2017 23:55:12 +0000 (23:55 +0000)]
Update vendor/libarchive to git c253f0aae9ac86a617b4f814137e07757df72391

Vendor changes (FreeBSD-related):
  PR 897: test for ZIP archives with invalid EOCD headers
  PR 901: fix invalid renaming of sparse files
  OSS-Fuzz issue 497: remove fallback tree in LZX decoder
  OSS-Fuzz issue 527: rewrite expressions in lz4 filter
  OSS-Fuzz issue 577: fix integer overflow in cpio reader
  OSS-Fuzz issue 862: fix numerc parsing in mtree reader
  OSS-Fuzz issue 1097: fix undefined shift in rar reader
  cpio: various optimizations and memory leak fixes

7 years agoext2fs: add read-write support for Extended Attributes.
Pedro F. Giffuni [Wed, 3 May 2017 22:35:41 +0000 (22:35 +0000)]
ext2fs: add read-write support for Extended Attributes.

Extended attributes and their particular implementation in linux are
different from FreeBSD so in this case we have started diverging from
the  UFS EA implementation, which would be the natural reference.

Depending on future progress implementing ACLs this approach may change
but for now bring to the tree an implementation that is consistent and
can be tested.

Submitted by: Fedor Uporov

Differential Revision: https://reviews.freebsd.org/D10460

7 years agoImprove documentation of fbuf device.
Gleb Smirnoff [Wed, 3 May 2017 21:44:04 +0000 (21:44 +0000)]
Improve documentation of fbuf device.

Submitted by: novel
Reviewed by: grehan, bcr
Differential Revision: https://reviews.freebsd.org/D10014

7 years agoBump the camcontrol(8) man page date.
Kenneth D. Merry [Wed, 3 May 2017 21:04:32 +0000 (21:04 +0000)]
Bump the camcontrol(8) man page date.

MFC after: 3 days
X-MFC-with: r317774
Sponsored by: Spectra Logic

7 years agoFix error recovery behavior in the pass(4) driver.
Kenneth D. Merry [Wed, 3 May 2017 20:59:47 +0000 (20:59 +0000)]
Fix error recovery behavior in the pass(4) driver.

After FreeBSD SVN revision 236814, the pass(4) driver changed from
only doing error recovery when the CAM_PASS_ERR_RECOVER flag was
set on a CCB to sometimes doing error recovery if the passed in
retry count was non-zero.

Error recovery would happen if two conditions were met:

1.  The error recovery action was simply a retry.  (Which is most
    cases.)
2.  The retry_count is non-zero. (Which happened a lot because of
    cut-and-pasted code.)

This explains a bug I noticed in with camcontrol:

# camcontrol tur da34 -v
Unit is ready
# camcontrol reset da34
Reset of 1:172:0 was successful

At this point, there should be a Unit Attention:

# camcontrol tur da34 -v
Unit is ready

No Unit Attention.

Try it again:

# camcontrol reset da34
Reset of 1:172:0 was successful

Now set the retry_count to 0 for the TUR:

# camcontrol tur da34 -v -C 0
Unit is not ready
(pass42:mps1:0:172:0): TEST UNIT READY. CDB: 00 00 00 00 00 00
(pass42:mps1:0:172:0): CAM status: SCSI Status Error
(pass42:mps1:0:172:0): SCSI status: Check Condition
(pass42:mps1:0:172:0): SCSI sense: UNIT ATTENTION asc:29,2 (SCSI bus reset occurred)
(pass42:mps1:0:172:0): Field Replaceable Unit: 2

There is the unit attention. camcontrol(8) has a default
retry_count of 1, in case someone sets the -E flag without
setting -C.

The CAM_PASS_ERR_RECOVER behavior was only broken with the
CAMIOCOMMAND ioctl, which is the synchronous pass(4) API.  It has
worked as intended (error recovery is only done when the flag
is set) in the asynchronous API (CAMIOQUEUE ioctl).

sys/cam/scsi/scsi_pass.c:
In passsendccb(), when calling cam_periph_runccb(), only
specify the error routine when CAM_PASS_ERR_RECOVER is set.

share/man/man4/pass.4:
Document that CAM_PASS_ERR_RECOVER is needed to enable
error recovery.

Reported by: Terry Kennedy <TERRY@glaver.org>
PR: kern/218572
MFC after: 1 week
Sponsored by: Spectra Logic

7 years agoAdd the ability to rescan or reset devices specified by peripheral
Kenneth D. Merry [Wed, 3 May 2017 20:57:52 +0000 (20:57 +0000)]
Add the ability to rescan or reset devices specified by peripheral
name and unit number in camcontrol(8).

Previously camcontrol(8) only supported rescanning or resetting
devices specified by bus:target:lun.  This is because for
rescanning at least, you don't have a peripheral name and unit
number (e.g. da4) for devices that don't exist yet.

That is still the case after this change, but in other cases, when
the device does exist in the CAM EDT (Existing Device Table), we
do a careful lookup of the bus/target/lun if the user supplies a
peripheral name and unit number to find the bus:target:lun and then
issue the requested reset or rescan.

The lookup is done without actually opening the device in question,
since a rescan is often done to make a device go away after it has
been pulled.  (This is especially true for busses/controllers, like
parallel SCSI controllers, that don't automatically detect changes
in topology.)  Opening a device that is no longer there to
determine the bus/target/lun might result in error recovery actions
when the user really just wanted to make the device go away.

sbin/camcontrol/camcontrol.c:
In dorescan_or_reset(), if the use hasn't specified a
numeric argument, assume he has specified a device.  Lookup
the pass(4) instance for that device using the transport
layer CAMGETPASSTHRU ioctl.  If that is successful, we can
use the returned bus:target:lun to rescan or reset the
device.

Under the hood, resetting a device using XPT_RESET_DEV is
actually sent via the pass(4) device anyway.  But this
provides a way for the user to specify devices in a more
convenient way, and can work on device rescans when the
device is going away, assuming it still exists in the EDT.

sbin/camcontrol/camcontrol.8:
Update the man page for the rescan and reset subcommands
to reflect that you can now use a device name and unit
number with them.

Sponsored by: Spectra Logic
MFC after: 3 days

7 years agopf: Fix panic on unload
Kristof Provost [Wed, 3 May 2017 20:56:54 +0000 (20:56 +0000)]
pf: Fix panic on unload

vnet_pf_uninit() is called through vnet_deregister_sysuninit() and
linker_file_unload() when the pf module is unloaded. This is executed
after pf_unload() so we end up trying to take locks which have been
destroyed already.

Move pf_unload() to a separate SYSUNINIT() to ensure it's called after
all the vnet_pf_uninit() calls.

Differential Revision: https://reviews.freebsd.org/D10025

7 years agoAdd myself (wulf) as a src committer with gonzo and bapt as my mentors.
Vladimir Kondratyev [Wed, 3 May 2017 20:56:34 +0000 (20:56 +0000)]
Add myself (wulf) as a src committer with gonzo and bapt as my mentors.

Approved by: gonzo (mentor)

7 years agoFlush stdout before yes/no confirmations, to force question
Poul-Henning Kamp [Wed, 3 May 2017 20:41:26 +0000 (20:41 +0000)]
Flush stdout before yes/no confirmations, to force question
through pipes/tee(1)/whatever

7 years agoFix memory leaks in camcontrol
Alan Somers [Wed, 3 May 2017 19:56:55 +0000 (19:56 +0000)]
Fix memory leaks in camcontrol

Reported by: Coverity
CID: 13316741331675
Reviewed by: ken
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D10588

7 years agoUnbreak ifconfig for mlx4en(4) after r317755
Alan Somers [Wed, 3 May 2017 19:53:01 +0000 (19:53 +0000)]
Unbreak ifconfig for mlx4en(4) after r317755

ifconfig doesn't correctly infer mlx interfaces' module names, so it will
attempt to load the mlx(4) module even when not necessary.

Reported by: rstone
MFC after: 3 weeks
X-MFC-With: 317755
Sponsored by: Spectra Logic Corp

7 years agocpuset.2: Document new API options
Conrad Meyer [Wed, 3 May 2017 18:46:33 +0000 (18:46 +0000)]
cpuset.2: Document new API options

A follow-up to r317756.  Adrian will chase up the userspace cpuset(1)
additions.

Reported by: kib@
Sponsored by: Dell EMC Isilon

7 years agoExtend cpuset_get/setaffinity() APIs
Conrad Meyer [Wed, 3 May 2017 18:41:08 +0000 (18:41 +0000)]
Extend cpuset_get/setaffinity() APIs

Add IRQ placement-only and ithread-only API variants. intr_event_bind
has been extended with sibling methods, as it has many more callsites in
existing code.

Reviewed by: kib@, adrian@ (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D10586

7 years agoVarious Coverity fixes in ifconfig(8)
Alan Somers [Wed, 3 May 2017 17:21:01 +0000 (17:21 +0000)]
Various Coverity fixes in ifconfig(8)

* Exit early if kldload(2) fails (1011259). This is the only change that
  affects ifconfig's behavior.
* Close memory and resource leaks (130562413052051007100)
* Mark usage() as _Noreturn (13058061305750)
* Fix some dereference after null checks (1011474, 270774)

Reported by: Coverity
CID: 130562413052051007100130580613057501011474,
CID: 270774, 1011259
Reviewed by: cem
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D10587

7 years agoReplace 'riscv' with the RISC-V targets 'riscv64' and 'riscv64sf'.
John Baldwin [Wed, 3 May 2017 16:55:02 +0000 (16:55 +0000)]
Replace 'riscv' with the RISC-V targets 'riscv64' and 'riscv64sf'.

7 years agoglob: Fix an overlong line
Conrad Meyer [Wed, 3 May 2017 16:34:22 +0000 (16:34 +0000)]
glob: Fix an overlong line

Trivial style(9) fix, no functional change.  There are also some 81
characters lines below, but I don't see a good way to shorten them.

Sponsored by: Dell EMC Isilon

7 years agoFix typo in r317659.
Alexander Motin [Wed, 3 May 2017 16:34:03 +0000 (16:34 +0000)]
Fix typo in r317659.

MFC after: 2 weeks

7 years agoPull in r301983 from upstream llvm trunk (by Tim Northover):
Dimitry Andric [Wed, 3 May 2017 16:12:43 +0000 (16:12 +0000)]
Pull in r301983 from upstream llvm trunk (by Tim Northover):

  ARM: avoid handing a deleted node back to TableGen during ISel.

  When we replaced the multiplicand the destination node might already
  exist. When that happens the original gets CSEd and deleted. However,
  it's actually used as the offset so nonsense is produced.

  Should fix PR32726.

This fixes an assertion failure when building building www/firefox 53.0
for arm.

Reported by: Bob Prohaska
PR: 218782
MFC after: 3 days

7 years agoAdd support for sctp_generic_sendmsg() and sctp_generic_recvmsg().
Michael Tuexen [Wed, 3 May 2017 16:03:33 +0000 (16:03 +0000)]
Add support for sctp_generic_sendmsg() and sctp_generic_recvmsg().

7 years agolibc glob: Avoid pathological exponential behavior
Conrad Meyer [Wed, 3 May 2017 15:55:29 +0000 (15:55 +0000)]
libc glob: Avoid pathological exponential behavior

Adapt glob's match() routine to use a greedy algorithm that avoids
exponential runtime in byzantine inputs.

While here, add a testcase for the byzantine input.

Prompted by: https://research.swtch.com/glob
Authored by: Yves Orton <demerphq at gmail.com>
Obtained from: Perl (33252c318625f3c6c89b816ee88481940e3e6f95)
Sponsored by: Dell EMC Isilon

7 years agoAdd support for socket option names related to the IPPROTO_IPV6 level.
Michael Tuexen [Wed, 3 May 2017 15:20:40 +0000 (15:20 +0000)]
Add support for socket option names related to the IPPROTO_IPV6 level.

7 years agoAdd support for socket option names related to the IPPROTO_SCTP level.
Michael Tuexen [Wed, 3 May 2017 15:03:00 +0000 (15:03 +0000)]
Add support for socket option names related to the IPPROTO_SCTP level.

7 years agomakefs: clean up warnings
Ed Maste [Wed, 3 May 2017 14:57:04 +0000 (14:57 +0000)]
makefs: clean up warnings

- make functions and variables static where appropriate
- use const char * where appropriate
- remove unused variables

Sponsored by: The FreeBSD Foundation

7 years agoDon't bother retrying errors for encrypted drives that are locked.
Kenneth D. Merry [Wed, 3 May 2017 14:53:27 +0000 (14:53 +0000)]
Don't bother retrying errors for encrypted drives that are locked.

sys/cam/scsi/scsi_all.c:
In the asc_table, if we get a 0x20,0x02 error ("Access denied -
no access rights"), don't bother retrying.  Instead, immediately
fail the command.

This is the error returned by Self Encrypting Drives (SED) when
they are locked.

MFC after: 3 days
Sponsored by: Spectra Logic

7 years agomakefs: make buf generic
Ed Maste [Wed, 3 May 2017 14:21:18 +0000 (14:21 +0000)]
makefs: make buf generic

it has nothing to do with ffs and will eventually be moved.
gc sectorsize.

NetBSD versions:
ffs.c 1.58
ffs/buf.c 1.14 1.18
ffs/buf.h 1.8

Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation

7 years agoUse nitems() from sys/param.h.
Marcelo Araujo [Wed, 3 May 2017 14:03:46 +0000 (14:03 +0000)]
Use nitems() from sys/param.h.

Reviewed by: ngie
MFC after: 2 weeks.
Differential Revision: https://reviews.freebsd.org/D9942

7 years agoFree the memory allocated to trackbuf before exiting, it might fix a potential
Marcelo Araujo [Wed, 3 May 2017 13:57:31 +0000 (13:57 +0000)]
Free the memory allocated to trackbuf before exiting, it might fix a potential
memory leak.

Submitted by: trix@juniper.net
MFC after: 2 weeks.
Differential Revision: https://reviews.freebsd.org/D9856

7 years agobsdgrep: correct uninitialized variable introduced in r317703
Ed Maste [Wed, 3 May 2017 13:47:02 +0000 (13:47 +0000)]
bsdgrep: correct uninitialized variable introduced in r317703

CID: 1374747
Submitted by: Kyle Evans <kevans91@ksu.edu>

7 years agoCorrect loop mode CRN resets to adhere to FCP-4 section 4.10
Kenneth D. Merry [Wed, 3 May 2017 13:17:01 +0000 (13:17 +0000)]
Correct loop mode CRN resets to adhere to FCP-4 section 4.10

Prior to this change, the CRN (Command Reference Number) is reset on any
firmware LIP, LOOP DOWN, or LOOP RESET event in violation of FCP-4 which
specifies that the CRN should only be reset in response to a LIP Reset
(LIPyx) primitive. FCP-4 also indicates PLOGI/LOGO and PRLI/PRLO ELS
actions as conditions for resetting the CRN for the associated initiator
port.

These violations manifest themselves when the HBA is removed from the
loop, or a target device is removed (especially during an outstanding
command) without power cycling. If the HBA and and the target device
determine upon re-establishing the loop that no PLOGI or PRLI is
required, and the target does not issue a LIPxy to the initiator, the
CRN for the target will have been improperly reset by the isp driver. As
a result, the target port will silently ignore all FCP commands issued
during the device probe (which will time out) preventing the device from
attaching.

This change corrects thie CRN reset behavior in response to loop state
changes, also introduces CRN resets for the above mentioned ELS actions
as encountered through async PDB change events.

This change also adds cleanup of outstanding commands in isp_loop_dead()
that was previously missing.

sys/dev/isp/isp.c
Add the last login state to debug output when syncing the pdb

sys/dev/isp/isp_freebsd.c
Replace binary statement setting aborted ccb status in
isp_watchdog() with the XS_SETERR macro used elsewhere

In isp_loop_dead(), abort or complete pending commands as done
in isp_watchdog()

In isp_async(), segregate the ISPASYNC_LOOP_RESET action from
ISPASYNC_LIP, ISPASYNC_LOOP_DOWN, and ISPASYNC_LOOP_UP
fallthroughs, and only reset the CRN in the RESET case. Also add
checks to handle false LOOP RESET actions that do not have a
proper associated LIP primitive, and log the primitive in the
debug messages

In isp_async(), remove the goto from ISP_ASYNC_DEV_STAYED, and
only reset the CRN in the DEV_CHANGED action

In isp_async(), when processing an ISPASYNC_CHANGE_PDB status,
reset CRN(s) for the associated nphdl (or all ports) if the
change reason is some form of ELS login/logout. Also remove
assignment to fc since it is not used in the scope

sys/dev/isp/ispmbox.h
Add macro definition for the global N-Port handle, and correct a
macro typo 'PDB24XX_AE_PRLI_DONJE'

sys/dev/isp/ispvar.h
Add macros FCP_AL_DA_ALL, FCP_AL_PA, and FCP_IS_DEST_ALPD for
more legible code when determining if an AL_PD port matches the
portid for a given struct fcparam* by value or by virtue of the
AL_PD port being 0xFF

Submitted by: Reid Linnemann
Sponsored by: Spectra Logic
MFC after: 1 week

7 years agoAdd support for sendmsg() and recvmsg().
Michael Tuexen [Wed, 3 May 2017 12:26:16 +0000 (12:26 +0000)]
Add support for sendmsg() and recvmsg().

7 years agoPrint all virtual addresses in the show vtop ddb command. The results may
Andrew Turner [Wed, 3 May 2017 12:24:31 +0000 (12:24 +0000)]
Print all virtual addresses in the show vtop ddb command. The results may
be different with PAN enabled.

MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoDecode the fourth argument of sendto and recvfrom call.
Michael Tuexen [Wed, 3 May 2017 12:23:58 +0000 (12:23 +0000)]
Decode the fourth argument of sendto and recvfrom call.

7 years agoAdd support for [gs]etsockopt().
Michael Tuexen [Wed, 3 May 2017 12:18:09 +0000 (12:18 +0000)]
Add support for [gs]etsockopt().

7 years agoDecode the third argument of socket().
Michael Tuexen [Wed, 3 May 2017 09:23:13 +0000 (09:23 +0000)]
Decode the third argument of socket().

7 years agoAdd Socklent for handling args of type socklen_t.
Michael Tuexen [Wed, 3 May 2017 09:20:36 +0000 (09:20 +0000)]
Add Socklent for handling args of type socklen_t.