Navdeep Parhar [Tue, 8 Mar 2016 02:04:05 +0000 (02:04 +0000)]
cxgbe(4): Overhaul the shared code that deals with the chip's TP block,
which is responsible for filtering and RSS.
Add the ability to use filters that match on PF/VF (aka "VNIC id") while
here. This is mutually exclusive with filtering on outer VLAN tag with
Q-in-Q.
Mark Johnston [Tue, 8 Mar 2016 00:46:03 +0000 (00:46 +0000)]
Fix a couple of silly mistakes in r291962.
- Handle the case where no DOF helper is provided. This occurs with the
currently-unused DTRACEHIOC_ADD ioctl.
- Fix some checks that prevented the loading DOF in the (non-default)
lazyload mode.
Mark Johnston [Tue, 8 Mar 2016 00:43:03 +0000 (00:43 +0000)]
Fix fasttrap tracepoint locking.
Upstream, tracepoints are protected by per-CPU mutexes. An unlinked
tracepoint may be freed once all the tracepoint mutexes have been acquired
and released - this is done in fasttrap_mod_barrier(). This mechanism was
not properly ported: in some places, the proc lock is used in place of a
tracepoint lock, and in others the locking is omitted entirely. This change
implements tracepoint locking with an rmlock, where the read lock is used
in fasttrap probe context. As a side effect, this fixes a recursion on the
proc lock when the raise action is used from a userland probe.
Navdeep Parhar [Tue, 8 Mar 2016 00:23:56 +0000 (00:23 +0000)]
cxgbe(4): Add a struct sge_params to store per-adapter SGE parameters.
Move the code that reads all the parameters to t4_init_sge_params in the
shared code. Use these per-adapter values instead of globals.
Mark Johnston [Tue, 8 Mar 2016 00:14:14 +0000 (00:14 +0000)]
MFV r296306: 6604 harden DIF bounds checking
Reviewed by: Alex Wilson <alex.wilson@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Bryan Cantrill <bryan@joyent.com>
Ed Maste [Tue, 8 Mar 2016 00:09:34 +0000 (00:09 +0000)]
libc/{i386,amd64}: Do not export .cerror when building WITHOUT_SYMVER
Further to r240152 (i386) and r240178 (amd64), hide the .cerror symbol
so that it is not exported if symbol versioning is not in use. Without
this change WITHOUT_SYMVER libc contains .text relocations for .cerror,
as described in LLVM PR 26813 (http://llvm.org/pr26813).
This is a no-op for the regular build as the symbol version script
already controls .cerror visibility.
Bryan Drewery [Mon, 7 Mar 2016 21:39:29 +0000 (21:39 +0000)]
Require kldunload -f to unload.
Code may still be executing from the wrappers at unload time and thus is
not generally safe to unload. Converting the wrappers to use
EVENTHANDLER(9) will allow this to safely drain on active threads in
hooks. More work on EVENTHANDLER(9) is needed first.
Navdeep Parhar [Mon, 7 Mar 2016 21:11:35 +0000 (21:11 +0000)]
cxgbe(4): Updated register dumps.
- Get the list of registers to read during a regdump from the shared
code instead of the OS specific code. This follows a similar move
internally. The shared code includes the list for T6.
- Update cxgbetool to be able to decode T5 VF, T6, and T6 VF register
dumps (and catch up with some updates to T4 and T5 register decode).
Convert all panics from the link_elf_obj kernel linker for object
files format into printfs and errors to caller. Some leaks of
resources are there, but the same leaks are present in other error
pathes. With the change, the kernel at least boots even when module
with unexpected or corrupted ELF structure is preloaded.
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
As reported on the transport@ and current@ mailing lists, the FreeBSD TCP
stack is not compliant with RFC 7323, which requires that TCP stacks send
a timestamp option on all packets (except, optionally, RSTs) after the
session is established.
This patch adds that support. It also adds a TCP signature option to the
packet, if appropriate.
Some cleanup in tcp_respond() in preparation for another change:
- Reorder variables by size
- Move initializer closer to where it is used
- Remove unneeded variable
Something in libedit appears to be causing breakage in lldb38.
The changes are not generally huge but they are suficient to
to justify reverting for now.
Dimitry Andric [Sun, 6 Mar 2016 15:57:43 +0000 (15:57 +0000)]
Since kernel modules can now contain sections of type SHT_AMD64_UNWIND,
the boot loader should not skip over these anymore while loading images.
Otherwise the kernel can still panic when it doesn't find the .eh_frame
section belonging to the .rela.eh_frame section.
Unfortunately this will require installing boot loaders from sys/boot
before attempting to boot with a new kernel.
Andrew Turner [Sun, 6 Mar 2016 11:41:08 +0000 (11:41 +0000)]
Add SMP support for the Allwinner A31 and A31s. This updated the existing
code for the A20 to use the new PLATFORM_SMP interface, and extends it to
add support for the new SoCs allowing for both to coexist within the same
kernel.
In the link_elf_obj.c, handle sections of type SHT_AMD64_UNWIND same
as SHT_PROGBITS. This is needed after the clang 3.8 import, which
generates that type for .eh_frame section, which had SHT_PROGBITS type
before.
Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
PR: 207729
Tested by: dim (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Dimitry Andric [Sat, 5 Mar 2016 20:24:31 +0000 (20:24 +0000)]
Upgrade our copies of clang, llvm, lldb and compiler-rt to 3.8.0
release.
Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.
Release notes for llvm and clang will soon be available here:
<http://llvm.org/releases/3.8.0/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.8.0/tools/clang/docs/ReleaseNotes.html>
Thanks to Ed Maste, Roman Divacky, Davide Italiano and Antoine Brodin
for their help.
Mark Peek [Sat, 5 Mar 2016 19:55:42 +0000 (19:55 +0000)]
Signal handling within tcsh vfork code path will conflict with some system
libraries (such as libthr) which maintain their own signal state. This
change adds the tcsh SAVESIGVEC option to save and restore the sigvecs for
the signals the child modifies before it execs.
Andrew Turner [Sat, 5 Mar 2016 13:17:53 +0000 (13:17 +0000)]
Add support to enable/disable both the EHCI and OHCI Allwinner clocks. This
adds a lock to ensure only a single device is accessing the hardware. A
reference count is added to only enable when we start to use the clock,
and to disable after we have finished needing the clock.
This was extracted from a larger review to add OHCI support to the
Allwinner SoCs.
Bryan Drewery [Sat, 5 Mar 2016 05:39:59 +0000 (05:39 +0000)]
Revert r296395.
This mistakenly removed the SUBDIR_PARALLEL but even worse is that the install
(and build) order is not correct due to the lack of SUBDIR_DEPEND on the
most critical libraries. The only reason they build correctly now is because
buildworld's 'make libraries' orders them properly.
Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division
Bryan Drewery [Sat, 5 Mar 2016 05:08:57 +0000 (05:08 +0000)]
Conditionalize building makewhatis(1) for upgrades that need it.
Remove building of the legacy makewhatis(1) since it was only needed for
6.0 upgrades.
On my 2.2 GHz system libsqlite3 takes 60-100 seconds to build, which due to
its serialized nature can hold up the build waiting on it to finish in
bootstrap-tools.
makewhatis(1) was only required to be a build tool to support upgrades
from 6.0 which was properly removed in r208324 but later reverted due to
installworld using it. The installworld issue was fixed in r275622
when it was added to ITOOLS. A BOOTSTRAPPING check was missed when
makewhatis(1) was replaced with mandoc in r283777.
Bryan Drewery [Fri, 4 Mar 2016 22:37:31 +0000 (22:37 +0000)]
Update libsdp to the latest 1.1.108-0.17.ga6958ef.
The only relevant change here is the support for IPv6 in the config
file. The previous version of this supported IPv6 but not in the
config. The change for that ended up removing __sdp_sockaddr_to_sdp
which the IPV4 config code required; the IPv6 fix resolved the lack of
that symbol.
Note that the ChangeLog was lacking entries for which we already had the
changes for, which itself was an upstream bug.
Bryan Drewery [Fri, 4 Mar 2016 22:36:56 +0000 (22:36 +0000)]
NO_ROOT: Create the METALOG directory on installworld/distributeworld.
When not using NO_ROOT the DESTDIR is implicitly created by the
distrib-dirs call. However with NO_ROOT it is trying to write
to the METALOG right away before running distrib-dirs which
may fail.
The defines for xdr_rpc* in xdr.h are wrong. It could be
very well that Solaris did strip the '_t' from xdr_u_int32_t,
but Solaris has a xdr_u_int32 function, we don't have this.
So all of this defines will lead to an unresolved symbol.
This explains why we do not use these functions in FreeBSD
while they are used in Illumos/Solaris.
Ed Maste [Fri, 4 Mar 2016 18:28:19 +0000 (18:28 +0000)]
elfcopy: fail if debug link target is empty
An empty debug link target previously returned a confusing and incorrect
error like "objcopy: fread failed: No error: 0". Now, return an explicit
error.
GNU objcopy allows an empty file as the debug link target. However,
that case is nonsensical so diverging from GNU behaviour is fine.
Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5541
Pass MNTK_NO_IOPF and MNTK_UNMAPPED_BUFS flags from the lower
filesystem to the nullfs mount.
MNTK_NO_IOPF must be present on the nullfs struct mount so that struct
file fo_read and fo_write fops operate in the mode requested by the
lower mount.
MNTK_UNMAPPED_BUFS allows VOP_GETPAGES() to use unmapped buffers. It
does not matter for VOP_GETPAGES() calls from vm_fault() since handle
of the vm_object always points to the lower vnode. But it may be
useful for other situations where VOP_GETPAGES() is used.
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Sean Bruno [Fri, 4 Mar 2016 14:23:34 +0000 (14:23 +0000)]
The register read/write mphy functions have misleading whitespace around
the locked check. This cleanup merely preserves the existing functionality
while improving the ready check.
Navdeep Parhar [Fri, 4 Mar 2016 13:11:13 +0000 (13:11 +0000)]
cxgbe(4): Very basic T6 awareness. This is part of ongoing work to
update to the latest internal shared code.
- Add a chip_params structure to keep track of hardware constants for
all generations of Terminators handled by cxgbe.
- Update t4_hw_pci_read_cfg4 to work with T6.
- Update the hardware debug sysctls (hidden within dev.<tNnex>.<n>.misc.*) to
work with T6. Most of the changes are in the decoders for the CIM
logic analyzer and the MPS TCAM.
- Acquire the regwin lock around indirect register accesses.
Bryan Drewery [Thu, 3 Mar 2016 18:08:58 +0000 (18:08 +0000)]
DEBUG_FILES: Create the DEBUGFILEDIR if it doesn't exist on install.
Currently the base.txz distribution does not get the BSD.debug.dist mtree
extracted into it. So if you start from that and then try to build a 3rd-party
application outside of buildworld it will by-default try installing the
debug files into a missing directory if they are being installed into /usr/lib.
Check for the existence before forcing the directory to be created rather than
the older way of running a shell command with test -d || mkdir -p always.
Fix dtrace probes (introduced in 287759): debug__input was used
for output and drop; connect didn't always fire a user probe
some probes were missing in fastpath
Allow for overlapping quirk device ranges. Prior to this patch only
the first device entry matching the USB vendor, product and revision
would be searched for quirks. After this patch all device entries will
be searched for quirks.
Justin Hibbits [Thu, 3 Mar 2016 05:07:35 +0000 (05:07 +0000)]
Replace all resource occurrences of '0UL/~0UL' with '0/~0'.
Summary:
The idea behind this is '~0ul' is well-defined, and casting to uintmax_t, on a
32-bit platform, will leave the upper 32 bits as 0. The maximum range of a
resource is 0xFFF.... (all bits of the full type set). By dropping the 'ul'
suffix, C type promotion rules apply, and the sign extension of ~0 on 32 bit
platforms gets it to a type-independent 'unsigned max'.
Reviewed By: cem
Sponsored by: Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D5255
Navdeep Parhar [Thu, 3 Mar 2016 01:41:53 +0000 (01:41 +0000)]
cxgbe(4): First of many changes to reduce diffs with internal shared
code:
- Rename some CamelCase variables.
- s/t4_link_start/t4_link_l1cfg/g
- Pull in t4_get_port_type_description.
- Move t4_wait_op_done to t4_hw.c.
- Flip the order of the RDMA stats.
- Remove unsused function t4_iq_start_stop.
- Move t4_wait_op_done and t4_wait_op_done_val to t4_hw.c