]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r316657:
bcr [Sun, 23 Apr 2017 10:29:09 +0000 (10:29 +0000)]
MFC r316657:

Make setkey(8) more clear about anti-replay window size option semantics.

PR: 172913
Submitted by: john@saltant.com
Reviewed by: ae@
Differential Revision:  https://reviews.freebsd.org/D10304

7 years agoMFC r314290: Implement use of multiple transfers per I/O.
mav [Sun, 23 Apr 2017 09:01:40 +0000 (09:01 +0000)]
MFC r314290: Implement use of multiple transfers per I/O.

This change removes limitation of single S/G list entry and limitation on
maximal I/O size, using multiple data transfers per I/O if needed.  Also
it removes code duplication between send and receive paths, which are now
completely equal.

7 years agoMFC r314256: Use ctl_queue_sense() to implement sense data reporting.
mav [Sun, 23 Apr 2017 09:01:01 +0000 (09:01 +0000)]
MFC r314256: Use ctl_queue_sense() to implement sense data reporting.

USB MS BBB transport does not support autosense, so we have to queue any
sense data back to CTL for later fetching via REQUEST SENSE.

7 years agoMFC r314254: Update kern_data_resid according to r312291.
mav [Sun, 23 Apr 2017 09:00:26 +0000 (09:00 +0000)]
MFC r314254: Update kern_data_resid according to r312291.

This now mandatory for correct operation.

7 years agoMFC r317186
kp [Sun, 23 Apr 2017 08:58:50 +0000 (08:58 +0000)]
MFC r317186

pf: Fix possible incorrect IPv6 fragmentation

When forwarding pf tracks the size of the largest fragment in a fragmented
packet, and refragments based on this size.
It failed to ensure that this size was a multiple of 8 (as is required for all
but the last fragment), so it could end up generating incorrect fragments.

For example, if we received an 8 byte and 12 byte fragment pf would emit a first
fragment with 12 bytes of payload and the final fragment would claim to be at
offset 8 (not 12).

We now assert that the fragment size is a multiple of 8 in ip6_fragment(), so
other users won't make the same mistake.

Reported by: Antonios Atlasis <aatlasis at secfu net>

7 years agoMFC r316589:
trasz [Sun, 23 Apr 2017 08:45:55 +0000 (08:45 +0000)]
MFC r316589:

Unify capitalization.

7 years agoMFC r316587:
trasz [Sun, 23 Apr 2017 08:44:50 +0000 (08:44 +0000)]
MFC r316587:

Update hier(7) by removing files and directories that no longer
exist and doing a few random tweaks.

7 years agoMFC r316467:
trasz [Sun, 23 Apr 2017 08:43:45 +0000 (08:43 +0000)]
MFC r316467:

Add basic description of kernel source layout.

7 years agoMFC r316466:
trasz [Sun, 23 Apr 2017 08:41:58 +0000 (08:41 +0000)]
MFC r316466:

Remove excessive horizontal whitespace from hier(7) by correctly
using "-width". The http://mdocml.bsd.lv/mdoc/details/width.html
says: "Do not use macros in the argument specifying the width,
that's not portable. While GNU troff can handle it, mandoc cannot."
The same problem seems to exist in many other man pages.

7 years agoMFC r316468:
trasz [Sun, 23 Apr 2017 08:40:34 +0000 (08:40 +0000)]
MFC r316468:

Fix typo.

Sponsored by: DARPA, AFRL

7 years agoMFC r316057:
trasz [Sun, 23 Apr 2017 08:39:46 +0000 (08:39 +0000)]
MFC r316057:

Document EVENTHANDLER_DEFINE(9).

Sponsored by: DARPA, AFRL

7 years agoMFC r316056:
trasz [Sun, 23 Apr 2017 08:38:47 +0000 (08:38 +0000)]
MFC r316056:

The cn_consume was removed in r296716.

Sponsored by: DARPA, AFRL

7 years agoMFC r315560:
trasz [Sun, 23 Apr 2017 08:36:29 +0000 (08:36 +0000)]
MFC r315560:

Document how to use reroot with NFS.

Sponsored by: DARPA, AFRL

7 years agoMFC r316652: Fix few minor issues found by Clang Analyzer.
mav [Sun, 23 Apr 2017 07:36:44 +0000 (07:36 +0000)]
MFC r316652: Fix few minor issues found by Clang Analyzer.

7 years agoMFC r316653: Fix few minor issues found by Clang Analyzer.
mav [Sun, 23 Apr 2017 07:35:10 +0000 (07:35 +0000)]
MFC r316653: Fix few minor issues found by Clang Analyzer.

7 years agoMFC r315506:
dchagin [Sun, 23 Apr 2017 06:45:21 +0000 (06:45 +0000)]
MFC r315506:

Glibc get_nprocs() and get_nprocs_conf() uses the sysfs cpu infrastructure
to get number of processors. Implement /sys/devices/system/cpu/.

7 years agoMFC r315505:
dchagin [Sun, 23 Apr 2017 06:43:52 +0000 (06:43 +0000)]
MFC r315505:

Implement getrandom() syscall.
Note. GRND_RANDOM option is not supported for now.

7 years agoMFC r316993, r316994, r316997 as follows:
cy [Sun, 23 Apr 2017 03:16:38 +0000 (03:16 +0000)]
MFC r316993, r316994, r316997 as follows:

r316993:

Fix CID 1372601 in ipfilter/lib/parsefields.c, possible NULL pointer
dereference should reallocarray() fail.

Reported by: Coverity CID 1372601

r316994:

Fix CID 1372600 in ipfilter/tools/ipf_y.y, possible NULL pointer
dereference should reallocarray() fail.

Reported by: Coverity CID 1372600

r316997:

Use warnx() to issue error message.

Reported by: cem

7 years agoMFC: r314694
rgrimes [Sat, 22 Apr 2017 22:05:23 +0000 (22:05 +0000)]
MFC: r314694

  Make vmrun.sh passthrough -u and -w to bhybe

PR: 214273
Submitted by: Martin Birgmeier <la5lb...@aon.at>
Approved by: grehan (mentor)

7 years agoMFC r314691:
rgrimes [Sat, 22 Apr 2017 21:49:59 +0000 (21:49 +0000)]
MFC r314691:

Document 3 more src/ directories

Approved by: grehan (mentor)

7 years agoMFC r316065: Enable route and LLE (ndp) caching in TCP/IPv6
karels [Sat, 22 Apr 2017 18:55:25 +0000 (18:55 +0000)]
MFC r316065: Enable route and LLE (ndp) caching in TCP/IPv6

tcp_output.c was using a route on the stack for IPv6, which does not
allow route caching or LLE/ndp caching. Switch to using the route
(v6 flavor) in the in_pcb, which was already present, which caches
both L3 and L2 lookups.

Reviewed by: gnn hiren

7 years agoMFC r302664:
pfg [Fri, 21 Apr 2017 20:03:08 +0000 (20:03 +0000)]
MFC r302664:
mkimg(1): minor cleanups with argument order in calloc(3).

Generally the first argument in calloc is supposed to stand for a count
and the second for a size. Try to make that consistent. While here,
attempt to make some use of the overflow detection capability in
calloc(3).

Requested by: manu

7 years agoDocument EN-17:01 through EN-17:05, SA-16:39 through SA-17:03
gjb [Fri, 21 Apr 2017 19:41:33 +0000 (19:41 +0000)]
Document EN-17:01 through EN-17:05, SA-16:39 through SA-17:03

Sponsored by: The FreeBSD Foundation

7 years agoMFC r316824:
ae [Fri, 21 Apr 2017 17:09:37 +0000 (17:09 +0000)]
MFC r316824:
  The rule field in the ipfw_dyn_rule structure is used as storage
  to pass rule number and rule set to userland. In r272840 the kernel
  internal rule representation was changed and the rulenum field of
  struct ip_fw_rule got the type uint32_t, but userlevel representation
  still have the type uint16_t. To not overflow the size of pointer
  on the systems with 32-bit pointer size use separate variable to
  copy rulenum and set.

  Reported by: PVS-Studio

7 years agoMFC r316989:
dim [Fri, 21 Apr 2017 17:03:48 +0000 (17:03 +0000)]
MFC r316989:

Pull in r300404 from upstream llvm trunk (by me):

  Use correct registers for "A" inline asm constraint

  Summary:
  In PR32594, inline assembly using the 'A' constraint on x86_64 causes
  llvm to crash with a "Cannot select" stack trace.  This is because
  `X86TargetLowering::getRegForInlineAsmConstraint` hardcodes that 'A'
  means the EAX and EDX registers.

  However, on x86_64 it means the RAX and RDX registers, and on 16-bit
  x86 (ia16?) it means the old AX and DX registers.

  Add new register classes in `X86RegisterInfo.td` to support these
  cases, and amend the logic in `getRegForInlineAsmConstraint` to cope
  with different subtargets.  Also add a test case, derived from
  PR32594.

  Reviewers: craig.topper, qcolombet, RKSimon, ab

  Reviewed By: ab

  Subscribers: ab, emaste, royger, llvm-commits

  Differential Revision: https://reviews.llvm.org/D31902

This should fix crashes when using the 'A' constraint on amd64, for
example as it is being used in Xen.

Reported by: royger

MFC r317079:

Pull in r300429 from upstream llvm trunk (by Benjamin Kramer):

  [X86] Remove special handling for 16 bit for A asm constraints.

  Our 16 bit support is assembler-only + the terrible hack that is
  .code16gcc. Simply using 32 bit registers does the right thing for
  the latter.

  Fixes PR32681.

This fixes some cases of assembling 16 bit code (i.e. SeaBIOS) that uses
the 'A' inline asm constraint, after r316989.

7 years agoMFC r317100:
gjb [Fri, 21 Apr 2017 16:47:57 +0000 (16:47 +0000)]
MFC r317100:
 Use relative symlink for 'latest' to allow repo to work after being
 moved.

PR: 217197
Sponsored by: The FreeBSD Foundation

7 years agoMFC r310181 (matthew) (originally r309314):
gjb [Fri, 21 Apr 2017 16:47:09 +0000 (16:47 +0000)]
MFC r310181 (matthew) (originally r309314):
 Allow a user-overridable setting 'PKG_CMD' to control the command used
 to create a repo during 'make packages'.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r316770:
ae [Fri, 21 Apr 2017 16:45:43 +0000 (16:45 +0000)]
MFC r316770:
  Clear h/w csum flags on mbuf handled by UDP.

  When checksums of received IP and UDP header already checked, UDP uses
  sbappendaddr_locked() to pass received data to the socket.
  sbappendaddr_locked() uses given mbuf as is, and if NIC supports checksum
  offloading, mbuf contains csum_data and csum_flags that were calculated
  for already stripped headers. Some NICs support only limited checksums
  offloading and do not use CSUM_PSEUDO_HDR flag, and csum_data contains
  some value that UDP/TCP should use for pseudo header checksum calculation.

  When L2TP is used for tunneling with mpd5, ng_ksocket receives mbuf with
  filled csum_flags and csum_data, that were calculated for outer headers.
  When L2TP header is stripped, a packet that was tunneled goes to the IP
  layer and due to presence of csum_flags (without CSUM_PSEUDO_HDR) and
  csum_data, the UDP/TCP checksum check fails for this packet.

  Reported by: Irina Liakh <spell at itl ua>
  Tested by: Irina Liakh <spell at itl ua>

MFC r316822,316823:
  Rework r316770 to make it protocol independent and general, like we
  do for streaming sockets.

  And do more cleanup in the sbappendaddr_locked_internal() to prevent
  leak information from existing mbuf to the one, that will be possible
  created later by netgraph.

  Suggested by: glebius
  Tested by: Irina Liakh <spell at itl ua>

7 years agoMFC r316852:
kib [Fri, 21 Apr 2017 10:13:07 +0000 (10:13 +0000)]
MFC r316852:
In fsck_ffs pass1, prevent the inosused variable from wrapping.

PR: 218592

7 years agoMFC r316851:
kib [Fri, 21 Apr 2017 10:11:08 +0000 (10:11 +0000)]
MFC r316851:
Correct calculation of the entry->free_down in the invariants-checking
code.

7 years agoMFC r316811, r317139:
cy [Fri, 21 Apr 2017 02:02:52 +0000 (02:02 +0000)]
MFC r316811, r317139:

Add missing free()'s after calls to randomize().

PR: NetBSD PR/50559
Obtained from: Netbsd radix_ipf.c r1.6

7 years agoMFC r316809:
cy [Fri, 21 Apr 2017 01:51:49 +0000 (01:51 +0000)]
MFC r316809:

Fix a use after free panic in ipfilter's fragment processing.
Memory is malloc'd, then a search for a match in the fragment table
is made and if the fragment matches, the wrong fragment table is
freed, causing a use after free panic. This commit fixes this.

A symptom of the problem is a kernel page fault in bcopy() called by
ipf_frag_lookup() at line 715 in ip_frag.c. Another symptom is a
kernel page fault in ipf_frag_delete() when called by ipf_frag_expire()
via ipf_slowtimer().

7 years agoMFC r312764:
andrew [Thu, 20 Apr 2017 12:48:01 +0000 (12:48 +0000)]
MFC r312764:
Pull the R_AARCH64_TLSDESC code out into a common function and use them in
both the plt and non-plt case.

This fixes an issue where libraries built with LLD can fail with
"Unhandled relocation 1031"

7 years agoMFC r308569,r308570:
skra [Thu, 20 Apr 2017 11:52:10 +0000 (11:52 +0000)]
MFC r308569,r308570:

  r308569:
    Always call PHYS_TO_VM_PAGE() in is_managed(). Fast road for addresses
    under first_page cannot be taken as this variable is connected only to
    vm_page_array segment. There could be more segments in system like the ones
    for various fictitious page ranges. These can be situated under
    vm_page_array segment and so, they could be skipped before this fix.
    However, as far as I know, there is no report associated with it.
  r308570:
    The return type of is_managed() was changed from boolean_t to bool type in
    r308569. Now, propagate this change further for consistency sake.

7 years agoMFC r316183
davidcs [Thu, 20 Apr 2017 04:26:47 +0000 (04:26 +0000)]
MFC r316183
Upgrade firmware and other related files to version 5.4.64

7 years agoMFC r316533:
bdrewery [Wed, 19 Apr 2017 17:32:32 +0000 (17:32 +0000)]
MFC r316533:

  Support assym.s in DPSRCS to depend on it but not link it in.

7 years agoMFC r316534:
bdrewery [Wed, 19 Apr 2017 17:29:54 +0000 (17:29 +0000)]
MFC r316534:

  Stop building assym.o into the module.

7 years agoMFC r313006 (by cem), r315983 (by bde):
markj [Wed, 19 Apr 2017 16:16:41 +0000 (16:16 +0000)]
MFC r313006 (by cem), r315983 (by bde):
Add an SSE4.2 implementation of crc32 for x86.

7 years agoMFC 313772:
andrew [Wed, 19 Apr 2017 15:59:16 +0000 (15:59 +0000)]
MFC 313772:

Load the new sp_el0 with interrupts disabled in fork_trampoline. If an
interrupt arrives in fork_trampoline after sp_el0 was written we may then
switch to a new thread, enter userland so change this stack pointer, then
return to this code with the wrong value. This fixes this case by moving
the load of sp_el0 until after interrupts have been disabled.

7 years agoMFC 305355:
andrew [Wed, 19 Apr 2017 15:46:34 +0000 (15:46 +0000)]
MFC 305355:

Explicitly include all .rodata.* sections in the kernel .rodata. This
helps link the kernel with lld as it will then put all these into a single
.rodata section.

7 years agoMFC r303442, r305343: remove CONSTRUCTORS from linker scripts
emaste [Wed, 19 Apr 2017 15:33:24 +0000 (15:33 +0000)]
MFC r303442, r305343: remove CONSTRUCTORS from linker scripts

r303442: remove CONSTRUCTORS from kernel linker scripts

r305343: remove CONSTRUCTORS from MIPS uboot linker script

The linker script CONSTRUCTORS keyword is only meaningful "when linking
object file formats which do not support arbitrary sections, such as
ECOFF and XCOFF"[1] and is ignored for other object file formats.

LLVM's lld does not yet accept (and ignore) CONSTRUCTORS, so just remove
CONSTRUCTORS from the linker script as it has no effect.

[1] https://sourceware.org/binutils/docs/ld/Output-Section-Keywords.html

Reported by: andrew
Sponsored by: The FreeBSD Foundation

7 years agoFix the arm64 userland building with lld:
andrew [Wed, 19 Apr 2017 14:07:35 +0000 (14:07 +0000)]
Fix the arm64 userland building with lld:

MFC 308124:
 On arm64 build the efi loader with -fPIC. Without this clang 3.9 will
 generate relocation in the self relocation code.

MFC 316608:
 Add -fPIC to the standalone build flags on arm64. This is needed as
 loader.efi is position independend, however we were not building it as
 such causing a build failure when building with lld.

MFC 315452:
 Mark the EFI PE header as allocated. While ld.bfd doesn't seem to care
 about not having this flag ld.lld fails to link without it.

7 years agoMFC r316532:
kib [Wed, 19 Apr 2017 11:13:32 +0000 (11:13 +0000)]
MFC r316532:
Make nfs pageout coherent with the dirty state of the buffers.

7 years agoMFC r316531:
kib [Wed, 19 Apr 2017 11:11:51 +0000 (11:11 +0000)]
MFC r316531:
Handle nfs IO_ASYNC write requests asynchronously.

7 years agoMFC r316529:
kib [Wed, 19 Apr 2017 11:10:02 +0000 (11:10 +0000)]
MFC r316529:
Handle possible vnode reclamation after ncl_vinvalbuf() call.

7 years agoMFC r316739:
kib [Wed, 19 Apr 2017 10:54:08 +0000 (10:54 +0000)]
MFC r316739:
Fix reporting of _SC_SEM_NSEMS_MAX and _SC_SEM_VALUE_MAX.

7 years agoMFC 316813,316815
sephe [Wed, 19 Apr 2017 03:39:50 +0000 (03:39 +0000)]
MFC 316813,316815

316813
    hyperv/storvsc: Use ULL for 64bits value shift.

    Reported by:    PVS
    Sponsored by:   Microsoft

316815
    hyperv/kvp: Remove always false condition.

    Reported by:    PVS
    Sponsored by:   Microsoft

7 years agoMFC 316515,316812
sephe [Wed, 19 Apr 2017 03:30:37 +0000 (03:30 +0000)]
MFC 316515,316812

316515
    hyperv/kbd: Add support for synthetic keyboard.

    Synthetic keyboard is the only supported keyboard on GEN2 Hyper-V.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D10196

316812
    hyperv/kbd: Remove unnecessary assignment.

    Reported by:    PVS
    Sponsored by:   Microsoft

7 years agoMFC r316747
davidcs [Wed, 19 Apr 2017 03:18:11 +0000 (03:18 +0000)]
MFC r316747
Fix rss_ind_table entry for num_funcs > 1

7 years agoMFC r316720
davidcs [Wed, 19 Apr 2017 03:13:58 +0000 (03:13 +0000)]
MFC r316720
Fix defects reported by Coverity
  1. Deadcode in ecore_init_cache_line_size(), qlnx_ioctl() and
   qlnx_clean_filters()
  2. ARRAY_VS_SINGLETON issue in qlnx_remove_all_mcast_mac() and
   qlnx_update_rx_prod()

7 years agoMFC r316485
davidcs [Wed, 19 Apr 2017 03:09:20 +0000 (03:09 +0000)]
MFC r316485
  Add 25/40/100Gigabit Ethernet Driver version v1.3.0 for Cavium Inc's.
  Qlogic 45000 Series Adapters

7 years agoMFC r316310
davidcs [Wed, 19 Apr 2017 02:54:59 +0000 (02:54 +0000)]
MFC r316310
Update man page for commit r316309 "Add support for optional Soft LRO".
The driver provides the ability to select either HW or Software LRO, when
LRO is enabled (default HW LRO).

7 years agoMFC r316309
davidcs [Wed, 19 Apr 2017 02:52:55 +0000 (02:52 +0000)]
MFC r316309
Add support for optional Soft LRO

7 years agoMFC 317107
sephe [Wed, 19 Apr 2017 02:48:38 +0000 (02:48 +0000)]
MFC 317107
    hyperv: Use kmem_malloc for hypercall memory due to NX bit change.

    Reported by:    dexuan@
    Sponsored by:   Microsoft

7 years agoMFC r316715:
ae [Tue, 18 Apr 2017 09:27:26 +0000 (09:27 +0000)]
MFC r316715:
  Make sysctl identifiers for direct netisr queue unique.
  Introduce IPCTL_INTRDQMAXLEN and IPCTL_INTRDQDROPS macros for this purpose.

  Reviewed by: gnn
  Differential Revision: https://reviews.freebsd.org/D10358

7 years agoMFC r316716:
ae [Tue, 18 Apr 2017 09:17:20 +0000 (09:17 +0000)]
MFC r316716:
  Inherit IPv6 checksum offloading flags to vlan interfaces.

  if_vlan(4) interfaces inherit IPv4 checksum offloading flags from the
  parent when VLAN_HWCSUM and VLAN_HWTAGGING flags are present on the
  parent interface. Do the same for IPv6 checksum offloading flags.

  Reported by: Harry Schmalzbauer
  Reviewed by: np, gnn
  Differential Revision: https://reviews.freebsd.org/D10356

7 years agoMFC r313025, r313395, r314113, r314442, r315458, r315656
asomers [Mon, 17 Apr 2017 20:13:20 +0000 (20:13 +0000)]
MFC r313025, r313395, r314113, r314442, r315458, r315656

r313025:
Add tests for multi-fib IPv6 routing

PR: 196361
Submitted by: jhujhiti@adjectivism.org
Reported by: Jason Healy <jhealy@logn.net>
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r313395:
Add fibs_test:udp_dontroute6, another IPv6 multi-FIB test

PR: 196361
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

r314113:
Remove tests/sys/netinet/fibs_tests's dependency on net/socat

Instead of bridging two tap interfaces with socat, just use an epair pair.

MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

r314442:
Add an ATF test for IPv6 SLAAC with multiple fibs

Tests that an interface can get a SLAAC address and that it inserts its
routes into the correct fib. Does not test anything to do with NDP.

PR: 196361
Reviewed by: Erick Turnquist <jhujhiti@adjectivism.org>
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9776

r315458:
Constrain IPv6 routes to single FIBs when net.add_addr_allfibs=0

sys/netinet6/icmp6.c
Use the interface's FIB for source address selection in ICMPv6 error
responses.

sys/netinet6/in6.c
In in6_newaddrmsg, announce arrival of local addresses on the
interface's FIB only.  In in6_lltable_rtcheck, use a per-fib ND6
cache instead of a single cache.

sys/netinet6/in6_src.c
In in6_selectsrc, use the caller's fib instead of the default fib.
In in6_selectsrc_socket, remove a superfluous check.

sys/netinet6/nd6.c
In nd6_lle_event, use the interface's fib for routing socket
messages.  In nd6_is_new_addr_neighbor, check all FIBs when trying
to determine whether an address is a neighbor.  Also, simplify the
code for point to point interfaces.

sys/netinet6/nd6.h
sys/netinet6/nd6.c
sys/netinet6/nd6_rtr.c
Make defrouter_select fib-aware, and make all of its callers pass in
the interface fib.

sys/netinet6/nd6_nbr.c
When inputting a Neighbor Solicitation packet, consider the
interface fib instead of the default fib for DAD.  Output NS and
Neighbor Advertisement packets on the correct fib.

sys/netinet6/nd6_rtr.c
Allow installing the same host route on different interfaces in
different FIBs.  If rt_add_addr_allfibs=0, only install or delete
the prefix route on the interface fib.

tests/sys/netinet/fibs_test.sh
Clear some expected failures, but add a skip for the newly revealed
BUG217871.

PR: 196361
Submitted by: Erick Turnquist <jhujhiti@adjectivism.org>
Reported by: Jason Healy <jhealy@logn.net>
Reviewed by: asomers
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9451

r315656:
Fix back-to-back runs of sys/netinet/fibs_test;slaac_on_nondefault_fib6

This test was failing if run twice because rtadvd takes too long to die.
The rtadvd process from the first run was still running when the
second run created its interfaces.  The solution is to use SIGKILL during
the cleanup instead of SIGTERM so rtadvd will die faster.

While I'm here, randomize the addresses used for the test, which makes bugs
like this easier to spot, and fix the cleanup order to be the opposite of
the setup order

PR: 217871
MFC after: 18 days
X-MFC-With: 315458
Sponsored by: Spectra Logic Corp

7 years agoMFC r316956:
bapt [Mon, 17 Apr 2017 19:08:49 +0000 (19:08 +0000)]
MFC r316956:

Update pci_vendors to 2017.04.03

7 years agoMFC r314987-r314989, r314993-r314994, r315046-r315049, r315102
araujo [Mon, 17 Apr 2017 18:55:54 +0000 (18:55 +0000)]
MFC r314987-r314989, r314993-r314994, r315046-r315049, r315102

r314987:
Use nitems() from sys/param.h.

Reviewed by: asomers
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9944

r314988:
Use nitems() from sys/param.h.

Reviewed by: ume
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9938

r314989:
Use nitems() from sys/param.h and also remove the cast.

Reviewed by: markj
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9937

r314993:
Use nitems() from sys/param.h.

Reviewed by: ngie
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9936

r314994:
Use nitems() from sys/param.h.

Reviewed by: ngie
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9940

r315046:
Use nitems() from sys/param.h

Reviewed by: jhb
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9941

r315047:
Use nitems() from sys/param.h.

Reviewed by: np
MFC after: 3 weeks.
Differential Revision: https://reviews.freebsd.org/D9945

r315048:
Use nitems() from sys/param.h.

MFC after: 3 weeks.

r315049:
Bring back the cast removed in my previous commit to allow us build vmstat
with WARNS 2. This cast was first introduced at r87690.

Reported by: bde, pfg and ngie
MFC after: 3 weeks.

r315102:
Use nitems() from sys/param.h.

Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D9943

7 years agoMFC r316686, r316687, r316689
markj [Mon, 17 Apr 2017 16:59:18 +0000 (16:59 +0000)]
MFC r316686, r316687, r316689
Fix a race between vm_map_wire() and vm_map_protect().

7 years agoMFC r316592:
garga [Mon, 17 Apr 2017 13:01:42 +0000 (13:01 +0000)]
MFC r316592:

Introduce libxo support to arp(8)

Reviewed by: wblock, gnn, allanjude, phil
Approved by: allanjude
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9563

7 years agoMFC r316435:
ae [Mon, 17 Apr 2017 09:42:05 +0000 (09:42 +0000)]
MFC r316435:
  Add ipfw_pmod kernel module.

  The module is designed for modification of a packets of any protocols.
  For now it implements only TCP MSS modification. It adds the external
  action handler for "tcp-setmss" action.

  A rule with tcp-setmss action does additional check for protocol and
  TCP flags. If SYN flag is present, it parses TCP options and modifies
  MSS option if its value is greater than configured value in the rule.
  Then it adjustes TCP checksum if needed. After handling the search
  continues with the next rule.

  Obtained from: Yandex LLC
  Relnotes: yes
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D10150

7 years agoMFC r316433:
ae [Mon, 17 Apr 2017 09:38:15 +0000 (09:38 +0000)]
MFC r316433:
  Add the log formatting for an external action opcode.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

7 years agoMFC r316434:
ae [Mon, 17 Apr 2017 09:36:35 +0000 (09:36 +0000)]
MFC r316434:
  Add O_EXTERNAL_DATA opcode support.

  This opcode can be used to attach some data to external action opcode.
  And unlike to O_EXTERNAL_INSTANCE opcode, this opcode does not require
  creating of named instance to pass configuration arguments to external
  action handler. The data is coming just next to O_EXTERNAL_ACTION opcode.

  The userlevel part currenly supports formatting for opcode with ipfw_insn
  size, by default it expects u16 numeric value in the arg1.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

7 years agoMFC r316461:
ae [Mon, 17 Apr 2017 09:34:09 +0000 (09:34 +0000)]
MFC r316461:
  Remove "IPFW static rules" rmlock.

  Make PFIL's lock global and use it for this purpose.
  This reduces the number of locks needed to acquire for each packet.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D10154

7 years agoMFC r307686:
mmel [Sun, 16 Apr 2017 09:00:10 +0000 (09:00 +0000)]
MFC r307686:

  Use MACHINE_ARCH rather than TARGET_ARCH which has no meaning outside of
  Makefile.inc1

7 years agoMFC r309538:
mmel [Sun, 16 Apr 2017 08:21:14 +0000 (08:21 +0000)]
MFC r309538:

  Fixes for NVIDIA Tegra124 clocks:
   - EMC clock have standard peripheral clock block. Use it.  - Implement full
   frequency set method for PLLD2. This PLL
     is used as HDMI pixel clock so we must be able to set it to wide range of
     frequencies, within 5% tolerance allowed by HDMI specification. Due to
     this, full state space search (over m, n, p fields) is necessary.

7 years agoMFC r308286,r308287:
mmel [Sun, 16 Apr 2017 08:18:37 +0000 (08:18 +0000)]
MFC r308286,r308287:

  r308286:
    TEGRA: Add basic driver for memory controller.  For now, it only reports
    memory and SMMU access errors.
  r308287:
    TEGRA: Fix numerous issues in clock code.  Define and export clocks related
    to XUSB driver.

7 years agoMFC r310593,r310599:
mmel [Sun, 16 Apr 2017 08:07:38 +0000 (08:07 +0000)]
MFC r310593,r310599:

  r310593:
    Fix late monitor hotplug event.  If system starts without attached monitor,
    DRM create framebuffer for VT console. Later, when monitor is attached, the
    hotplug event must issue full modeset procedure to setup CRTC.  In original
    code, this was done in drm_fb_helper_set_par(), but we don't have this
    function implemented yet. Use unrolled version of drm_fb_helper_set_par()
    to ensure same functionality.
  r310599:
    Import drm_patform.c, an implementation of non-PCI based attachment for
    graphics drivers.  It will be used in upcoming driver for Nvidia Tegra
    boards.

7 years agoMFC r309532,r310674:
mmel [Sun, 16 Apr 2017 08:04:01 +0000 (08:04 +0000)]
MFC r309532,r310674:

  r309532:
    Add IDs for HDA codecs found on Nvidia Tegra SoCs.
  r310674:
    Limit number of stripes supported by HDA codec to maximum number announced
    by HDA controller.  Incorrectly implermented HDA codec may report support
    for more stripes that HDA controller already have. Due to this, always
    limit number of enabled stripes by global controller maximum.

7 years agoMFC r309537:
mmel [Sun, 16 Apr 2017 08:01:57 +0000 (08:01 +0000)]
MFC r309537:

  Clock framework fixes:
   - The clk_test_freq() (aka CLK_SET_DRYRUN) doesn't change frequency,
     don't cache it result.
   - Fix busy condition for clk_set_freq().

7 years agoMFC r308612,r308614:
mmel [Sun, 16 Apr 2017 07:58:41 +0000 (07:58 +0000)]
MFC r308612,r308614:

  r308612:
    Allow DRM2 code to be built on platforms without AGP.  This patch is taken
    from original drm-3.8 code.
  r308614:
    Allow embeding DRM2 code into kernel.  It's usefull for development (for
    netboot) and it also helps to boot FreeBSD on some embeded platforms (where
    we must boot kernel directly, without standard boot loader).

7 years agoMFC r306703:
mmel [Sun, 16 Apr 2017 07:43:29 +0000 (07:43 +0000)]
MFC r306703:

  ARM: Disconnect elf_trampoline.c from ARMv6 build.  The trampoline code never
  functioned properly for Cortex CPUs, and its functionality is already
  provided by ubldr.

7 years agoMFC r306442,r306444,r306445,r306550:
mmel [Sun, 16 Apr 2017 07:41:30 +0000 (07:41 +0000)]
MFC r306442,r306444,r306445,r306550:

  r306442:
    TEGRA: Add support for MULTIDELAY option.
  r306444:
    TEGRA: Don't include files already included by system or arch configs.
  r306445:
    TEGRA: Return back kern_clocksource.c into tegra config file. It was
    removed in r306444 by mistake.
  r306550:
    TEGRA: Extend timeout for PLLs lock to 5 ms. Real lock time for PLLA has
    been very near to old limit.

7 years agoMFC r315900,r315973,r315974:
mmel [Sun, 16 Apr 2017 07:33:47 +0000 (07:33 +0000)]
MFC r315900,r315973,r315974:

  r315900:
    Cleanup structures related to VFP and/or mcontext_t.  - in mcontext_t,
    rename newer used 'union __vfp' to equaly sized 'mc_spare'.
      Space allocated by 'union __vfp' is too small and cannot hold full VFP
      context.
    - move structures defined in fp.h to more appropriate headers.  - remove
    all unused VFP structures.
  r315973:
    Save VFP state on fork().  Update the copy of VFP state in PCB before it is
    cloned for new process.
  r315974:
    Preserve VFP state across signal delivery.

7 years agoMFC r303261,r315059:
mmel [Sun, 16 Apr 2017 07:21:20 +0000 (07:21 +0000)]
MFC r303261,r315059:

  r303261:
    Add more UEFI/e820 memory types from latest specifications.
  r315059:
    Split overbloated machep.c to multiple files and do basic cleanup of these
    fragments.

7 years agoMFC r306704,r308406:
mmel [Sun, 16 Apr 2017 06:51:06 +0000 (06:51 +0000)]
MFC r306704,r308406:

  r306704:
    ARM: Remove next bunch of unused cpu_functions from ARMv6.
  r308406:
    Only include sys/boot.h if LINUX_BOOT_ABI is defined

7 years agoMFC r306631,r306640,r306641,r306650,r306656:
mmel [Sun, 16 Apr 2017 06:35:09 +0000 (06:35 +0000)]
MFC r306631,r306640,r306641,r306650,r306656:

  r306631:
    Use C99 designated initializers to create the armv6 cpu_functions structs.
    This will help with a later cleanup of what functions we implement.
  r306640:
    Only define the CF_* macros on ARMv4/v5. They are unused on armv6.
  r306641:
    Remove the parts of cpu_functions from armv6 that are unused on that
    architecture.
  r306650:
    Add the Cortex-A{53,57,72} ID register values. These can all run 32-bit
    code so could run a 32-bit kernel.
  r306656:
    Use the cortex functions when booting on one of the Cortex-A ARMv8 CPUs.
    This list is incomplete, however we don't have the ID values for the
    missing Cortex-A32 or A35.

7 years agoMFC r316427, r316428: Add Log directory and SATA NCQ Send and Receive Log.
mav [Sun, 16 Apr 2017 05:59:29 +0000 (05:59 +0000)]
MFC r316427, r316428: Add Log directory and SATA NCQ Send and Receive Log.

Those are used at least by Linux guests to detect queued TRIM support.

7 years agoMFC r313873:
mmel [Sun, 16 Apr 2017 05:17:48 +0000 (05:17 +0000)]
MFC r313873:

  Publish fp[get][set]sticky() for ARMv6.

7 years agoMFC r313823,r313866:
mmel [Sun, 16 Apr 2017 05:14:42 +0000 (05:14 +0000)]
MFC r313823,r313866:

  r313823:
    Pull in r285478 from upstream compiler-rt trunk (by Saleem Abdulrasool):
  r313866:
    Publish __aeabi_uidiv and __aeabi_idiv as compatible symbols from libc.

7 years agoMFC r315501:
dchagin [Sat, 15 Apr 2017 15:38:15 +0000 (15:38 +0000)]
MFC r315501:

To reduce code duplication move socket defines to the MI path.

7 years agoMFC r316395:
dchagin [Sat, 15 Apr 2017 15:32:22 +0000 (15:32 +0000)]
MFC r316395:

Remove excess tv_nsec test as this is done by linux_to_native_timespec().

7 years agoMFC r316394:
dchagin [Sat, 15 Apr 2017 15:31:28 +0000 (15:31 +0000)]
MFC r316394:

The value in the tv_nsec field should be in the range 0 to 999999999.

7 years agoMFC r316393:
dchagin [Sat, 15 Apr 2017 15:30:28 +0000 (15:30 +0000)]
MFC r316393:

As noted by bde@ negative tv_sec values are not checked for overflow,
so overflow can still occur. Fix that. Also remove the extra check for
tv_sec size as under COMPAT_LINUX32 it is always true.

7 years agoMFC r315498:
dchagin [Sat, 15 Apr 2017 15:29:16 +0000 (15:29 +0000)]
MFC r315498:

Check for negative nanoseconds.
Linux do that in timespec_valid().

7 years agoMFC r316599:
dchagin [Sat, 15 Apr 2017 15:15:42 +0000 (15:15 +0000)]
MFC r316599:

Prevent ushort values overflow when convert new Linux 64-bit ipc
struct to the old Linux ipc struct.

7 years agoMFC r314868:
dchagin [Sat, 15 Apr 2017 15:13:54 +0000 (15:13 +0000)]
MFC r314868:

Linux semop system call return EINVAL in case when the invalid nsops
or semid values specified.

7 years agoMFC r314867:
dchagin [Sat, 15 Apr 2017 15:12:25 +0000 (15:12 +0000)]
MFC r314867:

Linux kernel does not export to the user space ipc_perm.mode values
other than S_IRWXUGO (0777).

7 years agoMFC r314866:
dchagin [Sat, 15 Apr 2017 15:11:23 +0000 (15:11 +0000)]
MFC r314866:

Reduce code duplication between MD Linux code by moving SYSV IPC 64-bit
related struct definitions out into the MI path.

Invert the native ipc structs to the Linux ipc structs convesion logic.
Since 64-bit variant of ipc structs has more precision convert native ipc
structs to the 64-bit Linux ipc structs and then truncate 64-bit values
into the non 64-bit if needed. Unlike Linux, return EOVERFLOW if the
values do not fit.

Fix SYSV IPC for 64-bit Linuxulator which never sets IPC_64 bit.

7 years agoMFC r314648:
dchagin [Sat, 15 Apr 2017 15:09:23 +0000 (15:09 +0000)]
MFC r314648:

Style(9).

7 years agoMFC r314647:
dchagin [Sat, 15 Apr 2017 15:08:23 +0000 (15:08 +0000)]
MFC r314647:

Remove attribute __packed from some IPC struct definition since
Linuxulator is x86 only.
The only notable differences in algnment for an LP64 64-bit system
when compared to a 32-bit system is an eight or large byte types
alignment.

7 years agoMFC r315948:
dchagin [Sat, 15 Apr 2017 11:13:11 +0000 (11:13 +0000)]
MFC r315948:

Update tcsh to 6.20.00

MFC r315952:

Update tcsh to vendor git b605cb561d

Vendor changes:

1. PR/471: Daiki Ueno: Delay interpreting arginp until we've processed
our startup files (which can change the NLS environment).

2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar).

3. Fix out of bounds read (Brooks Davis)
(reproduce by starting tcsh and hitting tab at the prompt).

4. Don't play pointer tricks that are undefined in modern c
(Brooks Davis).

7 years agoMFC 316644:
avatar [Sat, 15 Apr 2017 09:33:42 +0000 (09:33 +0000)]
MFC 316644:

Trying to be more compatible with Linux if.h definitions:
- renaming l_ifreq::ifru_metric to l_ifreq::ifru_ivalue;
- adding a definition for ifr_ifindex which points to l_ifreq::ifru_ivalue.

A quick search indicates that Linux already got the above changes since 2.1.14.

Reviewed by: kib, marcel, dchagin

7 years agoMFC r316313, r316328:
smh [Fri, 14 Apr 2017 22:02:08 +0000 (22:02 +0000)]
MFC r316313, r316328:

Allow explicitly assigned IPv4 & IPv6 loopback addresses to be used in
jails.

Relnotes: Yes
Sponsored by: Multiplay

7 years agoMFC r303863:
smh [Fri, 14 Apr 2017 21:49:20 +0000 (21:49 +0000)]
MFC r303863:

Move IPv4 & IPv6 specific jail functions to netinet and netinet6 files.

Sponsored by: Multiplay

7 years agoMFC r315852: zfs: add zio_buf_alloc_nowait and use it in vdev_queue_aggregate
avg [Fri, 14 Apr 2017 15:09:23 +0000 (15:09 +0000)]
MFC r315852: zfs: add zio_buf_alloc_nowait and use it in vdev_queue_aggregate

7 years agoMFC r315853: zfs_putpages: use TXG_WAIT
avg [Fri, 14 Apr 2017 15:07:50 +0000 (15:07 +0000)]
MFC r315853: zfs_putpages: use TXG_WAIT

7 years agoMFC r315858: aacraid: rework r315083 for a clean build with and without AACRAID_DEBUG
avg [Fri, 14 Apr 2017 15:06:16 +0000 (15:06 +0000)]
MFC r315858: aacraid: rework r315083 for a clean build with and without AACRAID_DEBUG

7 years agoMFC r316017,r316020: add SMT detection for newer AMD processors
avg [Fri, 14 Apr 2017 14:48:55 +0000 (14:48 +0000)]
MFC r316017,r316020: add SMT detection for newer AMD processors