]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoAdd USB IDs supported by TI / Intel USB 3410 family (modems of various
imp [Wed, 1 Feb 2017 02:00:18 +0000 (02:00 +0000)]
Add USB IDs supported by TI / Intel USB 3410 family (modems of various
flavors). This includes both the release products (from Honeywell,
Moxa and Multitech) as well as development kits.

7 years agoAdd myself (jmd) to committers-ports.dot. Document rene and swills as my mentors.
jmd [Wed, 1 Feb 2017 01:25:30 +0000 (01:25 +0000)]
Add myself (jmd) to committers-ports.dot. Document rene and swills as my mentors.

Reviewed by: rene (mentor)
Approved by: rene (mentor)
Differential Revision: https://reviews.freebsd.org/D9393

7 years agoEnsure that the variable bail is always initialized before used.
tuexen [Wed, 1 Feb 2017 00:10:29 +0000 (00:10 +0000)]
Ensure that the variable bail is always initialized before used.

MFC after: 1 week

7 years agoTake the SCTP common header into account when computing the
tuexen [Tue, 31 Jan 2017 23:36:31 +0000 (23:36 +0000)]
Take the SCTP common header into account when computing the
space available for chunks. This unbreaks the handling of
ICMPV6 packets indicating "packet too big". It just worked
for IPv4 since we are overbooking for IPv4.

MFC after: 1 week

7 years agoRemove a duplicate debug statement.
tuexen [Tue, 31 Jan 2017 23:34:02 +0000 (23:34 +0000)]
Remove a duplicate debug statement.

MFC after: 1 week

7 years agonet80211: cleanup ic_flags / iv_flags
avos [Tue, 31 Jan 2017 22:21:08 +0000 (22:21 +0000)]
net80211: cleanup ic_flags / iv_flags

Flags
 - IEEE80211_F_ASCAN
 - IEEE80211_F_SIBSS
 - IEEE80211_F_IBSSON
are not used since r170530 (old WI compatibility ioctls removal)
and r178354 (removed from other places).

IEEE80211_F_TXPOW_FIXED was never utilized; initially added with
IEEE80211_F_TXPOW_AUTO / IEEE80211_F_TXPOW_OFF flags,
which were replaced with IEEE80211_C_TXPMGT capability check in r138568.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D9369

7 years agoAdd a new vagrant-box target, to make it easier and less redundant to only
brd [Tue, 31 Jan 2017 21:59:10 +0000 (21:59 +0000)]
Add a new vagrant-box target, to make it easier and less redundant to only
produce the Vagrant box and not upload it.

Approved by: re (gjb)

7 years ago[ath] log seqno, type and subtype when assigning sequence numbers for A-MPDU.
adrian [Tue, 31 Jan 2017 20:57:40 +0000 (20:57 +0000)]
[ath] log seqno, type and subtype when assigning sequence numbers for A-MPDU.

This is just to improve adrian-debugging.

7 years agoAdd tests for multi-fib IPv6 routing
asomers [Tue, 31 Jan 2017 20:13:50 +0000 (20:13 +0000)]
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

7 years agoForce a few variables to be upper case when they are evaulated.
brd [Tue, 31 Jan 2017 19:09:06 +0000 (19:09 +0000)]
Force a few variables to be upper case when they are evaulated.

This allows specifying, for example: CLOUDWARE=vagrant-vmware

Approved by: re (gjb)

7 years agoFix a couple of issues with t4iov probe and attach.
jhb [Tue, 31 Jan 2017 18:54:13 +0000 (18:54 +0000)]
Fix a couple of issues with t4iov probe and attach.

- Check for Chelsio vendor ID in probe routines.
- Fail attach instead of faulting if pci_find_dbsf() doesn't find a
  device.

PR: 216539
Reported by: asomers
Tested by: Dave Baukus <daveb@spectralogic.com>
MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agoAdd the folowing set accessor functions for recently-added members of ifnet
stevek [Tue, 31 Jan 2017 16:12:31 +0000 (16:12 +0000)]
Add the folowing set accessor functions for recently-added members of ifnet
structure:

if_gethwtsomax(), if_sethwtsomax()                 - if_hw_tsomax
if_gethwtsomaxsegcount(), if_sethwtsomaxsegcount() - if_hw_tsomaxsegcount
if_gethwtsomaxsegsize(), if_sethwtsomaxsegsize()   - if_hw_tsomaxsegsize

Update em and vnic drivers which had already been coverted to use accessor
functions for the other ifnet structure members.

Reviewed by: erj
Approved by: sjg (mentor)
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D8544

7 years agoAdd kern_pread() and kern_pwrite(), and use it in compats instead
trasz [Tue, 31 Jan 2017 15:35:18 +0000 (15:35 +0000)]
Add kern_pread() and kern_pwrite(), and use it in compats instead
of their sys_*() counterparts. The svr4 is left unchanged.

Reviewed by: kib@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9379

7 years agoFix linux_getppid() to debug the actual parent, even it was reparented
trasz [Tue, 31 Jan 2017 15:22:51 +0000 (15:22 +0000)]
Fix linux_getppid() to debug the actual parent, even it was reparented
by debugger.

Reviewed by: dchagin@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9361

7 years agoReplace calls to sys_truncate() with kern_truncate().
trasz [Tue, 31 Jan 2017 15:19:44 +0000 (15:19 +0000)]
Replace calls to sys_truncate() with kern_truncate().

Reviewed by: kib@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9371

7 years agoAdd kern_cpuset_getid() and kern_cpuset_setid(), and use them
trasz [Tue, 31 Jan 2017 15:11:23 +0000 (15:11 +0000)]
Add kern_cpuset_getid() and kern_cpuset_setid(), and use them
in compat32 instead of their sub_*() counterparts.

Reviewed by: jhb@, kib@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9382

7 years agoAdd missing ephy bus gates and resets.
jmcneill [Tue, 31 Jan 2017 14:36:06 +0000 (14:36 +0000)]
Add missing ephy bus gates and resets.

7 years agoExpose symbols in lib/libclang_rt/profile to fix --coverage
ngie [Tue, 31 Jan 2017 07:13:01 +0000 (07:13 +0000)]
Expose symbols in lib/libclang_rt/profile to fix --coverage

The symbols currently hidden in libprofile_rt are needed for linking with
`clang --coverage` to add coverage counters at link time and produce
coverage numbers at runtime.

In collaboration with: dim
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: D9168

7 years agoWait for /dev/ggate* to appear after calling `ggatel create` in :ggatel_{file,md}
ngie [Tue, 31 Jan 2017 06:12:51 +0000 (06:12 +0000)]
Wait for /dev/ggate* to appear after calling `ggatel create` in :ggatel_{file,md}

The test assumed that `ggatel create` created a device on completion, but that's
incorrect. This squashes the race by waiting for the device to appear, as
`ggatel create` daemonizes before issuing an ioctl to geom_gate(4) if not called
with `-v`.

Discussed with: asomers
MFC after: 1 week
PR: 204616
Sponsored by: Dell EMC Isilon

7 years agoDon't retry a lost reservation in atomic_fcmpset()
jhibbits [Tue, 31 Jan 2017 03:40:13 +0000 (03:40 +0000)]
Don't retry a lost reservation in atomic_fcmpset()

The desired behavior of atomic_fcmpset_() is to always exit on error.  Instead
of retrying on lost reservation, leave the retry to the caller, and return
error.

Reported by: kib

7 years agocalculate_crc32c: Add SSE4.2 implementation on x86
cem [Tue, 31 Jan 2017 03:26:32 +0000 (03:26 +0000)]
calculate_crc32c: Add SSE4.2 implementation on x86

Derived from an implementation by Mark Adler.

The fast loop performs three simultaneous CRCs over subsets of the data
before composing them.  This takes advantage of certain properties of
the CRC32 implementation in Intel hardware.  (The CRC instruction takes 1
cycle but has 2-3 cycles of latency.)

The CRC32 instruction does not manipulate FPU state.

i386 does not have the crc32q instruction, so avoid it there.  Otherwise
the implementation is identical to amd64.

Add basic userland tests to verify correctness on a variety of inputs.

PR: 216467
Reported by: Ben RUBSON <ben.rubson at gmail.com>
Reviewed by: kib@, markj@ (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9342

7 years agoUpdate CFLAGS for clang compatibility
jhibbits [Tue, 31 Jan 2017 01:55:29 +0000 (01:55 +0000)]
Update CFLAGS for clang compatibility

* Clang/llvm does not (yet) support -m(no-)spe, so make it gcc-only
* Clang now supports -msoft-float, and does not appear to recognize
  "-disable-ppc-float-in-variadic", which appears to have been a crutch until
  soft-float was implemented.  It's now implemented for both 32- and 64-bit.
* Clang/llvm use a 'medium' code model by default for powerpc64, supporting up
  to 4GB TOC, and does not support the '-mminimal-toc' option.  Given both of
  these, make -mminimal-toc gcc-only.

MFC after: 2 weeks

7 years agoFix compilation!
adrian [Tue, 31 Jan 2017 01:48:55 +0000 (01:48 +0000)]
Fix compilation!

7 years agoRemove a duplicate store when performing REL32 relocations in rtld.
jhb [Mon, 30 Jan 2017 23:13:41 +0000 (23:13 +0000)]
Remove a duplicate store when performing REL32 relocations in rtld.

The duplicate call to store_ptr() was added in r204687, but it should
have no effect as it only stores an Elf_Sword and the later store_ptr()
does a write that is at least as large if not larger.

Reviewed by: jmallett
Obtained from: CheriBSD (sort of)
Sponsored by: DARPA / AFRL

7 years agoMFV 312999:
pfg [Mon, 30 Jan 2017 23:00:51 +0000 (23:00 +0000)]
MFV 312999:
Update libedit 2016-03-21

Minor cleanups plus some license syncing.

Obtained from: NetBSD
X-MFC with: r312997

7 years agoFix indentantion in pf_purge_thread(). No functional change.
glebius [Mon, 30 Jan 2017 22:47:48 +0000 (22:47 +0000)]
Fix indentantion in pf_purge_thread().  No functional change.

7 years ago[mips] add some (temporary, I hope!) mips24k/mips74k hwpmc modules.
adrian [Mon, 30 Jan 2017 22:29:21 +0000 (22:29 +0000)]
[mips] add some (temporary, I hope!) mips24k/mips74k hwpmc modules.

Ideally we'd have a top level hwpmc module with the shared bits, then
cpu specific glue as needed.  However, on the MIPS side, there's no
probe code - {mips24k, mips74k, octeon} implement a set of methods
that hwpmc_mips.c expects.

So this populates separate modules with duplicate code.
Ew, but it does work.

This gets me off the hook - these work fine as copied into the relevant
mfsroot for mips24k/mips74k systems.

TODO:

* do it the "right" way in the future.  Note that modules/hwpmc/ does
  build fine on MIPS, it jusn't DO anything.  So it'd be nice to
  maybe call that "hwpmc_core" and then "hwpmc" can be the CPU/arch glue.

7 years agoMFV r312996:
pfg [Mon, 30 Jan 2017 22:11:53 +0000 (22:11 +0000)]
MFV r312996:
Re-import libedit 2016-02-27

This reverts r296435: the issues related to lldb and this update appear to
have been identified (in lldb).

Obtained from: NetBSD
Reported by: emaste
MFC after: 3 weeks

7 years agoInitialize a stack variable in mprsas_get_sas_address_for_sata_disk
asomers [Mon, 30 Jan 2017 19:49:08 +0000 (19:49 +0000)]
Initialize a stack variable in mprsas_get_sas_address_for_sata_disk

Thought it's difficult to reproduce, I think this variable was responsible
for a use-after-free panic when a SATA disk timed out responding to a SATA
identify command during boot.

Submitted by: slm
Reviewed by: slm
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9364

7 years agoAvoid page lookups in the top-level object in vm_object_madvise().
markj [Mon, 30 Jan 2017 18:51:43 +0000 (18:51 +0000)]
Avoid page lookups in the top-level object in vm_object_madvise().

We can iterate over consecutive resident pages in the top-level object
using the object's page list rather than by performing lookups in the
object radix tree. This extends one of the optimizations in r312208 to the
case where a shadow chain is present.

Suggested by: alc
Reviewed by: alc, kib (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9282

7 years agoPull in r279454 from upstream llvm trunk (by James Molloy):
dim [Mon, 30 Jan 2017 18:35:24 +0000 (18:35 +0000)]
Pull in r279454 from upstream llvm trunk (by James Molloy):

  [SROA] Remove incorrect assertion

  Confirmed with aprantl, this assertion is incorrect - code can get
  here (for example 80-bit FP types) and if it does it's benign. This
  is exposed by a completely unrelated patch of mine, so stop the
  compiler falling over.

  Original differential: http://reviews.llvm.org/D16187
  aprantl's advice to remove assertion:
  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160815/382129.html

This should fix assertions when building the math/opensolaris-libm port.

Reported by: marino
MFC after: 3 days

7 years agoMFV r312970:
pfg [Mon, 30 Jan 2017 16:32:53 +0000 (16:32 +0000)]
MFV r312970:
openresolv: update to version 3.9.0.

It is now possible to drop the _WITH_ARG vars thanks to a change to the
pdns_recursor upstreamed by Guy Yur.

MFC after: 3 weeks

7 years agoput very expensive sanity checks of advisory locks under DIAGNOSTIC
avg [Mon, 30 Jan 2017 15:20:13 +0000 (15:20 +0000)]
put very expensive sanity checks of advisory locks under DIAGNOSTIC

The checks have quadratic complexity over a number of advisory locks
active for a file and that could be a lot.  What's the worse is that the
checks are done while holding ls_lock.  That could lead to a long a very
long backlog and performance degradation even if all requested locks are
compatible (e.g. all shared locks).

The checks used to be under INVARIANTS.

Discussed with: kib
MFC after: 2 weeks
Sponsored by: Panzura

7 years agoAdd kern_listen(), kern_shutdown(), and kern_socket(), and use them
trasz [Mon, 30 Jan 2017 12:57:22 +0000 (12:57 +0000)]
Add kern_listen(), kern_shutdown(), and kern_socket(), and use them
instead of their sys_*() counterparts in various compats. The svr4
is left untouched, because there's no point.

Reviewed by: ed@, kib@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9367

7 years agoAdd kern_lseek() and use it instead of sys_lseek() in various compats.
trasz [Mon, 30 Jan 2017 12:24:47 +0000 (12:24 +0000)]
Add kern_lseek() and use it instead of sys_lseek() in various compats.
I didn't touch svr4/, there's no point.

Reviewed by: ed@, kib@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9366

7 years agoReplace sys_ftruncate() with kern_ftruncate() in various compats.
trasz [Mon, 30 Jan 2017 11:50:54 +0000 (11:50 +0000)]
Replace sys_ftruncate() with kern_ftruncate() in various compats.

Reviewed by: kib@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9368

7 years agoExtend LD_UTRACE by also generating utrace(2) log events for runtime linker
peterj [Mon, 30 Jan 2017 08:38:32 +0000 (08:38 +0000)]
Extend LD_UTRACE by also generating utrace(2) log events for runtime linker
errors.

Reviewed by: kib, jhb
Approved by: jhb(mentor)
MFC after: 1 week
Differential Revision:  D9347

7 years agoMake "desc" pointer non-constant inside the mlx5_core_diagnostics_entry
hselasky [Mon, 30 Jan 2017 08:35:15 +0000 (08:35 +0000)]
Make "desc" pointer non-constant inside the mlx5_core_diagnostics_entry
structure. This fixes compilation with amd64-xtoolchain-gcc.

PR: 216588
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoCorrect comment grammar and make it easier to understand.
cy [Mon, 30 Jan 2017 04:51:18 +0000 (04:51 +0000)]
Correct comment grammar and make it easier to understand.

MFC after: 1 week

7 years agocache: use vrefact for '.' lookups and refing the rdir in fullpath
mjg [Mon, 30 Jan 2017 03:20:05 +0000 (03:20 +0000)]
cache: use vrefact for '.' lookups and refing the rdir in fullpath

7 years agofd: sprinkle __read_mostly and __exclusive_cache_line
mjg [Mon, 30 Jan 2017 03:07:32 +0000 (03:07 +0000)]
fd: sprinkle __read_mostly and __exclusive_cache_line

7 years agoDo not update the lagg link layer address when destroying a lagg clone.
loos [Mon, 30 Jan 2017 03:04:33 +0000 (03:04 +0000)]
Do not update the lagg link layer address when destroying a lagg clone.

This would enqueue an event to send the gratuitous arp on a dying lagg
interface without any physical ports attached to it.

Apart from that, the taskqueue_drain() on lagg_clone_destroy() runs too
late, when the ifp data structure is already freed.  Fix that too.

Obtained from: pfSense
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoDrop the __GNUCLIKE_ASM guards around most atomic inlines.
jhibbits [Mon, 30 Jan 2017 02:52:15 +0000 (02:52 +0000)]
Drop the __GNUCLIKE_ASM guards around most atomic inlines.

There are no alternatives defined, so there's no point in keeping them.  Also,
they weren't around every inline asm block anyway.  Without __GNUCLIKE_ASM
defined, the guarded functions return garbage.

Reported by: Andrew Thompson

7 years agoForce the setting of bit 7 in the sysmouse packet byte 1 to be unsigned.
jhibbits [Mon, 30 Jan 2017 02:32:33 +0000 (02:32 +0000)]
Force the setting of bit 7 in the sysmouse packet byte 1 to be unsigned.

Clang complains about the shift of (1 << 7) into a int8_t changing the value:

warning: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes
value from 128 to -128 [-Wconstant-conversion]

Squash this warning by forcing clang to see it as an unsigned bit.

This seems odd, given that it's still a conversion of 128->-128, but I'm
guessing the explicit unsigned attribute notifies clang that sign really doesn't
matter in this case.

Reported by: Mark Millard <markmi AT dsl-only DOT net>
MFC after: 2 weeks

7 years agoMan page update to go along with r312907.
hiren [Mon, 30 Jan 2017 02:25:55 +0000 (02:25 +0000)]
Man page update to go along with r312907.

Reviewed by:     Allanjude
MFC after:     2 weeks
Sponsored by:     Limelight Networks

7 years agoi386: add atomic_fcmpset
mjg [Mon, 30 Jan 2017 02:24:54 +0000 (02:24 +0000)]
i386: add atomic_fcmpset

Tested by: pho

7 years agoAdd a INTR_TRIG_INVALID, and use it in the powerpc interrupt code.
jhibbits [Mon, 30 Jan 2017 02:21:29 +0000 (02:21 +0000)]
Add a INTR_TRIG_INVALID, and use it in the powerpc interrupt code.

Summary:
Clang throws the following warning in powerpc intr_machdep:

/usr/src/sys/powerpc/powerpc/intr_machdep.c:454:15: warning: comparison of
constant -1 with expression of type 'enum intr_trigger' is always false
[-Wtautological-constant-out-of-range-compare]
    if (i->trig == -1)
        ~~~~~~~ ^  ~~

This may lead to legitimate problems with aggressive optimizations, if not now
then in the future.  To avoid this, add a new enum, INTR_TRIG_INVALID, set to
-1, and use this new enumeration in these checks.

Test Plan: Compile test.

Reviewed By: jhb, kib
Differential Revision: https://reviews.freebsd.org/D9300

7 years agoAdd atomic_fcmpset_*() inlines for powerpc
jhibbits [Mon, 30 Jan 2017 02:15:54 +0000 (02:15 +0000)]
Add atomic_fcmpset_*() inlines for powerpc

Summary:
atomic_fcmpset_*() is analogous to atomic_cmpset(), but saves off the read value
from the target memory location into the 'old' pointer in the case of failure.

Requested by:  mjg
Differential Revision: https://reviews.freebsd.org/D9325

7 years ago[net80211] address seqno allocation for group addressed frames
adrian [Mon, 30 Jan 2017 01:11:30 +0000 (01:11 +0000)]
[net80211] address seqno allocation for group addressed frames

After some digging and looking at packet traces, it looks like the
sequence number allocation being done by net80211 doesn't meet
802.11-2012.

Specifically, group addressed frames (broadcast, multicast) have
sequence numbers allocated from a separate pool, even if they're
QoS frames.

This patch starts to try and address this, both on transmit and
receive.

* When receiving, don't throw away multicast frames for now.
  It's sub-optimal, but until we correctly track group addressed
  frames via another TID counter, this is the best we can do.

* When doing A-MPDU checks, don't include group addressed frames
  in the sequence number checks.

* When transmitting, don't allocate group frame sequence numbers
  from the TID, instead use the NONQOS TID for allocation.

This may fix iwn(4) 11n because I /think/ this was one of the
handful of places where ni_txseqs[] was being assigned /outside/
of the driver itself.

This however doesn't completely fix things - notably the way that
TID assignment versus WME assignment for driver hardware queues
will mess up multicast ordering. For example, if all multicast
QoS frames come from one sequence number space but they're
expected to obey the QoS value assigned, they'll end up in
different queues in the hardware and go out in different
orders.

I can't fix that right now and indeed fixing it will require some
pretty heavy lifting of both the WME<->TID QoS assignment, as well
as figuring out what the correct way for drivers to behave.

For example, both iwn(4) and ath(4) shouldn't put QoS multicast
traffic into the same output queue as aggregate traffic, because
the sequence numbers are all wrong. So perhaps the correct thing
to do there is ignore the WME/TID for QoS traffic and map it all
to the best effort queue or something, and ensure it doesn't
muck up the TID/blockack window tracking. However, I'm /pretty/
sure that is still going to happen.

.. maybe I should disable multicast QoS frames in general as well,
but I don't know what that'll do for whatever the current state
of 802.11s mesh support is.

Tested:

* STA mode, ath10k NIC
* AP mode, AR9344/AR9580 AP
* iperf tcp/udp tests with concurrent multicast QoS traffic.

Before this, iperfs would fail pretty quickly because the sending
AP would start sending out QoS multicast frames that would be
out of order from the rest of the TID traffic, causing the blockack
window to get way, way out of sync.

This now doesn't occur.

TODO:

* verify which QoS frames SHOULD be tagged as M_AMPDU_MPDU.
  For example, QoS NULL frames shouldn't be tagged!

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D9357

7 years ago[am335x] Fix DTB name in LINKS variable
gonzo [Sun, 29 Jan 2017 22:06:52 +0000 (22:06 +0000)]
[am335x] Fix DTB name in LINKS variable

Fix apparent typo introduced by r312915, upstream DTBs are
am335x-* not am3335x-*

7 years agoDo not leave stale 4K TLB entries on pde (superpage) removal or
kib [Sun, 29 Jan 2017 19:14:48 +0000 (19:14 +0000)]
Do not leave stale 4K TLB entries on pde (superpage) removal or
protection change.

On superpage promotion, x86 pmaps do not invalidate existing 4K
entries for the superpage range, because they are compatible with the
promoted 2/4M entry.  But the invalidation on superpage removal or
protection change only did single INVLPG with the base address of the
superpage.  This reliably flushed superpage TLB entry, and 4K entry
for the first page of the superpage, potentially leaving other 4K TLB
entries lingering.  Do the invalidation of the whole superpage range
to correct the problem.

Note that the precise invalidation is done by x86 code for kernel_pmap
only, for user pmaps whole (per-AS) TLB is flushed.  This made the bug
well hidden, because promotions of the kernel mappings require
specific load.

Reported and tested by: Jonathan Looney <jtl@netflix.com> (previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoThe stf(4) interface name does not conform with the default naming
loos [Sun, 29 Jan 2017 18:41:09 +0000 (18:41 +0000)]
The stf(4) interface name does not conform with the default naming
convention for interfaces, because only one stf(4) interface can exist
in the system.

This disallow the use of unit numbers different than 0, however, it is
possible to create the clone without specify the unit number (wildcard).

In the wildcard case we must update the interface name before return.

This fix an infinite recursion in pf code that keeps track of network
interfaces and groups:

1 - a group for the cloned type of the interface is added (stf in this
    case);
2 - the system will now try to add an interface named stf (instead of
    stf0) to stf group;
3 - when pfi_kif_attach() tries to search for an already existing 'stf'
    interface, the 'stf' group is returned and thus the group is added
    as an interface of itself;

This will now cause a crash at the first attempt to traverse the groups
which the stf interface belongs (which loops over itself).

Obtained from: pfSense
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoImplement get_pcpu() for i386 and use it to replace pcpu_find(curcpu)
jah [Sun, 29 Jan 2017 16:54:55 +0000 (16:54 +0000)]
Implement get_pcpu() for i386 and use it to replace pcpu_find(curcpu)
in the i386 pmap.

The curcpu macro loads the per-cpu data pointer as its first step,
so the remaining steps of pcpu_find(curcpu) are circular.

get_pcpu() is already implemented for arm, arm64, and risc-v.
My plan is to implement it for the remaining architectures and use
it to replace several instances of pcpu_find(curcpu) in MI code.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9370

7 years agoCorrect the IT instruction in atomic_fcmpset_64().
cognet [Sun, 29 Jan 2017 13:31:56 +0000 (13:31 +0000)]
Correct the IT instruction in atomic_fcmpset_64().

Reported by: andrew

7 years agoRemove unused kern_sendfile() declaration.
trasz [Sun, 29 Jan 2017 12:31:24 +0000 (12:31 +0000)]
Remove unused kern_sendfile() declaration.

7 years agoRemove "-Xassembler -G0" from CFLAGS.
brooks [Sun, 29 Jan 2017 11:52:36 +0000 (11:52 +0000)]
Remove "-Xassembler -G0" from CFLAGS.

-G0 is sufficent except on old version of clang (<3.8) and such versions
are unlikely to be generally useful on mips64.

Reported by: sbruno
Sponsored by: DARPA, AFRL

7 years ago- Remove i8255.h because it's pc98 device.
nyan [Sun, 29 Jan 2017 03:34:49 +0000 (03:34 +0000)]
- Remove i8255.h because it's pc98 device.
- rsa.h is for both RSA-DV/S ISA and RSA-98III CBUS, but there is no RSA-DV/S
  support.  So it can be removed.

7 years agoDo not run the pf purge thread while the VNET variables are not
loos [Sun, 29 Jan 2017 02:17:52 +0000 (02:17 +0000)]
Do not run the pf purge thread while the VNET variables are not
initialized, this can cause a divide by zero (if the VNET initialization
takes to long to complete).

Obtained from: pfSense
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoRemove GCC's __nonnull() attribute definition.
pfg [Sun, 29 Jan 2017 00:45:52 +0000 (00:45 +0000)]
Remove GCC's __nonnull() attribute definition.

While GCC's __nonnull__ attribute is generally useful to prevent misuse of
some functions it also tends to do rather dangerous "optimizations". Now
that we have replaced (r312934) all such uses with the clang nullability
qualifiers, the GCC attribute is unnecessary.

Remove the definition completely to prevent its use in system's headers.

7 years agoUpdate MACHINE/MACHINE_ARCH examples to use arm64/aarch64 instead of i386/pc98
ngie [Sun, 29 Jan 2017 00:24:34 +0000 (00:24 +0000)]
Update MACHINE/MACHINE_ARCH examples to use arm64/aarch64 instead of i386/pc98

pc98 support was removed in r312910

7 years agoRemove non-existent ct(4) dependency for scsi_low.c
ngie [Sun, 29 Jan 2017 00:12:06 +0000 (00:12 +0000)]
Remove non-existent ct(4) dependency for scsi_low.c

ct(4) was removed with pc98 in r312910

7 years agoFix overly long lines, whitespace and other bugs according to style(9).
marius [Sun, 29 Jan 2017 00:05:49 +0000 (00:05 +0000)]
Fix overly long lines, whitespace and other bugs according to style(9).

7 years agoUpdate TARGET/TARGET_ARCH examples to use arm64/aarch64 instead of i386/pc98
ngie [Sat, 28 Jan 2017 23:58:17 +0000 (23:58 +0000)]
Update TARGET/TARGET_ARCH examples to use arm64/aarch64 instead of i386/pc98

pc98 support was removed in r312910

7 years agoFix typo in lib/Makefile
ngie [Sat, 28 Jan 2017 23:51:03 +0000 (23:51 +0000)]
Fix typo in lib/Makefile

The SUBDIR_DEPEND variable should be for librpcsec_gss, not
liblibrpc_gss

MFC after: 1 week
PR: 216409
Reported by: mail@fbsd.e4m.org

7 years agoGarbage collect pc98-only variables still referenced in sys/modules/Makefile
ngie [Sat, 28 Jan 2017 23:47:17 +0000 (23:47 +0000)]
Garbage collect pc98-only variables still referenced in sys/modules/Makefile

These should have been removed with r312910

7 years agoRemove duplicate bhnd SUBDIR entry
ngie [Sat, 28 Jan 2017 23:41:38 +0000 (23:41 +0000)]
Remove duplicate bhnd SUBDIR entry

MFC after: 1 week
PR: 216413
Reported by: mail@fbsd.e4m.org

7 years agoMake use of clang nullability attributes.
pfg [Sat, 28 Jan 2017 20:54:43 +0000 (20:54 +0000)]
Make use of clang nullability attributes.

Replace uses of the GCC __nonnull__ attribute with the clang nullability
qualifiers. The replacement should be transparent for clang developers as
the new qualifiers will produce the same warnings and will be useful for
static checkers but will not cause aggressive optimizations.

GCC will not produce such warnings and developers will have to use
upgraded GCC ports built with the system headers from r312538.

Hinted by: Apple's Libc-1158.20.4, Bionic libc
MFC after: 11.1 Release

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

7 years agoRemove useless labels.
cognet [Sat, 28 Jan 2017 17:48:33 +0000 (17:48 +0000)]
Remove useless labels.

7 years agoUse strexeq instead of needlessly branch.
cognet [Sat, 28 Jan 2017 17:46:04 +0000 (17:46 +0000)]
Use strexeq instead of needlessly branch.

Suggested by: ian

7 years agoGarbage collect IFT_IEEE80211 (but leave the define for possible reuse)
avos [Sat, 28 Jan 2017 17:08:40 +0000 (17:08 +0000)]
Garbage collect IFT_IEEE80211 (but leave the define for possible reuse)

This interface type ("a parent interface of wlanX") is not used since
r287197

Reviewed by: adrian, glebius
Differential Revision: https://reviews.freebsd.org/D9308

7 years agoReally revert 312923 this time
bapt [Sat, 28 Jan 2017 16:40:51 +0000 (16:40 +0000)]
Really revert 312923 this time

7 years agoRevert crap accidentally committed
bapt [Sat, 28 Jan 2017 16:31:23 +0000 (16:31 +0000)]
Revert crap accidentally committed

7 years agoRevert r312923 a better approach will be taken later
bapt [Sat, 28 Jan 2017 16:30:14 +0000 (16:30 +0000)]
Revert r312923 a better approach will be taken later

7 years agoImplement atomic_fcmpset_* for arm and arm64.
cognet [Sat, 28 Jan 2017 16:24:06 +0000 (16:24 +0000)]
Implement atomic_fcmpset_* for arm and arm64.

7 years agoFix i386 compile failure by moving needed closing parenthesis out of
sbruno [Sat, 28 Jan 2017 15:44:14 +0000 (15:44 +0000)]
Fix i386 compile failure by moving needed closing parenthesis out of
conditional block.

Submitted by:   hiren
Reported by:    cy

7 years agoMake the drm2 module depend on linuxkpi
bapt [Sat, 28 Jan 2017 15:43:19 +0000 (15:43 +0000)]
Make the drm2 module depend on linuxkpi

Use linux memory allocation to reduce diff with upstream

7 years agoMerge enhancements to the ALTERA Avalon bus generic device attachment
rwatson [Sat, 28 Jan 2017 13:25:06 +0000 (13:25 +0000)]
Merge enhancements to the ALTERA Avalon bus generic device attachment
driver to support exposing a GEOM device, which can be used to mount
Avalon-attached ROMs, reserved areas of DRAM, etc, as a filesystem:

commit 9deb1e60eaaaf7a3687e48c58af5efd756f32ec6
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Sat Mar 5 20:33:12 2016 +0000

    Use format strings with make_dev(9) in avgen(4).

commit 0bf2176c23e7425bfa042c08a24f8a25fe6d8885
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Tue Mar 1 10:23:23 2016 +0000

    Implement a new "geomio" configuration argument to altera_avgen(4),
    the generic I/O device we attach to various BERI peripherals.  The new
    option requests that, instead of exposing the underlying device via a
    special device node in /dev, it instead be exposed via geom(4),
    allowing it to be used with filesystems.  The current implementation
    does not allow a device to be exposed both for file/mmap and geom, so
    one of the two models must be selected when configuring it via FDT or
    device.hints.  A typical use of the new option will be:

      sri-cambridge,geomio = "rw";

MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoFix a bug which caused not to create AF_LOCAL sockets when family
hrs [Sat, 28 Jan 2017 13:09:18 +0000 (13:09 +0000)]
Fix a bug which caused not to create AF_LOCAL sockets when family
is specified.

Spotted by: Alex Deiter

7 years agoMerge robustness improvements for the ALTERA JTAG UART driver from
rwatson [Sat, 28 Jan 2017 12:43:19 +0000 (12:43 +0000)]
Merge robustness improvements for the ALTERA JTAG UART driver from
CheriBSD, which attempt to work around an inherent race in the UART's
control-register design in detecting whether JTAG is currently,
present, which will otherwise lead to moderately frequent output
drops when running in polled rather than interrupt-driven operation.
Now, these drops are quite infrequent.

commit 9f33fddac9215e32781a4f016ba17eab804fb6d4
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Thu Jul 16 17:34:12 2015 +0000

    Add a new sysctl, hw.altera_jtag_uart.ac_poll_delay, which allows the
    (default 10ms) delay associated with a full JTAG UART buffer combined
    with a lack of a JTAG-present flag to be tuned.  Setting this higher
    may cause some JTAG configurations to be more reliable when printing
    out low-level console output at a speed greater than the JTAG UART is
    willing to carry data.  Or it may not.

commit 73992ef7607738b2973736e409ccd644b30eadba
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Sun Jan 1 15:13:07 2017 +0000

    Minor improvements to the Altera JTAG UART device driver:

    - Minor rework to the logic to detect JTAG presence in order to be a bit
      more resilient to inevitable races: increase the retry period from two
      seconds to four seconds for trying to find JTAG, and more agressively
      clear the miss counter if JTAG has been reconnected.  Once JTAG has
      vanished, stop prodding the miss counter.

    - Do a bit of reworking of the output code to frob the control register
      less by checking whether write interrupts are enabled/disabled before
      changing their state.  This should reduce the opportunity for races
      with JTAG discovery (which are inherent to the Altera
      hardware-software interface, but can at least be minimised).

    - Add statistics relating to interrupt enable/disable/JTAG
      discovery/etc.

    With these changes, polled-mode JTAG UART ttys appear substantially
    more robust.

MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoFix build of aio_test on MIPS, where the compiler warns about the local
rwatson [Sat, 28 Jan 2017 12:26:22 +0000 (12:26 +0000)]
Fix build of aio_test on MIPS, where the compiler warns about the local
variable 'err' shadowing the global function err(3).  Which it does.

Sponsored by: DARPA, AFRL

7 years agoAs with GENERIC on other architectures, include COMPAT_FREEBSD10 and
rwatson [Sat, 28 Jan 2017 11:38:51 +0000 (11:38 +0000)]
As with GENERIC on other architectures, include COMPAT_FREEBSD10 and
COMPAT_FREEBSD11 in the generic BERI kernel configuration template.

MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoRemove more pc98 support.
nyan [Sat, 28 Jan 2017 09:58:00 +0000 (09:58 +0000)]
Remove more pc98 support.

7 years agoifnet: move the new ifnet_event EVENTHANDLER_DECLARE to net/if_var.h
dexuan [Sat, 28 Jan 2017 07:26:42 +0000 (07:26 +0000)]
ifnet: move the new ifnet_event EVENTHANDLER_DECLARE to net/if_var.h

Thank glebius for pointing this out:
"The network stuff shall not be added to sys/eventhandler.h"

Reviewed by: David_A_Bright_DELL.com, sephe, glebius
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D9345

7 years agoSwitch to Linux / device tree upstream names. U-boot uses these by
imp [Sat, 28 Jan 2017 05:07:55 +0000 (05:07 +0000)]
Switch to Linux / device tree upstream names. U-boot uses these by
default, and the fewer changes relative to the upstream u-boot the
better.
Add compatibility links for the old names.
Add dts file for BeagleBone Green while we're here.

7 years agoHonor LINKS=x y in dtb modules. We need this for compatibility links
imp [Sat, 28 Jan 2017 05:07:53 +0000 (05:07 +0000)]
Honor LINKS=x y in dtb modules. We need this for compatibility links
for old, FreeBSD names.

7 years agoImprove the aio tests
asomers [Sat, 28 Jan 2017 04:33:51 +0000 (04:33 +0000)]
Improve the aio tests

* Add tests for aio_suspend(2).
* Add tests for polled completion notification.
* Test the full matrix of file descriptor types and completion notification
  mechanisms.
* Don't bother with mkstemp, because ATF runs every test in its own temp dir.
* Fix some typos.
* Remove extraneous ATF_REQUIRE_KERNEL_MODULE calls.

Reviewed by: jhb
MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D9045

7 years agoGarbage collect the FPU_ERROR_BROKEN option.
nyan [Sat, 28 Jan 2017 03:53:53 +0000 (03:53 +0000)]
Garbage collect the FPU_ERROR_BROKEN option.
It is for pc98 only.

7 years agoRegen after r312910.
nyan [Sat, 28 Jan 2017 02:25:33 +0000 (02:25 +0000)]
Regen after r312910.

7 years agoRemove pc98 support completely.
nyan [Sat, 28 Jan 2017 02:22:15 +0000 (02:22 +0000)]
Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes: yes

7 years agoAdd iflib man pages for developers.
sbruno [Sat, 28 Jan 2017 00:40:36 +0000 (00:40 +0000)]
Add iflib man pages for developers.

Doc review is probably waranted here for editing.

Submitted by: Nicole Graziano

7 years agoERL: set -march=octeon+ for use with external toolchain
emaste [Sat, 28 Jan 2017 00:00:10 +0000 (00:00 +0000)]
ERL: set -march=octeon+ for use with external toolchain

Upstream GCC and devel/mips64-gcc use "octeon+" as the CPU setting for
the Octeon processor in the EdgeRouter Lite. As of r312899 the base
system GCC 4.2.1 accepts octeon+ as an alias for the Octeon support
added in r208737 for the same CPU.

Sponsored by: The FreeBSD Foundation

7 years agoAdd a knob to change default behavior of inheriting listen socket's tcp stack
hiren [Fri, 27 Jan 2017 23:10:46 +0000 (23:10 +0000)]
Add a knob to change default behavior of inheriting listen socket's tcp stack
regardless of what the default stack for the system is set to.

With current/default behavior, after changing the default tcp stack, the
application needs to be restarted to pick up that change. Setting this new knob
net.inet.tcp.functions_inherit_listen_socket_stack to '0' would change that
behavior and make any new connection use the newly selected default tcp stack.

Reviewed by: rrs
MFC after: 2 weeks
Sponsored by: Limelight Networks

7 years agoUnregister CPL handlers for TOE-related messages when unloading TOM.
jhb [Fri, 27 Jan 2017 23:08:30 +0000 (23:08 +0000)]
Unregister CPL handlers for TOE-related messages when unloading TOM.

MFC after: 1 week
Sponsored by: Chelsio Communications

7 years agoIFLIB updates:
sbruno [Fri, 27 Jan 2017 23:08:06 +0000 (23:08 +0000)]
IFLIB updates:
We found routing performance dropped significantly when configuring
FreeBSD as a router, we are applying the following changes in order to
resolve those issues and hopefully perform better.
 - don't prefetch the flags array, we usually don't need it
 - prefetch the next cache line of each of the software descriptor arrays as
   well as the first cache line of each of the next four packets' mbufs and
   clusters
 - reduce max copy size to 63 bytes
 - convert rx soft descriptors from array of structures to a structure of arrays
 - update copyrights

Submitted by: Matt Macy <mmacy@nextbsd.org>

7 years agoDon't drop a reference to the TOE PCB in undo_offload_socket().
jhb [Fri, 27 Jan 2017 23:03:28 +0000 (23:03 +0000)]
Don't drop a reference to the TOE PCB in undo_offload_socket().

undo_offload_socket() is only called by t4_connect() during a connection
setup failure, but t4_connect() still owns the TOE PCB and frees ita
after undo_offload_socket() returns.  Release a reference in
undo_offload_socket() resulted in a double-free which panicked when
t4_connect() performed the second free.  The reference release was
added to undo_offload_socket() incorrectly in r299210.

MFC after: 1 week
Sponsored by: Chelsio Communications

7 years agoReplace customized busmaster code with standardized setup call.
sbruno [Fri, 27 Jan 2017 22:30:27 +0000 (22:30 +0000)]
Replace customized busmaster code with standardized setup call.

Reported by: jhb

7 years agohwpmc: annotate pmc_hook and pmc_intr as __read_mostly
mjg [Fri, 27 Jan 2017 22:14:42 +0000 (22:14 +0000)]
hwpmc: annotate pmc_hook and pmc_intr as __read_mostly

MFC after: 1 month

7 years agohwpmc: partially depessimize mmap handling if the module is not loaded
mjg [Fri, 27 Jan 2017 22:13:15 +0000 (22:13 +0000)]
hwpmc: partially depessimize mmap handling if the module is not loaded

In particular this means the pmc sx lock is no longer taken when an
executable mapping succeeds.

MFC after: 1 week

7 years agoSquash a couple of uses of xpt_print_path()
scottl [Fri, 27 Jan 2017 21:55:47 +0000 (21:55 +0000)]
Squash a couple of uses of xpt_print_path()

Sponsored by: Netflix

7 years agoadd octeon+ as an alias for octeon in GCC & binutils
emaste [Fri, 27 Jan 2017 21:31:32 +0000 (21:31 +0000)]
add octeon+ as an alias for octeon in GCC & binutils

In r208737 jmallett@ added support for the "mips64r2" architecture
and "octeon" CPU, and the saa/saad instructions.

Upstream binutils also added the "octeon+" CPU, and the saa/saad
instructions are only available in octeon+, not octeon.  Since our
base system tool chain already accepts saa/saad with -march=octeon,
just allow octeon+ as an alias.

This allows the use of octeon+ in kernel config files, for use with both
external tool chain and in-tree GCC/binutils.

PR: 216516
MFC after: 1 month
Sponsored by: The FreeBSD Foundation