]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoUpdate history. Patch supplied by Sevan Janiyan <venture37@geeklan.co.uk>.
wblock [Fri, 16 Sep 2016 14:23:16 +0000 (14:23 +0000)]
Update history.  Patch supplied by Sevan Janiyan <venture37@geeklan.co.uk>.

PR: 181390
Submitted by: ksmakoto@dd.iij4u.or.jp
MFC after: 1 week

7 years agomlx5en: Fix duplicate mbuf free-by-code.
hselasky [Fri, 16 Sep 2016 11:57:48 +0000 (11:57 +0000)]
mlx5en: Fix duplicate mbuf free-by-code.

When mlx5e_sq_xmit() returns an error code and the mbuf pointer is set,
we should not free the mbuf, because the caller will keep the mbuf in
the drbr. Make sure the mbuf pointer is correctly set upon function
exit.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Remove unused pdev pointer.
hselasky [Fri, 16 Sep 2016 11:55:38 +0000 (11:55 +0000)]
mlx5en: Remove unused pdev pointer.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Verify port type is ethernet before creating network device
hselasky [Fri, 16 Sep 2016 11:53:53 +0000 (11:53 +0000)]
mlx5en: Verify port type is ethernet before creating network device

Else the mlx5en driver might attach to infiniband ports.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Allow setting the software MTU size below 1500 bytes
hselasky [Fri, 16 Sep 2016 11:51:31 +0000 (11:51 +0000)]
mlx5en: Allow setting the software MTU size below 1500 bytes

The hardware MTU size can't be set to a value less than 1500 bytes due
to side-band management support. Allow setting the software MTU size
below 1500 bytes, thus creating a mismatch between hardware and
software MTU sizes.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Factor out common sendqueue code for use with rate limiting SQs.
hselasky [Fri, 16 Sep 2016 11:47:16 +0000 (11:47 +0000)]
mlx5en: Factor out common sendqueue code for use with rate limiting SQs.

Try to reuse code to setup sendqueues when possible by making some static
functions global. Further split the mlx5e_close_sq_wait() function to
separate out reusable parts.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Properly declare doorbell lock for 32-bit CPUs.
hselasky [Fri, 16 Sep 2016 11:45:35 +0000 (11:45 +0000)]
mlx5en: Properly declare doorbell lock for 32-bit CPUs.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Optimise away duplicate UAR pointers.
hselasky [Fri, 16 Sep 2016 11:40:45 +0000 (11:40 +0000)]
mlx5en: Optimise away duplicate UAR pointers.

This change also reduces the size of the mlx5e_sq structure so that the last
queue_state element will fit into the previous cacheline and then the mlx5e_sq
structure becomes one cacheline less for amd64.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Make the mlx5e_open_cq() and mlx5e_close_cq() functions global.
hselasky [Fri, 16 Sep 2016 11:39:15 +0000 (11:39 +0000)]
mlx5en: Make the mlx5e_open_cq() and mlx5e_close_cq() functions global.

Make some functions and structures global to allow for code reuse
when creating rate limiting sendqueues.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Minor completion queue control path code refactor.
hselasky [Fri, 16 Sep 2016 11:37:35 +0000 (11:37 +0000)]
mlx5en: Minor completion queue control path code refactor.

Move setting of CQ moderation mode together with the other
CQ moderation parameters. Pass completion event vector as
a separate argument to mlx5e_open_cq(), because its value is
different for each call. Pass mlx5e_priv pointer instead of
mlx5e_channel pointer so that code can be used by rate
limiting sendqueues.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Separate the sendqueue from using the mlx5e_channel structure.
hselasky [Fri, 16 Sep 2016 11:35:45 +0000 (11:35 +0000)]
mlx5en: Separate the sendqueue from using the mlx5e_channel structure.

This change allows for reusing the transmit path for so called
rate limited senqueues. While at it optimise some pointer lookups
in the fast path.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agoUpdate the MLX5 core module:
hselasky [Fri, 16 Sep 2016 11:28:16 +0000 (11:28 +0000)]
Update the MLX5 core module:
- Add new firmware commands and update existing ones.
- Add more firmware related structures and update existing ones.
- Some minor fixes, like adding missing \n to some prints.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agoFix decoding of tf_rsp on amd64, and move TF_HAS_STACKREGS() to the
bde [Fri, 16 Sep 2016 07:09:35 +0000 (07:09 +0000)]
Fix decoding of tf_rsp on amd64, and move TF_HAS_STACKREGS() to the
i386-only section, and fix a comment about the amd64 kernel trapframe
not having stackregs.

tf_rsp doesn't need decoding on amd64, but had an old clone of i386
code to do this in 1 place, and since the amd64 kernel trapframe does
have stackregs, the result was an off-by-16 error for %rsp in an error
message.

7 years agoStatically initialize the run mode to the one that will become
bde [Fri, 16 Sep 2016 06:31:10 +0000 (06:31 +0000)]
Statically initialize the run mode to the one that will become
current on first entry.  This fixes a spurious "Stepping aborted"
message when the first entry is for a breakpoint.

Don't reset to the run mode to STEP_NONE when stopping, and remove
STEP_NONE.  This mode was never really used, except transiently to
mis-decide whether to print the message on first entry.

7 years agoInvert calloc(3) argument order.
araujo [Fri, 16 Sep 2016 05:33:08 +0000 (05:33 +0000)]
Invert calloc(3) argument order.

Reviewed by: ed.
MFC after: 4 weeks.
Differential Revision: https://reviews.freebsd.org/D7902

7 years ago(1) Ifdef the new dr6 variable for KDB.
bde [Fri, 16 Sep 2016 04:58:37 +0000 (04:58 +0000)]
(1) Ifdef the new dr6 variable for KDB.

While here, avoid using the old variable 'code' and remove it
in trap().  ('code' was meant for holding things like %dr6,
but is too small to hold %dr6 on amd64 and was reduced to an
obfuscation of tf_err, with early truncation on amd64.)

Submitted by: Michael Butler (imb@...)

7 years agoAdd missing history sections to a number of storage related man pages
allanjude [Fri, 16 Sep 2016 04:28:31 +0000 (04:28 +0000)]
Add missing history sections to a number of storage related man pages

gmultipath.8: Add HISTORY
Adjust sentences with bad phrases picked up by igor

ggatec.8: Add HISTORY

ggated.8: Add HISTORY

ggatel.8: Add HISTORY
Seperate out sentence as advised by igor.

hastctl.8: Add HISTORY

hastd.8: Add HISTORY
Fix sentence highlighted by igor.

iscontrol.8: Add HISTORY

mdmfs.8: Add HISTORY
Address issues raised by igor

mount_nfs.8: Add HISTORY
Not sure where mount_nfs first showed up, but the verison used
in the BSD's originates from 4.4BSD according to CSRG archive.

Though commercial offerings from Sun and others covers older
systems, eg https://groups.google.com/forum/#!topic/net.unix-wizards/lMe7aQikqJI

nandfs.8: Add HISTORY
Adjust sentence in description to address bad phrase highlighted
by igor.

nvmecontrol.8: Add HISTORY

PR: 212491
PR: 212498
PR: 212499
PR: 212500
PR: 212501
PR: 212502
PR: 212505
PR: 212508
PR: 212540
PR: 212543
PR: 212546
Submitted by: Sevan Janiyan <venture37@geeklan.co.uk>

7 years agoAdd an option called "random" that combined with "ether" can generate a
araujo [Fri, 16 Sep 2016 04:22:21 +0000 (04:22 +0000)]
Add an option called "random" that combined with "ether" can generate a
random MAC address for an Ethernet interface.

PR: 211984
Submitted by: pi@
Reviewed by: gnn, cem, jhb, lidl, rpokala, wblock
Approved by: wblock (manpages)

7 years agosbin/umount/umount.8: Amend HISTORY
allanjude [Fri, 16 Sep 2016 04:12:32 +0000 (04:12 +0000)]
sbin/umount/umount.8: Amend HISTORY

umount first appeared in V1, confirmed using TUHS archive
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man1/umount.1

PR: 212554
Submitted by: Sevan Janiyan <venture37@geeklan.co.uk>

7 years agosbin/reboot/reboot.8: Amend HISTORY
allanjude [Fri, 16 Sep 2016 04:11:04 +0000 (04:11 +0000)]
sbin/reboot/reboot.8: Amend HISTORY

A standalone reboot utility showed up in 4.0BSD, in AT&T UNIX init has a
case for reboot and is present in the version shipped with V5

either way, current entry is incorrect.

PR: 212548
Submitted by: Sevan Janiyan <venture37@geeklan.co.uk>

7 years agosbin/rcorder/rcorder.8: Amend HISTORY
allanjude [Fri, 16 Sep 2016 04:08:34 +0000 (04:08 +0000)]
sbin/rcorder/rcorder.8: Amend HISTORY

rcorder appeared in FreeBSD 5.0.
Address issues raised by igor.

PR: 212547
Submitted by: Sevan Janiyan <venture37@geeklan.co.uk>

7 years agolinprocfs: garbage collect meminfo fields not present in linux
mjg [Fri, 16 Sep 2016 03:36:43 +0000 (03:36 +0000)]
linprocfs: garbage collect meminfo fields not present in linux

In particular memshared not only does not exist in linux, it was
extremely expensive to calculate.

7 years agoWhen MAKEOBJDIRPREFIX points to a case-insensitive file system, the
marcel [Fri, 16 Sep 2016 03:04:48 +0000 (03:04 +0000)]
When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same object
files (case-insensitivity speaking).  This is the case for _Exit.c
and _exit.s.  Compile _Exit.c as C99_Exit.c

Reviewed by: sjg@
MFC after: completion
Sponsored by: Bracket Computing
Differential Revision: https://reviews.freebsd.org/D7893

7 years agoUse arch-specific .text padding fill value in EFI loaders
emaste [Fri, 16 Sep 2016 01:38:22 +0000 (01:38 +0000)]
Use arch-specific .text padding fill value in EFI loaders

The fill pattern was previously an ia64 instruction sequence. Presumably
ia64's linker script was copied as a starting point.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agocxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will
np [Fri, 16 Sep 2016 00:08:37 +0000 (00:08 +0000)]
cxgbe(4): Attach to cards with the Terminator 6 ASIC.  T6 cards will
come up as 't6nex' nexus devices with 'cc' ports hanging off them.

The T6 firmware and configuration files will be added as soon as they
are released.  For now the driver will try to work with whatever
firmware and configuration is on the card's flash.

Sponsored by: Chelsio Communications

7 years agoWhitespace nits.
np [Thu, 15 Sep 2016 22:31:49 +0000 (22:31 +0000)]
Whitespace nits.

7 years agonet80211: allow to override SWCRYPT/SWMIC bits in the driver
avos [Thu, 15 Sep 2016 22:27:00 +0000 (22:27 +0000)]
net80211: allow to override SWCRYPT/SWMIC bits in the driver

Add IEEE80211_KEY_SWCRYPT / IEEE80211_KEY_SWMIC bits to the
IEEE80211_KEY_DEVICE mask - as a result, those bits will be preserved
during group key handshake.

A driver can override them in iv_key_alloc() for some keys in case
when hardware crypto support is not possible. As an example:
 - multi-vap without multicast key search support;
 - IBSS RSN for devices w/ fixed storage for group keys;

Tested with RTL8188EU (AP, sw crypto) and
RTL8821AU (STA, sw crypto for group keys + hw crypto for pairwise keys)

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

7 years agoDecode some REX prefixes in inst_call(). This makes the 'next' and
bde [Thu, 15 Sep 2016 18:30:53 +0000 (18:30 +0000)]
Decode some REX prefixes in inst_call().  This makes the 'next' and
'until' commands work in more cases.

7 years agoThe TLS offset is a property of the process ABI.
brooks [Thu, 15 Sep 2016 17:25:52 +0000 (17:25 +0000)]
The TLS offset is a property of the process ABI.

Move to a per-proc TLS offset rather than incorrectly keying off the
presense of freebsd32 compability in the kernel.

Reviewed by: adrian, sbruno
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D7843

7 years agoImplement multibyte encoding support for -v with fallback
ache [Thu, 15 Sep 2016 17:24:39 +0000 (17:24 +0000)]
Implement multibyte encoding support for -v with fallback

MFC after:      7 days

7 years agoAbort single stepping in ddb if the trap is not for single-stepping.
bde [Thu, 15 Sep 2016 17:24:23 +0000 (17:24 +0000)]
Abort single stepping in ddb if the trap is not for single-stepping.
This is not very easy to do, since ddb didn't know when traps are
for single-stepping.  It more or less assumed that traps are either
breakpoints or single-step, but even for x86 this became inadequate
with the release of the i386 in ~1986, and FreeBSD passes it other
trap types for NMIs and panics.

On x86, teach ddb when a trap is for single stepping using the %dr6
register.  Unknown traps are now treated almost the same as breakpoints
instead of as the same as single-steps.  Previously, the classification
of breakpoints was almost correct and everything else was unknown so
had to be treated as a single-step.  Now the classification of single-
steps is precise, the classification of breakpoints is almost correct
(as before) and everything else is unknown and treated like a
breakpoint.

This fixes:
- breakpoints not set by ddb, including the main one in kdb_enter(),
  were treated as single-steps and not stopped on when stepping
  (except for the usual, simple case of a step with residual count 1).
  As special cases, kdb_enter() didn't stop for fatal traps or panics
- similarly for "hardware breakpoints".

Use a new MD macro IS_SSTEP_TRAP(type, code) to code to classify
single-steps.  This is excessively complicated for bug-for-bug and
backwards compatibilty.  Design errors apparently started in Mach
in ~1990 or perhaps in the FreeBSD interface in ~1993.  Common trap
types like single steps should have a unique MI code (like the TRAP*
codes for user SIGTRAP) so that debuggers don't need macros like
IS_SSTEP_TRAP() to decode them.  But 'type' is actually an ambiguous
MD trap number, and code was always 0 (now it is (int)%dr6 on x86).
So it was impossible to determine the trap type from the args.
Global variables had to be used.

There is already a classification macro db_pc_is_single_step(), but
this just gets in the way.  It is only used to recover from bugs in
IS_BREAKPOINT_TRAP().  On some arches, IS_BREAKPOINT_TRAP() just
duplicates the ambiguity in 'type' and misclassifies single-steps as
breakpoints.  It defaults to 'false', which is the opposite of what is
needed for bug-for-bug compatibility.

When this is cleaned up, MI classification bits should be passed in
'code'.  This could be done now for positive-logic bits, since 'code'
was always 0, but some negative logic is needed for compatibility so
a simple MI classificition is not usable yet.

After reading %dr6, clear the single-step bit in it so that the type
of the next debugger trap can be decoded.  This is a little
ddb-specific.  ddb doesn't understand the need to clear this bit and
doing it before calling kdb is easiest.  gdb would need to reverse
this to support hardware breakpoints, but it just doesn't support
them now since gdbstub doesn't support %dr*.

Fix a bug involving %dr6: when emulating a single-step trap for vm86,
set the bit for it in %dr6.  Userland debuggers need this.  ddb now
needs this for vm86 bios calls.  The bit gets copied to 'code' then
cleared again.

Fix related style bugs:
- when clearing bits for hardware breakpoints in %dr6, spell the mask
  as ~0xf on both amd64 and i386 to get the correct number of bits
  using sign extension and not need a comment about using the wrong
  mask on amd64 (amd64 traps for invalid results but clearing the
  reserved top bits didn't trap since they are 0).
- rewrite my old wrong comments about using %dr6 for ddb watchpoints.

7 years agoRemove 'cpu' and 'cpu_class' on amd64.
jhb [Thu, 15 Sep 2016 17:05:54 +0000 (17:05 +0000)]
Remove 'cpu' and 'cpu_class' on amd64.

The 'cpu' and 'cpu_class' variables were always set to the same value
on amd64 and are legacy holdovers from i386.  Remove them entirely on
amd64.

Reviewed by: imp, kib (older version)
Differential Revision: https://reviews.freebsd.org/D7888

7 years agoChange the getnewvnode(9) tag for nullfs from "null" to "nullfs".
trasz [Thu, 15 Sep 2016 13:57:37 +0000 (13:57 +0000)]
Change the getnewvnode(9) tag for nullfs from "null" to "nullfs".
It's more consistent, and besides, the "null" alone looks weird.

MFC after: 1 month

7 years agoBump __FreeBSD_version for r305824.
kevlo [Thu, 15 Sep 2016 13:40:36 +0000 (13:40 +0000)]
Bump __FreeBSD_version for r305824.

Suggested by: ngie

7 years agoRenumber license clauses in sys/kern to avoid skipping #3
emaste [Thu, 15 Sep 2016 13:16:20 +0000 (13:16 +0000)]
Renumber license clauses in sys/kern to avoid skipping #3

7 years agocxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields
np [Thu, 15 Sep 2016 08:30:47 +0000 (08:30 +0000)]
cxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields
to use in tx work requests.

7 years agoRemove the 4.3BSD compatible macro m_copy(), use m_copym() instead.
kevlo [Thu, 15 Sep 2016 07:41:48 +0000 (07:41 +0000)]
Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead.

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

7 years agosdiff: improve errx string
emaste [Thu, 15 Sep 2016 02:48:56 +0000 (02:48 +0000)]
sdiff: improve errx string

errx() appends a newline so \n is superfluous. Also switch to lower case
with no period for consistency with other errx strings.

7 years agobspatch: use #define for header size instead of magic number
emaste [Thu, 15 Sep 2016 01:58:12 +0000 (01:58 +0000)]
bspatch: use #define for header size instead of magic number

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

7 years agologin: clean up errx strings
emaste [Thu, 15 Sep 2016 01:55:18 +0000 (01:55 +0000)]
login: clean up errx strings

errx() prefixes the error string with argv[0] so including "login: "
in the string is redundant. Also remove a superfluous newline.

Sponsored by: The FreeBSD Foundation

7 years agoOnly define db_show_spr if DDB is enabled.
jhibbits [Wed, 14 Sep 2016 23:24:23 +0000 (23:24 +0000)]
Only define db_show_spr if DDB is enabled.

PR: 212667
Reported by: Kenneth Salerno <kennethsalerno_AT_yahoo_dot_com>

7 years agoMFV r305816:
mm [Wed, 14 Sep 2016 21:15:01 +0000 (21:15 +0000)]
MFV r305816:
Sync libarchive with vendor including important security fixes.

Issues fixed (FreeBSD):
PR #778: ACL error handling
Issue #745: Symlink check prefix optimization is too aggressive
Issue #746: Hard links with data can evade sandboxing restrictions

This update fixes the vulnerability #3 and vulnerability #4 as reported in
"non-cryptanalytic attacks against FreeBSD update components".
https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f

Fix for vulnerability #2 has already been merged in r304989.

MFC after: 1 week
Security: http://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f

7 years agovtfontcvt: remove superfluous newlines in errx messages
emaste [Wed, 14 Sep 2016 18:22:12 +0000 (18:22 +0000)]
vtfontcvt: remove superfluous newlines in errx messages

7 years agoufsread: Do not cast struct direct from void *
manu [Wed, 14 Sep 2016 17:43:32 +0000 (17:43 +0000)]
ufsread: Do not cast struct direct from void *
This cause alignment problem on ARM (and possibly other archs), instead copy it.

MFC after: 1 week

7 years agolocaledef(1): make better use of calloc(3) arguments.
pfg [Wed, 14 Sep 2016 16:47:18 +0000 (16:47 +0000)]
localedef(1): make better use of calloc(3) arguments.

The first argument of calloc(3) should be an ordinal type, and the
second a size: split a multiplication to make better use of calloc(3)
and detect overflows.

Do some other re-ordering and style fixes while here.

MFC after: 3 weeks

7 years agofifolog(1): invert order of calloc(3) arguments.
pfg [Wed, 14 Sep 2016 16:34:52 +0000 (16:34 +0000)]
fifolog(1): invert order of calloc(3) arguments.

The second argment to calloc(3) should be the size, make it so.

While here be a little bit more cautious in fifolog_reader_open()
to protect in the unlikely event of an overflowed allocation.

MFC after: 3 weeks

7 years agoTry to fix LINT builds after r305807. Seems to be a simple s&r error
bz [Wed, 14 Sep 2016 16:08:23 +0000 (16:08 +0000)]
Try to fix LINT builds after r305807.  Seems to be a simple s&r error
I missed while reading through the 1st time as well.

7 years agoEnsure that the IPPROTO_TCP level socket options
tuexen [Wed, 14 Sep 2016 14:48:00 +0000 (14:48 +0000)]
Ensure that the IPPROTO_TCP level socket options
* TCP_KEEPINIT
* TCP_KEEPINTVL
* TCP_KEEPIDLE
* TCP_KEEPCNT
always always report the values currently used when getsockopt()
is used. This wasn't the case when the sysctl-inherited default
values where used.
Ensure that the IPPROTO_TCP level socket option TCP_INFO has the
TCPI_OPT_ECN flag set in the tcpi_options field when ECN support
has been negotiated successfully.

Reviewed by: rrs, jtl, hiren
MFC after: 1 month
Differential Revision: 7833

7 years agoUse the MI macro TRAPF_USERMODE() instead of open-coded checks for
bde [Wed, 14 Sep 2016 12:57:40 +0000 (12:57 +0000)]
Use the MI macro TRAPF_USERMODE() instead of open-coded checks for
SEL_UPL and sometimes PSL_VM.  This is just a style change on amd64,
but on i386 it fixes 1 unimportant place where the PSL_VM check was
missing and starts fixing 1 important place where the PSL_VM check
had a logic error.

Fix logic errors in treating vm86 bioscall mode as kernel mode.  The
main place checked all the necessary flags, but put the necessary
parentheses for the PSL_VM and PCB_VM86CALL checks in the wrong
place.  The broken case is only reached if a vm86 bioscall uses a
%cs which is nonzero mod 4, but that is unusual -- most bios calls
start with %cs = 0xc000 or 0xf000 and rarely change it.  Another
place was missing the check for PCB_VM86CALL, but was only reachable
if there are bugs virtualizing PSL_I.

Add a macro TF_HAS_STACKREGS() and use this instead of converting
open-coded checks of SEL_UPL, etc. to TRAPF_USERMODE() when we only
care about whether the frame has stack registers.  This fixes 3
places in my recent fix for register variables in vm86 mode where I
messed up the PSL_VM check and cleans up other places.

7 years agoImprove USB polling mode by not locking any mutexes, asserting any
hselasky [Wed, 14 Sep 2016 12:07:34 +0000 (12:07 +0000)]
Improve USB polling mode by not locking any mutexes, asserting any
mutexes or using any callouts when active.

Trying to lock a mutex when KDB is active or the scheduler is stopped
can result in infinite wait loops. The same goes for calling callout
related functions which in turn lock mutexes.

If the USB controller at which a USB keyboard is connected is idle
when KDB is entered, polling the USB keyboard via USB will always
succeed. Else polling may fail depending on which state the USB
subsystem and USB interrupt handler is in. This is unavoidable unless
KDB can wait for USB interrupt threads to complete before stalling the
CPU(s).

Tested by: Bruce Evans <bde@freebsd.org>
MFC after: 4 weeks

7 years agoUse proper argument order for calloc(3).
trasz [Wed, 14 Sep 2016 11:20:58 +0000 (11:20 +0000)]
Use proper argument order for calloc(3).

MFC after: 1 month

7 years agoMake the callout structure in the boot loader's kernel shim more
hselasky [Wed, 14 Sep 2016 11:16:00 +0000 (11:16 +0000)]
Make the callout structure in the boot loader's kernel shim more
similar to the kernel one.

MFC after: 1 week

7 years agohyperv/hn: Fix some ifnet settings
sephe [Wed, 14 Sep 2016 09:17:00 +0000 (09:17 +0000)]
hyperv/hn: Fix some ifnet settings

- ifnet.if_mtu does not require explicit setting.
- ifnet.if_hdrlen must be set after ether_ifattach().

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

7 years agohyperv/hn: Remove the FreeBSD_version check for TSO configuration
sephe [Wed, 14 Sep 2016 08:59:13 +0000 (08:59 +0000)]
hyperv/hn: Remove the FreeBSD_version check for TSO configuration

It is available on both stable/10 and stable/11. This eases future MFCs
to stable/10.

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

7 years agohyperv/hn: Bring in shims from stable/10
sephe [Wed, 14 Sep 2016 08:48:08 +0000 (08:48 +0000)]
hyperv/hn: Bring in shims from stable/10

This eases future MFCs to stable/10.

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

7 years agohyperv/hn: Use sx for the main lock.
sephe [Wed, 14 Sep 2016 08:33:08 +0000 (08:33 +0000)]
hyperv/hn: Use sx for the main lock.

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

7 years agohyperv/hn: Cleanup hn_ioctl.
sephe [Wed, 14 Sep 2016 08:24:01 +0000 (08:24 +0000)]
hyperv/hn: Cleanup hn_ioctl.

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

7 years agohyperv/hn: Function renaming: hn_ifinit -> hn_init
sephe [Wed, 14 Sep 2016 08:08:45 +0000 (08:08 +0000)]
hyperv/hn: Function renaming: hn_ifinit -> hn_init

No functional changes.

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

7 years agohyperv/hn: Deprecate hn_softc_t
sephe [Wed, 14 Sep 2016 08:00:30 +0000 (08:00 +0000)]
hyperv/hn: Deprecate hn_softc_t

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

7 years agohyperv/hn: Remove unused softc field
sephe [Wed, 14 Sep 2016 06:47:25 +0000 (06:47 +0000)]
hyperv/hn: Remove unused softc field

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

7 years agohyperv/vmbus: Make sure that the sub-channel count is valid.
sephe [Wed, 14 Sep 2016 06:30:14 +0000 (06:30 +0000)]
hyperv/vmbus: Make sure that the sub-channel count is valid.

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

7 years agohyperv/hn: Pull RSS key and indirect table setup up.
sephe [Wed, 14 Sep 2016 06:15:45 +0000 (06:15 +0000)]
hyperv/hn: Pull RSS key and indirect table setup up.

This paves the way for the dynamic RSS key and indirect table setting.

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

7 years agoSwitch from .CURDIR to the simpler, more legible SRCTOP.
cy [Wed, 14 Sep 2016 01:47:01 +0000 (01:47 +0000)]
Switch from .CURDIR to the simpler, more legible SRCTOP.

Suggested by: emaste
X-MFC-with: upcoming amd upgrade

7 years agonet80211: improve error checking in ieee80211_parse_{wpa,rsn}()
avos [Tue, 13 Sep 2016 22:59:38 +0000 (22:59 +0000)]
net80211: improve error checking in ieee80211_parse_{wpa,rsn}()

- Add few checks for group/pairwise ciphers into
ieee80211_parse_{wpa,rsn}().
- Split error code and cipher value in wpa_cipher() / rsn_cipher(); current
hack with (1 << 32) does not work - it's 1, not 0 (detected by CSA).
- Return IEEE80211_REASON_UNSUPP_RSN_IE_VERSION instead of
IEEE80211_REASON_IE_INVALID when version field is not equal to RSN_VERSION.

Tested with wpi(4) / urtwn(4) (HOSTAP mode).

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

7 years agoAvoid clobbering existing value of META_COOKIE_TOUCH
sjg [Tue, 13 Sep 2016 22:17:25 +0000 (22:17 +0000)]
Avoid clobbering existing value of META_COOKIE_TOUCH

7 years agoFix swap tables between sets when this functional is enabled.
ae [Tue, 13 Sep 2016 18:16:15 +0000 (18:16 +0000)]
Fix swap tables between sets when this functional is enabled.

We have 6 opcode rewriters for table opcodes. When `set swap' command
invoked, it is called for each rewriter, so at the end we get the same
result, because opcode rewriter uses ETLV type to match opcode. And all
tables opcodes have the same ETLV type. To solve this problem, use
separate sets handler for one opcode rewriter. Use it to handle TEST_ALL,
SWAP_ALL and MOVE_ALL commands.

PR: 212630
MFC after: 1 week

7 years agoAdd a missing opt_ddb.h include from places that include debug_moditor.h
andrew [Tue, 13 Sep 2016 16:20:31 +0000 (16:20 +0000)]
Add a missing opt_ddb.h include from places that include debug_moditor.h
to fix the build.

Obtained from: ABT Systems Ltd
X-MFC with: r305771
Sponsored by: The FreeBSD Foundation

7 years agoFix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on
andrew [Tue, 13 Sep 2016 15:45:22 +0000 (15:45 +0000)]
Fix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on
DDB, and is unused when it's disabled.

Obtained from: ABT Systems Ltd
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoAdd a comment on the #endif related to the guards
bapt [Tue, 13 Sep 2016 15:41:05 +0000 (15:41 +0000)]
Add a comment on the #endif related to the guards

Reported by: tsoome

7 years agoRemove code that crept in r305125 by accident
bapt [Tue, 13 Sep 2016 15:37:23 +0000 (15:37 +0000)]
Remove code that crept in r305125 by accident

Reported by: tsoome

7 years agoAdd a warning about a known erratum we have observed on ThunderX pass 1.1.
andrew [Tue, 13 Sep 2016 14:10:49 +0000 (14:10 +0000)]
Add a warning about a known erratum we have observed on ThunderX pass 1.1.
As this is evaluation hardware with only a few users, and there is a lack
of information add a warning when booting on this hardware.

Reported by: cognet
Obtained from: ABT Systems Ltd
MFC after: Instant
Sponsored by: The FreeBSD Foundation

7 years agohyperv/hn: Reorganize synthetic parts attach code.
sephe [Tue, 13 Sep 2016 05:54:31 +0000 (05:54 +0000)]
hyperv/hn: Reorganize synthetic parts attach code.

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

7 years agohyperv/hn: Regroup synthetic parts attach code.
sephe [Tue, 13 Sep 2016 05:41:13 +0000 (05:41 +0000)]
hyperv/hn: Regroup synthetic parts attach code.

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

7 years agohyperv/hn: Reorganize channel attach/detach code.
sephe [Tue, 13 Sep 2016 05:27:36 +0000 (05:27 +0000)]
hyperv/hn: Reorganize channel attach/detach code.

This paves the way for further attach/detach code reorganization.

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

7 years agoAdd another badly-needed simple example to the pw(8) man page.
wblock [Tue, 13 Sep 2016 02:18:29 +0000 (02:18 +0000)]
Add another badly-needed simple example to the pw(8) man page.

7 years agonet80211: fix possible panic in adhoc mode (INIT -> RUN state transition).
avos [Mon, 12 Sep 2016 23:00:31 +0000 (23:00 +0000)]
net80211: fix possible panic in adhoc mode (INIT -> RUN state transition).

In case if there is already running interface, a second non-sta
interface will omit scanning, going directly to RUN state. Handle
this case for adhoc mode appropriately.

Tested with RTL8821AU, 2 vaps in IBSS mode.

7 years agofd: add fget_cap and fget_cap_locked primitives
oshogbo [Mon, 12 Sep 2016 22:46:19 +0000 (22:46 +0000)]
fd: add fget_cap and fget_cap_locked primitives

They can be used to obtain capabilities along with a referenced fp.

Reviewed by: mjg@

7 years agoFixup whitespace, repace space with a tab.
cy [Mon, 12 Sep 2016 19:31:14 +0000 (19:31 +0000)]
Fixup whitespace, repace space with a tab.

X-MFC-with: Upcoming amd update.

7 years agoRemove explicit device_verbose() from the t4iov driver detach routine
jhb [Mon, 12 Sep 2016 18:07:06 +0000 (18:07 +0000)]
Remove explicit device_verbose() from the t4iov driver detach routine
now that this case is handled generically.

7 years agoMake device_quiet() an attachment property.
jhb [Mon, 12 Sep 2016 18:06:42 +0000 (18:06 +0000)]
Make device_quiet() an attachment property.

In particular, reset the DF_QUIET flag when detaching from a device so
that a driver that marks a device quiet doesn't dictate policy for a
different driver that may claim the device in the future.

Reviewed by: rpokala, wblock
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7803

7 years agoRemove semicolon from the end of the macro definition
gonzo [Mon, 12 Sep 2016 17:29:20 +0000 (17:29 +0000)]
Remove semicolon from the end of the macro definition

Reported by: hans

7 years agourtwn: fix possible driver hang when beacon miss is detected.
avos [Mon, 12 Sep 2016 16:46:14 +0000 (16:46 +0000)]
urtwn: fix possible driver hang when beacon miss is detected.

7 years agoFix typo in comment.
kib [Mon, 12 Sep 2016 16:44:21 +0000 (16:44 +0000)]
Fix typo in comment.

MFC after: 3 days

7 years agoAdd SMP support for MTI Malta 34kf CPU.
br [Mon, 12 Sep 2016 16:38:51 +0000 (16:38 +0000)]
Add SMP support for MTI Malta 34kf CPU.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoRemove CUBIEBOARD kernel config file.
manu [Mon, 12 Sep 2016 16:13:27 +0000 (16:13 +0000)]
Remove CUBIEBOARD kernel config file.
Every Allwinner board should either use ALLWINNER (SMP) or ALLWINER_UP kernel
config files.

MFC after: 2 week

7 years agoUse "generic" ALLWINNER_UP kernel config for Cubieboard release.
manu [Mon, 12 Sep 2016 16:10:47 +0000 (16:10 +0000)]
Use "generic" ALLWINNER_UP kernel config for Cubieboard release.

Reviewed by: gjb
MFC after: 2 week

7 years agobspatch: remove superfluous newlines from errx strings
emaste [Mon, 12 Sep 2016 14:28:38 +0000 (14:28 +0000)]
bspatch: remove superfluous newlines from errx strings

7 years agohyperv/hn: Pull ether address and link status extraction up.
sephe [Mon, 12 Sep 2016 06:12:28 +0000 (06:12 +0000)]
hyperv/hn: Pull ether address and link status extraction up.

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

7 years agohyperv/hn: Reorganize RNDIS attach
sephe [Mon, 12 Sep 2016 05:59:39 +0000 (05:59 +0000)]
hyperv/hn: Reorganize RNDIS attach

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

7 years agohyperv/hn: Reorganize sub-channel allocation.
sephe [Mon, 12 Sep 2016 05:37:44 +0000 (05:37 +0000)]
hyperv/hn: Reorganize sub-channel allocation.

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

7 years agohyperv/hn: Function rename.
sephe [Mon, 12 Sep 2016 05:28:50 +0000 (05:28 +0000)]
hyperv/hn: Function rename.

- Minor style changes.
- Nuke unnecessary indirection.
- Nuke unapplied comment.

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

7 years agoReport the Silicon Revisions for the AM335x SoCs correctly.
imp [Mon, 12 Sep 2016 05:19:56 +0000 (05:19 +0000)]
Report the Silicon Revisions for the AM335x SoCs correctly.

7 years agohyperv/hn: Rename chimney sending buffer connect/disconnect functions.
sephe [Mon, 12 Sep 2016 05:18:30 +0000 (05:18 +0000)]
hyperv/hn: Rename chimney sending buffer connect/disconnect functions.

Minor cleanup and wording in error messages.

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

7 years agohyperv/hn: Rename RXBUF connect/disconnect functions.
sephe [Mon, 12 Sep 2016 05:09:45 +0000 (05:09 +0000)]
hyperv/hn: Rename RXBUF connect/disconnect functions.

Minor cleanup and wording in error messages.

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

7 years ago[ath_hal] quieten a bit of the boot messages - this stuff has been working for a...
adrian [Mon, 12 Sep 2016 04:58:59 +0000 (04:58 +0000)]
[ath_hal] quieten a bit of the boot messages - this stuff has been working for a while.

7 years agox86: Use sx lock for interrupt sources.
sephe [Mon, 12 Sep 2016 04:57:58 +0000 (04:57 +0000)]
x86: Use sx lock for interrupt sources.

- Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long
  call chain.  For msi_assign_cpu, mutex makes complex PCI bridge
  drivers more tricky, e.g. sleep can note be called, etc, it will
  be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI
  pass-through.
- It is not used on any hot code path nor non-sleepable context, so
  sx should have the same effect as mutex.

PIC list is still protected by mutex to keep suspend/resume work.

Discussed with: jhb
Reviewed by: jhb
MFC after: 3 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7784

7 years ago[ath] set the relevant TOA/TOD locationing bits when trying to do locationing.
adrian [Mon, 12 Sep 2016 04:55:13 +0000 (04:55 +0000)]
[ath] set the relevant TOA/TOD locationing bits when trying to do locationing.

* Don't do RTS/CTS - experiments show that we get ACK frames for each of them
  and this ends up causing the timestamps to look all funny.
* Set the HAL_TXDESC_POS bit, so the AR9300 HAL sets up the hardware to return
  location and CSI information.

7 years ago[ath] tweak the TX EDMA debugging a bit.
adrian [Mon, 12 Sep 2016 04:50:40 +0000 (04:50 +0000)]
[ath] tweak the TX EDMA debugging a bit.

I've used this to debug some amusing issues with the EDMA code.

Tested:

* AR9380, STA mode
* AR9380, TDMA mode (master, slave)

7 years agoCleanup evdev support for TI ADC/TS
gonzo [Mon, 12 Sep 2016 01:18:25 +0000 (01:18 +0000)]
Cleanup evdev support for TI ADC/TS

- evdev_set_methods call is not required if actual methods are no-ops
- evdev_set_serial is also optional if there is no meaningful input device
    identifier
- evdev_set_id on the other hand is mandatory, so set virtual bus with
    dummy vendor/product/version

Suggested by: Vladimir Kondratiev

7 years agocxgbe(4): Catch up with the rename of tlscaps -> cryptocaps. TLS is one
np [Mon, 12 Sep 2016 00:15:40 +0000 (00:15 +0000)]
cxgbe(4): Catch up with the rename of tlscaps -> cryptocaps.  TLS is one
of the capabilities of the crypto engine in T6.

Sponsored by: Chelsio Communications