]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r309362:
mm [Thu, 1 Dec 2016 15:46:26 +0000 (15:46 +0000)]
MFC r309362:

Sync libarchive with vendor.
Small improvements, style fixes, bugfixes.
Restores compatibility with tar archives created with Perl Archive::Tar (1)

MFC after: 1 week
Reported by: Matthew Seaman <matthew@freebsd.org> (1)

7 years agoUpdate vendor/libarchive to git 2d2b3e928605f795515b03f060fd638c265b0778
mm [Thu, 1 Dec 2016 15:39:33 +0000 (15:39 +0000)]
Update vendor/libarchive to git 2d2b3e928605f795515b03f060fd638c265b0778

Small improvements, style fixes, bugfixes.

Important vendor bugfixes:
Restore compatibility with Perl Archive::Tar that was broken with #825

7 years ago- Mention mismatching numbers in MSR vs. ACPI _PSS count warning: seeing
danfe [Thu, 1 Dec 2016 14:31:05 +0000 (14:31 +0000)]
- Mention mismatching numbers in MSR vs. ACPI _PSS count warning: seeing
  actual numbers would help debugging (also, `MSR' and `ACPI' are standard
  abbreviations and thus should be properly capitalized)
- Rephrase unsupported AMD CPUs message and wrap as an overly long line:
  `sorry' 1) is wrongly spelled after period (starts with a small letter)
  and 2) carries emotional "tinge" that is unnecessary and even bogus in
  debug message; `implemented' is not the best word as `supported' suits
  better in this context
- Improve readability when reporting resulted P-state transition (debug)

Approved by: jhb

7 years agoEFI loaders: parse rela relocations on amd64
emaste [Thu, 1 Dec 2016 14:28:37 +0000 (14:28 +0000)]
EFI loaders: parse rela relocations on amd64

Prior to this change the loader self relocation code interpreted amd64's
rela relocations as if they were rel relocations, discarding the addend.
This "works" because GNU ld 2.17.50 stores the addend value in both the
r_addend field of the relocation (as expected) and at the target of the
relocation.

Other linkers, and possibly other versions of GNU ld, won't have this
behaviour, so interpret the relocations correctly.

Reported by: George Rimar
Reviewed by: andrew
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8681

7 years agoSpeling fixes and fix line endings for err_msg output.
n_hibma [Thu, 1 Dec 2016 09:14:58 +0000 (09:14 +0000)]
Speling fixes and fix line endings for err_msg output.

In some cases there was not \n, in other cases there was.

7 years agoUpdate from subversion 1.9.4 to 1.9.5.
peter [Thu, 1 Dec 2016 07:50:44 +0000 (07:50 +0000)]
Update from subversion 1.9.4 to 1.9.5.

This includes a security fix for a component that we do not build, and
two potentially useful client side fixes for reintegrate merges and tree
conflict handling.  See CHANGES for full details.

7 years agohyperv/hn: Add 'options RSS' support.
sephe [Thu, 1 Dec 2016 05:37:29 +0000 (05:37 +0000)]
hyperv/hn: Add 'options RSS' support.

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

7 years agoFinish incomplete comments in prior revision. I was going to fix this
imp [Thu, 1 Dec 2016 05:16:27 +0000 (05:16 +0000)]
Finish incomplete comments in prior revision. I was going to fix this
after I tested it, but didn't.

7 years agoRevert the 'performance' setting to 'NONE' from C2. C2 has issues with
imp [Thu, 1 Dec 2016 04:35:43 +0000 (04:35 +0000)]
Revert the 'performance' setting to 'NONE' from C2. C2 has issues with
USB in places, as well as having the potential for reducing
performance. Since this is used even when powerd isn't enabled, these
two problems can cause on servers. Supermicro X9 motherboards, for
example, have problems with the virtual IPMI USB keyboards and mice
attaching and detaching repeatedly. Since there are issues on some
CPUs with C2, fail safe by defaulting to not altering it.

MFC After: 3 days

7 years agoIf the kenv variable rc_debug is set, turn on rc_debug.
imp [Thu, 1 Dec 2016 04:35:41 +0000 (04:35 +0000)]
If the kenv variable rc_debug is set, turn on rc_debug.

7 years agoSimplify test.
imp [Thu, 1 Dec 2016 04:35:38 +0000 (04:35 +0000)]
Simplify test.

7 years agohyperv/hn: Don't hold txdesc, if no BPFs are attached.
sephe [Thu, 1 Dec 2016 03:39:34 +0000 (03:39 +0000)]
hyperv/hn: Don't hold txdesc, if no BPFs are attached.

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

7 years agoMDIO_PHYACCESS_ACK is only valid for read access, remove it from
loos [Thu, 1 Dec 2016 03:34:04 +0000 (03:34 +0000)]
MDIO_PHYACCESS_ACK is only valid for read access, remove it from
miibus_writereg.

Reduce the DELAY() between reads while waiting for MII access.

Spotted by: yongari
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agohyperv/hn: Add HN_DEBUG kernel option.
sephe [Thu, 1 Dec 2016 03:27:16 +0000 (03:27 +0000)]
hyperv/hn: Add HN_DEBUG kernel option.

If bufring is used for per-TX ring descs, don't update "available"
counter, which is only used to help debugging.

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

7 years agoThe RX_FREEBUFFER registers are a write to increment field.
loos [Thu, 1 Dec 2016 02:35:15 +0000 (02:35 +0000)]
The RX_FREEBUFFER registers are a write to increment field.

Writing the full queue size to it every time was makeing it overflow with a
lot of bogus values.

This fixes the interrupt storms on irq 40.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoRemove a death threat from the FreeBSD sources
cem [Thu, 1 Dec 2016 02:21:36 +0000 (02:21 +0000)]
Remove a death threat from the FreeBSD sources

Reported by: koobs@, araujo@, linimon@, bjk@, emaste@, jhb@, ngie@, cem@
Maintainer timeout: des@

7 years agoindent(1): Don't unnecessarily add a blank before a comment ends.
pfg [Thu, 1 Dec 2016 01:56:34 +0000 (01:56 +0000)]
indent(1): Don't unnecessarily add a blank before a comment ends.

pr_comment() did avoid adding surplus space character when a comment
contained it at the end. Now it's also paying attention to tabs.

Taken from:  Piotr Stefaniak

7 years agoindent(1): Don't ignore newlines after comments that follow braces.
pfg [Thu, 1 Dec 2016 01:48:56 +0000 (01:48 +0000)]
indent(1): Don't ignore newlines after comments that follow braces.

indent.c has a special loop that stores tokens from between an if () and
the next statement into a buffer. The loop ignored all newlines, but that
resulted in not calling dump_line() when it was needed to produce the
final line of the buffered up comment.

Taken from:  Piotr Stefaniak

7 years agoindent(1): Avoid out of bound access of array in_buffer
pfg [Thu, 1 Dec 2016 01:32:13 +0000 (01:32 +0000)]
indent(1): Avoid out of bound access of array in_buffer

Work-around a somewhat complex interaction within the code. From
Piotr's commit [1]:

When pr_comment() calls dump_line() for the first line of a multiline
comment, it doesn't include any indentation - it starts with the "/*".
This is consistent for both boxed and not boxed comments. Where the logic
diverges is in how it treats the rest of the lines of the comment. For box
comments indent assumes that it must not change anything, so lines are
dumped as they were, including the indentation where it exists. For the
rest of comments, it will first remove the indentation to store plain text
of the comment and then add it again where indent thinks it's appropriate
-- this is part of comment re-indenting process.

For continuations of multi-line comments, the code that handles comments
in dump_line() will use pad_output() to create indentation from the
beginning of the line (what indent calls the first column) and then write
string pointed by s_com afterwards. But if it's a box comment, the string
will include original indentation, unless it's the first line of the
comment. This is why tab characters from s_com have to be considered when
calculating how much padding is needed and the "while (*com_st == '\t')
com_st++, target += 8;" does that.

In dump_line(), /target/ is initially set to ps.com_col, so it always
assumes that indentation needs to be produced in this function, regardless
of which line of a box comment it is. But for the first line of a box
comment it is not true, so pr_comment() signals it by setting
ps.n_comment_delta, the negative comment delta, to a negative number which
is then added to /target/ in dump_line() on all lines except the first
one, so that the function produces adequate indentation in this special
case.

The bug was in how that negative offset was calculated: pr_comment() used
count_spaces() on in_buffer, which pr_comment() expected to contain
non-null terminated sequence of characters, originating from whatever
originally was on the left side of the comment. Understanding that
count_spaces() requires a string, pr_comment() temporarily set buf_ptr[-2]
to 0 in hope that it would nul-terminate the right thing in in_buffer and
calling count_spaces() would be safe and do the expected thing. This was
false whenever buf_ptr would point into save_com, an entirely different
char array than in_buffer.

The short-term fix is to recognize whether buf_ptr points into in_buffer
or save_com.

Reference:
[1]
https://github.com/pstef/freebsd_indent/commit/ea486a2aa3b056b146bdfbb8e94843159750f200

Taken from:  Piotr Stefaniak

7 years agoRevert r309314, which breaks installing ports.
gjb [Wed, 30 Nov 2016 22:00:25 +0000 (22:00 +0000)]
Revert r309314, which breaks installing ports.

Requested by: antoine
Differential Revision: https://reviews.freebsd.org/D8120 (related)
Sponsored by: The FreeBSD Foundation

7 years agoioat(4): Fix 'bogus completion_pending' KASSERT
cem [Wed, 30 Nov 2016 21:59:52 +0000 (21:59 +0000)]
ioat(4): Fix 'bogus completion_pending' KASSERT

Fix ioat_release to only set is_completion_pending if DMAs were actually
queued.  Otherwise, the spurious flag could trigger an assert in the
reset path on INVARIANTS kernels.

Reviewed by: bdrewery, Suraj Raju @ Isilon
Sponsored by: Dell EMC Isilon

7 years agoCleanup old debug dirs in delete-old-dirs target
dim [Wed, 30 Nov 2016 19:06:47 +0000 (19:06 +0000)]
Cleanup old debug dirs in delete-old-dirs target

Any .debug or .symbols files under /usr/lib/debug which correspond to
OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up
by the delete-old target.  Make this also apply to any OLD_DIRS entries.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D8683

7 years agoInclude limits.h for CHAR_MAX
vangyzen [Wed, 30 Nov 2016 18:34:40 +0000 (18:34 +0000)]
Include limits.h for CHAR_MAX

This was needed on stable/10.  Apparently, sys/param.h supplies CHAR_MAX
on head.  Include limits.h anyway, for consistency, and because C says so.

Sponsored by: Dell EMC

7 years agoFix the PCI host generic FDT driver to call into the common code and not
andrew [Wed, 30 Nov 2016 14:18:52 +0000 (14:18 +0000)]
Fix the PCI host generic FDT driver to call into the common code and not
recurse into itself.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoFix the alloc function the ThunderX PCIe driver calls, the previous
andrew [Wed, 30 Nov 2016 14:17:06 +0000 (14:17 +0000)]
Fix the alloc function the ThunderX PCIe driver calls, the previous
function may not exist when FDT is removed from the kernel.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoClarify warning message when failing to configure audit on user login:
rwatson [Wed, 30 Nov 2016 14:02:36 +0000 (14:02 +0000)]
Clarify warning message when failing to configure audit on user login:
when au_user_mask() fails, it's not a failure to set the audit mask,
but to calculate the audit mask -- and hence a condfiguration-file
issue (of some sort).

MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoMark the Alpine ethernet driver as FDT only. It calls
andrew [Wed, 30 Nov 2016 10:17:03 +0000 (10:17 +0000)]
Mark the Alpine ethernet driver as FDT only. It calls
alpine_serdes_resource_get which is defined in an FDT only file.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMove the FDT specific parts of the GIC diver softc to the FDT attachment.
andrew [Wed, 30 Nov 2016 09:47:29 +0000 (09:47 +0000)]
Move the FDT specific parts of the GIC diver softc to the FDT attachment.
This allows the driver to be built in a kernel with no FDT support, e.g.
on arm64 with just ACPI.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoOnly include FDT headders when building for FDT.
andrew [Wed, 30 Nov 2016 09:45:18 +0000 (09:45 +0000)]
Only include FDT headders when building for FDT.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoAdd `gmirror create` subcommand, alike to gstripe, gconcat, etc.
mav [Wed, 30 Nov 2016 09:27:08 +0000 (09:27 +0000)]
Add `gmirror create` subcommand, alike to gstripe, gconcat, etc.

It is quite specific mode of operation without storing on-disk metadata.
It can be useful in some cases in combination with some external control
tools handling mirror creation and disks hot-plug.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

7 years agohyperv/storvsc: Don't use timedwait.
sephe [Wed, 30 Nov 2016 08:21:15 +0000 (08:21 +0000)]
hyperv/storvsc: Don't use timedwait.

The timeout is unnecessary.

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

7 years agohypver/vmbus: Remove extra assertion.
sephe [Wed, 30 Nov 2016 08:10:49 +0000 (08:10 +0000)]
hypver/vmbus: Remove extra assertion.

It is asserted by vmbus_chan_gpadl_connect() now.

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

7 years agohyperv/hn: Allow TX to share event taskqueues.
sephe [Wed, 30 Nov 2016 07:54:28 +0000 (07:54 +0000)]
hyperv/hn: Allow TX to share event taskqueues.

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

7 years agohyperv/vmbus: Add DEVMETHOD to map cpu to event taskq.
sephe [Wed, 30 Nov 2016 07:45:05 +0000 (07:45 +0000)]
hyperv/vmbus: Add DEVMETHOD to map cpu to event taskq.

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

7 years agoAllow a user-overridable setting 'PKG_CMD' to control the command used
matthew [Wed, 30 Nov 2016 07:16:29 +0000 (07:16 +0000)]
Allow a user-overridable setting 'PKG_CMD' to control the command used
to create a repo during 'make packages'

This would have been useful for a situation I found myself in where
pkg(8) had been upgraded to a version that wanted the FBSD_1.5 ABI
version but libc.so.7 had not been upgraded, and only provided
FBSD_1.4. I found I needed to update libc in order to run pkg, and I
also needed to use pkg to update libc... Which is why pkg-static
exists, but there's currently no way to tell the build system to use
pkg-static instead of pkg.

This creates a variable PKG_CMD, default value 'pkg', that can be
overridden from the command line.

Reviewed by: gjb
Approved by: gjb
Differential Revision: https://reviews.freebsd.org/D8120

7 years agohyperv/hn: Allow multiple TX taskqueues.
sephe [Wed, 30 Nov 2016 05:28:39 +0000 (05:28 +0000)]
hyperv/hn: Allow multiple TX taskqueues.

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

7 years agohyperv/hn: Nuke the unused TX taskqueue CPU binding tunable.
sephe [Wed, 30 Nov 2016 05:11:59 +0000 (05:11 +0000)]
hyperv/hn: Nuke the unused TX taskqueue CPU binding tunable.

It was an experimental tunable, and is now deemed to be road blocker
for further changes.  Time to retire it.

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

7 years agoBring the powerpc DDB disassembler into the 21st century
jhibbits [Wed, 30 Nov 2016 02:35:51 +0000 (02:35 +0000)]
Bring the powerpc DDB disassembler into the 21st century

Bring in the most recent copy of NetBSD's db_disasm, to fix bugs and add more
instructions.

* Fix several bugs in the disassembler, most notably the disassembly of the
  rlwi* instructions, the original reason for bringing in this change.
* Add more registers to the SPR list
* Add more instructions to the opcode table

Obtained from: NetBSD
MFC after: 2 weeks

7 years agovfs: fix a whitespace nit in r309307
mjg [Wed, 30 Nov 2016 02:17:03 +0000 (02:17 +0000)]
vfs: fix a whitespace nit in r309307

7 years agovfs: avoid VOP_ISLOCKED in the common case in lookup
mjg [Wed, 30 Nov 2016 02:14:53 +0000 (02:14 +0000)]
vfs: avoid VOP_ISLOCKED in the common case in lookup

7 years agonetmap: add cast to fix powerpc64 LINT kernel
emaste [Wed, 30 Nov 2016 02:00:30 +0000 (02:00 +0000)]
netmap: add cast to fix powerpc64 LINT kernel

Attempt to fix powerpc64 LINT kernel broken by r308000. Netmap's use of
a uint64_t wchan seems odd, but in the interest of minimizing this
change just cast through uintptr_t to silence the compiler warning.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8669

7 years agocxgbe(4): Include firmware for T6 cards in the driver. Update all
np [Wed, 30 Nov 2016 00:26:35 +0000 (00:26 +0000)]
cxgbe(4): Include firmware for T6 cards in the driver.  Update all
firmwares to 1.16.12.0.

Obtained from: Chelsio Communications
MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agoMFV r309299:
mm [Tue, 29 Nov 2016 22:14:42 +0000 (22:14 +0000)]
MFV r309299:
Sync libarchive with vendor.

Important vendor bugfixes (relevant to FreeBSD):
#821: tar -P cannot extract hardlinks through symlinks
#825: Add sanity check of tar "uid, "gid" and "mtime" fields

PR: 213255
Reported by: Tijl Coosemans <tilj@FreeBSD.org>
MFC after: 1 week

7 years agoUpdate vendor/libarchive to git 256e52f073765a4ddad1e86fd4d0eda2a18147bf
mm [Tue, 29 Nov 2016 21:53:16 +0000 (21:53 +0000)]
Update vendor/libarchive to git 256e52f073765a4ddad1e86fd4d0eda2a18147bf

Important vendor bugfixes (relevant to FreeBSD):
#821: tar -P cannot extract hardlinks through symlinks
#825: Add sanity check of tar "uid, "gid" and "mtime" fields

7 years agolibm: remove duplicate version script entries
emaste [Tue, 29 Nov 2016 18:40:24 +0000 (18:40 +0000)]
libm: remove duplicate version script entries

These symbols already appear in the common lib/msun/Symbol.map.
Duplicate entries produce an error with LLVM's LLD linker.

Reviewed by: br
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8627

7 years agoMake SES status updates more aggressive.
mav [Tue, 29 Nov 2016 13:48:36 +0000 (13:48 +0000)]
Make SES status updates more aggressive.

 - On control request update all status pages, since they may also be
affected if user enables/disables enclosure slots.
 - Periodically update element descriptors too, since there is some
hardware where they are changed dynamically.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

7 years agoWe only use the cpu0 variable in the FDT code.
andrew [Tue, 29 Nov 2016 13:32:23 +0000 (13:32 +0000)]
We only use the cpu0 variable in the FDT code.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agobhyve: stability and performance improvement for dbgport
avg [Tue, 29 Nov 2016 13:11:00 +0000 (13:11 +0000)]
bhyve: stability and performance improvement for dbgport

The TCP server implementation in dbgport does not track clients, so it
may try to write to a disconected socket resulting in SIGPIPE.
Avoid that by setting SO_NOSIGPIPE socket option.

Because dbgport emulates an I/O port to guest, the communication is done
byte by byte.  Reduce latency of the TCP/IP transfers by using
TCP_NODELAY option.  In my tests that change improves performance of
kgdb commands with lots of output (e.g. info threads) by two orders of
magnitude.

A general note.  Since we have a uart emulation in bhyve, that can be
used for the console and gdb access to guests.  So, bvmconsole and bvmdebug
could be de-orbited now.  But there are many existing deployments that
still dependend on those.

Discussed with: julian, jhb
MFC after: 2 weeks
Sponsored by: Panzura

7 years agoThis patch upgrades driver version to 06.712.04.00-fbsd
kadesai [Tue, 29 Nov 2016 13:05:43 +0000 (13:05 +0000)]
This patch upgrades driver version to 06.712.04.00-fbsd

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoThis patch will add code to refire IOCTL commands after OCR.
kadesai [Tue, 29 Nov 2016 13:04:40 +0000 (13:04 +0000)]
This patch will add code to refire IOCTL commands after OCR.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoThis patch will unblock SYNCHRONIZE_CACHE command to firmware, i.e. don't block the...
kadesai [Tue, 29 Nov 2016 13:03:43 +0000 (13:03 +0000)]
This patch will unblock SYNCHRONIZE_CACHE command to firmware, i.e. don't block the SYNCHRONIZE_CACHE command at driver instead of
passing it to firmware for all Gen3 controllers.
For Thunderbolt controller, keep the legacy behavior i.e. return the SYNCHRONIZE_CACHE command with success status from driver itself.

There is Sysctl parameter 'block_sync_cache' is provided to enable customers either to block/unblock these commands to facilitate
legacy behavior if there is a compatibility issue. Default value for module parameter is to unblock this command.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoWait for AEN task to be completed(if in queue) before resetting the controller
kadesai [Tue, 29 Nov 2016 13:02:48 +0000 (13:02 +0000)]
Wait for AEN task to be completed(if in queue) before resetting the controller
and return without processing event in AEN thread, if controller reset is in progress.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoThis patch will add task management support in driver. Below is high level description:
kadesai [Tue, 29 Nov 2016 13:01:31 +0000 (13:01 +0000)]
This patch will add task management support in driver. Below is high level description:
If a SCSI IO times out, then before initiating OCR, now the driver will try to send a
target reset to the particular target for which the IO is timed out. If that also fails,
then the driver will initiate OCR.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoProcess outstanding reply descriptors from all the reply descriptor post queues befor...
kadesai [Tue, 29 Nov 2016 12:59:38 +0000 (12:59 +0000)]
Process outstanding reply descriptors from all the reply descriptor post queues before initiating OCR.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoClean up reference to AEN command if abort AEN is succesful as the command is aborted.
kadesai [Tue, 29 Nov 2016 12:58:28 +0000 (12:58 +0000)]
Clean up reference to AEN command if abort AEN is succesful as the command is aborted.
Did the same by setting sc->aen_cmd = NULL when aborting AEN is successful.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoUpdate controller properties(read OCR capability bit) when MR_EVT_CTRL_PROP_CHANGED...
kadesai [Tue, 29 Nov 2016 12:56:53 +0000 (12:56 +0000)]
Update controller properties(read OCR capability bit) when MR_EVT_CTRL_PROP_CHANGED recieved.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoAdd sanity check in IO and IOCTL path not to process command further if controller...
kadesai [Tue, 29 Nov 2016 12:55:01 +0000 (12:55 +0000)]
Add sanity check in IO and IOCTL path not to process command further if controller is in
HW_CRITICAL_ERROR.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoUse a variable to indicate Gen3 controllers and remove all PCI ids based
kadesai [Tue, 29 Nov 2016 12:53:05 +0000 (12:53 +0000)]
Use a variable to indicate Gen3 controllers and remove all PCI ids based
checks used for gen3 controllers.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoProblem statement:
kadesai [Tue, 29 Nov 2016 12:49:20 +0000 (12:49 +0000)]
Problem statement:
MFI linked list in megaraid_sas driver is used for mfi-mpt pass-through commands.
This list can be corrupted due to many possible race conditions in driver and
eventually we may see kernel panic.

One example -
MFI frame is freed from calling process as driver send command via polling method and interrupt
for that command comes after driver free mfi frame (actually even after some other context reuse
the mfi frame). When driver receive MPT frame in ISR, driver will be using the index of MFI and
access that MFI frame and finally in-used MFI frames list will be corrupted.

High level description of new solution -
Free MFI and MPT command from same context.
Free both the command either from process (from where mfi-mpt pass-through was called) or from
ISR context. Do not split freeing of MFI and MPT, because it creates the race condition which
will do MFI/MPT list.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoMark the Broadcom code as FDT only, there is no ACPI support for the
andrew [Tue, 29 Nov 2016 12:46:42 +0000 (12:46 +0000)]
Mark the Broadcom code as FDT only, there is no ACPI support for the
Raspberry Pi 3.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoExplicitly initialize cdai.flags.
mav [Tue, 29 Nov 2016 11:13:43 +0000 (11:13 +0000)]
Explicitly initialize cdai.flags.

In SES driver uninitialized value caused unreliable physpath reporting.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

7 years agoFix 'ipfw delete set N':
oleg [Tue, 29 Nov 2016 10:43:58 +0000 (10:43 +0000)]
Fix 'ipfw delete set N':
do not emit meaningless 'rule 0 not found' warning if set was already empty.

MFC after: 1 week

7 years agoFix interrupt clear in pl011 uart receive function
jchandra [Tue, 29 Nov 2016 04:32:14 +0000 (04:32 +0000)]
Fix interrupt clear in pl011 uart receive function

Clear the interrupt state before reading the input char from the
input FIFO. In the current code there is a window between the read
to the data register and the write to the the ICR, during which an
input char will not cause an interrupt.

This fixes the issue by which the serial port input on QEMU freezes
when using the emulated pl011 serial port.

7 years agoUse the correct name for the GCC macro indicating max_align_t is defined.
jhb [Tue, 29 Nov 2016 00:16:19 +0000 (00:16 +0000)]
Use the correct name for the GCC macro indicating max_align_t is defined.

MFC after: 3 days

7 years agoTrying to autodetect legacy setups lead to problems when people
imp [Mon, 28 Nov 2016 21:29:01 +0000 (21:29 +0000)]
Trying to autodetect legacy setups lead to problems when people
overrode the disk image creation routine. For now, just always bring
in the legecy defines / routines.

7 years agoAdd a FREEBSD-Xlist file for CK.
cognet [Mon, 28 Nov 2016 21:16:03 +0000 (21:16 +0000)]
Add a FREEBSD-Xlist file for CK.

7 years agoUse malloc()ed buffers instead of stack buffers in gr_copy() and pw_copy().
des [Mon, 28 Nov 2016 21:00:19 +0000 (21:00 +0000)]
Use malloc()ed buffers instead of stack buffers in gr_copy() and pw_copy().
This allows pw(8) to operate on passwd and group files with longer lines
than could be accomodated by a stack buffer.  It doesn't take more than a
few hundred users to exceed 8192 bytes in /etc/group.

MFC after: 3 weeks
Sponsored by: The University of Oslo

7 years agoHook CK to the kernel build.
cognet [Mon, 28 Nov 2016 20:44:12 +0000 (20:44 +0000)]
Hook CK to the kernel build.

7 years agoAdd FreeBSD-specific files.
cognet [Mon, 28 Nov 2016 20:33:30 +0000 (20:33 +0000)]
Add FreeBSD-specific files.

7 years agoImport Concurrency Kit in the kernel.
cognet [Mon, 28 Nov 2016 20:27:58 +0000 (20:27 +0000)]
Import Concurrency Kit in the kernel.
CK is a toolkit providing different lockfree algorithms/data structures.
More information can be found here : www.concurrencykit.org

7 years agoRemove files that won't be used during FreeBSD build.
cognet [Mon, 28 Nov 2016 20:22:32 +0000 (20:22 +0000)]
Remove files that won't be used during FreeBSD build.

7 years agoFix packaging for clang, lldb and lld 3.9.0
dim [Mon, 28 Nov 2016 20:13:56 +0000 (20:13 +0000)]
Fix packaging for clang, lldb and lld 3.9.0

During the upgrade of clang/llvm etc to 3.9.0 in r309124, the PACKAGE
directive in the usr.bin/clang/*.mk files got dropped accidentally.

Restore it, with a few minor changes and additions:
* Correct license in clang.ucl to NCSA
* Add PACKAGE=clang for clang and most of the "ll" tools
* Put lldb in its own package
* Put lld in its own package

Reviewed by: gjb, jmallett
X-MFC-With: 309124
Differential Revision: https://reviews.freebsd.org/D8666

7 years agoImport concurrencykit as of commit 566bb28dba963a1904e0889b74fe7005a5bc5eb8
cognet [Mon, 28 Nov 2016 20:08:52 +0000 (20:08 +0000)]
Import concurrencykit as of commit 566bb28dba963a1904e0889b74fe7005a5bc5eb8

7 years agoRework ip_tryforward() to use FIB4 KPI.
ae [Mon, 28 Nov 2016 17:55:32 +0000 (17:55 +0000)]
Rework ip_tryforward() to use FIB4 KPI.

Tested by: olivier
Obtained from: Yandex LLC
MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D8526

7 years ago[ath] force wake the hardware if we see a missed beacon.
adrian [Mon, 28 Nov 2016 17:54:29 +0000 (17:54 +0000)]
[ath] force wake the hardware if we see a missed beacon.

This adds a workaround to incorrectly behaving APs (ie, FreeBSD APs) which
don't beacon out exactly when they should (at TBTT multiples of beacon
intervals.)

It forces the hardware awake (but leaves it in network-sleep so self
generated frames still state that the hardware is asleep!) and will
remain awake until the next sleep transition driven by net80211.

That way if the beacons are just at the wrong interval, we get a much
better chance of hearing more consecutive beacons before we go to sleep,
thus not constantly disconnecting.

Tested:

* AR9485, STA mode, against a misbehaving FreeBSD AP.

7 years ago[ath] revert the previous commit, after reading the 802.11-2012 spec a bit more.
adrian [Mon, 28 Nov 2016 17:06:35 +0000 (17:06 +0000)]
[ath] revert the previous commit, after reading the 802.11-2012 spec a bit more.

The 802.11-2012 spec talks about this - section 10.1.3.2 - Beacon Generation
in Infrastructure Networks.  So yes, we should be expecting beacons to be
going out in multiples of intval.

Silly adrian.

So:

* fix the FreeBSD APs that are sending beacons at incorrect TBTTs (target
  beacon transmit time); and
* yes indeed we will have to wake up out of network sleep until we sync
  a beacon.

7 years agoAdd more ASMedia PCI IDs from different sources.
mav [Mon, 28 Nov 2016 16:25:05 +0000 (16:25 +0000)]
Add more ASMedia PCI IDs from different sources.

Exact device names are not clear, but its better then nothing at all.

MFC after: 1 month

7 years agoProcess port interrupt even is PxIS register is zero.
mav [Mon, 28 Nov 2016 16:23:32 +0000 (16:23 +0000)]
Process port interrupt even is PxIS register is zero.

ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside
seems sometimes forgeting to set bits in PxIS, causing command timeouts.
Removal of this check fixes the issue by the theoretical cost of slightly
higher CPU usage in some odd cases, but this is what Linux does too.

MFC after: 1 month

7 years agoMFV r309249: 3821 Race in rollback, zil close, and zil flush
avg [Mon, 28 Nov 2016 15:14:31 +0000 (15:14 +0000)]
MFV r309249: 3821 Race in rollback, zil close, and zil flush

Note: there was a merge conflict resolved by me.

illumos/illumos-gate@43297f973a3543e7403ac27076490ab958a94b15
https://github.com/illumos/illumos-gate/commit/43297f973a3543e7403ac27076490ab958a94b15

https://www.illumos.org/issues/3821
  We recently had nodes with some of the latest zfs bits panic on us in a
  rollback-heavy environment. The following is from my preliminary analysis:
  Let's look at where we died:
  > $C
  ffffff01ea6b9a10 taskq_dispatch+0x3a(0, fffffffff7d20450ffffff5551dea920, 1)
  ffffff01ea6b9a60 zil_clean+0xce(ffffff4b7106c080, 7e0f1)
  ffffff01ea6b9aa0 dsl_pool_sync_done+0x47(ffffff4313065680, 7e0f1)
  ffffff01ea6b9b70 spa_sync+0x55f(ffffff4310c1d040, 7e0f1)
  ffffff01ea6b9c20 txg_sync_thread+0x20f(ffffff4313065680)
  ffffff01ea6b9c30 thread_start+8()
  If we dig in we can find that this dataset corresponds to a zone:
  > ffffff4b7106c080::print zilog_t zl_os->os_dsl_dataset->ds_dir->dd_myname
  zl_os->os_dsl_dataset->ds_dir->dd_myname = [ "8ffce16a-13c2-4efa-a233-
  9e378e89877b" ]
  Okay so we have a null taskq pointer. That only happens during the calls to
  zil_open and zil_close. If we poke around we can see that we're actually in
  midst of a rollback:
  > ::pgrep zfs | ::printf "0x%x %s\\n" proc_t . p_user.u_psargs
  0xffffff43262800a0 zfs rollback zones/15714eb6-f5ea-469f-ac6d-
  4b8ab06213c2@marlin_init
  0xffffff54e22a1028 zfs rollback zones/8ffce16a-13c2-4efa-a233-
  9e378e89877b@marlin_init
  0xffffff4362f3a058 zfs rollback zones/0ddb8e49-ca7e-42e1-8fdc-
  4ac4ba8fe9f8@marlin_init
  0xffffff5748e8d020 zfs rollback zones/426357b5-832d-4430-953e-
  10cd45ff8e9f@marlin_init
  0xffffff436b867008 zfs rollback zones/8f36bf37-8a9c-4a44-995c-
  6d1b2751e6f5@marlin_init
  0xffffff4381ad4090 zfs rollback zones/6c8eca18-fbd6-46dd-ac24-
  2ed45cd0da70@marlin_init

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: George Wilson <george.wilson@delphix.com>

MFC after: 3 weeks

7 years agoFix ISS_DATA_DFSC_MASK, it should include all bits in the field.
andrew [Mon, 28 Nov 2016 14:24:07 +0000 (14:24 +0000)]
Fix ISS_DATA_DFSC_MASK, it should include all bits in the field.

7 years ago[ath] wake up the hardware from power-save before doing transmit completion checking.
adrian [Mon, 28 Nov 2016 08:13:20 +0000 (08:13 +0000)]
[ath] wake up the hardware from power-save before doing transmit completion checking.

This was being done in the pre-AR9380 case, but not for AR9380 and later.
When powersave in STA mode is enabled, this may have lead to the transmit
completion code doing this:

* call the task, which doesn't wake up the hardware
* complete the frames, which doesn't touch the hardware
* schedule pending frames on the hardware queue, which DOES touch the
  hardware, and this will be ignored

This would show up in the logs like this:

(with debugging enabled):
Nov 27 23:03:56 lovelace kernel: Q1[  0] (nseg=1) (DS.V:0xfffffe011bd57300 DS.P:0x49b57300) I: 168cc117 L:00000000 F:0005
...
(in general, doesn't require debugging enabled):
Nov 27 23:03:56 lovelace kernel: ath_hal_reg_write: reg=0x00000804, val=0x49b57300, pm=2

That register is a EDMA TX FIFO register (queue 1), and the val is the descriptor
being written.

Whilst here, make sure the software queue gets kicked here.

Tested;

* AR9485, STA mode + powersave

7 years agohyperv/vmbus: Use poll/cancel APIs to wait for the CHOPEN response.
sephe [Mon, 28 Nov 2016 07:56:03 +0000 (07:56 +0000)]
hyperv/vmbus: Use poll/cancel APIs to wait for the CHOPEN response.

Since hypervisor does not respond CHOPEN to a revoked channel.

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

7 years agohyperv/vmbus: Add exec cancel support for message Hypercall API.
sephe [Mon, 28 Nov 2016 07:44:50 +0000 (07:44 +0000)]
hyperv/vmbus: Add exec cancel support for message Hypercall API.

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

7 years agoPlug another leak with malformed IPv6 address.
delphij [Mon, 28 Nov 2016 07:41:01 +0000 (07:41 +0000)]
Plug another leak with malformed IPv6 address.

MFC after: 2 weeks

7 years agohyperv/vmbus: Add result polling support for message Hypercall API.
sephe [Mon, 28 Nov 2016 07:36:51 +0000 (07:36 +0000)]
hyperv/vmbus: Add result polling support for message Hypercall API.

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

7 years agoDon't leak 'str' when we see a malformed IPv6 address.
delphij [Mon, 28 Nov 2016 07:33:26 +0000 (07:33 +0000)]
Don't leak 'str' when we see a malformed IPv6 address.

MFC after: 2 weeks

7 years agohyperv/vmbus: Add result polling support for xact API.
sephe [Mon, 28 Nov 2016 07:27:08 +0000 (07:27 +0000)]
hyperv/vmbus: Add result polling support for xact API.

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

7 years agostyle(9).
delphij [Mon, 28 Nov 2016 07:21:09 +0000 (07:21 +0000)]
style(9).

MFC after: 2 weeks

7 years agoPlug a potential memory leak.
delphij [Mon, 28 Nov 2016 07:19:45 +0000 (07:19 +0000)]
Plug a potential memory leak.

MFC after: 2 weeks

7 years agohyperv/vmbus: Stringent GPADL parameter assertion.
sephe [Mon, 28 Nov 2016 07:04:32 +0000 (07:04 +0000)]
hyperv/vmbus: Stringent GPADL parameter assertion.

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

7 years agohyperv/vmbus: Make sure that the allocated GPADL is not zero.
sephe [Mon, 28 Nov 2016 06:53:00 +0000 (06:53 +0000)]
hyperv/vmbus: Make sure that the allocated GPADL is not zero.

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

7 years agohyperv/hn: Simplify RSS indirect table fixup API
sephe [Mon, 28 Nov 2016 06:40:26 +0000 (06:40 +0000)]
hyperv/hn: Simplify RSS indirect table fixup API

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

7 years agopages and psize are always assigned, so there is no need to initialize
delphij [Mon, 28 Nov 2016 06:38:41 +0000 (06:38 +0000)]
pages and psize are always assigned, so there is no need to initialize
them as zero.

MFC after: 2 weeks

7 years agoEliminate variables that are computed, assigned but never
delphij [Mon, 28 Nov 2016 06:36:10 +0000 (06:36 +0000)]
Eliminate variables that are computed, assigned but never
used.

MFC after: 2 weeks

7 years agoFix an obvious typo.
delphij [Mon, 28 Nov 2016 06:32:05 +0000 (06:32 +0000)]
Fix an obvious typo.

MFC after: 2 weeks

7 years agohyperv/hn: Fix vmbus_chan_subidx usage.
sephe [Mon, 28 Nov 2016 06:10:41 +0000 (06:10 +0000)]
hyperv/hn: Fix vmbus_chan_subidx usage.

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

7 years agohyperv/hn: Enable multi-packet RNDIS message support by default.
sephe [Mon, 28 Nov 2016 05:54:20 +0000 (05:54 +0000)]
hyperv/hn: Enable multi-packet RNDIS message support by default.

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

7 years agohyperv/hn: Fix attach error handling
sephe [Mon, 28 Nov 2016 05:46:00 +0000 (05:46 +0000)]
hyperv/hn: Fix attach error handling

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

7 years agohyperv/hn: Fix multi-packet RNDIS message aggregation size setting.
sephe [Mon, 28 Nov 2016 05:31:36 +0000 (05:31 +0000)]
hyperv/hn: Fix multi-packet RNDIS message aggregation size setting.

Just in case that no chimney sending buffer can be used.

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

7 years agohyperv/hn: Fix detach error handling.
sephe [Mon, 28 Nov 2016 05:23:57 +0000 (05:23 +0000)]
hyperv/hn: Fix detach error handling.

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