]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoDo not leak empty swblk.
kib [Wed, 6 Sep 2017 16:18:53 +0000 (16:18 +0000)]
Do not leak empty swblk.

In swp_pager_meta_build(), if the requested operation results in
freeing the last swap pointer in the swblk, free the trie node.  Other
swap pager code does not expect to find completely empty swblk.

Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoReflect realtime and idle priorities in ps(1) state flags, same like
trasz [Wed, 6 Sep 2017 16:18:06 +0000 (16:18 +0000)]
Reflect realtime and idle priorities in ps(1) state flags, same like
we do for the usual nice values.  It could be argued that they should
use another set of indicators, since the underlying mechanism is
different, but they match the description in the manual page, and so
I think it's ok to not overcomplicate things.

PR: 81757
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoIn swp_pager_meta_build(), handle a race with other thread allocating
kib [Wed, 6 Sep 2017 16:16:11 +0000 (16:16 +0000)]
In swp_pager_meta_build(), handle a race with other thread allocating
swapblk for our index while we dropped the object lock.

Noted by: jeff
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoAdd myself and mentorship status to committers files
shurd [Wed, 6 Sep 2017 15:07:53 +0000 (15:07 +0000)]
Add myself and mentorship status to committers files

I failed to do this when I got my ports bit, so do them both in one commit.

Reviewed by: sbruno (mentor)
Differential Revision: https://reviews.freebsd.org/D12226

6 years agoMake LACP based lagg work with interfaces (like 100Gbps and 25Gbps) that
np [Wed, 6 Sep 2017 14:36:35 +0000 (14:36 +0000)]
Make LACP based lagg work with interfaces (like 100Gbps and 25Gbps) that
report extended media types.

lacp_aggregator_bandwidth() uses the media to determine the speed of the
interface and returns 0 for IFM_OTHER without the bits in the extended
range.

Reported by: kbowling@
Reviewed by: eugen_grosbein.net, mjoras@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D12188

6 years agoAdd new USB quirk.
hselasky [Wed, 6 Sep 2017 13:59:57 +0000 (13:59 +0000)]
Add new USB quirk.

PR: 221775
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd support for generic backpressure indicator for ratelimited
hselasky [Wed, 6 Sep 2017 13:56:18 +0000 (13:56 +0000)]
Add support for generic backpressure indicator for ratelimited
transmit queues aswell as non-ratelimited ones.

Add the required structure bits in order to support a backpressure
indication with ratelimited connections aswell as non-ratelimited
ones. The backpressure indicator is a value between zero and 65535
inclusivly, indicating if the destination transmit queue is empty or
full respectivly. Applications can use this value as a decision point
for when to stop transmitting data to avoid endless ENOBUFS error
codes upon transmitting an mbuf. This indicator is also useful to
reduce the latency for ratelimited queues.

Reviewed by: gallatin, kib, gnn
Differential Revision: https://reviews.freebsd.org/D11518
Sponsored by: Mellanox Technologies

6 years agoFix typos. Stop claiming that two children are created.
kib [Wed, 6 Sep 2017 11:47:59 +0000 (11:47 +0000)]
Fix typos.  Stop claiming that two children are created.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoCheckpoint the next phase in debug message cleanup, this time focusing on
scottl [Wed, 6 Sep 2017 09:19:54 +0000 (09:19 +0000)]
Checkpoint the next phase in debug message cleanup, this time focusing on
error recovery messages.

Sponsored by: Netflix

6 years agoEnable dtrace support for mips64 and the ERL kernel config
lidl [Wed, 6 Sep 2017 03:19:52 +0000 (03:19 +0000)]
Enable dtrace support for mips64 and the ERL kernel config

Turn on the required options in the ERL config file, and ensure
that the fbt module is listed as a dependency for mips in
the modules/dtrace/dtraceall/dtraceall.c file.

PR:  220346
Reviewed by: gnn, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12227

6 years agoMakefile.inc1: bump elf tool chain version check after PR 215350 fix
rlibby [Wed, 6 Sep 2017 01:55:40 +0000 (01:55 +0000)]
Makefile.inc1: bump elf tool chain version check after PR 215350 fix

This causes builds to use the in-tree libdwarf with the bug fix instead
of the host library.

Reviewed by: bdrewery, emaste, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12239

6 years agoBugfix: Don't treat NANO_IMAGES as a direcotory.
n_hibma [Tue, 5 Sep 2017 21:17:20 +0000 (21:17 +0000)]
Bugfix: Don't treat NANO_IMAGES as a direcotory.

This was probably accidentally broken in r295377 .

Submitted by: Igor Serikov
MFC after: 2 weeks

6 years agoamdsmn(4): Do not probe not matching hostbridges
cem [Tue, 5 Sep 2017 21:00:33 +0000 (21:00 +0000)]
amdsmn(4): Do not probe not matching hostbridges

Similar to r323195, but for amdsmn(4) driver (which borrowed some design).

Ignore hostbs that do not match our PCI device id criteria.

Sponsored by: Dell EMC Isilon

6 years agoamdtemp(4): Do not probe not matching hostbridges
cem [Tue, 5 Sep 2017 20:35:25 +0000 (20:35 +0000)]
amdtemp(4): Do not probe not matching hostbridges

Some systems have hostbs that do not match our PCI device id criteria.
Detect and ignore these devices in probe.

PR: 218264
Sponsored by: Dell EMC Isilon

6 years agoFix remounting ZFS filesystem with "zfs mount"
asomers [Tue, 5 Sep 2017 19:40:04 +0000 (19:40 +0000)]
Fix remounting ZFS filesystem with "zfs mount"

"zfs mount -o" passes a list of mount options directly to nmount(2) after
sanity checking them. In particular, zfs(8) will refuse to mount an already
existing file system unless "remount" is specified in the option list.
However, the "remount" option only exists in Illumos. FreeBSD's equivalent is
"update".

PR: 221985
Reviewed by: avg
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12233

6 years agoHonor all options of "zfs mount -o"
asomers [Tue, 5 Sep 2017 19:28:35 +0000 (19:28 +0000)]
Honor all options of "zfs mount -o"

The existing code in zmount incorrectly parses the comma-delimited option
string. The result is that nmount only honors the last option. AFAICT the
parsing has been broken ever since ZFS's initial import in change 168404.

PR: 222078
Reviewed by: avg
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12232

6 years agognu binutils: FSGSBASE assembly/disassembly
rlibby [Tue, 5 Sep 2017 19:04:07 +0000 (19:04 +0000)]
gnu binutils: FSGSBASE assembly/disassembly

Enable the in-tree binutils to assemble and disassemble amd64 FSGSBASE
instructions (rdfsbase, rdgsbase, wrfsbase, wrgsbase), used in the base
system since r322763.

This gives one last gasp for in-tree gcc, and provides a small
enhancement for in-tree binutils objdump.

Reviewed by: dim, kib
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12222

6 years agoamdtemp(4): Add support for Family 17h temperature sensor
cem [Tue, 5 Sep 2017 15:19:14 +0000 (15:19 +0000)]
amdtemp(4): Add support for Family 17h temperature sensor

The sensor value is formatted similarly to previous models (same
bitfield sizes, same units), but must be read off of the internal
System Management Network (SMN) from the System Management Unit (SMU)
co-processor.

PR: 218264
Reported and tested by: Nils Beyer <nbe AT renzel.net>
Reviewed by: avg (no +1), mjoras, truckman
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12217

6 years agoAdd smn(4) driver for AMD System Management Network
cem [Tue, 5 Sep 2017 15:13:41 +0000 (15:13 +0000)]
Add smn(4) driver for AMD System Management Network

AMD Family 17h CPUs have an internal network used to communicate between
the host CPU and the PSP and SMU coprocessors.  It exposes a simple
32-bit register space.

Reviewed by: avg (no +1), mjoras, truckman
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12217

6 years agoMake root_mount_rel(9) ignore NULL arguments, like it used to before r313351.
trasz [Tue, 5 Sep 2017 14:32:56 +0000 (14:32 +0000)]
Make root_mount_rel(9) ignore NULL arguments, like it used to before r313351.
It would be better to fix API consumers to not pass NULL there - most of them,
such as gmirror, already contain the neccessary checks - but this is easier
and much less error-prone.

One known user-visible result is that it fixes panic on a failed "graid label".

PR: 221846
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agomake-memstick.sh: use 'set -e' to abort if any step fails
emaste [Tue, 5 Sep 2017 12:57:45 +0000 (12:57 +0000)]
make-memstick.sh: use 'set -e' to abort if any step fails

Also remove the now-redundant error handling that was only for makefs.

This change applies arm64's r308171 to the other make-memstick.sh
versions.

Reviewed by: gjb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12195

6 years agoMerge pipes and socket pairs.
ed [Tue, 5 Sep 2017 07:46:45 +0000 (07:46 +0000)]
Merge pipes and socket pairs.

Now that CloudABI's sockets API has been changed to be addressless and
only connected socket instances are used (e.g., socket pairs), they have
become fairly similar to pipes. The only differences on CloudABI is that
socket pairs additionally support shutdown(), send() and recv().

To simplify the ABI, we've therefore decided to remove pipes as a
separate file descriptor type and just let pipe() return a socket pair
of type SOCK_STREAM. S_ISFIFO() and S_ISSOCK() are now defined
identically.

6 years agohyperv/hn: Log RSS capabilities mask.
sephe [Tue, 5 Sep 2017 06:20:02 +0000 (06:20 +0000)]
hyperv/hn: Log RSS capabilities mask.

This helps to detect when UDP hash types can be supported.

MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D12177

6 years agohyperv/hn: Implement SIOCGIFRSS{KEY,HASH}.
sephe [Tue, 5 Sep 2017 06:05:48 +0000 (06:05 +0000)]
hyperv/hn: Implement SIOCGIFRSS{KEY,HASH}.

The conditional compiling in the review request is removed, since
these IOCTLs will be available in stable/10 and stable/11.

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

6 years agoFix loader bug causing too many pages allocation when bootloader is U-Boot
mw [Tue, 5 Sep 2017 05:53:43 +0000 (05:53 +0000)]
Fix loader bug causing too many pages allocation when bootloader is U-Boot

FreeBSD loader expects to have mmsz variable set by bootloader.
U-Boot behaviour is that if buffer size is not big enough to keep
whole memory map, assign the smallest correct buffer size to sz
and return error.

In other words U-Boot assumes that nobody will need mmsz value when buffer
is not filled with memory map, which is not true, so calculated pages value
was too big to allocate.

Solution: Simply assign default value to mmsz.

Submitted by: Patryk Duda <pdk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12194

6 years agoAdd Marvell RTC driver to arm64 GENERIC config
mw [Tue, 5 Sep 2017 05:50:01 +0000 (05:50 +0000)]
Add Marvell RTC driver to arm64 GENERIC config

Marvell Armada 80x0/70x0 SoC family uses same RTC IP as
Armada 38x. This patch adds necessary files and enable driver in
GENERIC config.

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12200

6 years agoAdd Armada 80x0/70x0 compatible to 38x RTC driver
mw [Tue, 5 Sep 2017 05:45:57 +0000 (05:45 +0000)]
Add Armada 80x0/70x0 compatible to 38x RTC driver

Marvell Armada 80x0/70x0 SoC family uses same RTC IP as Armada 38x.
This patch adds Armada 8k compatible to Marvell RTC driver.

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12186

6 years agoChange name of Marvell Armada38x RTC driver
mw [Tue, 5 Sep 2017 05:42:37 +0000 (05:42 +0000)]
Change name of Marvell Armada38x RTC driver

Two modules with the same name cannot be loaded, so Marvell specific drivers
cannot have the same name as generic drivers.
Files with the same name, even in different folder overlaps their .o files.
Change armada38x/rtc.c to armada38x/armada38x_rtc.c fix it.
Preparation for adding this driver to GENERIC config for ARMv7
Marvell platforms.

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12185

6 years agoif: Add ioctls to get RSS key and hash type/function.
sephe [Tue, 5 Sep 2017 05:28:52 +0000 (05:28 +0000)]
if: Add ioctls to get RSS key and hash type/function.

It will be needed by hn(4) to configure its RSS key and hash
type/function in the transparent VF mode in order to match VF's
RSS settings. The description of the transparent VF mode and
the RSS hash value issue are here:
https://svnweb.freebsd.org/base?view=revision&revision=322299
https://svnweb.freebsd.org/base?view=revision&revision=322485

These are generic enough to promise two independent IOCs instead
of abusing SIOCGDRVSPEC.

Setting RSS key and hash type/function is a different story,
which probably requires more discussion.

Comment about UDP_{IPV4,IPV6,IPV6_EX} were only in the patch
in the review request; these hash types are standardized now.

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

6 years agoUse O_CLOEXEC when opening persistent handles in libdtrace.
markj [Tue, 5 Sep 2017 00:11:06 +0000 (00:11 +0000)]
Use O_CLOEXEC when opening persistent handles in libdtrace.

PR: 199810
Submitted by: jau@iki.fi
MFC after: 1 week

6 years agomkisoimages.sh: remove obsolete x$var convention
emaste [Mon, 4 Sep 2017 22:37:28 +0000 (22:37 +0000)]
mkisoimages.sh: remove obsolete x$var convention

Ancient shells had trouble with empty variables but this has not been
relevant for FreeBSD for a very long time (decades?).

6 years agoCorrect the binmiscctl(8) man page for powerpc64
jhibbits [Mon, 4 Sep 2017 20:57:38 +0000 (20:57 +0000)]
Correct the binmiscctl(8) man page for powerpc64

Magic for powerpc64 erroneously specified ELFCLASS32 instead of ELFCLASS64.

Submitted by: luca.pizzamiglio _AT_ gmail DOT com
MFC after: 3 days

6 years agoUpdate pci_vendors to 2017-09-01
bapt [Mon, 4 Sep 2017 20:41:34 +0000 (20:41 +0000)]
Update pci_vendors to 2017-09-01

MFC after: 2 days

6 years agoThe new fsck recovery information to enable it to find backup
mckusick [Mon, 4 Sep 2017 20:19:36 +0000 (20:19 +0000)]
The new fsck recovery information to enable it to find backup
superblocks created in revision 322297 only works on disks
with sector sizes up to 4K. This update allows the recovery
information to be created by newfs and used by fsck on disks
with sector sizes up to 64K. Note that FFS currently limits
filesystem to be mounted from disks with up to 8K sectors.
Expanding this limitation will be the subject of another
commit.

Reported by: Peter Holm
Reviewed with: kib

6 years agoFix whitespace on "options" to be <space><tab>, no functional change
lidl [Mon, 4 Sep 2017 20:10:34 +0000 (20:10 +0000)]
Fix whitespace on "options" to be <space><tab>, no functional change

6 years agolibefivar: -fno-strict-aliasing
rlibby [Mon, 4 Sep 2017 18:59:44 +0000 (18:59 +0000)]
libefivar: -fno-strict-aliasing

Avoid dealing with some code that uses type-punned pointers.

See D12210 and D12211 for more background.

Reviewed by: imp
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12219

6 years agoacpi/srat: zero the SRAT cpu array
royger [Mon, 4 Sep 2017 10:08:42 +0000 (10:08 +0000)]
acpi/srat: zero the SRAT cpu array

Fix from fallout introduced in r322348 that moved the cpus array to a
dynamic allocation without zeroing the area.

Reported by: mjg
MFC with: r322348
Reviewed by: mjg
Differential revision: https://reviews.freebsd.org/D12220

6 years agoDecode pathconf() names, *at() flags, and sysarch() numbers in libsysdecode.
jhb [Mon, 4 Sep 2017 05:34:36 +0000 (05:34 +0000)]
Decode pathconf() names, *at() flags, and sysarch() numbers in libsysdecode.

Move tables that were previously in truss over to libsysdecode.  truss
output is unchanged, but kdump has been updated to decode these fields.
In addition, sysdecode_sysarch_number() should support all platforms
whereas the old table in truss only supported x86.

6 years agoDisable the ARM generic timers before interrupts are enabled. Some
andrew [Sun, 3 Sep 2017 09:41:40 +0000 (09:41 +0000)]
Disable the ARM generic timers before interrupts are enabled. Some
Raspberry Pi firmware images leave them enabled causing an interrupt storm.

Sponsored by: ABT Systems Ltd

6 years agoAdd ARM Cortex A72 to CPU list
mw [Sun, 3 Sep 2017 08:32:33 +0000 (08:32 +0000)]
Add ARM Cortex A72 to CPU list

This change is required to properly detect CPUs
on Marvell Armada 80x0/70x0 SoC family.

Submitted by: Rafal Kozik <rk@semihalf.com>
Reviewed by: andrew, cognet (mentor)
Approved by: cognet (mentor)
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12184

6 years agoSpelling.
grog [Sat, 2 Sep 2017 23:17:35 +0000 (23:17 +0000)]
Spelling.

6 years agoChange leading spaces to tabs, no functional change.
ian [Sat, 2 Sep 2017 19:22:16 +0000 (19:22 +0000)]
Change leading spaces to tabs, no functional change.

6 years agoThe latest RPi firmware leaves secondary cores in a wait-for-event (WFE)
ian [Sat, 2 Sep 2017 19:20:11 +0000 (19:20 +0000)]
The latest RPi firmware leaves secondary cores in a wait-for-event (WFE)
state to save power, so after writing the entry point address for a core to
the mailbox, use a dsb() to synchronize the execution pipeline to the data
written, then use an sev() to wake up the core.

Submitted by: Sylvain Garrigues <sylgar@gmail.com>

6 years agoRevert r322941: Eliminate redundant device matching functions
imp [Sat, 2 Sep 2017 18:18:49 +0000 (18:18 +0000)]
Revert r322941: Eliminate redundant device matching functions

Turns out, they are subtly different. I'll refactor anew in the future
if it's worth it then.

Sponsored by: Netflix
Reported by: Tomoaki AOKI-san

6 years agoIncrease negotiation polling period from 10ms to 100ms.
mav [Sat, 2 Sep 2017 13:28:45 +0000 (13:28 +0000)]
Increase negotiation polling period from 10ms to 100ms.

There is no big need to burn CPU if other side may be not there yet.  For
example, the PLX hardware by default enables the NTB link up on reset, not
dependig on driver to do it.  In case of Intel hardware this also reduces
race between MSI-X workaround negotiation and upper layers, using the same
scratchpad registers in different time.

MFC after: 12 days

6 years agoSome NTB man pages polishing.
mav [Sat, 2 Sep 2017 11:57:08 +0000 (11:57 +0000)]
Some NTB man pages polishing.

MFC after: 12 days

6 years agoMake NTB drivers report more info via NewBus methods.
mav [Sat, 2 Sep 2017 11:56:16 +0000 (11:56 +0000)]
Make NTB drivers report more info via NewBus methods.

MFC after: 12 days

6 years agoThe hard drive media device path contains the size of the partition,
imp [Sat, 2 Sep 2017 07:04:06 +0000 (07:04 +0000)]
The hard drive media device path contains the size of the partition,
not its end. This makes the GEOM efimedia attribute match the
FreeBSD:Boot1Device environment variable now.

Sponsored by: Netflix

6 years agotail(1): Do not print bogus errno string
cem [Fri, 1 Sep 2017 22:37:49 +0000 (22:37 +0000)]
tail(1): Do not print bogus errno string

In the case where write(2) does not return -1, it does not initialize errno.
This can happen when a broken pipe causes a short write.

I attempted to adapt the submitted test case to ATF but could not figure out
how to make the test run in the ATF environment.  So the aborted test is
left disabled, in case someone would like to run it manually or fix it.

PR: 221976
Submitted by: <martin AT lispworks.com> (earlier version)
Sponsored by: Dell EMC Isilon

6 years agoFix mdoc typo in auto_master.5
bjk [Fri, 1 Sep 2017 22:04:45 +0000 (22:04 +0000)]
Fix mdoc typo in auto_master.5

There needs to be a space after the no-space macro in order for it
to be interpreted.

PR: 221986
Submitted by: Paul Townsend <pt@zendware.com>

6 years agoSync NTB options between amd64 and i386.
mav [Fri, 1 Sep 2017 19:15:53 +0000 (19:15 +0000)]
Sync NTB options between amd64 and i386.

Somehow they happen to become different.

MFC after: 13 days

6 years agoUpgrade our copies of clang, llvm, lldb and compiler-rt to r312293 from
dim [Fri, 1 Sep 2017 18:53:36 +0000 (18:53 +0000)]
Upgrade our copies of clang, llvm, lldb and compiler-rt to r312293 from
the upstream release_50 branch.  This corresponds to 5.0.0 rc4.

As of this version, the cad/stepcode port should now compile in a more
reasonable time on i386 (see bug 221836 for more information).

PR: 221836
MFC after: 2 months
X-MFC-with: r321369

6 years agoAdd efimedia attribute for all GPT partitions.
imp [Fri, 1 Sep 2017 17:55:25 +0000 (17:55 +0000)]
Add efimedia attribute for all GPT partitions.

Sposnored by: Netflix
Differential Revision: https://reviews.freebsd.org/D12206

6 years agoRevert r323087
jpaetzel [Fri, 1 Sep 2017 17:03:48 +0000 (17:03 +0000)]
Revert r323087

This needs more thinking out and consensus, and the commit message
was wrong AND there was a typo in the commit.

pointyhat: jpaetzel

6 years agoAdd serial comma.
kib [Fri, 1 Sep 2017 16:56:37 +0000 (16:56 +0000)]
Add serial comma.

Submitted by: wblock
MFC after: 3 days

6 years agolibstand: nfs_readlink() should return proper return code
tsoome [Fri, 1 Sep 2017 16:40:12 +0000 (16:40 +0000)]
libstand: nfs_readlink() should return proper return code

The nfs_readlink() is returning constant 0 instead of variable.

Reviewed by: avg
Differential Revision: https://reviews.freebsd.org/D12201

6 years agoTake options IPSEC out of GENERIC
jpaetzel [Fri, 1 Sep 2017 15:54:53 +0000 (15:54 +0000)]
Take options IPSEC out of GENERIC

PR: 220170
Submitted by: delphij
Reviewed by: ae, glebius
MFC after: 2 weeks
Differential Revision: D11806

6 years agoFix possible double releasing for SA reference.
ae [Fri, 1 Sep 2017 11:51:07 +0000 (11:51 +0000)]
Fix possible double releasing for SA reference.

This is missing part of r318734. When crypto subsystem returns error
the xform code handles an error independently.

PR: 221849
MFC after: 5 days

6 years agoLink Interface has no Link Error registers.
mav [Fri, 1 Sep 2017 09:48:19 +0000 (09:48 +0000)]
Link Interface has no Link Error registers.

MFC after: 13 days

6 years agocxgbe/iw_cxgbe: Set TCP_NODELAY before initiating connection so that
np [Fri, 1 Sep 2017 01:34:12 +0000 (01:34 +0000)]
cxgbe/iw_cxgbe: Set TCP_NODELAY before initiating connection so that
t4_tom picks it up right away.  This is less work than waiting for
the connection to be established before applying the setting.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agocxgbe/t4_tom: There may not be a tid to update if the connection isn't
np [Thu, 31 Aug 2017 23:34:08 +0000 (23:34 +0000)]
cxgbe/t4_tom: There may not be a tid to update if the connection isn't
established.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoDo not abuse flag that is clearly marked as unused.
glebius [Thu, 31 Aug 2017 23:19:18 +0000 (23:19 +0000)]
Do not abuse flag that is clearly marked as unused.
This creates conflicts with FreeBSD variations that may use it.  The
usage of the flag M_TOOBIG is limited to iflib queue, thus using
one of M_PROTO flags is fine.  There is no need to grab global flag.

Silence from: kmacy, sbruno (2 weeks)

6 years agoMerge ACPICA 20170831.
jkim [Thu, 31 Aug 2017 22:47:04 +0000 (22:47 +0000)]
Merge ACPICA 20170831.

6 years agoClear doorbell bits after masking them before processing.
mav [Thu, 31 Aug 2017 21:37:22 +0000 (21:37 +0000)]
Clear doorbell bits after masking them before processing.

In theory this allows to avoid one more expensive doorbell register read
later in some scenarios.  But in practice it also significantly increases
packet rate on PLX hardware, that I can't explain yet, possibly work-
arounding some interrupt delays.

MFC after: 13 days
Sponsored by: iXsystems, Inc.

6 years agoAdd support for quirks while enabling secondary CPUs. This uses the fdt
andrew [Thu, 31 Aug 2017 20:48:05 +0000 (20:48 +0000)]
Add support for quirks while enabling secondary CPUs. This uses the fdt
compatible string to check if the board is compatible with a given quirk.
It's possible this will be moved later, however as it's currently only used
by the MP code put it there.

So far the only instance of a quirk is when the list of CPUs may be
incorrect. This can happen on virtual machines with a hard coded
devicetree, but where the user may then set the number of CPUs as an
argument. This is the case on the ARM models so include the model specific
compat strings for these, including the spelling mistake found in some of
the OpenplatformPkg dtb files.

Sponsored by: DARPA, AFRL

6 years agocxgbe/t4_tom: Add a knob to select the congestion control algorigthm
np [Thu, 31 Aug 2017 20:33:22 +0000 (20:33 +0000)]
cxgbe/t4_tom: Add a knob to select the congestion control algorigthm
used by the TOE hardware for fully offloaded connections.  The knob
affects new connections only.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoAllow kldload tcpmd5
jpaetzel [Thu, 31 Aug 2017 20:16:28 +0000 (20:16 +0000)]
Allow kldload tcpmd5

PR: 220170
MFC after: 2 weeks

6 years agoamdtemp.4: Update BKDG URL to current location
cem [Thu, 31 Aug 2017 18:39:18 +0000 (18:39 +0000)]
amdtemp.4: Update BKDG URL to current location

Sponsored by: Dell EMC Isilon

6 years agoAdd UCS2->UTF8 option.
imp [Thu, 31 Aug 2017 17:53:50 +0000 (17:53 +0000)]
Add UCS2->UTF8 option.

Many UEFI variables are UCS2 strings (some NUL terminated, others
not). Add --utf8 (-u) to convert UCS2 strings to UTF8 before printing.

Sponsored by: Netflix

6 years agoSave where we're booted from
imp [Thu, 31 Aug 2017 17:32:24 +0000 (17:32 +0000)]
Save where we're booted from

Record the file path for boot1.efi as the UEFI environemnt variable
FreeBSDBootVarGUID:Boot1Path. Record the device this came from as
FreeBSDBootVarGUID:Boot1Dev. While later stages of the boot may be
able to guess these values by retrieving UEFIGlobal:BootCurrent and
groveling through the correct UEFIGlobal:BootXXXX, this provides
certanty in the face of behavior from any part of the boot loader
chain that might "guess" what to do next. These env variables are
volatile and will disappear on reboot.

Sponsored by: Netflix

6 years agoExit rather than panic for most errors.
imp [Thu, 31 Aug 2017 17:32:19 +0000 (17:32 +0000)]
Exit rather than panic for most errors.

In the FreeBSD UEFI boot protocol, boot1.efi exits back to UEFI if it
can't boot the image for most reasons (so that further items in the
EFI boot manger list can be tried). Rename panic to efi_panic, make it
static and give it an extra status argument. Exit back to UEFI with
that status argument so the next loader can be tried.

Use malloc/free exclusively instead of mixing malloc/free and
AllocatePool/FreePool. The code is smaller.

Sponsored by: Netflix

6 years agoboot1.efi: print more info about where boot1.efi is loaded from
imp [Thu, 31 Aug 2017 17:32:14 +0000 (17:32 +0000)]
boot1.efi: print more info about where boot1.efi is loaded from

Print the device that boot1.efi was loaded from. Print the path as
well (since it isn't included in DeviceHandle). Move block where we do
this earlier so all the block handle code is now together.

Sponsored by: Netflix

6 years agoMake efichar.c routines available to libefi.
imp [Thu, 31 Aug 2017 17:32:09 +0000 (17:32 +0000)]
Make efichar.c routines available to libefi.

Make efichar.c routines available to libefi as well as
libefivar. Define LIBEFI when building so we can conditionally include
stand.h vs the normal userland stuff.

6 years agoImport ACPICA 20170831.
jkim [Thu, 31 Aug 2017 17:21:06 +0000 (17:21 +0000)]
Import ACPICA 20170831.

6 years agoRemove unneeded pmap_change_attr() calls.
mav [Thu, 31 Aug 2017 17:02:06 +0000 (17:02 +0000)]
Remove unneeded pmap_change_attr() calls.

Reported by: kib
MFC after: 13 days

6 years agoAdd/polish some defines.
mav [Thu, 31 Aug 2017 16:32:11 +0000 (16:32 +0000)]
Add/polish some defines.

MFC after: 13 days

6 years agoFix parsing File() nodes in device paths.
imp [Thu, 31 Aug 2017 15:53:47 +0000 (15:53 +0000)]
Fix parsing File() nodes in device paths.

o Add File to the mUefiDevicePathLibDevPathFromTextTable table so we
  don't include 'File()' in the supposed path name. This happens because
  of a possible misfeature in the EDK2 code where any path that's not
  recognized is treated as a File() node.
o Convert utf8 input into ucs2 output rather than just copying the
  utf8 and hoping for the best (no good comes from that).
o Remove bogus comment about needing to add 1. The dummy array already
  is length 1, so that's included in sizeof the struct, so there's no
  need to add it.

Sponsored by: Netflix

6 years agoFix printing File() nodes in device paths.
imp [Thu, 31 Aug 2017 15:53:27 +0000 (15:53 +0000)]
Fix printing File() nodes in device paths.

Device paths encoded into the FILEPATH_DEVICE_PATH are UCS2 not
ASCII/UTF8. Convert to utf8 and print that when printing File
paths. Also, since File may be at the end of a long device path,
output File() around the path so it doesn't just show up as random
nodes that might accidentally match real node paths names and cause
errors.

6 years agoThe nvme module should explicitly declare dependency on the cam.
kib [Thu, 31 Aug 2017 14:21:32 +0000 (14:21 +0000)]
The nvme module should explicitly declare dependency on the cam.

If both nvme and cam are compiled as modules, nvme cannot be kldloaded
otherwise.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFix port control for PEX 8749.
mav [Thu, 31 Aug 2017 13:41:44 +0000 (13:41 +0000)]
Fix port control for PEX 8749.

That chip has three Station Ports, so previous address math was incorrect.

MFC after: 13 days
Sponsored by: iXsystems, Inc.

6 years agoAdd sysctls for arc shrinking and growing values
bapt [Thu, 31 Aug 2017 13:02:17 +0000 (13:02 +0000)]
Add sysctls for arc shrinking and growing values

The default value for arc_no_grow_shift may not be optimal when using
several GiB ARC. Expose it via sysctl allows users to tune it easily.

Also expose arc_grow_retry via sysctl for the same reason. The default value of
60s might, in case of intensive load, be too long.

Submitted by: Nikita Kozlov <nikita.kozlov@blade-group.com>
Reviewed by: mav, manu, bapt
MFC after: 2 weeks
Sponsored by: blade
Differential Revision: https://reviews.freebsd.org/D12144

6 years agoMerge upstream r4302 to support multiple concurrently valid anchors.
des [Thu, 31 Aug 2017 12:02:14 +0000 (12:02 +0000)]
Merge upstream r4302 to support multiple concurrently valid anchors.

If an unpatched unbound-anchor is run without a preexisting root anchor
between 2017-09-11 and 2017-10-11, it will fail and Unbound will not be
able to start unless the validator is disabled.  An EN will be issued
with patches for existing systems and information on how to work around
the issue on new installations.

6 years agoMake ntb_set_ctx() always generate fake link event.
mav [Thu, 31 Aug 2017 10:59:39 +0000 (10:59 +0000)]
Make ntb_set_ctx() always generate fake link event.

It allows application driver get initial link state without racing with
hardware interrupts, thanks to the context rmlock held here.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

6 years agoMake ntb_transport(4) ready receive early link events.
mav [Thu, 31 Aug 2017 10:53:10 +0000 (10:53 +0000)]
Make ntb_transport(4) ready receive early link events.

Those events may be reported as soon as callback is registered, if the link
is enabled by hardware or some other application.

While there, clean link_is_up variable on link down event.

MFC after: 1 week

6 years agoFix flags field decoding in ACPI_NFIT_CONTROL_REGION.
mav [Thu, 31 Aug 2017 09:08:06 +0000 (09:08 +0000)]
Fix flags field decoding in ACPI_NFIT_CONTROL_REGION.

It looked like incomplete copy/paste, printing absolute garbage.

While there, print ValidFields field ax hex, since it is a bitmask.

MFC after: 3 days

6 years agoSpelling.
grog [Wed, 30 Aug 2017 23:49:14 +0000 (23:49 +0000)]
Spelling.

6 years agocxgbe(4): Add two new debug flags -- one to allow manual firmware
np [Wed, 30 Aug 2017 23:41:04 +0000 (23:41 +0000)]
cxgbe(4): Add two new debug flags -- one to allow manual firmware
install after full initialization, and another to disable the TCB
cache (T6+).  The latter works as a tunable only.

Note that debug_flags are for debugging only and should not be set
normally.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoxls_ehci: eliminate 'format string is not a string literal' warning
emaste [Wed, 30 Aug 2017 22:58:11 +0000 (22:58 +0000)]
xls_ehci: eliminate 'format string is not a string literal' warning

Reported by: Clang
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoocteon_ebt3000_cf: eliminate 'format string is not a string literal' warning
emaste [Wed, 30 Aug 2017 22:54:11 +0000 (22:54 +0000)]
octeon_ebt3000_cf: eliminate 'format string is not a string literal' warning

Reported by: Clang
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoAdd NTB driver for PLX/Avago/Broadcom PCIe switches.
mav [Wed, 30 Aug 2017 21:16:32 +0000 (21:16 +0000)]
Add NTB driver for PLX/Avago/Broadcom PCIe switches.

This driver supports both NTB-to-NTB and NTB-to-Root Port modes (though
the second with predictable complications on hot-plug and reboot events).
I tested it with PEX 8717 and PEX 8733 chips, but expect it should work
with many other compatible ones too.  It supports up to two NT bridges
per chip, each of which can have up to 2 64-bit or 4 32-bit memory windows,
6 or 12 scratchpad registers and 16 doorbells.  There are also 4 DMA engines
in those chips, but they are not yet supported.

While there, rename Intel NTB driver from generic ntb_hw(4) to more specific
ntb_hw_intel(4), so now it is on par with this new ntb_hw_plx(4) driver and
alike to Linux naming.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

6 years agoCompile reloc.o with -fno-jump-tables on MIPS.
jhb [Wed, 30 Aug 2017 20:00:15 +0000 (20:00 +0000)]
Compile reloc.o with -fno-jump-tables on MIPS.

In particular, the switch statement on the type of dynamic entries
in _rtld_relocate_nonplt_self() needs to not use a jump table since
jump tables on MIPS use local GOT entries which aren't initialized
until after this loop.

Suggested by: arichardson
Reviewed by: emaste
Sponsored by: DARPA / AFRL

6 years agoApply 64k padding to stack pointer for 32-bit processes.
jhb [Wed, 30 Aug 2017 19:21:11 +0000 (19:21 +0000)]
Apply 64k padding to stack pointer for 32-bit processes.

In particular, MIPS now has COMPAT_FREEBSD32 for n64 kernels so this
cannot be ignored for n64.  On the other hand, it is unneeded for o32
MIPS kernels as the issue is only present when using 64-bit registers,
so remove the workaround from o32 kernels.

Reviewed by: jmallett
Sponsored by: DARPA / AFRL

6 years agoDon't include GNU object attributes when building with clang.
jhb [Wed, 30 Aug 2017 19:19:31 +0000 (19:19 +0000)]
Don't include GNU object attributes when building with clang.

LLVM's MIPS assembler parser does not understand the GNU as
'.gnu_attribute' keyword.  This could be re-enabled if LLVM is updated
in the future.  The desired floating point ABI is already described in
the .MIPS.abiflags section.

Reviewed by: emaste
Sponsored by: DARPA / AFRL

6 years agoRevert r323008 and its conversion of e1000/iflib to using SX locks.
sbruno [Wed, 30 Aug 2017 18:56:24 +0000 (18:56 +0000)]
Revert r323008 and its conversion of e1000/iflib to using SX locks.

This seems to be missing something on the 82574L causing NFS root mounts
to hang.

Reported by: kib

6 years agocxgbe(4): Zero out the memory allocated for the debug dump.
np [Wed, 30 Aug 2017 18:46:38 +0000 (18:46 +0000)]
cxgbe(4): Zero out the memory allocated for the debug dump.
cudbg_collect seems to expect it this way.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoRead max_stack_flags from correct object.
jhb [Wed, 30 Aug 2017 18:22:52 +0000 (18:22 +0000)]
Read max_stack_flags from correct object.

'obj' is not initialized here.

Reviewed by: kib
MFC after: 1 week
Sponsored by: DARPA / AFRL

6 years agoOnly make the if_ix module depend on netmap when netmap is configured.
kib [Wed, 30 Aug 2017 18:19:25 +0000 (18:19 +0000)]
Only make the if_ix module depend on netmap when netmap is configured.

Approved by: erj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agobhnd: initialize variable before use
emaste [Wed, 30 Aug 2017 17:39:51 +0000 (17:39 +0000)]
bhnd: initialize variable before use

Reported by: Clang
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoarge: correct bzero sizeof (pointed-to object, not pointer)
emaste [Wed, 30 Aug 2017 17:38:55 +0000 (17:38 +0000)]
arge: correct bzero sizeof (pointed-to object, not pointer)

Reported by: Clang
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoDecode signal information returned by system calls.
jhb [Wed, 30 Aug 2017 15:45:23 +0000 (15:45 +0000)]
Decode signal information returned by system calls.

Specifically, decode the siginfo structure returned by sigtimedwait(),
sigwaitinfo(), and wait6().  While here, also decode the signal number
returned in the second argument to sigwait().