]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoSupport the D-Link DWM-222 LTE Dongle
Kristof Provost [Fri, 13 Oct 2017 19:41:35 +0000 (19:41 +0000)]
Support the D-Link DWM-222 LTE Dongle

Submitted by: Daniel Hänschke <jailedemon@googlemail.com>

6 years agoMake the PHOLD in linux_wait_event_common() unconditional.
Mark Johnston [Fri, 13 Oct 2017 19:27:33 +0000 (19:27 +0000)]
Make the PHOLD in linux_wait_event_common() unconditional.

After some in-progress work is committed, this would otherwise be the only
instance of #if(n)def NO_SWAPPING in the tree. Moreover, the requisite
opt_vm.h include was missing, so the PHOLD/PRELE calls were always being
compiled in anyway.

MFC after: 1 week

6 years agoclean up remnants of removed GPL software
Ed Maste [Fri, 13 Oct 2017 18:30:32 +0000 (18:30 +0000)]
clean up remnants of removed GPL software

send-pr r267486
texinfo r276551
ranlib r286332
sdiff r298823
rcs r307351
diff r317209

6 years agoRemove additional groff leftovers (r319664)
Ed Maste [Fri, 13 Oct 2017 18:23:08 +0000 (18:23 +0000)]
Remove additional groff leftovers (r319664)

6 years agoObsoleteFiles.inc: correct year on libstand removal
Ed Maste [Fri, 13 Oct 2017 17:15:17 +0000 (17:15 +0000)]
ObsoleteFiles.inc: correct year on libstand removal

6 years agoAddress two problems with sendfile(..., SF_NOCACHE) and apply one
Alan Cox [Fri, 13 Oct 2017 16:31:50 +0000 (16:31 +0000)]
Address two problems with sendfile(..., SF_NOCACHE) and apply one
"optimization".  First, sendfile(..., SF_NOCACHE) frees pages without
checking whether those pages are mapped.  This can leave the system
with mappings to free or repurposed pages.  Second, a page can be
busied between the time of the current busy test and acquiring the
object lock.  Essentially, the test performed before the object lock
is acquired can only be regarded as an optimization to short-circuit
further work on the page.  It cannot, however, be relied upon to prove
that it is safe to free the page.  Third, when sendfile(..., SF_NOCACHE)
was originally implemented, vm_page_deactivate_noreuse() did not yet
exist.  Use vm_page_deactivate_noreuse() instead of vm_page_deactivate(),
because it comes closer to freeing the page.

In collaboration with: glebius
Discussed with: gallatin, kib, markj
X-MFC after: r324448

6 years agoEvaluate the real size of the sblk_zone.
Konstantin Belousov [Fri, 13 Oct 2017 16:23:05 +0000 (16:23 +0000)]
Evaluate the real size of the sblk_zone.

Submitted by: ota@j.email.ne.jp
PR: 221356
Reviewed by: alc, markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D12660

6 years agoIncrease the arm/armv6 and arm/armv7 images from 2.5GB to 3GB,
Glen Barber [Fri, 13 Oct 2017 15:16:57 +0000 (15:16 +0000)]
Increase the arm/armv6 and arm/armv7 images from 2.5GB to 3GB,
since the RPI2 (at least) does not fit in 2.5GB.

While here, add a missing BOARDNAME to RPI2.conf.

Sponsored by: The FreeBSD Foundation

6 years agoo Support for Kabylake CPU PMCs (fall down to PMC_CPU_INTEL_SKYLAKE).
Ruslan Bukin [Fri, 13 Oct 2017 15:02:29 +0000 (15:02 +0000)]
o Support for Kabylake CPU PMCs (fall down to PMC_CPU_INTEL_SKYLAKE).
o Fix bugs in events descriptions for Skylake, Skylake Xeon and Haswell.

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12654

6 years agoDon't call selrecord() outside the select system call in the LinuxKPI, because
Hans Petter Selasky [Fri, 13 Oct 2017 14:14:46 +0000 (14:14 +0000)]
Don't call selrecord() outside the select system call in the LinuxKPI, because
then td->td_sel is NULL and this will result in a segfault inside selrecord().
This happens when only using kqueue() to poll for read and write events.
If select() and kqueue() is mixed there won't be a segfault.

Reported by: Johannes Lundberg
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoANSIfy vm_kern.c
Ed Maste [Fri, 13 Oct 2017 13:53:19 +0000 (13:53 +0000)]
ANSIfy vm_kern.c

PR: 222673
Submitted by: ota@j.email.ne.jp
MFC after: 1 week

6 years agotruss: mention 'H' in usage
Ed Maste [Fri, 13 Oct 2017 13:47:55 +0000 (13:47 +0000)]
truss: mention 'H' in usage

r295930 introduced the 'H' option to display thread IDs, but did not add
the option to usage().

PR: 222837
Submitted by: Oliver Kiddle <okiddle@yahoo.co.uk>
MFC after: 1 week

6 years agoFix regression in handling O_FORWARD_IP opcode after r279948.
Andrey V. Elsukov [Fri, 13 Oct 2017 11:11:53 +0000 (11:11 +0000)]
Fix regression in handling O_FORWARD_IP opcode after r279948.

To properly handle 'fwd tablearg,port' opcode, copy sin_port value from
sockaddr_in structure stored in the opcode into corresponding hopstore
field.

PR: 222953
MFC after: 1 week

6 years agoReturn 'errno' value from the table_do_modify_record(), it is expected
Andrey V. Elsukov [Fri, 13 Oct 2017 11:01:33 +0000 (11:01 +0000)]
Return 'errno' value from the table_do_modify_record(), it is expected
by table_modify_record().

This makes quiet operations with tables really quiet.

PR: 222953
MFC after: 1 week

6 years agoremove process and jail directory machinations from dounmount
Andriy Gapon [Fri, 13 Oct 2017 09:42:05 +0000 (09:42 +0000)]
remove process and jail directory machinations from dounmount

The manipulations done by mountcheckdirs() are not that useful during
the unmount, they can bring about unexpected security consequences.

Thic change effectively reverts the change in r73241.

The change also allows to simplify the handling of rootvnode global
variable.

Discussed with: mckusick, mjg, kib
Reviewed by: trasz
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D12366

6 years agoi2c(8): clean up and clarify read operation
Andriy Gapon [Fri, 13 Oct 2017 09:21:41 +0000 (09:21 +0000)]
i2c(8): clean up and clarify read operation

The code went to a lot of trouble to issue either a start+stop condition
or a repeated start condition only to follow it with a stop condition
and a read(2) call that issues a new start condition.
So, fix the read in I2C_MODE_REPEATED_START mode by using I2CREAD ioctl
within the running transaction.  This obviously requires that the slave
address has the read bit set which was not required before.

Another problem was with width parameter of zero and
I2C_MODE_REPEATED_START mode.  In that case we issued a repeated start
without any preceding start.

While here, remove the redundant (unused) argument to I2CSTOP throughout
the program.
Also, clarify the meaning of -w option, especially "-w 0", in the manual
page.

Reviewed by: no one
Differential Revision: https://reviews.freebsd.org/D12331

6 years ago[net80211] don't try to follow a NULL rxs pointer down the sink.
Adrian Chadd [Fri, 13 Oct 2017 06:49:07 +0000 (06:49 +0000)]
[net80211] don't try to follow a NULL rxs pointer down the sink.

It's smelly, and we already checked earlier whether we needed to.

6 years ago[ath] Begin using the replacement EDCA functions.
Adrian Chadd [Thu, 12 Oct 2017 21:58:51 +0000 (21:58 +0000)]
[ath] Begin using the replacement EDCA functions.

As part of ath10k and other chipset support, the EDCA stuff has to be moved
to potentially be per-VAP.  For hardware that doesn't support it (ie,
everything that we currently support) it can just fetch the "current"
global EDCA parameters for the NIC.

This is one of those parameters that is linked to the currently active
channel context / VAP in Linux mac80211 parlance.

Tested:

* ath(4), STA and AP modes

6 years ago[net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path.
Adrian Chadd [Thu, 12 Oct 2017 21:56:58 +0000 (21:56 +0000)]
[net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path.

The duplicate detection code currently expects A-MSDU frames to be encaped -
they're decap'ed /after/ duplicate detection.

However for ath10k (and iwm hardware later on) the firmware supports
doing A-MSDU decap in hardware - which shows up as multiple frames with
the same sequence number and IV.

This is the first part of decap handling - if we see a stretch of A-MSDU
frames from the driver with the MORE bit set, then don't treat them
as duplicates.

This isn't 100% complete as crypto sequence number handling and "A-MSDU in
A-MPDU" needs handling, but it's a start.

This should be a glorified no-op for everyone.  Please tell me if it isn't.

6 years agoFix build after r324446.
Gleb Smirnoff [Thu, 12 Oct 2017 21:26:52 +0000 (21:26 +0000)]
Fix build after r324446.

6 years agoOptimize zpool_read_all_labels with AIO
Alan Somers [Thu, 12 Oct 2017 21:25:11 +0000 (21:25 +0000)]
Optimize zpool_read_all_labels with AIO

Read all labels in parallel instead of sequentially

MFC after: 3 weeks
X-MFC-With: 322854
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12495

6 years agoAdd arm/armv7 checks to env_check().
Glen Barber [Thu, 12 Oct 2017 20:31:10 +0000 (20:31 +0000)]
Add arm/armv7 checks to env_check().

Sponsored by: The FreeBSD Foundation

6 years agoFix shadowed variable hidden by WARNS changing to 3 in r313006.
Bryan Drewery [Thu, 12 Oct 2017 19:58:21 +0000 (19:58 +0000)]
Fix shadowed variable hidden by WARNS changing to 3 in r313006.

Sponsored by: Dell EMC Isilon
MFC after: 1 week

6 years agoregen freebsd32_sysent.c after r324564 (freebsd32_posix_fallocate)
Ed Maste [Thu, 12 Oct 2017 18:31:28 +0000 (18:31 +0000)]
regen freebsd32_sysent.c after r324564 (freebsd32_posix_fallocate)

6 years agoallow posix_fallocate in 32-bit compat capability mode
Ed Maste [Thu, 12 Oct 2017 18:30:54 +0000 (18:30 +0000)]
allow posix_fallocate in 32-bit compat capability mode

Reported by: kib
MFC after: 2 weeks
MFC with: r324560
Sponsored by: The FreeBSD Foundation

6 years agoa10_ehci: Remove the passby code
Emmanuel Vadot [Thu, 12 Oct 2017 18:00:29 +0000 (18:00 +0000)]
a10_ehci: Remove the passby code

It doesn't seems to be needed anymore and this make ehci working again
on the Pine64.
Thanks to jmcneill@ for the help.

Tested on: Pine64 (A64), OrangePi One (H3), BananapiM2 (A31s)

6 years agoAdd rev16 instruction to the disassembler.
Bjoern A. Zeeb [Thu, 12 Oct 2017 15:53:54 +0000 (15:53 +0000)]
Add rev16 instruction to the disassembler.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D12645

6 years agoregen init_sysent.c r324560
Ed Maste [Thu, 12 Oct 2017 15:48:37 +0000 (15:48 +0000)]
regen init_sysent.c r324560

6 years agoallow posix_fallocate in capability mode
Ed Maste [Thu, 12 Oct 2017 15:45:53 +0000 (15:45 +0000)]
allow posix_fallocate in capability mode

posix_fallocate is logically equivalent to writing zero blocks to the
desired file size and there is no reason to prevent calling it in
capability mode. posix_fallocate already checked for the CAP_WRITE
right, so we merely need to list it in capabilities.conf.

Reviewed by: allanjude
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12640

6 years agoMove panic back into libsa. It's documented in libstand(3) to belong
Warner Losh [Thu, 12 Oct 2017 15:16:27 +0000 (15:16 +0000)]
Move panic back into libsa. It's documented in libstand(3) to belong
there.

Sponsored by: Netflix

6 years agoDefine prototype for exit and ensure references
Warner Losh [Thu, 12 Oct 2017 15:16:22 +0000 (15:16 +0000)]
Define prototype for exit and ensure references

Define a prototype for exit in stand.h. Provide a reference to exit in
a few conf.c files to ensure that its definition gets pulled in early.
Since exit() is a MD routine, it isn't defined in libsa. However,
libsa tends to be listed last and will soon have panic() in it which
calls exit(). The reference to exit early ensures that the MD exit is
available to satisfy linking for static libraries.

6 years agoRename exit to efi_exit to avoid clashing with libsa exit definition
Warner Losh [Thu, 12 Oct 2017 15:16:16 +0000 (15:16 +0000)]
Rename exit to efi_exit to avoid clashing with libsa exit definition

Rename exit to efi_exit. It doesn't have the proper signature and
conflicts with standard definition. Provide the standard definition as
well.

Sponsored by: Netflix

6 years agoMove ufsread.c
Warner Losh [Thu, 12 Oct 2017 14:57:05 +0000 (14:57 +0000)]
Move ufsread.c

Move ufsread.c from sys/boot/common (which used to be all the common
files for /boot/loader, but grew to be all the common files for
sys/boot, but that's now sys/boot/libsa's job) to sys/boot/libsa.

Sponsored by: Netflix

6 years agoHonor CFLAGS modifications in Makefile.inc by using += here. There's
Warner Losh [Thu, 12 Oct 2017 14:57:00 +0000 (14:57 +0000)]
Honor CFLAGS modifications in Makefile.inc by using += here.  There's
no hyper-small space constraints, so there's no reason to tightly
control it.

Sponsored by: Netflix

6 years agoMove crc32.c, util.c and gpt.c over to libsa.
Warner Losh [Thu, 12 Oct 2017 14:56:54 +0000 (14:56 +0000)]
Move crc32.c, util.c and gpt.c over to libsa.

Sponsored by: Netflix

6 years agoRename libstand.a to libsa.a and libstand32.a to libsa32.a
Warner Losh [Thu, 12 Oct 2017 14:56:48 +0000 (14:56 +0000)]
Rename libstand.a to libsa.a and libstand32.a to libsa32.a

Sponsored by: Netflix

6 years agoKill the userboot copy of libstand.
Warner Losh [Thu, 12 Oct 2017 14:56:42 +0000 (14:56 +0000)]
Kill the userboot copy of libstand.

It's not needed (it's now identical to libsa, and seems to have been
for some time).

Sponsored by: Netflix

6 years agoMove lib/libstand to sys/boot/libsa
Warner Losh [Thu, 12 Oct 2017 14:56:28 +0000 (14:56 +0000)]
Move lib/libstand to sys/boot/libsa

Move the sources to sys/boot. Make adjustments related to the
move. Kill LIBSTAND_SRC since it's no longer needed.

Sponsored by: Netflix

6 years agoAdd $FreeBSD$ to ancient sources that it's missing from.
Warner Losh [Thu, 12 Oct 2017 14:53:25 +0000 (14:53 +0000)]
Add $FreeBSD$ to ancient sources that it's missing from.

Sponsored by: Netflix

6 years agoPreviously there was a VIRT kernel to which I had added these options.
Bjoern A. Zeeb [Thu, 12 Oct 2017 14:32:45 +0000 (14:32 +0000)]
Previously there was a VIRT kernel to which I had added these options.
With that gone they need to go into GENERIC now.

Makes FreeBSD/arm usable on gem5 by default.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D12566

6 years agoxinstall: plug an infinite loop in directory creation
Mateusz Guzik [Thu, 12 Oct 2017 13:59:23 +0000 (13:59 +0000)]
xinstall: plug an infinite loop in directory creation

If stat continues to fail with ENOENT and mkdir with EEXIST the code wont
finish. In particular this can show up when the target path follows through
a symlink to a non-existent directory.

Reported by: ae
MFC after: 1 week

6 years agoWhen unmounting a tmpfs, do not call free_unr.
Matt Joras [Wed, 11 Oct 2017 21:53:53 +0000 (21:53 +0000)]
When unmounting a tmpfs, do not call free_unr.

tmpfs uses unr(9) to allocate inodes. Previously when unmounting it
would individually free the units when it freed each vnode. This is
unnecessary as we can use the newly-added unrhdr_clear function to clear
out the unr in onde go. This measurably reduces the time to unmount a
tmpfs with many files.

Reviewed by: cem, lidl
Approved by: rstone (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12591

6 years agoAdd clearing function for unr(9).
Matt Joras [Wed, 11 Oct 2017 21:53:50 +0000 (21:53 +0000)]
Add clearing function for unr(9).

Previously before you could call unrhdr_delete you needed to
individually free every allocated unit. It is useful to be able to tear
down the unr without having to go through this process, as it is
significantly faster than freeing the individual units.

Reviewed by: cem, lidl
Approved by: rstone (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12591

6 years agoDeclare more TCP globals in tcp_var.h, so that alternative TCP stacks
Gleb Smirnoff [Wed, 11 Oct 2017 20:36:09 +0000 (20:36 +0000)]
Declare more TCP globals in tcp_var.h, so that alternative TCP stacks
can use them.  Gather all TCP tunables in tcp_var.h in one place and
alphabetically sort them, to ease maintainance of the list.

Don't copy and paste declarations in tcp_stacks/fastpath.c.

6 years agoAdded support driver state capture/retrieval
David C Somayajulu [Wed, 11 Oct 2017 20:22:01 +0000 (20:22 +0000)]
Added support driver state capture/retrieval

MFC after:5 days

6 years agocrypto(9): Print flags in more useful hex
Conrad Meyer [Wed, 11 Oct 2017 20:04:30 +0000 (20:04 +0000)]
crypto(9): Print flags in more useful hex

Sponsored by: Dell EMC Isilon

6 years agolibunwind: use upstream patch to disable executable stacks
Ed Maste [Wed, 11 Oct 2017 19:26:39 +0000 (19:26 +0000)]
libunwind: use upstream patch to disable executable stacks

arm uses '@' as a comment character, and cannot use @progbits in the
.section directive. Apply the upstream noexec stach change which avoids
this issue.

Obtained from: LLVM r277868

6 years agoAdd sanity checks in ql_hw_send() qla_send() to ensure that empty slots
David C Somayajulu [Wed, 11 Oct 2017 18:25:05 +0000 (18:25 +0000)]
Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots
in Tx Ring map to empty slot in Tx_buf array before Transmits. If the
checks fail further Transmission on that Tx Ring is prevented.

MFC after:5 days

6 years agohwpmc(4): Actually use a sufficiently wide type
Conrad Meyer [Wed, 11 Oct 2017 15:13:40 +0000 (15:13 +0000)]
hwpmc(4): Actually use a sufficiently wide type

jhibbits@ points out that left shifting bits 8-11 24 bits won't fit in a 32-bit
integer either.

Corrects r324533.

Submitted by: jhibbits
Sponsored by: Dell EMC Isilon

6 years agohwpmc(4): Force sufficiently wide type for left shift
Conrad Meyer [Wed, 11 Oct 2017 14:59:04 +0000 (14:59 +0000)]
hwpmc(4): Force sufficiently wide type for left shift

Ordinary input to this macro comes from pe_code, which is uint16_t.  Coverity
points out that shifting such a value discards the result of a 24 bit shift,
which is not what we want.

A follow-up to r324291.

CID: 1381676
Sponsored by: Dell EMC Isilon

6 years agoDo not try to remove diff.7 optionaly has it is always removed
Baptiste Daroussin [Wed, 11 Oct 2017 14:41:11 +0000 (14:41 +0000)]
Do not try to remove diff.7 optionaly has it is always removed
since GNU diff(1) has been replaced with BSD diff(1)

6 years agoOptionalObsoleteFiles: remove diff from MK_GNU_DIFF=no block
Ed Maste [Wed, 11 Oct 2017 14:34:06 +0000 (14:34 +0000)]
OptionalObsoleteFiles: remove diff from MK_GNU_DIFF=no block

diff (and man page) are not from GNU, as of r317209, and should not be
deleted if WITHOUT_GNU_DIFF is set. (WITHOUT_GNU_DIFF still controls
whether diff3 is built.)

Sponsored by: The FreeBSD Foundation

6 years agoThe th_bintime, th_microtime and th_nanotime members of the timehand
Konstantin Belousov [Wed, 11 Oct 2017 11:03:11 +0000 (11:03 +0000)]
The th_bintime, th_microtime and th_nanotime members of the timehand
all cache the last system time (uptime + boottime).  Only the format
differs.  Do not re-calculate the bintime and simply use the value
used to calculate the microtime and nanotime.

Group all the updates under the relevant comment.  Remove obsoleted
XXX part.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 1 week

6 years agorss: Remove never defined UDP_IPV4_EX
Sepherosa Ziehau [Wed, 11 Oct 2017 06:08:01 +0000 (06:08 +0000)]
rss: Remove never defined UDP_IPV4_EX

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D12455

6 years agoixgbe: Remove never defined UDP_IPV4_EX
Sepherosa Ziehau [Wed, 11 Oct 2017 05:55:52 +0000 (05:55 +0000)]
ixgbe: Remove never defined UDP_IPV4_EX

Reviewed by: sbruno
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D12454

6 years agohyperv/hn: Enable transparent VF by default.
Sepherosa Ziehau [Wed, 11 Oct 2017 05:28:51 +0000 (05:28 +0000)]
hyperv/hn: Enable transparent VF by default.

MFC after: 3 days
Sponsored by: Microsoft

6 years agohyperv/hn: Workaround erroneous hash type observed on WS2016 for VF.
Sepherosa Ziehau [Wed, 11 Oct 2017 05:15:49 +0000 (05:15 +0000)]
hyperv/hn: Workaround erroneous hash type observed on WS2016 for VF.

The background was described in r324489.

MFC after: 3 days
Sponsored by: Microsoft

6 years agoDon't use a non-zero argument for __builtin_frame_address
Kurt Lidl [Wed, 11 Oct 2017 03:50:44 +0000 (03:50 +0000)]
Don't use a non-zero argument for __builtin_frame_address

Mirror the change made for powerpc64 in r323687.  With this
change, gcc 6.4.0 can successfully compile and link a kernel
that runs on sparc64.

MFC after: 2 weeks

6 years agoDo exception offset computations in 64 bits, not 32.
Justin Hibbits [Wed, 11 Oct 2017 02:39:20 +0000 (02:39 +0000)]
Do exception offset computations in 64 bits, not 32.

This fixes clang-built binaries on a gcc powerpc64 world.  Gets us one step
closer to a clang-built world.  The same change was made in later upstream
binutils.

Submitted by: rdivacky
MFC after: 2 weeks

6 years agosysctl.9: document CTLFLAG_CAPRD and CTLFLAG_CAPWR
Ed Maste [Tue, 10 Oct 2017 23:54:25 +0000 (23:54 +0000)]
sysctl.9: document CTLFLAG_CAPRD and CTLFLAG_CAPWR

Reported by: Shawn Webb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agomatch sendfile() error handling to send().
Sean Bruno [Tue, 10 Oct 2017 22:21:05 +0000 (22:21 +0000)]
match sendfile() error handling to send().

Sendfile() should match the error checking order of send() which
is currently:

SBS_CANTSENDMORE
so_error
SS_ISCONNECTED

Submitted by: Jason Eggleston <jason@eggnet.com>
Reviewed by: glebius
MFC after: 2 weeks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12633

6 years agogrowfs: ANSIfy cgckhash()
Ed Maste [Tue, 10 Oct 2017 21:16:07 +0000 (21:16 +0000)]
growfs: ANSIfy cgckhash()

The build was broken on GCC-using architectures with:

growfs.c: In function 'cgckhash':
growfs.c:1753: warning: old-style function definition

Sponsored by: The FreeBSD Foundation

6 years agoFix forced dismount when a pNFS mount is hung on a DS.
Rick Macklem [Tue, 10 Oct 2017 21:05:40 +0000 (21:05 +0000)]
Fix forced dismount when a pNFS mount is hung on a DS.

When a "pnfs" NFSv4.1 mount is hung because of an unresponsive DS,
a forced dismount wouldn't work, because the RPC socket for the DS
was not being closed. This patch fixes this.
This will only affect "pnfs" mounts where the pNFS server's DS
is unresponsive (crashed or network partitioned or...).
Found during testing of the pNFS server.

MFC after: 2 weeks

6 years agoRevert Commit r324290
David C Somayajulu [Tue, 10 Oct 2017 20:45:45 +0000 (20:45 +0000)]
Revert Commit r324290
  Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots
  in Tx Ring map to empty slot in Tx_buf array before Transmits. If the
  checks fail further Transmission on that Tx Ring is prevented.

6 years agouart: detect 256-byte FIFOs
Ed Maste [Tue, 10 Oct 2017 20:08:30 +0000 (20:08 +0000)]
uart: detect 256-byte FIFOs

Submitted by: Zakary Nafziger <worldofzak@gmail.com>
Sponsored by: The FreeBSD Foundation

6 years agoMerge ACPICA 20170929 (take 2).
Jung-uk Kim [Tue, 10 Oct 2017 19:33:24 +0000 (19:33 +0000)]
Merge ACPICA 20170929 (take 2).

6 years agoDo not check whether AcpiOsGetTimer() is called during boot.
Jung-uk Kim [Tue, 10 Oct 2017 19:20:38 +0000 (19:20 +0000)]
Do not check whether AcpiOsGetTimer() is called during boot.

From ACPICA 20170929, AcpiOsGetTimer() should be available early because
While() loop timeout mechanism was reimplemented with it.  Unfortunately,
it means AcpiLoadTables() may cause panic when a While() loop is executed.
After having lengthy discussions with ACPICA developers, I have concluded
that dummy timecounter is good enough for the purpose and it is the least
intrusive solution for now.  Also, they reminded me the ACPI specification
implies OS timer function should be available before loading tables.

6 years agoHard link if_igb.ko to if_em.ko. Use a LINK directive to ensure that
Sean Bruno [Tue, 10 Oct 2017 19:14:40 +0000 (19:14 +0000)]
Hard link if_igb.ko to if_em.ko.  Use a LINK directive to ensure that
this is more friendly to the tree.

Tested this with loader.conf:if_igb_load="YES" and it does the right
thing.

Submitted by: Ian Lepore <ian@freebsd.org>

6 years agoGrowfs got missed in r323923 that added a check hash to cylinder groups.
Kirk McKusick [Tue, 10 Oct 2017 16:17:03 +0000 (16:17 +0000)]
Growfs got missed in r323923 that added a check hash to cylinder groups.
This makes the needed changes to add/update cylinder group check hashes
when a filesystem is expanded.

Reported by: kib and Warner Losh (imp)
Reviewed by: kib
Tested by: Peter Holm (pho)

6 years agoMute gcc warning about p not being possibly initialized
Enji Cooper [Tue, 10 Oct 2017 15:41:35 +0000 (15:41 +0000)]
Mute gcc warning about p not being possibly initialized

I'm running into this warning on a tinderbox run with gcc 4.2.1 with mips and
powerpc.

MFC after: 1 week

6 years agoDo not print error when running make check-old on system
Baptiste Daroussin [Tue, 10 Oct 2017 13:06:11 +0000 (13:06 +0000)]
Do not print error when running make check-old on system
without catpages directories

Reported by: dim

6 years agoSupport the EFI Runtime Services on arm64. As with amd64 we use the 1:1
Andrew Turner [Tue, 10 Oct 2017 13:05:26 +0000 (13:05 +0000)]
Support the EFI Runtime Services on arm64. As with amd64 we use the 1:1
mapping. This uses the new common code shared with amd64.

The RTC should only be accessed via EFI. There is no locking around it as
the spec only has this as a requirement for the PC-AT CMOS device.

Reviewed by: kib, imp
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12595

6 years agoAdd machine/fpu.h on arm64 for compatibility with amd64.
Andrew Turner [Tue, 10 Oct 2017 13:02:58 +0000 (13:02 +0000)]
Add machine/fpu.h on arm64 for compatibility with amd64.

Sponsored by: DARPA, AFRL

6 years agoMove the pmap_l0_index, etc. macros to pte.h. These will be used by the
Andrew Turner [Tue, 10 Oct 2017 12:54:36 +0000 (12:54 +0000)]
Move the pmap_l0_index, etc. macros to pte.h. These will be used by the
EFI Runtime Services code.

Sponsored by: DARPA, AFRL

6 years agoMake sure the IPv6 scope ID gets zeroed inside the GID. Else searching for a
Hans Petter Selasky [Tue, 10 Oct 2017 12:36:41 +0000 (12:36 +0000)]
Make sure the IPv6 scope ID gets zeroed inside the GID. Else searching for a
valid GID entry based on IPv6 addresses can fail.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoUse common rdma_ip2gid() function instead of custom mlx5_ip2gid() one.
Hans Petter Selasky [Tue, 10 Oct 2017 12:24:52 +0000 (12:24 +0000)]
Use common rdma_ip2gid() function instead of custom mlx5_ip2gid() one.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd support for parsing and using IPv6 addresses in krping.
Hans Petter Selasky [Tue, 10 Oct 2017 12:10:19 +0000 (12:10 +0000)]
Add support for parsing and using IPv6 addresses in krping.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agohyperv/hn: Workaround erroneous hash type observed on WS2016.
Sepherosa Ziehau [Tue, 10 Oct 2017 08:32:03 +0000 (08:32 +0000)]
hyperv/hn: Workaround erroneous hash type observed on WS2016.

Background:
- UDP 4-tuple hash type is unconditionally enabled in Hyper-V on WS2016,
  which is _not_ affected by NDIS_OBJTYPE_RSS_PARAMS.
- Non-fragment UDP/IPv4 datagrams' hash type is delivered to VM as
  TCP_IPV4.

Currently this erroneous behavior only applies to WS2016/Windows10.

Force l3/l4 protocol check, if the RXed packet's hash type is TCP_IPV4,
and the Hyper-V is running on WS2016/Windows10.  If the RXed packet is
UDP datagram, adjust mbuf hash type to UDP_IPV4.

MFC after: 3 days
Sponsored by: Microsoft

6 years agohyperv/vmbus: Expose Hyper-V major version.
Sepherosa Ziehau [Tue, 10 Oct 2017 08:23:19 +0000 (08:23 +0000)]
hyperv/vmbus: Expose Hyper-V major version.

MFC after: 3 days
Sponsored by: Microsoft

6 years agohyperv/vmbus: Add tunable to pin/unpin event tasks.
Sepherosa Ziehau [Tue, 10 Oct 2017 08:16:55 +0000 (08:16 +0000)]
hyperv/vmbus: Add tunable to pin/unpin event tasks.

Event tasks are pinned to their respective CPU by default, in the same
fashion as they were.

Unpin the event tasks by setting hw.vmbus.pin_evttask to 0, if certain
CPUs serve special purpose.

MFC after: 3 days
Sponsored by: Microsoft

6 years agoCheck the exit code from fsck_ffs instead of relying on MODIFIED being in the output
Enji Cooper [Tue, 10 Oct 2017 05:58:33 +0000 (05:58 +0000)]
Check the exit code from fsck_ffs instead of relying on MODIFIED being in the output

^/head@r323923 changed when MODIFIED is printed at exit. It's better to follow the
documented way of determining whether or not a filesystem is clean per fsck_ffs, i.e.,
ensure that the exit code is either 0 or 7.

The pass/fail determination is brittle prior to this commit, and ^/head@r323923 made
the issue apparent -- thus this needs to be fixed independent of ^/head@r323923.

PR: 222780
MFC after: 1 week
MFC with: r323923
Reported by: Jenkins

6 years agoAdd OpenBSD 6.2, reorder macOS 10.13
Eitan Adler [Tue, 10 Oct 2017 05:47:10 +0000 (05:47 +0000)]
Add OpenBSD 6.2, reorder macOS 10.13

6 years agoFix typos: `stand alon{e,g}` should be spelled like `standalone`
Enji Cooper [Tue, 10 Oct 2017 04:53:26 +0000 (04:53 +0000)]
Fix typos: `stand alon{e,g}` should be spelled like `standalone`

6 years agoAdd missing SUBDIR needed for iwmfw to load after ^/head@r324434
Enji Cooper [Tue, 10 Oct 2017 04:50:05 +0000 (04:50 +0000)]
Add missing SUBDIR needed for iwmfw to load after ^/head@r324434

Submitted by: Pete Wright <pete@nomadlogic.org>
MFC after: 1 month
MFC with: r324434

6 years agoSort SUBDIR and put entries on a single list
Enji Cooper [Tue, 10 Oct 2017 04:47:01 +0000 (04:47 +0000)]
Sort SUBDIR and put entries on a single list

This is to aid with identifying diffs between commits.

MFC after: 3 days

6 years agoRather than laying whack-a-mole with including the path to stand.h,
Warner Losh [Tue, 10 Oct 2017 01:31:44 +0000 (01:31 +0000)]
Rather than laying whack-a-mole with including the path to stand.h,
always include it. Remove places where we explicitly include it. This
also helps reduce the 'cut-and-paste' factor of these Makefiles.

Sponsored by: Netflix

6 years agoRevert r324405 at the request of the submitter pending better solution.
Sean Bruno [Tue, 10 Oct 2017 00:32:21 +0000 (00:32 +0000)]
Revert r324405 at the request of the submitter pending better solution.

Submitted by: Jason Eggleston <jason@eggnet.com>
Sponsored by: Limelight Networks

6 years agoAdd Asus USB-N13, rev. B1 to the rtwn_usb hardware list
Benjamin Kaduk [Tue, 10 Oct 2017 00:26:44 +0000 (00:26 +0000)]
Add Asus USB-N13, rev. B1 to the rtwn_usb hardware list

Reported by: Patrik Horst <mail@patrikhorst.de>

6 years agoRemove embedded newlines from sysctl variable descriptions
Alan Somers [Mon, 9 Oct 2017 22:27:38 +0000 (22:27 +0000)]
Remove embedded newlines from sysctl variable descriptions

PR: 112556
Submitted by: Willem Jan Withagen <wjw@digiware.nl> (earlier version)
Reported by: Willem Jan Withagen, ighighi@gmail.com
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

6 years agoDo not report the filesystem as modified when the only change is to
Kirk McKusick [Mon, 9 Oct 2017 22:19:58 +0000 (22:19 +0000)]
Do not report the filesystem as modified when the only change is to
update the timestamp in the superblock.

Reported by: Peter Holm
MFC after: 1 week

6 years agoNote libstand is no longer a public interface in UPDATING. Bump
Warner Losh [Mon, 9 Oct 2017 22:17:18 +0000 (22:17 +0000)]
Note libstand is no longer a public interface in UPDATING. Bump
FreeBSD_version to 1200051 on the off chance that something cares.

Sponsored by: Netflix

6 years agoDisconnect libstand from the build.
Warner Losh [Mon, 9 Oct 2017 22:12:57 +0000 (22:12 +0000)]
Disconnect libstand from the build.

Remove libstand from the src/lib build. Remove LIBSTAND from
bsd.libnames.mk. Add affected files to the obsolete files list.

Sponsored by: Netflix

6 years agoCreate sys/boot/libsa and build libstand.a there
Warner Losh [Mon, 9 Oct 2017 22:12:53 +0000 (22:12 +0000)]
Create sys/boot/libsa and build libstand.a there

Build libstand from inside the sys/boot build. Redirect all users in
sys/boot to grab it from there. We still build it as libstand.a for
the moment. When lib/libstand is moved here, we'll change the name.

Sponsored by: Netflix

6 years agoDefine LIBSA* and use them instead of overloaded LIBSTAND
Warner Losh [Mon, 9 Oct 2017 22:12:46 +0000 (22:12 +0000)]
Define LIBSA* and use them instead of overloaded LIBSTAND

LIBSA is the current stand alone library. LIBSA32 is the 32-bit
version of the library. LIBSAU is the userboot version of libsa. Use
the proper define instead of the more generic define.

Sponsored by: Netflix

6 years agoAdd missing -I${SASRC} in a couple of places so that stand.h doesn't
Warner Losh [Mon, 9 Oct 2017 22:12:39 +0000 (22:12 +0000)]
Add missing -I${SASRC} in a couple of places so that stand.h doesn't
accidentally come in via host pollution.

Sponsored by: Netflix

6 years agoDefine SASRC and use it
Warner Losh [Mon, 9 Oct 2017 22:12:32 +0000 (22:12 +0000)]
Define SASRC and use it

Define SASRC to point to the current libstand sources. Include
../Makefile.inc early enough in a few places so we can .include
"${SASRC}/Makefile" and have it work. Create a new pass-up
Makefile.inc in sys/boot/userboot to allow this pattern to work.

Sponsored by: Netflix

6 years agoPrefer ${LIBSTAND} to -lstand
Warner Losh [Mon, 9 Oct 2017 22:11:57 +0000 (22:11 +0000)]
Prefer ${LIBSTAND} to -lstand

Sponsored by: Netflix

6 years agoImprovements to sendfile(2) mbuf free routine.
Gleb Smirnoff [Mon, 9 Oct 2017 21:06:16 +0000 (21:06 +0000)]
Improvements to sendfile(2) mbuf free routine.

o Fall back to default m_ext free mech, using function pointer in
  m_ext_free, and remove sf_ext_free() called directly from mbuf code.
  Testing on modern CPUs showed no regression.
o Provide internally used flag EXT_FLAG_SYNC, to mark that I/O uses
  SF_SYNC flag.  Lack of the flag allows us not to dereference
  ext_arg2, saving from a cache line miss.
o Create function sendfile_free_page() that later will be used, for
  multi-page mbufs.  For now compiler will inline it into
  sendfile_free_mext().

In collaboration with: gallatin
Differential Revision: https://reviews.freebsd.org/D12615

6 years agoIn mb_dupcl() don't copy full m_ext, to avoid cache miss. Respectively,
Gleb Smirnoff [Mon, 9 Oct 2017 20:51:58 +0000 (20:51 +0000)]
In mb_dupcl() don't copy full m_ext, to avoid cache miss.  Respectively,
in mb_free_ext() always use fields from the original refcount holding
mbuf (see. r296242) mbuf.  Cuts another cache miss from mb_free_ext().

However, treat EXT_EXTREF mbufs differently, since they are different -
they don't have a refcount holding mbuf.

Provide longer comments in m_ext declaration to explain this change
and change from r296242.

In collaboration with: gallatin
Differential Revision: https://reviews.freebsd.org/D12615

6 years agoShorten list of arguments to mbuf external storage freeing function.
Gleb Smirnoff [Mon, 9 Oct 2017 20:35:31 +0000 (20:35 +0000)]
Shorten list of arguments to mbuf external storage freeing function.

All of these arguments are stored in m_ext, so there is no reason
to pass them in the argument list.  Not all functions need the second
argument, some don't even need the first one.  The second argument
lives in next cache line, so not dereferencing it is a performance
gain.  This was discovered in sendfile(2), which will be covered by
next commits.

The second goal of this commit is to bring even more flexibility
to m_ext mbufs, allowing to create more fields in m_ext, opaque to
the generic mbuf code, and potentially set and dereferenced by
subsystems.

Reviewed by: gallatin, kbowling
Differential Revision: https://reviews.freebsd.org/D12615