Commit Graph

217898 Commits

Author SHA1 Message Date
Justin Hibbits
a8c4b5ced8 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
2016-11-30 02:35:51 +00:00
Mateusz Guzik
a4ce25b5b0 vfs: fix a whitespace nit in r309307 2016-11-30 02:17:03 +00:00
Mateusz Guzik
1babea0341 vfs: avoid VOP_ISLOCKED in the common case in lookup 2016-11-30 02:14:53 +00:00
Ed Maste
54c7693f2c 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
2016-11-30 02:00:30 +00:00
Navdeep Parhar
a10443e8ba 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
2016-11-30 00:26:35 +00:00
Martin Matuska
d5d08d297d 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
2016-11-29 22:14:42 +00:00
Martin Matuska
35837ea989 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
2016-11-29 21:53:16 +00:00
Ed Maste
2737721014 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
2016-11-29 18:40:24 +00:00
Alexander Motin
7027c01c56 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.
2016-11-29 13:48:36 +00:00
Andrew Turner
323057e8af We only use the cpu0 variable in the FDT code.
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-11-29 13:32:23 +00:00
Andriy Gapon
9aaefb2c53 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
2016-11-29 13:11:00 +00:00
Kashyap D Desai
605a51e323 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
2016-11-29 13:05:43 +00:00
Kashyap D Desai
2d53b48503 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
2016-11-29 13:04:40 +00:00
Kashyap D Desai
d993dd831d 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
2016-11-29 13:03:43 +00:00
Kashyap D Desai
85c0a961fa 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
2016-11-29 13:02:48 +00:00
Kashyap D Desai
8bb601ac8a 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
2016-11-29 13:01:31 +00:00
Kashyap D Desai
e2e8afb12c 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
2016-11-29 12:59:38 +00:00
Kashyap D Desai
c2a20ff95a 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
2016-11-29 12:58:28 +00:00
Kashyap D Desai
8bc320add0 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
2016-11-29 12:56:53 +00:00
Kashyap D Desai
808517a4f9 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
2016-11-29 12:55:01 +00:00
Kashyap D Desai
f9c630813e 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
2016-11-29 12:53:05 +00:00
Kashyap D Desai
731b75614d 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
2016-11-29 12:49:20 +00:00
Andrew Turner
a91426958c 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
2016-11-29 12:46:42 +00:00
Alexander Motin
ab4327bb3f Explicitly initialize cdai.flags.
In SES driver uninitialized value caused unreliable physpath reporting.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2016-11-29 11:13:43 +00:00
Oleg Bulyzhin
c99ebe6c01 Fix 'ipfw delete set N':
do not emit meaningless 'rule 0 not found' warning if set was already empty.

MFC after:	1 week
2016-11-29 10:43:58 +00:00
Jayachandran C.
cbee50f1df 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.
2016-11-29 04:32:14 +00:00
John Baldwin
31ad7c11b3 Use the correct name for the GCC macro indicating max_align_t is defined.
MFC after:	3 days
2016-11-29 00:16:19 +00:00
Warner Losh
75aa5f28e9 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.
2016-11-28 21:29:01 +00:00
Olivier Houchard
114b7c00ca Add a FREEBSD-Xlist file for CK. 2016-11-28 21:16:03 +00:00
Dag-Erling Smørgrav
e68bca507d 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
2016-11-28 21:00:19 +00:00
Olivier Houchard
bba481d7e9 Hook CK to the kernel build. 2016-11-28 20:44:12 +00:00
Olivier Houchard
5ac7aafe09 Add FreeBSD-specific files. 2016-11-28 20:33:30 +00:00
Olivier Houchard
1fb62fb074 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
2016-11-28 20:27:58 +00:00
Olivier Houchard
7d81e831cf Remove files that won't be used during FreeBSD build. 2016-11-28 20:22:32 +00:00
Dimitry Andric
8930262bce 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
2016-11-28 20:13:56 +00:00
Olivier Houchard
85bd1e2d0a Import concurrencykit as of commit 566bb28dba963a1904e0889b74fe7005a5bc5eb8 2016-11-28 20:08:52 +00:00
Andrey V. Elsukov
dc9d21f8b0 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
2016-11-28 17:55:32 +00:00
Adrian Chadd
8c03e55dd2 [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.
2016-11-28 17:54:29 +00:00
Adrian Chadd
872f3a66dd [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.
2016-11-28 17:06:35 +00:00
Alexander Motin
de4a194549 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
2016-11-28 16:25:05 +00:00
Alexander Motin
6ddb10bd0c 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
2016-11-28 16:23:32 +00:00
Andriy Gapon
0451d4e97b MFV r309249: 3821 Race in rollback, zil close, and zil flush
Note: there was a merge conflict resolved by me.

illumos/illumos-gate@43297f973a
43297f973a

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, fffffffff7d20450, ffffff5551dea920, 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
2016-11-28 15:14:31 +00:00
Andriy Gapon
aed3e94d2f 3821 Race in rollback, zil close, and zil flush
illumos/illumos-gate@43297f973a
43297f973a

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, fffffffff7d20450, ffffff5551dea920, 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>
2016-11-28 15:09:58 +00:00
Andrew Turner
a70475ca42 Fix ISS_DATA_DFSC_MASK, it should include all bits in the field. 2016-11-28 14:24:07 +00:00
Adrian Chadd
908341abeb [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
2016-11-28 08:13:20 +00:00
Sepherosa Ziehau
5e61edf60e 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
2016-11-28 07:56:03 +00:00
Sepherosa Ziehau
2ee4e46fe6 hyperv/vmbus: Add exec cancel support for message Hypercall API.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8635
2016-11-28 07:44:50 +00:00
Xin LI
9a913ec291 Plug another leak with malformed IPv6 address.
MFC after:	2 weeks
2016-11-28 07:41:01 +00:00
Sepherosa Ziehau
2fb45c54a1 hyperv/vmbus: Add result polling support for message Hypercall API.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8634
2016-11-28 07:36:51 +00:00
Xin LI
203632f263 Don't leak 'str' when we see a malformed IPv6 address.
MFC after:	2 weeks
2016-11-28 07:33:26 +00:00