]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoRename exit to efi_exit to avoid clashing with libsa exit definition
imp [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
imp [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
imp [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.
imp [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
imp [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.
imp [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
imp [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.
imp [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.
bz [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
mjg [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.
mjoras [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).
mjoras [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
glebius [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
davidcs [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
cem [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
emaste [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
davidcs [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
cem [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
cem [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
bapt [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
emaste [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
kib [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
sephe [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
sephe [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.
sephe [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.
sephe [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
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.
jhibbits [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
emaste [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().
sbruno [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()
emaste [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.
rmacklem [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
davidcs [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
emaste [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).
jkim [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.
jkim [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
sbruno [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.
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
ngie [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
bapt [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 [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 [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 [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
hselasky [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.
hselasky [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.
hselasky [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.
sephe [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.
sephe [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.
sephe [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
ngie [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
eadler [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`
ngie [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
ngie [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
ngie [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,
imp [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.
sbruno [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
bjk [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
asomers [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
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
imp [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.
imp [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
imp [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
imp [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
imp [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
imp [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
imp [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.
glebius [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,
glebius [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.
glebius [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

6 years agoWhen showing the sleepqueues from the in-kernel debugger,
hselasky [Mon, 9 Oct 2017 18:33:29 +0000 (18:33 +0000)]
When showing the sleepqueues from the in-kernel debugger,
properly dump all the sendqueues and not just the first one

History:
It appears that in the commit which introduced the code,
r165272, the array indexes of "sq_blocked[0]" and "td_name[i]"
were interchanged. In r180927 "td_name[i]" was corrected to
"td_name[0]", but "sq_blocked[0]" was left unchanged.

PR: 222624
Discussed with: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoThe recent change to initialization of blists (r324420) relied on '-1'
alc [Mon, 9 Oct 2017 18:19:06 +0000 (18:19 +0000)]
The recent change to initialization of blists (r324420) relied on '-1'
appearing only where the code explicitly set it, but since much of the
data was not initialized, '-1' appeared other places too, and led to
panics.  Clear the allocated data before initializing nonzero values by
allocating with M_ZERO.

Submitted by: Doug Moore <dougm@rice.edu>
Reported by: Oleg V. Nauman <oleg@theweb.org.ua>, cy
Tested by: Oleg V. Nauman <oleg@theweb.org.ua>
MFC after: 1 week
X-MFC with: r324420
Differential Revision: https://reviews.freebsd.org/D12627

6 years agocxgbetool(8): Do not close uninitialized fd on malloc failure.
np [Mon, 9 Oct 2017 18:00:40 +0000 (18:00 +0000)]
cxgbetool(8): Do not close uninitialized fd on malloc failure.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoSwitch BEAGLEBONE, CUBIEBOARD, and PANDABOARD to use the GENERIC
gjb [Mon, 9 Oct 2017 17:12:02 +0000 (17:12 +0000)]
Switch BEAGLEBONE, CUBIEBOARD, and PANDABOARD to use the GENERIC
kernel configuration.

Submitted by: andrew
Differential Revision: https://reviews.freebsd.org/D12484
Sponsored by: The FreeBSD Foundation

6 years agoFix freebsd-update(8) erroneous message and exit status when "fetch install" used.
ygy [Mon, 9 Oct 2017 16:33:37 +0000 (16:33 +0000)]
Fix freebsd-update(8) erroneous message and exit status when "fetch install" used.

PR: 190660
Reviewed by: allanjude
Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D12037

6 years agoChange amd64_get_ldt() to return 'EOF' when the LDT is not yet
kib [Mon, 9 Oct 2017 16:20:39 +0000 (16:20 +0000)]
Change amd64_get_ldt() to return 'EOF' when the LDT is not yet
allocated, when requested range of descriptors does not fit into
currently allocated LDT, or trim the return if the range fits
partially.  Before, the function returned EINVAL.

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

6 years agoChange i386_get_ldt() to return 'EOF' when the requested range of
kib [Mon, 9 Oct 2017 16:19:26 +0000 (16:19 +0000)]
Change i386_get_ldt() to return 'EOF' when the requested range of
descriptors does not fit into currently allocated LDT, or trim the
return if the range fits partially.  Before, the function returned
EINVAL.

Fix two bugs in r324366: use capped num counter for malloc size, and
do not leak allocated buffer on EINVAL (by handling EINVAL case as
normal, see above).

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

6 years agoImprovements to set_user_ldt().
kib [Mon, 9 Oct 2017 16:07:27 +0000 (16:07 +0000)]
Improvements to set_user_ldt().

Remove mtx_owned() checks from set_user_ldt().  Split the function
into _locked() version which requires the dt_lock spinlock owned, and
make set_user_ldt() a wrapper.  Add a comment in swtch.s noting that
the call to the new set_user_ldt() cannot recurse on dt_lock.

Remove #ifdef SMP block, the addend is always zero on UP.

Fix type of set_user_ldt_rv(), making it match the type used for
smb_rendezvous() callback, and remove the cast.  Use curproc.

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

6 years agoSee r198948
eadler [Mon, 9 Oct 2017 16:02:15 +0000 (16:02 +0000)]
See r198948

6 years agoAdd the firmware for the Intel 8265 WiFi device.
gnn [Mon, 9 Oct 2017 15:54:57 +0000 (15:54 +0000)]
Add the firmware for the Intel 8265 WiFi device.

MFC after: 1 month

6 years agoAdd support for Intel 8265 WiFi
gnn [Mon, 9 Oct 2017 15:48:56 +0000 (15:48 +0000)]
Add support for Intel 8265 WiFi

Obtained from: OpenBSD
MFC after: 1 month

6 years agoReset the fs and gs bases on exec(2).
kib [Mon, 9 Oct 2017 15:39:43 +0000 (15:39 +0000)]
Reset the fs and gs bases on exec(2).

The values from the old address space do not make sense for the new
program.  In particular, gsbase might be the TLS base for the old
program but the new program has no TLS now.

amd64 already handles this correctly.

Reported and reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoMore style.
kib [Mon, 9 Oct 2017 15:24:18 +0000 (15:24 +0000)]
More style.

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

6 years agopatch(1): Don't overrun line buffer in some cases
kevans [Mon, 9 Oct 2017 14:50:02 +0000 (14:50 +0000)]
patch(1): Don't overrun line buffer in some cases

Patches like file.txt attached to PR 190195 with a final line formed
like ">(EOL)" could cause a copy past the end of the current line buffer. In the
case of PR 191641, this caused a duplicate line to be copied into the resulting
file.

Instead of running past the end, treat it as if it were a blank line.

PR: 191641
Reviewed by: cem, emaste, pfg
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D12609

6 years agoUndocument "tdnam" (leaving it as an alias), and rename the column
trasz [Mon, 9 Oct 2017 13:53:41 +0000 (13:53 +0000)]
Undocument "tdnam" (leaving it as an alias), and rename the column
to TDNAME.

Suggested by: bde
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoFix long name (used by libxo) for the "tdnam" ps(1) keyword.
trasz [Mon, 9 Oct 2017 13:48:10 +0000 (13:48 +0000)]
Fix long name (used by libxo) for the "tdnam" ps(1) keyword.

Reported by: pluknet
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoDocument "tdnam" keyword to ps(1), and add "tdname" alias.
trasz [Mon, 9 Oct 2017 10:24:06 +0000 (10:24 +0000)]
Document "tdnam" keyword to ps(1), and add "tdname" alias.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoillumos mutex_init: use SX_NEW instead of bzero
avg [Mon, 9 Oct 2017 07:44:09 +0000 (07:44 +0000)]
illumos mutex_init: use SX_NEW instead of bzero

There should be no functional change, but SX_NEW seems to be more
idiomatic to the use-case.

MFC after: 2 weeks
X-MFC note: stable/11 only

6 years agoRemove CVS - we don't run that infrastructure anymore
eadler [Mon, 9 Oct 2017 05:16:34 +0000 (05:16 +0000)]
Remove CVS - we don't run that infrastructure anymore

6 years agoUpdate iso3166 codes
eadler [Mon, 9 Oct 2017 05:01:51 +0000 (05:01 +0000)]
Update iso3166 codes

Based on https://raw.githubusercontent.com/lukes/ISO-3166-Countries-with-Regional-Codes/master/all/all.csv
and hand massaged.

6 years agoAdd macOS 10.13
eadler [Mon, 9 Oct 2017 04:43:05 +0000 (04:43 +0000)]
Add macOS 10.13

6 years agoThe blst_radix_init function has two purposes - to compute the number of
alc [Sun, 8 Oct 2017 22:17:39 +0000 (22:17 +0000)]
The blst_radix_init function has two purposes - to compute the number of
nodes to allocate for the blist, and to initialize them.  The computation
can be done much more quickly by identifying the terminating node, if any,
at every level of the tree and then summing the number of nodes at each
level that precedes the topmost terminator.  The initialization can also be
done quickly, since settings at the root mark the tree as all-allocated, and
only a few terminator nodes need to be marked in the rest of the tree.
Eliminate blst_radix_init, and perform its two functions more simply in
blist_create.

The allocation of the blist takes places in two pieces, but there's no good
reason to do so, when a single allocation is sufficient, and simpler.
Allocate the blist struct, and the array of nodes associated with it, with a
single allocation.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: markj (an earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11968

6 years agoFix imx6 hdmi init after r323553, which used a config_intrhook to defer the
ian [Sun, 8 Oct 2017 18:38:22 +0000 (18:38 +0000)]
Fix imx6 hdmi init after r323553, which used a config_intrhook to defer the
attachment of i2c devices needed by hdmi.

The hdmi init also uses an intrhook callback to defer initialization, and if
the hdmi callback runs first, the i2c devices will not yet have registered
their device_t in association with their FDT phandle, which allows cross-
device references on FDT systems.

Now the hdmi deferred init checks for the i2c device registration, and if
it's not complete yet, it registers as an eventhandler watching for newbus
attach events.  When the i2c device eventually attaches, the hdmi driver
unregisters from watching further events, and continues with the hdmi init.
Because the function signatures for an intrhook callback and an event
handler callback are the same, a single function is used for both callbacks.

Reported by: Russell Haley <russ.haley@gmail.com>

6 years agoAdd eventhandler notifications for newbus device attach/detach.
ian [Sun, 8 Oct 2017 17:33:49 +0000 (17:33 +0000)]
Add eventhandler notifications for newbus device attach/detach.

The detach case is slightly complicated by the fact that some in-kernel
consumers may want to know before a device detaches (so they can release
related resources, stop using the device, etc), but the detach can fail. So
there are pre- and post-detach notifications for those consumers who need to
handle all cases.

A couple salient comments from the review, they amount to some helpful
documentation about these events, but there's currently no good place for
such documentation...

Note that in the current newbus locking model, DETACH_BEGIN and
DETACH_COMPLETE/FAILED sequence of event handler invocation might interweave
with other attach/detach events arbitrarily. The handlers should be prepared
for such situations.

Also should note that detach may be called after the parent bus knows the
hardware has left the building. In-kernel consumers have to be prepared to
cope with this race.

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

6 years agocapsicum_helpers: Add EVENT to default stdio rights set
trasz [Sun, 8 Oct 2017 17:29:43 +0000 (17:29 +0000)]
capsicum_helpers: Add EVENT to default stdio rights set

Without it, calling caph_limit_stdio(3) breaks Irssi.

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

6 years agoRestore the ability to deregister an eventhandler from within the callback.
ian [Sun, 8 Oct 2017 17:21:16 +0000 (17:21 +0000)]
Restore the ability to deregister an eventhandler from within the callback.

When the EVENTHANDLER(9) subsystem was created, it was a documented feature
that an eventhandler callback function could safely deregister itself. In
r200652 that feature was inadvertantly broken by adding drain-wait logic to
eventhandler_deregister(), so that it would be safe to unload a module upon
return from deregistering its event handlers.

There are now 145 callers of EVENTHANDLER_DEREGISTER(), and it's likely many
of them are depending on the drain-wait logic that has been in place for 8
years. So instead of creating a separate eventhandler_drain() and adding it
to some or all of those 145 call sites, this creates a separate
eventhandler_drain_nowait() function for the specific purpose of
deregistering a callback from within the running callback.

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

6 years agoReplace an unnecessary call to vm_page_activate() by an assertion that
alc [Sun, 8 Oct 2017 16:54:42 +0000 (16:54 +0000)]
Replace an unnecessary call to vm_page_activate() by an assertion that
the page is already wired or queued.  Prior to the elimination of PG_CACHED
pages, vm_page_grab() might have returned a valid, previously PG_CACHED
page, in which case enqueueing the page was necessary.  Now, that can't
happen.  Moreover, activating the page is a dubious choice, since the page
is not being accessed.

Reviewed by: kib
MFC after: 1 week

6 years agoFix symlink if_igb.ko in -current such that its relative and doesn't
sbruno [Sat, 7 Oct 2017 23:33:14 +0000 (23:33 +0000)]
Fix symlink if_igb.ko in -current such that its relative and doesn't
end up with non-standard DESTDIR information in its symlink.  This
can happen very trivially if the release scripts are used.

Sponsored by: Limelight Networks

6 years agoCheck so_error early in sendfile() call. Prior to this patch, if a
sbruno [Sat, 7 Oct 2017 23:30:57 +0000 (23:30 +0000)]
Check so_error early in sendfile() call.  Prior to this patch, if a
connection was reset by the remote end, sendfile() would just report
ENOTCONN instead of ECONNRESET.

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

6 years agorandom(4): Gather entropy from Pure sources
cem [Sat, 7 Oct 2017 19:02:03 +0000 (19:02 +0000)]
random(4): Gather entropy from Pure sources

At initialization, hc_source_mask only includes non-Pure sources.

The patch changes source registration to enable the registered source in the
hc_source_mask bitmask. This mask governs which sources are harvested.

This patch also disallows userspace from disabling such sources.

PR: 222807
Submitted by: W. Dean Freeman <badfilemagic AT gmail.com>
Reviewed by: jmg (earlier version), delphij
Approved by: secteam (delphij)
Obtained from: HBSD 0054e3e170e083811acc9f3b637f8be8a86c03e7
Security: yes
Differential Revision: https://reviews.freebsd.org/D12611

6 years agorandom(4): Add missing source descriptions
cem [Sat, 7 Oct 2017 18:59:29 +0000 (18:59 +0000)]
random(4): Add missing source descriptions

Add source descriptions missed in r260847, r303035.

While here, convert the array to C99 initializers.

Reviewed by: delphij
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12618