]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agobnxt: fix intermittent VLAN issues
Stephen Hurd [Thu, 5 Oct 2017 17:52:38 +0000 (17:52 +0000)]
bnxt: fix intermittent VLAN issues

bnxt_init() is invokes Function Reset (bnxt_hwrm_func_reset) and thus FW
configuration for VLANs get erased.  To fix this, in bnxt_init(), Invoking
HWRM to configure VLANs (bnxt_hwrm_cfa_l2_set_rx_mask).

Submitted by: Siva Kallam <siva.kallam@@broadcom.com>
Reviewed by: shurd, sbruno
Approved by: sbruno (mentor)
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D12527

6 years agoThis README file was quite relevant for FreeBSD 3 or 4. However, the
Warner Losh [Thu, 5 Oct 2017 16:48:05 +0000 (16:48 +0000)]
This README file was quite relevant for FreeBSD 3 or 4. However, the
information in this file is now somewhat dated, or is present mostly
correct in the man pages. Retire this file rather than fix it.

Noticed by: cognet@
Sponsored by: Netflix

6 years agoAdd support for new cuse(3) error code, CUSE_ERR_NO_DEVICE.
Hans Petter Selasky [Thu, 5 Oct 2017 16:42:02 +0000 (16:42 +0000)]
Add support for new cuse(3) error code, CUSE_ERR_NO_DEVICE.
This error code is useful when emulating Linux input event
devices from userspace.

PR: 218626
Submitted by: jan.kokemueller@gmail.com
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoDocument KERNBUILDDIR.
Warner Losh [Thu, 5 Oct 2017 16:40:50 +0000 (16:40 +0000)]
Document KERNBUILDDIR.

Sponsored by: Netflix

6 years agoFix "taskqgroup_attach: setaffinity failed: 3" with iflib drivers
Stephen Hurd [Thu, 5 Oct 2017 14:43:30 +0000 (14:43 +0000)]
Fix "taskqgroup_attach: setaffinity failed: 3" with iflib drivers

Improved logging added in r323879 exposed an error during
attach. We need the irq, not the rid to work correctly. em uses
shared irqs, so it will use the same irq for TX as RX. bnxt does
not use shared irqs, or TX irqs at all, so there's no need to set
the TX irq affinity.

Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12496

6 years agoEnsure that the accept ABORT chunks with the T-bit set only the
Michael Tuexen [Thu, 5 Oct 2017 13:29:54 +0000 (13:29 +0000)]
Ensure that the accept ABORT chunks with the T-bit set only the
a non-zero matching peer tag is provided.

MFC after: 1 week

6 years agohyperv/hn: Fix options RSS building
Sepherosa Ziehau [Thu, 5 Oct 2017 13:22:14 +0000 (13:22 +0000)]
hyperv/hn: Fix options RSS building

Reported by: np
MFC after: 1 week
Sponsored by: Microsoft

6 years agoEnsure that after sucessfull i386_set_ldt() call, other threads can
Konstantin Belousov [Thu, 5 Oct 2017 13:12:59 +0000 (13:12 +0000)]
Ensure that after sucessfull i386_set_ldt() call, other threads can
use LDT segments immediately.

If the i386_set_ldt() call created a first LDT descriptor (and
consequently created the LDT) for our address space, LDTR is currently
loaded only on the CPU executing the syscall.  Other CPUs executing
threads sharing the address space, would only load LDTR after context
switch.

Uncomment set_user_ldt_rv() and call it on all CPUs.  Remove critical
section inside set_user_ldt(), it is not needed in the context of call
from smp_rendezvous().

Set md_ldt after md_ldt_sd is initialized using the same code sequence
as in user_ldt_free().  Do the whole initialization in a critical
section, to not race with the context switching while we set LDT.

Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agolocks: partially tidy up waiting on readers
Mateusz Guzik [Thu, 5 Oct 2017 13:01:18 +0000 (13:01 +0000)]
locks: partially tidy up waiting on readers

spin first instant of instantly re-readoing and don't re-read after
spinning is finished - the state is already known.

Note the code is subject to significant changes later.

MFC after: 1 week

6 years agoAvoid a race betweem freeing LDT and context switches.
Konstantin Belousov [Thu, 5 Oct 2017 12:50:03 +0000 (12:50 +0000)]
Avoid a race betweem freeing LDT and context switches.

cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating
presence of the process LDT.  The flag is checked and then ldt segment
descriptor is copied into the CPU' GDT slot.

Disallow context switches around clearing of the curproc LDT state by
performing the cleanup in critical section.  Ensure that the md_ldt
flag is cleared before md_ldt_sd descriptor content is destroyed by
inserting fence between the operations.

We depend on the x86 memory model strong ordering guarantees, in
particular, that cpu_switch.S observes the writes to md_ldt and
md_ldt_sd in the expected order.

Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agofix the misleading log facility used in devd/zfs.conf
Andriy Gapon [Thu, 5 Oct 2017 12:38:26 +0000 (12:38 +0000)]
fix the misleading log facility used in devd/zfs.conf

In general, the "kern" facility is reserved for the kernel use only.
If a program specifies that facility, then it is silently converted
to "user" facility.
So, using logger -p kern.xxx was both misleading and non-specific.

Thus, change the facility to local7, so that users can create
more adequate syslogd configurations.

While local0..local7 are documented as being for local use we already
have several examples in the tree where they are used because none of
the named facilities really fits.

Approved by: asomers
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12420

6 years agosysctl-s in a module should be accessible only when the module is initialized
Andriy Gapon [Thu, 5 Oct 2017 12:32:14 +0000 (12:32 +0000)]
sysctl-s in a module should be accessible only when the module is initialized

A sysctl can have a custom handler that may access data that is initialized
via SYSINIT(9) or via a module event handler (also invoked via SYSINIT).
Thus, it is not safe to allow access to the module's sysctl-s until
the initialization is performed.  Likewise, we should not allow access
to teh sysctl-s after the module is uninitialized.
The latter is easy to achieve by properly ordering linker_file_unregister_sysctls
and linker_file_sysuninit.
The former is not as easy for two reasons:
- the initialization may depend on tunables which get set when sysctl-s are
  registered, so we need to set the tunables before running sysinit-s
- the initialization may try to dynamically add more sysctl-s under statically
  defined sysctl nodes
So, this change splits the sysctl setup into two phases.  In the first phase
the sysctl-s are registered as before but they are disabled and hidden from
consumers.  In the second phase, done after sysinit-s, normal access to the
sysctl-s is enabled.

The change should affect only dynamic module loading and unloading after
the system boot-up.  Nothing changes for sysctl-s compiled into the kernel
and sysctl-s in preloaded modules.

Discussed with: hselasky, ian, jhb
Reviewed by: julian, kib
MFC after: 2 weeks
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D12545

6 years agoImprove amd64_get_ldt().
Konstantin Belousov [Thu, 5 Oct 2017 12:29:34 +0000 (12:29 +0000)]
Improve amd64_get_ldt().

Provide consistent snapshot of the requested descriptors by preventing
other threads from modifying LDT while we fetch the data, lock dt_lock
around the read.  Copy the data into intermediate buffer, which is
copied out after the lock is dropped.

Use guaranteed atomic (aligned volatile) reads of the descriptors to
use same-size atomic as CPU update to set A bit in the descriptor type
field.

Improve overflow checking for the descriptors range calculations and
remove unneeded casts.

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

6 years agoremove heuristic error detection from ddi_strto*()
Andriy Gapon [Thu, 5 Oct 2017 12:25:18 +0000 (12:25 +0000)]
remove heuristic error detection from ddi_strto*()

Zero, <TYPE>_MIN and <TYPE>_MAX values can result from valid conversions.
They don't necessarily imply any error.
Since we do not have any reliable error signaling from libkern's strto*(),
it's better to always assume success rather than to report an error when
there is none.

Reviewed by: tsoome
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12565

6 years agoMinor style fix.
Konstantin Belousov [Thu, 5 Oct 2017 12:19:55 +0000 (12:19 +0000)]
Minor style fix.

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

6 years agoComplete r323772 on amd64.
Konstantin Belousov [Thu, 5 Oct 2017 12:16:45 +0000 (12:16 +0000)]
Complete r323772 on amd64.

Compilers are allowed to combine plain reads into group operations,
e.g. 64bit element copies of one array into another can be
legitimately optimized back to a memcpy() call, which r323772 tried to
prevent.

Qualify accesses to LDT descriptors with volatile dereference to
ensure that each write indeed occurs.  After that, our usual claim of
native-size aligned writes being atomic applies.

This is equivalent to atomic_store(memory_order_relaxed) C11 accesses,
but our machine/atomic.h does not provide corresponding primitive.

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

6 years agoUse ANSI C declaration for amd64_get_ldt().
Konstantin Belousov [Thu, 5 Oct 2017 12:07:38 +0000 (12:07 +0000)]
Use ANSI C declaration for amd64_get_ldt().

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

6 years agoCorrect format specifiers in the debug code.
Konstantin Belousov [Thu, 5 Oct 2017 12:01:39 +0000 (12:01 +0000)]
Correct format specifiers in the debug code.

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

6 years agoRemove useless comments.
Konstantin Belousov [Thu, 5 Oct 2017 11:56:04 +0000 (11:56 +0000)]
Remove useless comments.

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

6 years agoOn amd64, mark the set_user_ldt() function as static.
Konstantin Belousov [Thu, 5 Oct 2017 11:50:01 +0000 (11:50 +0000)]
On amd64, mark the set_user_ldt() function as static.

On i386, the function is used from the context switch code and needs
to be accessible externally.  Amd64 MD context switch does not lock an
LDT spinlock and inlines switching in assembly.

Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoReduce default max_ldt_segment value to 512.
Konstantin Belousov [Thu, 5 Oct 2017 11:36:55 +0000 (11:36 +0000)]
Reduce default max_ldt_segment value to 512.

This makes the LDT to use only one page with default settings,
avoiding the need to find contigous 2 pages in KVA.  It seems that
most users are fine even with 512 segments.

Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoUpdate comment to note that we skip LDT reload for kthreads as well.
Konstantin Belousov [Thu, 5 Oct 2017 11:34:51 +0000 (11:34 +0000)]
Update comment to note that we skip LDT reload for kthreads as well.

Noted by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agocxgbe(4): Provide knobs to set the holdoff parameters of TOE rx queues
Navdeep Parhar [Thu, 5 Oct 2017 07:18:16 +0000 (07:18 +0000)]
cxgbe(4): Provide knobs to set the holdoff parameters of TOE rx queues
separately from NIC rx queues instead of using the same parameters for
both types of queues.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoreally unbreak kernel builds on sparc64 and powerpc64 after r324163, ZFS Channel...
Andriy Gapon [Thu, 5 Oct 2017 06:39:57 +0000 (06:39 +0000)]
really unbreak kernel builds on sparc64 and powerpc64 after r324163, ZFS Channel Programs

This commit also reverts r324178 that did not fix the problem on powerpc64
where char is usigned.

MFC after: 4 weeks
X-MFC with: r324163

6 years agohwpmc(4): Add support for extended AMD events
Conrad Meyer [Wed, 4 Oct 2017 23:35:10 +0000 (23:35 +0000)]
hwpmc(4): Add support for extended AMD events

Sponsored by: Dell EMC Isilon

6 years agoAdd sanity checks in ql_hw_send() qla_send() to ensure that empty slots
David C Somayajulu [Wed, 4 Oct 2017 23:03:09 +0000 (23:03 +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.

6 years agoAdd a few definitions for the Flex File Layout.
Rick Macklem [Wed, 4 Oct 2017 22:55:30 +0000 (22:55 +0000)]
Add a few definitions for the Flex File Layout.

This patch adds a few definitions for the Flex File Layout.
Until a future commit adds Flex File layout support, these new fields
are not used.
This patch should not affect the "pnfs" option for File Layout.

6 years agoaesni(4): CRYPTO_AES_NIST_GCM_16 mandates MAC
Conrad Meyer [Wed, 4 Oct 2017 21:15:45 +0000 (21:15 +0000)]
aesni(4): CRYPTO_AES_NIST_GCM_16 mandates MAC

Remove some dead conditionals and add an assertion around behavior already
present in aesni_process().

Silence a few Coverity false positives.

CIDs: 13815711381557
Sponsored by: Dell EMC Isilon

6 years agoPartially revert r323866.
Mariusz Zaborski [Wed, 4 Oct 2017 21:05:44 +0000 (21:05 +0000)]
Partially revert r323866.

Using HAVE_* is a internal tcpdump style standard.
We want to be consistent with the standard to upstream those changes in
the future.

Requested by: glebius@

6 years agohexdump: Remove expected test failures for now succeeding tests
Kyle Evans [Wed, 4 Oct 2017 18:11:00 +0000 (18:11 +0000)]
hexdump: Remove expected test failures for now succeeding tests

r323990 fixed the -s flag breakage reported by PR 219173. Mark the
corresponding hexdump tests accordingly, since they should now both succeed.

PR: 222781
Reported by: ngie
Reviewed by: emaste, ngie
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D12590

6 years agoAdd get_random_{int,long} to the LinuxKPI.
Mark Johnston [Wed, 4 Oct 2017 17:29:08 +0000 (17:29 +0000)]
Add get_random_{int,long} to the LinuxKPI.

Fix some whitespace bugs while here.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D12588

6 years agoDisplay rotation rate and TRIM/UNMAP support in diskinfo(8)
Alan Somers [Wed, 4 Oct 2017 15:09:49 +0000 (15:09 +0000)]
Display rotation rate and TRIM/UNMAP support in diskinfo(8)

Bump __FreeBSD_version due to the expansion of struct diocgattr_arg.

Reviewed by: mav, allanjude, imp
MFC after: 3 weeks
Relnotes: yes
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12578

6 years ago'private' isn't a PNP string field, so instead used the reserved '#'
Warner Losh [Wed, 4 Oct 2017 14:41:45 +0000 (14:41 +0000)]
'private' isn't a PNP string field, so instead used the reserved '#'
name for this field (it might even be possible to just drop it
entirely, since it will be ignored either way).

Sponsored by: Netflix

6 years agoarch.7: correct statement about time_t size
Ed Maste [Wed, 4 Oct 2017 14:39:55 +0000 (14:39 +0000)]
arch.7: correct statement about time_t size

After r320347 it is 64-bit on every architecture except i386.

Sponsored by: The FreeBSD Foundation

6 years agoMake sure the timer belonging to the delayed work in the LinuxKPI
Hans Petter Selasky [Wed, 4 Oct 2017 13:13:38 +0000 (13:13 +0000)]
Make sure the timer belonging to the delayed work in the LinuxKPI
gets drained before invoking the work function. Else the timer
mutex may still be in use which can lead to use-after-free situations,
because the work function might free the work structure before returning.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agomdoc style: start new sentence on new line
Benjamin Kaduk [Wed, 4 Oct 2017 12:58:30 +0000 (12:58 +0000)]
mdoc style: start new sentence on new line

6 years agoDon't destroy gmountver(8) devices on shutdown, unless they are orphaned.
Edward Tomasz Napierala [Wed, 4 Oct 2017 12:25:39 +0000 (12:25 +0000)]
Don't destroy gmountver(8) devices on shutdown, unless they are orphaned.
Otherwise we would fail to sync the filesystem on reboot.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoMake md(4) support GEOM::ident for vnode-backed disks. It's based
Edward Tomasz Napierala [Wed, 4 Oct 2017 12:23:34 +0000 (12:23 +0000)]
Make md(4) support GEOM::ident for vnode-backed disks.  It's based
on backing file device and inode numbers.

This is useful for gmountver(8) regression tests.

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

6 years agoFix iSCSI target panics on concurrent session teardown and display
Edward Tomasz Napierala [Wed, 4 Oct 2017 11:35:04 +0000 (11:35 +0000)]
Fix iSCSI target panics on concurrent session teardown and display
(eg removing a target and doing "ctladm islist -v" at the same time).

Reviewed by: manu
Tested by: manu
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoFix typo.
Cy Schubert [Wed, 4 Oct 2017 09:54:59 +0000 (09:54 +0000)]
Fix typo.

Reported by: se

6 years agoFix typo.
Cy Schubert [Wed, 4 Oct 2017 09:54:55 +0000 (09:54 +0000)]
Fix typo.

6 years agomountd: Convert mountlist to SLIST
Emmanuel Vadot [Wed, 4 Oct 2017 08:48:05 +0000 (08:48 +0000)]
mountd: Convert mountlist to SLIST

Use SLIST from sys/queue.h instead of homebrew linked list for mountlist.

Reviewed by: bapt, rmacklem
MFC after: 1 week
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D12504

6 years agomountd: Convert exportlist to SLIST
Emmanuel Vadot [Wed, 4 Oct 2017 08:43:56 +0000 (08:43 +0000)]
mountd: Convert exportlist to SLIST

Use SLIST from sys/queue.h instead of homebrew linked list for the exportlist.

Reviewed by: bapt, rmacklem
MFC after: 1 week
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D12502

6 years agoClarify the wording describing the stayopen flag.
Cy Schubert [Wed, 4 Oct 2017 06:06:22 +0000 (06:06 +0000)]
Clarify the wording describing the stayopen flag.

MFC after: 1 week

6 years agoWhen building multiple kernels using KERNCONF, non-existent KERNCONF
Cy Schubert [Wed, 4 Oct 2017 03:39:54 +0000 (03:39 +0000)]
When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

This is the correct patch.

Reviewed by: ngie (previous version, r302865)
MFC after: 2 months
Differential Revision: D7167

6 years agoRevert r324246. This is not exactly what was intended.
Cy Schubert [Wed, 4 Oct 2017 03:35:23 +0000 (03:35 +0000)]
Revert r324246. This is not exactly what was intended.

6 years agoWhen building multiple kernels using KERNCONF, non-existent KERNCONF
Cy Schubert [Wed, 4 Oct 2017 03:24:16 +0000 (03:24 +0000)]
When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

Reviewed by: ngie (previous version, r302865)
MFC after: 2 months
Differential Revision: D7167

6 years agochpass(1): Check crypt(3) return and handle error appropriately
Conrad Meyer [Wed, 4 Oct 2017 01:12:26 +0000 (01:12 +0000)]
chpass(1): Check crypt(3) return and handle error appropriately

This change is spiritually similar to the earlier r231994.

PR: 222756
Submitted by: Lubos Boucek <bouceklubos AT gmail.com>
Obtained from: DragonflyBSD 2020c8fec4168a5020f984a093224fade3074b25

6 years agoRemove an unneeded and incorrect memset().
Brooks Davis [Tue, 3 Oct 2017 22:57:19 +0000 (22:57 +0000)]
Remove an unneeded and incorrect memset().

On Variant I TLS architectures (aarch64, arm, mips, powerpc, and riscv)
the __libc_allocate_tls function allocates thread local storage memory
with calloc(). It then copies initialization data over the portions with
non-zero initial values. Before this change it would then pointlessly
zero the already zeroed remainder of the storage. Unfortunately the
calculation was wrong and it would zero TLS_TCB_SIZE (2*sizeof(void *))
additional bytes.

In practice, this overflow only matters if the TLS segment is sized such
that calloc() allocates a less than TLS_TCB_SIZE extra memory. Even
then, the likely result will be zeroing part of the next bucket. This
coupled with the impact being confined to Tier II platforms means there
will be no security advisory for this issue.

Reviewed by: kib, dfr
Discussed with: security-officer (delphij)
MFC after: 1 week
Found by: CHERI
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12547

6 years agoFix copy/paste error in diskinfo.8 from r320555
Alan Somers [Tue, 3 Oct 2017 17:00:01 +0000 (17:00 +0000)]
Fix copy/paste error in diskinfo.8 from r320555

MFC after: 1 week
Sponsored by: Spectra Logic Corp

6 years agoo FreeBSD 10.4 happened after 11.1, adjust the branches accordingly.
Maxim Konovalov [Tue, 3 Oct 2017 14:23:49 +0000 (14:23 +0000)]
o FreeBSD 10.4 happened after 11.1, adjust the branches accordingly.
o The current FreeBSD branch is 12 not 13.

Suggested by: lidl

6 years agoFreeBSD 10.4 release added.
Maxim Konovalov [Tue, 3 Oct 2017 13:31:22 +0000 (13:31 +0000)]
FreeBSD 10.4 release added.

6 years agoMake procstat(1) recognize process descriptors, so that it shows
Edward Tomasz Napierala [Tue, 3 Oct 2017 11:45:24 +0000 (11:45 +0000)]
Make procstat(1) recognize process descriptors, so that it shows
"P" instead of "?" in "procstat -af" output. Note that there are
still a few more DTYPE_* kinds we don't decode yet.

Reported by: rwatson
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12426

6 years agoFixed description of msg_name/msg_namelen in recvmsg().
Ruslan Ermilov [Tue, 3 Oct 2017 11:13:25 +0000 (11:13 +0000)]
Fixed description of msg_name/msg_namelen in recvmsg().

6 years agoCorrect sense of crypt(3) NULL checks in init(8) and lock(1)
Conrad Meyer [Tue, 3 Oct 2017 00:53:11 +0000 (00:53 +0000)]
Correct sense of crypt(3) NULL checks in init(8) and lock(1)

In r231994, an attempt was made to fix crypt(3) failure returns (NULL).
However, instead of treating crypt(3) failure as authentication failure,
some of the changes treated crypt(3) failure as authentication success.
This is wrong.

r324225 fixed this for ppp, which also inspired this review.  The other
changes in the 231994 revision were audited for correctness and look ok.

Reviewed by: jhb
Security: yes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12571

6 years agoFlesh out pathconf() on UDF.
John Baldwin [Mon, 2 Oct 2017 23:31:11 +0000 (23:31 +0000)]
Flesh out pathconf() on UDF.

- Return 64 bits for _PC_FILESIZEBITS.
- Handle _PC_SYMLINK_MAX.
- Defer _PC_PATH_MAX to vop_stdpathconf().

Sponsored by: Chelsio Communications

6 years agoHide struct socket and struct unpcb from the userland.
Gleb Smirnoff [Mon, 2 Oct 2017 23:29:56 +0000 (23:29 +0000)]
Hide struct socket and struct unpcb from the userland.

Violators may define _WANT_SOCKET and _WANT_UNPCB respectively and
are not guaranteed for stability of the structures.  The violators
list is the the usual one: libprocstat(3) and netstat(1) internally
and lsof in ports.

In struct xunpcb remove the inclusion of kernel structure and add
a bunch of spare fields.  The xsocket already has socket not included,
but add there spares as well.  Embed xsockbuf into xsocket.

Sort declarations in sys/socketvar.h to separate kernel only from
userland available ones.

PR: 221820 (exp-run)

6 years agoReturn 64 for pathconf(_PC_FILESIZEBITS) on tmpfs.
John Baldwin [Mon, 2 Oct 2017 23:23:12 +0000 (23:23 +0000)]
Return 64 for pathconf(_PC_FILESIZEBITS) on tmpfs.

Sponsored by: Chelsio Communications

6 years agoppp(8): Fix various bugs in NOPAM section of auth_CheckPasswd
Conrad Meyer [Mon, 2 Oct 2017 23:14:29 +0000 (23:14 +0000)]
ppp(8): Fix various bugs in NOPAM section of auth_CheckPasswd

* pw is not initialized before use
* success is returned if crypt(3) errors

These bugs were introduced in r231994, which attempted to adopt DragonflyBSD
f4a9869feb646aafe72de6e5d61051a023a02676.  The original author of the
Dragonfly change also noticed these mistakes and filed the PR.

PR: 222620
Submitted by: Lubos Boucek <bouceklubos AT gmail.com>
Obtained from: DragonflyBSD f4a9869feb646aafe72de6e5d61051a023a02676

6 years agoHandle _PC_FILESIZEBITS and _PC_SYMLINK_MAX pathconf() requests in cd9660.
John Baldwin [Mon, 2 Oct 2017 23:12:02 +0000 (23:12 +0000)]
Handle _PC_FILESIZEBITS and _PC_SYMLINK_MAX pathconf() requests in cd9660.

cd9660 only supports symlinks with Rock Ridge extensions, so
_PC_SYMLINK_MAX is conditional on Rock Ridge.

Sponsored by: Chelsio Communications

6 years agoMFV r319743: 8108 zdb -l fails to read labels 2 and 3
Alan Somers [Mon, 2 Oct 2017 22:39:12 +0000 (22:39 +0000)]
MFV r319743:   8108 zdb -l fails to read labels 2 and 3

illumos/illumos-gate@22c8b9583d07895c16549075a53668d7bc988cf3
https://github.com/illumos/illumos-gate/commit/22c8b9583d07895c16549075a53668d7bc988cf3

https://www.illumos.org/issues/8108

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

MFC after: 3 weeks

6 years agoMFV r316863: 3871 fix issues introduced by 3604
Alan Somers [Mon, 2 Oct 2017 22:35:35 +0000 (22:35 +0000)]
MFV r316863: 3871 fix issues introduced by 3604

illumos/illumos-gate@de05b58863498b10283637eb9ac85e92fe85150e
https://github.com/illumos/illumos-gate/commit/de05b58863498b10283637eb9ac85e92fe85150e

https://www.illumos.org/issues/3871
  GCC 4.5.3 on Gentoo Linux did not like a few of the changes made in the issue
  3604 patch. It printed an error and a couple of warnings:
  ../../cmd/zdb/zdb.c: In function 'dump_bpobj':
  ../../cmd/zdb/zdb.c:1257:3: error: 'for' loop initial declarations are only
  allowed in C99 mode
  ../../cmd/zdb/zdb.c:1257:3: note: use option -std=c99 or -std=gnu99 to compile
  your code
  ../../cmd/zdb/zdb.c: In function 'dump_deadlist':
  ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format
  ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Richard Yao <ryao@gentoo.org>

MFC after: 3 weeks

6 years agoMFV r316861: 6866 zdb -l should return non-zero if it fails to find any label
Alan Somers [Mon, 2 Oct 2017 22:13:20 +0000 (22:13 +0000)]
MFV r316861: 6866 zdb -l should return non-zero if it fails to find any label

illumos/illumos-gate@64723e361134b2a2c45341334174f9d34002f8d0
https://github.com/illumos/illumos-gate/commit/64723e361134b2a2c45341334174f9d34002f8d0

https://www.illumos.org/issues/6866
  Need this for #6865.
  To be generally more scripting-friendly, overload this issue with adding '-q'
  option which should skip printing any label information.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

MFC after: 3 weeks

6 years agoMFC r316858 7280 Allow changing global libzpool variables in zdb
Alan Somers [Mon, 2 Oct 2017 22:02:04 +0000 (22:02 +0000)]
MFC r316858 7280 Allow changing global libzpool variables in zdb

7280 Allow changing global libzpool variables in zdb and ztest through command line

illumos/illumos-gate@0e60744c982adecd0a1f146f5637475d07ab1069
https://github.com/illumos/illumos-gate/commit/0e60744c982adecd0a1f146f5637475d07ab1069

https://www.illumos.org/issues/7280
  zdb is very handy for diagnosing problems with a pool in a safe and
  quick way. When a pool is in a bad shape, we often want to disable some
  fail-safes, or adjust some tunables in order to open them. In the
  kernel, this is done by changing public variables in mdb. The goal of
  this feature is to add the same capability to zdb and ztest, so that
  they can change libzpool tuneables from the command line.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

MFC after: 3 weeks

6 years ago[libthr] revert change of visibility of _thread_keytable to unbreak debugger
Michael Zhilin [Mon, 2 Oct 2017 20:33:16 +0000 (20:33 +0000)]
[libthr] revert change of visibility of _thread_keytable to unbreak debugger

Fix regression by r318539. The sysutils/pstack uses library libthread_db to
read information about threads state. The function pt_ta_new makes lookup of
several key symbols including _thread_keytable. But r318539 mades this field
static. It causes silent ignore of libthr library by pstack and as result
sysutils/pstack doesn't output any thread information.

This fix changes this field back to non-static.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11738

6 years agoWhitespace changes: Remove leading spaces followed by a tab.
Michael Tuexen [Mon, 2 Oct 2017 20:02:25 +0000 (20:02 +0000)]
Whitespace changes: Remove leading spaces followed by a tab.

6 years agoAllwinner H3 CCU: Fix build on ARM64
Emmanuel Vadot [Mon, 2 Oct 2017 19:17:09 +0000 (19:17 +0000)]
Allwinner H3 CCU: Fix build on ARM64

ccu_h3.c is also used on ARM64 as it provides clocks for the H5 SoC.
Since ARM64 doesn't have sys/gun/dts/include in it's include path, use
the full name for the sun8i-h3-ccu.h include.

Reported by: andreast

6 years agoFix a bug which avoided that rules for matching port numbers for SCTP
Michael Tuexen [Mon, 2 Oct 2017 18:25:30 +0000 (18:25 +0000)]
Fix a bug which avoided that rules for matching port numbers for SCTP
packets where actually matched.
While there, make clean in the man-page that SCTP port numbers are
supported in rules.

MFC after: 1 month

6 years agoAllwinner GPIO: Fail if we cannot enable a clock
Emmanuel Vadot [Mon, 2 Oct 2017 17:20:07 +0000 (17:20 +0000)]
Allwinner GPIO: Fail if we cannot enable a clock

If we cannot enable a clock (which is required to have the device
working), do not attach the device as it will not work.

6 years agoAllwinner: Remove a10_gpio.h
Emmanuel Vadot [Mon, 2 Oct 2017 16:39:12 +0000 (16:39 +0000)]
Allwinner: Remove a10_gpio.h

a10_gpio.h isn't used since a long time, remove it from the tree.

6 years agorsh: introduce new option -N disabling shutdown of socket sending path.
Eugene Grosbein [Mon, 2 Oct 2017 16:33:04 +0000 (16:33 +0000)]
rsh: introduce new option -N disabling shutdown of socket sending path.

This prevents premature disconnection of rsh session with protocol
implementation confused by "end-of-file" condition for standard
input stream. For example, modern Cisco IOS (15.x) versions
can be managed with "rsh -N" cron jobs having /dev/null as stdin.

PR: 205144
Approved by: avg (mentor)
MFC after: 1 week

6 years agoAllwinner A31 ccu: Use clock/reset IDs from dt-bindings
Emmanuel Vadot [Mon, 2 Oct 2017 16:21:20 +0000 (16:21 +0000)]
Allwinner A31 ccu: Use clock/reset IDs from dt-bindings

Do not redefines resets and clocks ID which are already in the
dt-bindings include directory. Those files are under dual licenced
under GPL2/MIT so use them directly.

6 years agoAllwinner A64 ccu: Use clock/reset IDs from dt-bindings
Emmanuel Vadot [Mon, 2 Oct 2017 16:12:06 +0000 (16:12 +0000)]
Allwinner A64 ccu: Use clock/reset IDs from dt-bindings

Do not redefines resets and clocks ID which are already in the
dt-bindings include directory. Those files are under dual licenced
under GPL2/MIT so use them directly.

6 years agoBump armv6 SoC images to 2.25GB. RPI-B is full, so increase all
Glen Barber [Mon, 2 Oct 2017 15:56:45 +0000 (15:56 +0000)]
Bump armv6 SoC images to 2.25GB.  RPI-B is full, so increase all
image sizes for consistency.

Submitted by: manu
Sponsored by: The FreeBSD Foundation

6 years agoAllwinner H3 ccu: Use clock/reset IDs from dt-bindings
Emmanuel Vadot [Mon, 2 Oct 2017 15:48:39 +0000 (15:48 +0000)]
Allwinner H3 ccu: Use clock/reset IDs from dt-bindings

Do not redefines resets and clocks ID which are already in the
dt-bindings include directory. Those files are under dual licence
GPL2/MIT so use them directly.

6 years agoAdd a memory barrier to ensure the atomic write is visible to the other
Andrew Turner [Mon, 2 Oct 2017 14:22:35 +0000 (14:22 +0000)]
Add a memory barrier to ensure the atomic write is visible to the other
CPUs before waking them up.

Sponsored by: DARPA, AFRL

6 years agobsdinstall(8) hardening menu: Utilize new kern.randompid=1 behaviour
Allan Jude [Mon, 2 Oct 2017 14:19:31 +0000 (14:19 +0000)]
bsdinstall(8) hardening menu: Utilize new kern.randompid=1 behaviour

Enabling the PID randomization option in bsdinstall(8)'s hardening menu
now randomizes the effective value of kern.randompid on each boot.

Previous behaviour:
When kern.randompid was enabled via the the bsdinstall(8) hardening menu,
a random value was generated and placed in the systems /etc/sysctl.conf as
kern.randompid=value
This makes the value of kern.randompid static across reboots.

New behaviour:
When kern.randompid is enabled via the bsdinstall(8) hardening menu, the
line kern.randompid=1 is placed in the systems /etc/sysctl.conf.
This takes advantage of a new kernel feature and makes the value of
kern.randompid be randomized by the kernel on each reboot.

Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Reviewed by: des
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12433

6 years agoMake sure the doorbell lock is valid for the i386 version
Hans Petter Selasky [Mon, 2 Oct 2017 12:20:55 +0000 (12:20 +0000)]
Make sure the doorbell lock is valid for the i386 version
of the mlx5en(4) driver.

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

6 years agoSetup mbuf hash type properly when receiving IP packets in the mlx4en(4) driver.
Hans Petter Selasky [Mon, 2 Oct 2017 12:11:43 +0000 (12:11 +0000)]
Setup mbuf hash type properly when receiving IP packets in the mlx4en(4) driver.

Submitted by: sephe@
Differential Revision: https://reviews.freebsd.org/D12229
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoImplement SIOCGIFRSS{KEY,HASH} for the mlx4en(4) driver.
Hans Petter Selasky [Mon, 2 Oct 2017 12:05:38 +0000 (12:05 +0000)]
Implement SIOCGIFRSS{KEY,HASH} for the mlx4en(4) driver.

Differential Revision: https://reviews.freebsd.org/D12176
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoClear G_CF_ORPHAN when attaching. This fixes cases where the same
Edward Tomasz Napierala [Mon, 2 Oct 2017 11:57:00 +0000 (11:57 +0000)]
Clear G_CF_ORPHAN when attaching. This fixes cases where the same
GEOM consumer can be orphaned, and then reattach to another provider.

From a user point of view, this makes gmountver(4) work again.

Reviewed by: avg, mav
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12228

6 years agoMFV r323913: 8600 ZFS channel programs - snapshot
Andriy Gapon [Mon, 2 Oct 2017 11:32:08 +0000 (11:32 +0000)]
MFV r323913: 8600 ZFS channel programs - snapshot

illumos/illumos-gate@2840dce1a029098fb784afd951d5f98089f850d8
https://github.com/illumos/illumos-gate/commit/2840dce1a029098fb784afd951d5f98089f850d8

https://www.illumos.org/issues/8600
  ZFS channel programs should be able to create snapshots.
  In addition to the base snapshot functionality, this will likely entail adding
  extra logic to handle edge cases which were formerly not possible, such as
  creating then destroying a snapshot in the same transaction sync.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Chris Williamson <chris.williamson@delphix.com>

MFC after: 5 weeks
X-MFC after: r324163

6 years agoMFV r323912: 8592 ZFS channel programs - rollback
Andriy Gapon [Mon, 2 Oct 2017 11:23:31 +0000 (11:23 +0000)]
MFV r323912: 8592 ZFS channel programs - rollback

illumos/illumos-gate@000cce6b6fad4a8b0eecef6e1251f6aca1719c55
https://github.com/illumos/illumos-gate/commit/000cce6b6fad4a8b0eecef6e1251f6aca1719c55

https://www.illumos.org/issues/8592
  ZFS channel programs should be able to perform a rollback. This logic will
  probably look pretty similar to zfs.sync.destroy().

Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Brad Lewis <brad.lewis@delphix.com>

MFC after: 5 weeks
X-MFC after: r324163

6 years agoMFV r323795: 8604 Avoid unnecessary work search in VFS when unmounting snapshots
Andriy Gapon [Mon, 2 Oct 2017 11:15:32 +0000 (11:15 +0000)]
MFV r323795: 8604 Avoid unnecessary work search in VFS when unmounting snapshots

illumos/illumos-gate@ed992b0aac4e5b70dc1273b1d055c0d471fbb4b1
https://github.com/illumos/illumos-gate/commit/ed992b0aac4e5b70dc1273b1d055c0d471fbb4b1

https://www.illumos.org/issues/8604
  Every time we want to unmount a snapshot (happens during snapshot deletion or
  renaming) we unnecessarily iterate through all the mountpoints in the VFS layer
  (see zfs_get_vfs).
  Ideally we would just put a hold on the snapshot and access its respective VFS
  resource directly.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>

FreeBSD note: I added a FreeBSD specific function getzfsvfs_ref() which
is like getzfsvfs() but returns a filesystem referenced, not busied.
We want a busied filesystem in most cases, because we access its private
data and, thus, we need to prevent the filesystem from being unmounted
and its private data destroyed.  But in some cases we can either get
away with just a referenced filesystem or we must not busy the
filesystem.  Unmounting the filesystem is one of such cases.

MFC after: 5 weeks
X-MFC after: r324163

6 years agofix incorrect use of getzfsvfs_impl in r324163, ZFS Channel Programs
Andriy Gapon [Mon, 2 Oct 2017 11:07:48 +0000 (11:07 +0000)]
fix incorrect use of getzfsvfs_impl in r324163, ZFS Channel Programs

getzfsvfs_impl() returns a referenced, not busied, filesystem,
so the matching call is vfs_rel, not vfs_unbusy.

MFC after: 4 weeks
X-MFC with: r324163

6 years agoForgotten bits in r324179: Include sys/syslog.h if INVARIANTS is not defined
Julien Charbon [Mon, 2 Oct 2017 09:45:17 +0000 (09:45 +0000)]
Forgotten bits in r324179:  Include sys/syslog.h if INVARIANTS is not defined

MFC after: 1 week
X-MFC with: r324179
Pointy hat to: jch

6 years agoHide kernel stuff from userspace.
Konstantin Belousov [Mon, 2 Oct 2017 08:37:43 +0000 (08:37 +0000)]
Hide kernel stuff from userspace.

Sponsored by: Mellanox Technologies

6 years agoUse vm_page_active() rather than directly accessing the page's queue
Alan Cox [Mon, 2 Oct 2017 07:30:21 +0000 (07:30 +0000)]
Use vm_page_active() rather than directly accessing the page's queue
field.

Reviewed by: kib, markj
MFC after: 2 weeks
X-MFC with: r324146

6 years agoWhen mdstart_swap() accesses a page that is already in the active queue,
Alan Cox [Mon, 2 Oct 2017 07:14:32 +0000 (07:14 +0000)]
When mdstart_swap() accesses a page that is already in the active queue,
mark the page as referenced rather than calling vm_page_activate().  This
allows the page's act_count to grow beyond ACT_INIT and better reflect
its usage.  (See also r324146, which modified a function used by tmpfs,
uiomove_object_page(), to behave in the same way.)

Reviewed by: kib, markj
MFC after: 2 weeks

6 years agoPPC: increase MAX_PICS to 32
Wojciech Macek [Mon, 2 Oct 2017 06:05:19 +0000 (06:05 +0000)]
PPC: increase MAX_PICS to 32

Previous value was too low on dual-socket POWER8 system.

Submitted by:          Wojciech Macek <wma@freebsd.org>
Reviewed by:           nwhitehorn
Obtained from:         Semihalf
Sponsored by:          QCM Technologies
Differential revision: https://reviews.freebsd.org/D12540

6 years agoDefine a single instance of ahci_devclass and reference it from all the
Ian Lepore [Mon, 2 Oct 2017 02:58:28 +0000 (02:58 +0000)]
Define a single instance of ahci_devclass and reference it from all the
attachment code for various SOCs and busses.  Remove all the static and
should-have-been-static and named-differently instances of it.

This should eliminate the recently-grown build warnings about multiple
definitions when building arm kernels.

6 years agoEnhance the interrupt capabilities of ti_pruss driver.
Ian Lepore [Mon, 2 Oct 2017 01:03:18 +0000 (01:03 +0000)]
Enhance the interrupt capabilities of ti_pruss driver.

The existing ti_pruss driver for the PRUSS Hardware provided by the AM335x
ARM CPU has basic interrupt capabilities.  This updated driver provides some
more options:

 - Sysctl based configuration for the interrupts (for some examples, see the
   test plan in the phabricator review cited below).

 - A device file (/dev/pruss0.irqN) for each enabled interrupt. This file
   can be read and the device blocks if no irq has happened or returns an
   uint64_t timestamp based on nanouptime().

 - Each interrupt device file provides kqueue-based event notification,
   blocking read(), or select().

Submitted by: Manuel Stuhn <freebsdnewbie@freenet.de>
Differential Revision: https://reviews.freebsd.org/D11959

6 years agoAllow Raspberry Pi platform and drivers to be configured with upstream DTBs.
Ian Lepore [Mon, 2 Oct 2017 00:49:33 +0000 (00:49 +0000)]
Allow Raspberry Pi platform and drivers to be configured with upstream DTBs.

 - Added more compatibility strings to drivers not yet converted
 - Added new RPI platform code compatibility string to match the ones used
   upstream
 - Adapted RPI and RPI2 DTS to match the new platform code compatibility
   string

The goal is to use the upstream DTBs as a replacement for our custom one.
This is now possible with these changes.

Additionally, as the RPI firmware automatically chooses the right DTB for
us, this would allow to have one common armv6 kernel for RPI0 and RPI1
(BCM2835-based), and one common armv7 kernel for RPI2 v1.1 (BCM2836-based),
and RPI2 v1.2 / RPI3 (BCM2837-based).

Submitted by: Sylvain Garrigues <sylgar@gmail.com>
Differential Revision: https://reviews.freebsd.org/D12360

6 years agoThe soisconnected() call removed from syncache_socket() in r307966 was
Patrick Kelsey [Sun, 1 Oct 2017 23:37:17 +0000 (23:37 +0000)]
The soisconnected() call removed from syncache_socket() in r307966 was
not extraneous in the TCP Fast Open (TFO) passive-open case.  In the
TFO passive-open case, syncache_socket() is being called during
processing of a TFO SYN bearing a valid cookie, and a call to
soisconnected() is required in order to allow the application to
immediately consume any data delivered in the SYN and to have a chance
to generate response data to accompany the SYN-ACK.  The removal of
this call to soisconnected() effectively converted all TFO passive
opens to having the same RTT cost as a standard 3WHS.

This commit adds a call to soisconnected() to syncache_tfo_expand() so
that it is only in the TFO passive-open path, thereby restoring TFO
passve-open RTT performance and preserving the non-TFO connection-rate
performance gains realized by r307966.

MFC after: 1 week
Sponsored by: Limelight Networks

6 years agoFix an infinite loop in tcp_tw_2msl_scan() when an INP_TIMEWAIT inp has
Julien Charbon [Sun, 1 Oct 2017 21:20:28 +0000 (21:20 +0000)]
Fix an infinite loop in tcp_tw_2msl_scan() when an INP_TIMEWAIT inp has
been destroyed before its tcptw with INVARIANTS undefined.

This is a symmetric change of r307551:

A INP_TIMEWAIT inp should not be destroyed before its tcptw, and INVARIANTS
will catch this case.  If INVARIANTS is undefined it will emit a log(LOG_ERR)
and avoid a hard to debug infinite loop in tcp_tw_2msl_scan().

Reported by: Ben Rubson, hselasky
Submitted by: hselasky
Tested by: Ben Rubson, jch
MFC after: 1 week
Sponsored by: Verisign, inc
Differential Revision: https://reviews.freebsd.org/D12267

6 years agounbreak kernel builds on sparc64 and powerpc after r324163, ZFS Channel Programs
Andriy Gapon [Sun, 1 Oct 2017 20:12:30 +0000 (20:12 +0000)]
unbreak kernel builds on sparc64 and powerpc after r324163, ZFS Channel Programs

The custom iscntrl() in ZFS Lua code expects a signed argumnet, so
remove the harmful cast.

Reported by: ian
MFC after: 5 weeks
X-MFC with: r324163

6 years agoTo prepare for adding EFI runtime services support on arm64 move the
Andrew Turner [Sun, 1 Oct 2017 19:52:47 +0000 (19:52 +0000)]
To prepare for adding EFI runtime services support on arm64 move the
machine independent parts of the existing code to a new file that can be
shared between amd64 and arm64.

Reviewed by: kib (previous version), imp
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12434

6 years agoFix supposed typo in the include guard symbol name, use full path for
Konstantin Belousov [Sun, 1 Oct 2017 19:03:21 +0000 (19:03 +0000)]
Fix supposed typo in the include guard symbol name, use full path for
the name.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoWhen an I/O error occurs on page out, there is no need to dirty the page,
Alan Cox [Sun, 1 Oct 2017 17:04:26 +0000 (17:04 +0000)]
When an I/O error occurs on page out, there is no need to dirty the page,
because it is already dirty.  Instead, assert that the page is dirty.

Reviewed by: kib, markj
MFC after: 1 week

6 years agoAlign test I/O buffer to page boundary.
Alexander Motin [Sun, 1 Oct 2017 16:59:02 +0000 (16:59 +0000)]
Align test I/O buffer to page boundary.

This is more alike to typical kernel behavior, that can be useful from
benchmarking point of view.

MFC after: 1 week