freebsd.git
7 years agohyperv/vmbus: Avoid unnecessary mb()
sephe [Thu, 28 Jul 2016 06:30:29 +0000 (06:30 +0000)]
hyperv/vmbus: Avoid unnecessary mb()

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7333

7 years agoEnable the build of micphy as part of generic miibus build, but only for
loos [Thu, 28 Jul 2016 05:59:56 +0000 (05:59 +0000)]
Enable the build of micphy as part of generic miibus build, but only for
FDT enabled systems.

Sponsored by: Rubicon Communications (Netgate)

7 years agoFix non-amd64 build from r292043 after reconnecting in r303410.
bdrewery [Wed, 27 Jul 2016 21:45:11 +0000 (21:45 +0000)]
Fix non-amd64 build from r292043 after reconnecting in r303410.

MFC after: 3 days
X-MFC-With: r303410
Sponsored by: EMC / Isilon Storage Division

7 years ago[iwm] When stopping TX DMA, wait for all channels at once.
ivadasz [Wed, 27 Jul 2016 20:51:31 +0000 (20:51 +0000)]
[iwm] When stopping TX DMA, wait for all channels at once.

    * Makes the TX DMA stopping more similar to Linux code, and potentially
      a bit faster. Also, output an error message when TX DMA idling fails.

    Taken-From: Linux iwlwifi

Tested:

* AC3165, STA mode

Approved by: adrian (mentor)
Obtained from: DragonFlyBSD git 2ee486ddff973ac552ff787c17e8d83e8ae0f24c
Differential Revision: https://reviews.freebsd.org/D7325

7 years agoopt_bdg.h was removed in r150636.
bdrewery [Wed, 27 Jul 2016 20:48:15 +0000 (20:48 +0000)]
opt_bdg.h was removed in r150636.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years ago[iwm] Set different pm_timeout for action frames.
ivadasz [Wed, 27 Jul 2016 20:46:51 +0000 (20:46 +0000)]
[iwm] Set different pm_timeout for action frames.

    When building a Tx Command for management frames, we are lacking
    a check for action frames, for which we should set a different
    pm_timeout.  This cause the fw to stay awake for 100TU after each
    such frame is transmitted, resulting an excessive power consumption.

    Taken-From: Linux iwlwifi (git b084a35663c3f1f7)

Approved by: adrian (mentor)
Obtained from: Linux git b084a35663c3f1f7de1c45c4ae3006864c940fe7
Obtained from: DragonFlyBSD git ba00f0e3ae873d6f0d5743e22c3ebc49c44dfdac
Differential Revision: https://reviews.freebsd.org/D7324

7 years agoopt_apic.h is only used on i386.
bdrewery [Wed, 27 Jul 2016 20:45:00 +0000 (20:45 +0000)]
opt_apic.h is only used on i386.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoopt_random.h was removed in r287558 for opt_global.h
bdrewery [Wed, 27 Jul 2016 20:44:53 +0000 (20:44 +0000)]
opt_random.h was removed in r287558 for opt_global.h

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years ago[iwm] Fix inverted logic in iwm_tx().
ivadasz [Wed, 27 Jul 2016 20:43:08 +0000 (20:43 +0000)]
[iwm] Fix inverted logic in iwm_tx().

    The PROT_REQUIRE flag in should be set for data frames above a certain
    length, but we were setting it for !data frames above a certain length,
    which makes no sense at all.

    Taken-From: OpenBSD, Linux iwlwifi

Approved by: adrian (mentor)
Obtained from: DragonFlyBSD git 8cc03924a36c572c2908e659e624f44636dc2b33
Differential Revision: https://reviews.freebsd.org/D7323

7 years agoRemove myself from kern_timeout.c yeah!
rrs [Wed, 27 Jul 2016 20:37:32 +0000 (20:37 +0000)]
Remove myself from kern_timeout.c yeah!

7 years agoPrepare for network stack as a module
stevek [Wed, 27 Jul 2016 20:34:09 +0000 (20:34 +0000)]
Prepare for network stack as a module

 - Move cr_canseeinpcb to sys/netinet/in_prot.c in order to separate the
   INET and INET6-specific code from the rest of the prot code (It is only
   used by the network stack, so it makes sense for it to live with the
   other network stack code.)
 - Move cr_canseeinpcb prototype from sys/systm.h to netinet/in_systm.h
 - Rename cr_seeotheruids to cr_canseeotheruids and cr_seeothergids to
   cr_canseeothergids, make them non-static, and add prototypes (so they
   can be seen/called by in_prot.c functions.)
 - Remove sw_csum variable from ip6_forward in ip6_forward.c, as it is an
   unused variable.

Reviewed by: gnn, jtl
Approved by: sjg (mentor)
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D2901

7 years agoReconnect pmcstudy, lost in r291021
bdrewery [Wed, 27 Jul 2016 20:28:28 +0000 (20:28 +0000)]
Reconnect pmcstudy, lost in r291021

Reported by: pluknet
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoAdjust tests in fsync job scheduling loop to reduce indentation.
jhb [Wed, 27 Jul 2016 19:31:25 +0000 (19:31 +0000)]
Adjust tests in fsync job scheduling loop to reduce indentation.

7 years agoAdd support for zero-copy aio_write() on TOE sockets.
jhb [Wed, 27 Jul 2016 18:29:35 +0000 (18:29 +0000)]
Add support for zero-copy aio_write() on TOE sockets.

AIO write requests for a TOE socket on a Chelsio T4+ adapter can now
DMA directly from the user-supplied buffer.  This is implemented by
wiring the pages backing the user-supplied buffer and queueing special
mbufs backed by raw VM pages to the socket buffer.  The TOE code
recognizes these special mbufs and builds a sglist from the VM page
array associated with the mbuf when queueing a work request to the TOE.

Because these mbufs do not have an associated virtual address, m_data
is not valid.  Thus, the AIO handler does not invoke sosend() directly
for these mbufs but instead inlines portions of sosend_generic() and
tcp_usr_send().

An aiotx_buffer structure is used to describe the user buffer (e.g.
it holds the array of VM pages and a reference to the AIO job).  The
special mbufs reference this structure via m_ext.  Note that a single
job might be split across multiple mbufs (e.g. if it is larger than
the socket buffer size).  The 'ext_arg2' member of each mbuf gives an
offset relative to the backing aiotx_buffer.  The AIO job associated
with an aiotx_buffer structure is completed when the last reference to
the structure is released.

Zero-copy aio_write()'s for connections associated with a given
adapter can be enabled/disabled at runtime via the
'dev.t[45]nex.N.toe.tx_zcopy' sysctl.

MFC after: 1 month
Relnotes: yes
Sponsored by: Chelsio Communications

7 years agoAdd a hack to add weekday to date format for ko_KR locale.
jkim [Wed, 27 Jul 2016 18:12:36 +0000 (18:12 +0000)]
Add a hack to add weekday to date format for ko_KR locale.

7 years agolibcxxrt: fix demangling of wchar_t
emaste [Wed, 27 Jul 2016 17:18:08 +0000 (17:18 +0000)]
libcxxrt: fix demangling of wchar_t

'wchar_t' is 7 characters long, not 6. r303297 fixed this in libelftc,
but not the second copy of this file that we have in libcxxrt.

PR: 208661
Submitted by: Daniel McRobb
Obtained from: ELF Tool Chain r3480
MFC after: 3 days

7 years agoDe-pluralize "queues" where appropriate in the pagedaemon code.
markj [Wed, 27 Jul 2016 17:11:03 +0000 (17:11 +0000)]
De-pluralize "queues" where appropriate in the pagedaemon code.

MFC after: 1 week

7 years agorename ARM's libunwind.S to to avoid conflict with llvm libunwind
emaste [Wed, 27 Jul 2016 16:34:19 +0000 (16:34 +0000)]
rename ARM's libunwind.S to to avoid conflict with llvm libunwind

llvm libunwind includes a libunwind.cpp, but on ARM libunwind.S is found
first in .PATH. Rename the latter one, since it is not going to be
updated again.

Reviewed by: andrew
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7162

7 years agoEnable LLVM libunwind by default on amd64 and i386
emaste [Wed, 27 Jul 2016 16:01:44 +0000 (16:01 +0000)]
Enable LLVM libunwind by default on amd64 and i386

It is a maintained and updated runtime exception stack unwinder that
should be a drop-in replacement.

It can be disabled by setting WITHOUT_LLVM_LIBUNWIND in src.conf.

PR: 206039 [exp-run]
Sponsored by: The FreeBSD Foundation

7 years agoRemove empty initializer for the once facility. It was not needed
kib [Wed, 27 Jul 2016 15:14:11 +0000 (15:14 +0000)]
Remove empty initializer for the once facility.  It was not needed
since r179417.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove ${OBJDUMP} as it is not used by the base system
emaste [Wed, 27 Jul 2016 14:58:15 +0000 (14:58 +0000)]
Remove ${OBJDUMP} as it is not used by the base system

It was added to sys.mk relatively recently (r274503) for EFI builds
but is no longer used by the base system. The in-tree binutils are
outdated, will not be updated, and will be removed in the future.
Remove it from the toolchain build now to slightly simplify the build
and make sure we don't grow an accidental dependency.

Note that this affects only the toolchain build, and does not affect
/usr/bin/objdump in the built world.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6460

7 years agoANSIfy kern_proc.c and delete register keyword
emaste [Wed, 27 Jul 2016 14:27:08 +0000 (14:27 +0000)]
ANSIfy kern_proc.c and delete register keyword

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6478

7 years agosyscons,vt: improve phrasing in kern.vty man page description
emaste [Wed, 27 Jul 2016 14:12:04 +0000 (14:12 +0000)]
syscons,vt: improve phrasing in kern.vty man page description

Submitted by: wblock

7 years agoRemove Giant from settime(), tc_setclock_mtx guards tc_windup() calls,
kib [Wed, 27 Jul 2016 11:54:24 +0000 (11:54 +0000)]
Remove Giant from settime(), tc_setclock_mtx guards tc_windup() calls,
and there is no other issues with parallel settime().  Remove spl()
vestiges there as well.

Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Discussed wit: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D7302

7 years agoPrevent parallel tc_windup() calls, both parallel top-level calls from
kib [Wed, 27 Jul 2016 11:49:41 +0000 (11:49 +0000)]
Prevent parallel tc_windup() calls, both parallel top-level calls from
setclock() and from simultaneous top-level and interrupt.  For this,
tc_windup() is protected with a tc_setclock_mtx spinlock, in the try
mode when called from hardclock interrupt.  If spinlock cannot be
obtained without spinning from the interrupt context, this means that
top-level executes tc_windup() on other core and our try may be
avoided.

The boottimebin and boottime variables should be adjusted from
tc_windup().  To be correct, they must be part of the timehands and
read using lockless protocol.  Remove the globals and reimplement the
getboottime(9)/getboottimebin(9) KPI using the timehands read
protocol.

Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Discussed wit: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agoFix a bug in r302252.
kib [Wed, 27 Jul 2016 11:40:06 +0000 (11:40 +0000)]
Fix a bug in r302252.

Change ntpadj_lock to spinlock always, and rename stuff removing
ADJ/adj from the names. ntp_update_second() requires ntp_lock and is
called from the tc_windup(), so ntp_lock must be a spinlock.  Add
missed lock to ntp_update_second().

Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Noted by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agoReduce the resettodr_lock scope to only CLOCK_SETTIME() call.
kib [Wed, 27 Jul 2016 11:34:25 +0000 (11:34 +0000)]
Reduce the resettodr_lock scope to only CLOCK_SETTIME() call.

Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agoStyle.
kib [Wed, 27 Jul 2016 11:33:33 +0000 (11:33 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agoReduce number of timehands to just two. This is useful because
kib [Wed, 27 Jul 2016 11:27:52 +0000 (11:27 +0000)]
Reduce number of timehands to just two.  This is useful because
consumers can now be only one tc_windup() call late.

Use C99 initialization.

Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agoHide the boottime and bootimebin globals, provide the getboottime(9)
kib [Wed, 27 Jul 2016 11:08:59 +0000 (11:08 +0000)]
Hide the boottime and bootimebin globals, provide the getboottime(9)
and getboottimebin(9) KPI. Change consumers of boottime to use the
KPI.  The variables were renamed to avoid shadowing issues with local
variables of the same name.

Issue is that boottime* should be adjusted from tc_windup(), which
requires them to be members of the timehands structure.  As a
preparation, this commit only introduces the interface.

Some uses of boottime were found doubtful, e.g. NLM uses boottime to
identify the system boot instance.  Arguably the identity should not
change on the leap second adjustment, but the commit is about the
timekeeping code and the consumers were kept bug-to-bug compatible.

Tested by: pho (as part of the bigger patch)
Reviewed by: jhb (same)
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agohyperv/vmbus: Rename cleaned up bufring code
sephe [Wed, 27 Jul 2016 09:27:08 +0000 (09:27 +0000)]
hyperv/vmbus: Rename cleaned up bufring code

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7318

7 years agoDue to dropped mbuf in netisr queue route(8) can fall into infinity
ae [Wed, 27 Jul 2016 08:26:34 +0000 (08:26 +0000)]
Due to dropped mbuf in netisr queue route(8) can fall into infinity
loop of reading the rtsock's feed. When it used by some scripts,
this leads to growing number of not finished route(8) instances and
thus growing number of rtsock consumers. Add SIGALRM handler to prevent this.

Reviewed by: melifaro
Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC

7 years agoRegenerate timedef for zh_TW.
kevlo [Wed, 27 Jul 2016 08:11:08 +0000 (08:11 +0000)]
Regenerate timedef for zh_TW.

Reviewed by: bapt

7 years agoFix cldr2def.pl script to add weekday to the date format of zh_TW locales.
kevlo [Wed, 27 Jul 2016 08:08:46 +0000 (08:08 +0000)]
Fix cldr2def.pl script to add weekday to the date format of zh_TW locales.
While here, mention dependency on textproc/p5-XML-Parser in README.

Reviewed by: bapt

7 years agohyperv/vmbus: Cleanup RX bufring read process.
sephe [Wed, 27 Jul 2016 07:36:54 +0000 (07:36 +0000)]
hyperv/vmbus: Cleanup RX bufring read process.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7317

7 years agohyperv/vmbus: Stringent RX bufring data length checks.
sephe [Wed, 27 Jul 2016 07:19:06 +0000 (07:19 +0000)]
hyperv/vmbus: Stringent RX bufring data length checks.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7316

7 years agohyperv/vmbus: Cleanup TX bufring write process.
sephe [Wed, 27 Jul 2016 06:52:43 +0000 (06:52 +0000)]
hyperv/vmbus: Cleanup TX bufring write process.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7315

7 years agoTestcase 7.8 no longer needs to be marked TODO
ngie [Wed, 27 Jul 2016 06:49:16 +0000 (06:49 +0000)]
Testcase 7.8 no longer needs to be marked TODO

It passes out of the box today

MFC after: 2 months
Sponsored by: EMC / Isilon Storage Division

7 years agohyperv/vmbus: Update comment for bufring
sephe [Wed, 27 Jul 2016 06:36:57 +0000 (06:36 +0000)]
hyperv/vmbus: Update comment for bufring

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7314

7 years agohyperv/vmbus: Use different struct for RX/TX bufring.
sephe [Wed, 27 Jul 2016 06:17:20 +0000 (06:17 +0000)]
hyperv/vmbus: Use different struct for RX/TX bufring.

So that they can use suitable MP synchronization mechanism.

While I'm here change the bufring init/read/write function names.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7313

7 years agohyperv/vmbus: Initialize RX/TX bufring mutex at channel creation time
sephe [Wed, 27 Jul 2016 05:47:32 +0000 (05:47 +0000)]
hyperv/vmbus: Initialize RX/TX bufring mutex at channel creation time

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7312

7 years agoUpdate a comment to reflect r284376.
alc [Wed, 27 Jul 2016 03:49:00 +0000 (03:49 +0000)]
Update a comment to reflect r284376.

MFC after: 3 days

7 years agoAdd the NUM_CORE_FILES kernel config option which specifies the limit for the
stevek [Wed, 27 Jul 2016 03:21:02 +0000 (03:21 +0000)]
Add the NUM_CORE_FILES kernel config option which specifies the limit for the
number of core files allowed by a particular process when using the %I core
file name pattern.

Sanity check at compile time to ensure the value is within the valid range of
0-10.

Reviewed by: jtl, sjg
Approved by: sjg (mentor)
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D6812

7 years agoAdd weekday to the date format.
kevlo [Wed, 27 Jul 2016 00:46:48 +0000 (00:46 +0000)]
Add weekday to the date format.

7 years agoAnnotate the usb-serial drivers which always return 0 for line status,
ian [Wed, 27 Jul 2016 00:08:01 +0000 (00:08 +0000)]
Annotate the usb-serial drivers which always return 0 for line status,
so that it'll be easier to find and fix them in the future.

7 years ago- Change the fbuf "vga" parameter to "vga=on|io|off".
grehan [Wed, 27 Jul 2016 00:03:29 +0000 (00:03 +0000)]
- Change the fbuf "vga" parameter to "vga=on|io|off".
   "io" is the default, and allows VGA i/o registers to be
   accessed. This is required by Win7/2k8 graphics guests that
   use a combination of BIOS int10 and UEFI.
   "off" disables all VGA i/o and mem accesses.
   "on" is not yet hooked up, but will enable full VGA rendering.

   OpenBSD/UEFI >= 5.9 graphics guests can be booted using "vga=off"

- Allow "rfb" to be used instead of "tcp" for the fbuf VNC
  description. "tcp" will be removed at a future point and is
  kept as an alias.

Discussed with: Leon Dang
MFC after: 3 days

7 years agoTranslate modem status reg bits from ns16550 to SER_* values used by the
ian [Wed, 27 Jul 2016 00:03:18 +0000 (00:03 +0000)]
Translate modem status reg bits from ns16550 to SER_* values used by the
tty layer.

Also annotate a switch case fall-through per style(9).

7 years agoTranslate modem status reg bits from ns16550 to SER_* values used by the
ian [Tue, 26 Jul 2016 23:42:42 +0000 (23:42 +0000)]
Translate modem status reg bits from ns16550 to SER_* values used by the
tty layer.

Also annotate a switch case fall-through per style(9).

7 years agoCatch another case where an XHCI interrupt was being
grehan [Tue, 26 Jul 2016 23:40:25 +0000 (23:40 +0000)]
Catch another case where an XHCI interrupt was being
injected without state being set up.

This fixes a core dump when dropping to the UEFI prompt
with graphics enabled and moving the mouse around.

Discussed with: Leon Dang
MFC after: 3 days

7 years agocxgbe(4): Initialize the adapter queues (fwq and mgmtq) instead of
np [Tue, 26 Jul 2016 23:29:37 +0000 (23:29 +0000)]
cxgbe(4): Initialize the adapter queues (fwq and mgmtq) instead of
returning EAGAIN if they aren't available when the user tries to program
a filter.  Do this after validating the filter so that the driver
doesn't bring up the queues if it doesn't have to.

7 years agoTranslate modem status reg bits from ns16550 to SER_* values used by the
ian [Tue, 26 Jul 2016 23:27:28 +0000 (23:27 +0000)]
Translate modem status reg bits from ns16550 to SER_* values used by the
tty layer.  Also, the line status reg bits are already ns16550 as expected
by the ucom layer, so no need for translation or a local var to hold them.

7 years agoActually return line status register values from umoscom_cfg_get_status().
ian [Tue, 26 Jul 2016 22:26:49 +0000 (22:26 +0000)]
Actually return line status register values from umoscom_cfg_get_status().

The hardware delivers ns16550-compatible status bits, which is what the
usb_serial code expects, so no need for translation, no need for a local
variable to hold a temporary lsr result.

7 years agoMention AC3165 and AC8260 chipsets in iwm(4) and mention AC3165 in iwmfw(4)
ivadasz [Tue, 26 Jul 2016 21:27:02 +0000 (21:27 +0000)]
Mention AC3165 and AC8260 chipsets in iwm(4) and mention AC3165 in iwmfw(4)

- Support for the AC3165 and AC8260 chipsets was added by r303322 and r303327.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7322

7 years agoFix the case for some sysctl descriptions.
brd [Tue, 26 Jul 2016 20:20:09 +0000 (20:20 +0000)]
Fix the case for some sysctl descriptions.

Reviewed by: gnn

7 years agoFix typing of srandom() and initstate().
ed [Tue, 26 Jul 2016 20:11:29 +0000 (20:11 +0000)]
Fix typing of srandom() and initstate().

POSIX requires that these functions have an unsigned int for their first
argument; not an unsigned long.

My reasoning is that we can safely change these functions without
breaking the ABI. As far as I know, our supported architectures either
use registers for passing function arguments that are at least as big as
long (e.g., amd64), or int and long are of the same size (e.g., i386).

Reviewed by: ache
Differential Revision: https://reviews.freebsd.org/D6644

7 years agoFix start date to not be in the future.
phil [Tue, 26 Jul 2016 18:27:48 +0000 (18:27 +0000)]
Fix start date to not be in the future.

Submitted by: phil
Reviewed by: sjg (mentor)
Approved by: sjg

7 years agoAdd shmatt_t.
ed [Tue, 26 Jul 2016 17:23:49 +0000 (17:23 +0000)]
Add shmatt_t.

It looks like our "struct shmid_ds::shm_nattch" deviates from the
standard in the sense that it is a signed integer, whereas POSIX
requires that it is unsigned, having a special type shmatt_t.

Patch up our native and 32-bit copies to use a new shmatt_t that is an
unsigned integer. As it's unsigned, we can relax the comparisons that
are performed on it. Leave the Linux, iBCS2, etc. copies of the
structure alone.

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

7 years agoUpdate my TODO items.
adrian [Tue, 26 Jul 2016 16:40:03 +0000 (16:40 +0000)]
Update my TODO items.

7 years agovt: lock Giant around kbd calls in CONS_GETINFO
emaste [Tue, 26 Jul 2016 15:34:26 +0000 (15:34 +0000)]
vt: lock Giant around kbd calls in CONS_GETINFO

Note that keyboards are stored in an array and are not freed (just
"unregistered" by clearing some fields) so a race would be limited to
obtaining stale information about an unregistered keyboard.

Reported by: CTurt
MFC after: 3 days

7 years agoapply some style(9) to kbd: make function name start in column 1
emaste [Tue, 26 Jul 2016 13:36:28 +0000 (13:36 +0000)]
apply some style(9) to kbd: make function name start in column 1

Sponsored by: The FreeBSD Foundation

7 years agohyperv/vmbus: Nuke unnecessary accessor functions.
sephe [Tue, 26 Jul 2016 05:06:00 +0000 (05:06 +0000)]
hyperv/vmbus: Nuke unnecessary accessor functions.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7303

7 years agoAdd links for bit_ffc_at(3) and bit_ffs_at(3).
bdrewery [Tue, 26 Jul 2016 03:47:16 +0000 (03:47 +0000)]
Add links for bit_ffc_at(3) and bit_ffs_at(3).

MFC after: 3 days

7 years agoiwm(4) synchronize driver to DragonFlyBSD version and recent f/w update.
sbruno [Tue, 26 Jul 2016 00:02:17 +0000 (00:02 +0000)]
iwm(4) synchronize driver to DragonFlyBSD version and recent f/w update.

Submitted by: Kevin Bowling (kevin.bowling@kev009.com)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6967

7 years agoiwm(4): switch to ieee80211_runtask()
sbruno [Mon, 25 Jul 2016 23:44:44 +0000 (23:44 +0000)]
iwm(4): switch to ieee80211_runtask()

Submitted by: Andiry Voskoboinyk (s3erios@gmail.com)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D5054

7 years agoUpdate iwmfw(4) to include support for 8260 series units and update
sbruno [Mon, 25 Jul 2016 23:05:25 +0000 (23:05 +0000)]
Update iwmfw(4) to include support for 8260 series units and update
f/w for the other devices supported by this driver.

Patch linked in https://reviews.freebsd.org/D6967 but not actually
a part of the review.

Obtained from DragonflyBSD.

Submitted by:   Kevin Bowling <kev009@kev009.com>
MFC after:      2 weeks
Relnotes:       yes

7 years agomiwi resigned from FreeBSD, update the graph
rene [Mon, 25 Jul 2016 20:49:16 +0000 (20:49 +0000)]
miwi resigned from FreeBSD, update the graph

7 years agoRemove some extraneous printfs.
imp [Mon, 25 Jul 2016 19:16:30 +0000 (19:16 +0000)]
Remove some extraneous printfs.

7 years agodevfs: Move most ioctl logic down to vnode layer
cem [Mon, 25 Jul 2016 16:28:02 +0000 (16:28 +0000)]
devfs: Move most ioctl logic down to vnode layer

Devfs' file layer ioctl is now just a thin shim around the vnode layer.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7286

7 years agoRemove an unused variable.
andrew [Mon, 25 Jul 2016 16:18:20 +0000 (16:18 +0000)]
Remove an unused variable.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoFix a typo in a string in a KASSERT to sanity check the CPU IDs.
andrew [Mon, 25 Jul 2016 15:59:31 +0000 (15:59 +0000)]
Fix a typo in a string in a KASSERT to sanity check the CPU IDs.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoRework how we number CPUs on arm64 to try and keep clusters together.
andrew [Mon, 25 Jul 2016 15:57:13 +0000 (15:57 +0000)]
Rework how we number CPUs on arm64 to try and keep clusters together.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoEnable the generic OHCI driver on arm64
andrew [Mon, 25 Jul 2016 14:49:15 +0000 (14:49 +0000)]
Enable the generic OHCI driver on arm64

Obtained from: ABT Systems Ltd
MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation

7 years agoFix bspatch heap overflow vulnerability.
delphij [Mon, 25 Jul 2016 14:45:48 +0000 (14:45 +0000)]
Fix bspatch heap overflow vulnerability.

Obtained from: Chromium
Reported by: Lu Tung-Pin
Security: FreeBSD-SA-16:25.bspatch

7 years agoRewrite the GPT and MBR examples. For GPT, ensure that the boot partition
des [Mon, 25 Jul 2016 11:25:33 +0000 (11:25 +0000)]
Rewrite the GPT and MBR examples.  For GPT, ensure that the boot partition
is large enough for gptzfsboot, which has doubled in size since 10.

PR: 211361
MFC after: 3 days

7 years agoDo not invoke resize method if geom is being withered.
ae [Mon, 25 Jul 2016 09:12:08 +0000 (09:12 +0000)]
Do not invoke resize method if geom is being withered.

PR: 211028
MFC after: 2 weeks

7 years agoSplit MAKE_SYSENT into two parts so that the initializer part can be
julian [Mon, 25 Jul 2016 08:13:50 +0000 (08:13 +0000)]
Split MAKE_SYSENT into two parts so that the initializer part can be
used separately if one wants to embed the sysent into a larger structure.

MFC after: 1 week

7 years agoChange bsdiff to use divsufsort suffix sort library instead of qsufsort,
delphij [Mon, 25 Jul 2016 03:58:19 +0000 (03:58 +0000)]
Change bsdiff to use divsufsort suffix sort library instead of qsufsort,
which is more efficient.

Note that for now we do not create a separate library for libdivsufsort
because it's not used anywhere else.

Obtained from: Chromium
MFC after: 2 months

7 years agohyperv/vmbus: Move bufring info definition to vmbus_brvar.h
sephe [Mon, 25 Jul 2016 03:30:26 +0000 (03:30 +0000)]
hyperv/vmbus: Move bufring info definition to vmbus_brvar.h

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7282

7 years agohyperv/vmbus: Rename hv_vmbus_priv.h to vmbus_brvar.h
sephe [Mon, 25 Jul 2016 03:12:40 +0000 (03:12 +0000)]
hyperv/vmbus: Rename hv_vmbus_priv.h to vmbus_brvar.h

It only contains bufring related bits for a while.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7281

7 years agoavoid building otusfw when WITHOUT_SOURCELESS_UCODE set
emaste [Mon, 25 Jul 2016 00:49:27 +0000 (00:49 +0000)]
avoid building otusfw when WITHOUT_SOURCELESS_UCODE set

PR: 204748
Submitted by: Fabian Keil
Obtained from: ElectroBSD
MFC after: 1 week

7 years agolibelftc: fix demangling of wchar_t
emaste [Sun, 24 Jul 2016 23:40:33 +0000 (23:40 +0000)]
libelftc: fix demangling of wchar_t

"wchar_t" is 7 characters long, not 6.

PR: 208661
Submitted by: Daniel McRobb
Obtained from: ELF Tool Chain r3480
MFC after: 3 days

7 years agoFix failures of scripted conversion.
glebius [Sun, 24 Jul 2016 20:47:57 +0000 (20:47 +0000)]
Fix failures of scripted conversion.

Noticed by: ache
Pointy hat to: glebius

7 years agoVendor import of libdivsufsort, a software library that implements
delphij [Sun, 24 Jul 2016 20:39:43 +0000 (20:39 +0000)]
Vendor import of libdivsufsort, a software library that implements
a lightweight suffix array construction algorithm.

Obtained from: https://github.com/y-256/libdivsufsort

7 years agoDon't disable binutils/elftoolchain bootstrapping with external compiler.
bdrewery [Sun, 24 Jul 2016 18:50:11 +0000 (18:50 +0000)]
Don't disable binutils/elftoolchain bootstrapping with external compiler.

This was a regression from r300349.

Setting MK_CROSS_COMPILER=no forces the compiler bootstraping *and* the
binutils/elftoolchain bootstrapping to be disabled in share/mk/src.opts.mk.
The only intent with using an external compiler is to disable bootstrapping of
the compiler.  The binutils/elftoolchain bootstrapping must still occur unless
XAS is set.  This did not affect WITH_SYSTEM_COMPILER.

Now that setting an external compiler sets both MK_CLANG_BOOTSTRAP and
MK_GCC_BOOTSTRAP to no, and MK_CROSS_COMPILER does the same via
share/mk/src/opts.mk, remove redundant logic that checks for
MK_CROSS_COMPILER.  It will not always be true now that MK_CROSS_COMPILER==no
when an external compiler is used and --sysroot/-target is needed.

Reported by: sbruno
Pointyhat to: bdrewery
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoFix empty WANT_COMPILER_TYPE when neither compiler is bootstrapped.
bdrewery [Sun, 24 Jul 2016 18:28:14 +0000 (18:28 +0000)]
Fix empty WANT_COMPILER_TYPE when neither compiler is bootstrapped.

Bug in r303272.

MFC after: 3 days
X-MFC-With: r303272
Sponsored by: EMC / Isilon Storage Division

7 years agoSYSTEM_COMPILER: Rework the logic to allow a 'make test-system-compiler'.
bdrewery [Sun, 24 Jul 2016 18:05:05 +0000 (18:05 +0000)]
SYSTEM_COMPILER: Rework the logic to allow a 'make test-system-compiler'.

1. Always calculate what the expected values are.
2. Add 'make test-system-compiler' to show all of the computed values
   vs the wanted values.
3. Extend the .info line to buildkernel/kernel-toolchain/toolchain/_cross-tools.
4. Consolidate all of the logic to one condition.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoFix style.
br [Sun, 24 Jul 2016 18:04:12 +0000 (18:04 +0000)]
Fix style.

7 years agoPostpone ntb_get_msix_info() till we need to negotiate MSIX.
mav [Sun, 24 Jul 2016 14:42:11 +0000 (14:42 +0000)]
Postpone ntb_get_msix_info() till we need to negotiate MSIX.

Calling it earlier increases the window when MSIX info may change.
This change does not solve the problem completely, but seems logical.
Complete solution should probably include link reset in case of MSIX
remap to trigger new negotiation, but we have no way to get notified
about that now.

7 years agoRemove reference cpp(1) which is not used anymore
bapt [Sun, 24 Jul 2016 11:05:23 +0000 (11:05 +0000)]
Remove reference cpp(1) which is not used anymore

7 years agoThe date format for ru_RU.UTF-8 locale has changed some time ago, adjust
glebius [Sun, 24 Jul 2016 10:35:44 +0000 (10:35 +0000)]
The date format for ru_RU.UTF-8 locale has changed some time ago, adjust
the ru_RU.UTF-8 calendar files.

7 years agoPartially revert r257696/r257713, which have an issue with writing to user
glebius [Sun, 24 Jul 2016 10:10:09 +0000 (10:10 +0000)]
Partially revert r257696/r257713, which have an issue with writing to user
controlled address. Restore the old code that emulated OSIOCGIFCONF in if.c.

Noticed by: C Turt

7 years agoAdd more UEFI/e820 memory types from latest specifications.
mav [Sun, 24 Jul 2016 09:15:11 +0000 (09:15 +0000)]
Add more UEFI/e820 memory types from latest specifications.

This is only cosmetics.

MFC after: 2 weeks

7 years agoRemove now unused functions from the FDT uart cpu driver.
andrew [Sun, 24 Jul 2016 08:52:49 +0000 (08:52 +0000)]
Remove now unused functions from the FDT uart cpu driver.

Obtained from: ABT Systems Ltd
MFC after: 1 month
X-MFC with: r303100
Sponsored by: The FreeBSD Foundation

7 years ago[nvram2env] split implementation into generic & MIPS-based code
mizhka [Sun, 24 Jul 2016 08:35:45 +0000 (08:35 +0000)]
[nvram2env] split implementation into generic & MIPS-based code

Split implementation of nvram2env to generic (MI) & MIPS-based code:

 - removed includes like "*siba*", because they are unused
 - added nvram2env_mips.c file with MIPS-specific code, code moved from nvram2env.c
 - added header file to shared defines/structures/function prototypes between MI and MIPS code

Also this fix allows to implement own nvram2env drivers.

Reviewed by:    ray, adrian (mentor)
Approved by:    adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D6513

7 years agoAllow the use of micphy on am335x devices.
loos [Sun, 24 Jul 2016 01:31:41 +0000 (01:31 +0000)]
Allow the use of micphy on am335x devices.

The Micrel PHYs reads the optional external delays from DTB.

Tested and used by uBMC and uFW.

Sponsored by: Rubicon Communications (Netgate)

7 years agoCorrect a comment - each page queue has its own lock.
markj [Sat, 23 Jul 2016 21:03:25 +0000 (21:03 +0000)]
Correct a comment - each page queue has its own lock.

Reviewed by: alc
MFC after: 3 days

7 years agoUpdate a comment in vm_page_advise() to match behaviour after r290529.
markj [Sat, 23 Jul 2016 21:02:36 +0000 (21:02 +0000)]
Update a comment in vm_page_advise() to match behaviour after r290529.

Reviewed by: alc
MFC after: 3 days

7 years agoAdd support for the Microchip/Micrel KSZ9031 Gigabit Ethernet PHY.
loos [Sat, 23 Jul 2016 18:16:40 +0000 (18:16 +0000)]
Add support for the Microchip/Micrel KSZ9031 Gigabit Ethernet PHY.

Tested on uBMC and uFW.

Sponsored by: Rubicon Communications (Netgate)

7 years agoRemove unused USB ethernet driver from BEAGLEBONE/AM335x kernel.
loos [Sat, 23 Jul 2016 17:36:17 +0000 (17:36 +0000)]
Remove unused USB ethernet driver from BEAGLEBONE/AM335x kernel.

7 years agoFix kernel builds with "device cxgbe".
np [Sat, 23 Jul 2016 15:12:03 +0000 (15:12 +0000)]
Fix kernel builds with "device cxgbe".