Commit Graph

113619 Commits

Author SHA1 Message Date
Emmanuel Vadot
cd2b868b5d allwinner: Add support for P2WI in RSB driver
Push-Pull Two Wire interface is a almost compatible iic like bus used
in sun6i SoC. It's only use is to communicate with the power management IC.

Reviewed by:	jmcneill
MFC after:	1 week
Relnotes:	yes
2016-10-24 20:33:42 +00:00
Navdeep Parhar
77e9044c47 cxgbe(4): Fix bug in the calculation of the number of physically
contiguous regions in an mbuf chain.

If the payload of an mbuf ends at a page boundary count_mbuf_nsegs would
incorrectly consider the next mbuf's payload physically contiguous based
solely on a KVA comparison.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2016-10-24 19:09:56 +00:00
Marcel Moolenaar
d67ec19c3e Include <sys/types.h> explicitly instead of depending on that
header being included by <sys/param.h>. When compiled as part
of makefs(8) and on macOS or Linux, <sys/param.h> is not our
own.
2016-10-24 18:12:57 +00:00
Marcel Moolenaar
07f862a769 Include <stdarg.h> instead of <machine/stdarg.h> when compiled as
part of libsbuf. The former is the standard header, and allows us
to compile libsbuf on macOS/linux.
2016-10-24 18:03:04 +00:00
Konstantin Belousov
a57d70325e Fix typo.
Submitted by:	alc
MFC after:	3 days
2016-10-24 17:37:21 +00:00
Konstantin Belousov
835c2787be Handle broadcast NMIs.
On several Intel chipsets, diagnostic NMIs sent from BMC or NMIs
reporting hardware errors are broadcasted to all CPUs.

When kernel is configured to enter kdb on NMI, the outcome is
problematic, because each CPU tries to enter kdb.  All CPUs are
executing NMI handlers, which set the latches disabling the nested NMI
delivery; this means that stop_cpus_hard(), used by kdb_enter() to
stop other cpus by broadcasting IPI_STOP_HARD NMI, cannot work.  One
indication of this is the harmless but annoying diagnostic "timeout
stopping cpus".

Much more harming behaviour is that because all CPUs try to enter kdb,
and if ddb is used as debugger, all CPUs issue prompt on console and
race for the input, not to mention the simultaneous use of the ddb
shared state.

Try to fix this by introducing a pseudo-lock for simultaneous attempts
to handle NMIs.  If one core happens to enter NMI trap handler, other
cores see it and simulate reception of the IPI_STOP_HARD.  More,
generic_stop_cpus() avoids sending IPI_STOP_HARD and avoids waiting
for the acknowledgement, relying on the nmi handler on other cores
suspending and then restarting the CPU.

Since it is impossible to detect at runtime whether some stray NMI is
broadcast or unicast, add a knob for administrator (really developer)
to configure debugging NMI handling mode.

The updated patch was debugged with the help from Andrey Gapon (avg)
and discussed with him.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D8249
2016-10-24 16:40:27 +00:00
Toomas Soome
1d1140af58 loader should boot pre-feature flags pools.
The feature flags chek is missing the corner case where we have valid pool
version, but feature flags are not enabled - as for example plain v28 pool.

This update does fix the boot support for such pools.

Reviewed by:	avg, allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D8331
2016-10-24 16:28:54 +00:00
Emmanuel Vadot
2c3b1e3c42 Revert 307822
P2WI is almost compatible with RSB which we already support.
I'll add support for P2WI in aw_rsb instead.

Discussed with:	 jmcneill
2016-10-24 14:24:12 +00:00
Andrew Turner
9eb0ccbb54 Increase CACHE_LINE_SHIFT to 7 as cache lines are 128 bytes on ThunderX.
MFC after:	1 week
Sponsored by:	ABT Systems Ltd
2016-10-24 13:44:24 +00:00
Alexander Motin
f0cbbdecbc Fix panic after ZVOL renamed to name invalid for DEVFS.
MFC after:	2 weeks
2016-10-24 12:24:24 +00:00
Sepherosa Ziehau
5bf51473c0 hyperv/ic: Rework framework/message version negotiation.
Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Modified by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8280
2016-10-24 05:36:19 +00:00
Sepherosa Ziehau
f0dcc3114c hyperv/hn: Nuke unused forward declaration.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8314
2016-10-24 05:20:02 +00:00
Sepherosa Ziehau
121e98e697 hyperv/hn: Fix RX filter settings.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8313
2016-10-24 05:10:35 +00:00
Sepherosa Ziehau
665bc5ff49 hyperv/hn: Start link status check, if no network changes were pending.
Link status check is much more lightweight than network change detection.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8311
2016-10-24 05:01:34 +00:00
Justin Hibbits
e7c4ddf5ba Add a bunch of new default options to MPC85XX* configs
These were tested at various points but never merged into the configs at the
time.
2016-10-24 04:21:06 +00:00
Sepherosa Ziehau
6827d9497a hyperv/hn: Properly handle synthetic parts reattach failure.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8310
2016-10-24 03:42:34 +00:00
Sepherosa Ziehau
6aa8c9a4e0 hyperv/hn: Fix chimney sending buffer leakage upon NVS sending failure.
This will not happen in real world, since TX consumption of the vmbus
TX bufring is limitted.  Better safe than sorry.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8309
2016-10-24 03:34:19 +00:00
Sepherosa Ziehau
b7009d5392 hyperv/hn: Move chimney buffer index and size to txdesc.
All RNDIS control messages have used SG list for a while.  This makes
the send context suitable for further refactoring.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8308
2016-10-24 03:26:34 +00:00
Justin Hibbits
b474a02784 Use the correct name for the qm_portals class.
This file was copy&pasted from bman_fdt, and it still shows.
2016-10-23 19:59:56 +00:00
Jared McNeill
5a7f20b4d0 Add device cpufreq. 2016-10-23 19:02:19 +00:00
Jared McNeill
3c2b90f1d1 Throttle CPU frequency when hot temperature threshold has been reached to
prevent overheating.

When sensor 0's alarm interrupt is fired, set a throttle flag. Further
requests to set CPU frequency will be rejected until sensor 0's temperature
returns to a level below the hot temperature threshold.

Relnotes:	yes
2016-10-23 17:48:34 +00:00
Emmanuel Vadot
0b194aca21 allwinner: Add support for P2WI bus
P2WI (Push-Pull Two Wire Interface) is an I2C-like bus used in sun6i SoC
for talking to power management unit IC.
2016-10-23 12:48:09 +00:00
Konstantin Belousov
55ee7a4c5f In the fueword64(9) wrapper for architectures which do not implemented
native fueword64(9) still, use proper type for local where fuword64()
result is stored.

Note that fueword64() is unused in the tree.

Submitted by:	Chunhui He <hchunhui@mail.ustc.edu.cn>
PR:	212520
MFC after:	1 week
2016-10-23 11:23:17 +00:00
Adrian Chadd
d24ac5fb28 [net80211] Add a variant on ieee80211_get_rx_params() that returns a pointer.
Be careful when calling this, as the underlying mbuf may change
afterwards - common in the RX path.
2016-10-23 08:21:35 +00:00
Adrian Chadd
561da369d7 [net80211] Add a macro to see if a frame is a management frame or not. 2016-10-23 08:19:43 +00:00
Justin Hibbits
eaa5e39660 Revert r307813.
I misread the code, and it shouldn't have compiled (fputhread is just a variable
name).
2016-10-23 01:03:17 +00:00
Justin Hibbits
89965e7011 Use the right thread pointer for SPE alignment exceptions. 2016-10-23 01:01:08 +00:00
Oleksandr Tymoshenko
e012a280a5 EVDEV: ums evdev support improvements: locking and event reporting
- Use ums lock as evdev lock
- Do not cap axes values to sysmouse limits for evdev reports
- Do not map T-axis events to buttons for evdev reports
- Use shortcuts for event reporting

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after:	1 week
2016-10-22 22:55:10 +00:00
Oleksandr Tymoshenko
73362d0e56 EVDEV: Add shortcut functions for event types
Add wrappers around generic evdev_push_event for specific event types:
EV_KEY/EV_REL/EV_ABS etc...

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-22 22:52:50 +00:00
Baptiste Daroussin
7652bc12ba Fix typo in the COMPILER_VERSION check
PR:		213120
Submitted by:	Yuta Satoh <nigoro.dev@gmail.com>
MFC after:	3 days
2016-10-22 20:00:39 +00:00
Conrad Meyer
8798ef0679 ddb(4): Add sleepchains to "show allchains"
Reported by:	markj
Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8320
2016-10-22 18:02:20 +00:00
Michael Tuexen
38d3251c3d No functional changes, mostly getting the whitespace changes resulting
from an updated formatting tool chain.

MFC after: 1 month
2016-10-22 17:21:21 +00:00
Andriy Gapon
4afdfe9761 jedec_ts: a driver for thermal sensors on memory modules
The driver currently supports chips that are fully compliant with the
JEDEC SPD / EEPROM / TS standard (JEDEC Standard 21-C,
TSE2002 Specification, frequenlty referred to as JEDEC JC 42.4).

Additionally some chips from STMicroelectronics are supported as well.
They are compliant except for their Device ID pattern.

Given the continued lack of any common sensor infrastructure, the driver
uses an ad-hoc sysctl to report the temperature.

Reviewed by:	wblock (documentation)
MFC after:	2 weeks
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D8174
2016-10-22 08:00:46 +00:00
Justin Hibbits
3413fe9770 Initialize the ofw_bus_devinfo on the portals to prevent a crash.
If the device tree doesn't contain a cpu-handle field in any bman-portal or
qman-portal, it will exit without setting up the devinfo, leaving it
uninitialized.  This will lead to attempts to free random memory, and ultimately
panic.
2016-10-22 02:11:53 +00:00
Justin Hibbits
dc9b124d66 Create a new MACHINE_ARCH for Freescale PowerPC e500v2
Summary:
The Freescale e500v2 PowerPC core does not use a standard FPU.
Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor
unit, which doubles as a FPU.  The PowerPC SPE ABI is incompatible with the
stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this.
Additionaly, the SPE opcodes overlap with Altivec, so these are mutually
exclusive.  Taking advantage of this fact, a new file, powerpc/booke/spe.c, was
created with the same function set as in powerpc/powerpc/altivec.c, so it
becomes effectively a drop-in replacement.  setjmp/longjmp were modified to save
the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by
the SPE).

Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not
support double-precision floating point.

Also, without a new MACHINE_ARCH it would be impossible to provide binary
packages which utilize the SPE.

Additionally, no work has been done to support ports, work is needed for this.
This also means no newer gcc can yet be used.  However, gcc's powerpc support
has been refactored which would make adding a powerpcspe-freebsd target very
easy.

Test Plan:
This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222
(P1022-based) board, compiled against the new ABI.  Base system utilities
(/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot
multiuser.

Reviewed By:	bdrewery, imp
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D5683
2016-10-22 01:57:15 +00:00
Navdeep Parhar
aaa4ddd9d0 cxgbe(4): Dump any mailbox command that times out. 2016-10-22 00:48:58 +00:00
John Baldwin
5dd723425e Define max_align_t for C11.
libc++'s stddef.h includes an existing definition of max_align_t for
C++11, but it is only defined for C++, not for C.  In addition, GCC and
clang both define an alternate version of max_align_t that uses a
union of multiple types rather than a plain long double as in libc++.
This adds a __max_align_t to <sys/_types.h> that matches the GCC and
clang definition that is mapped to max_align_t in <stddef.h>.

PR:		210890
Reviewed by:	dim
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D8194
2016-10-21 23:50:02 +00:00
Hiren Panchasara
9d71a3975e Rework r306337.
In sendit(), if mp->msg_control is present, then in sockargs() we are
allocating mbuf to store mp->msg_control. Later in kern_sendit(), call
to getsock_cap(), will check validity of file pointer passed, if this
fails EBADF is returned but mbuf allocated in sockargs() is not freed.
Made code changes to free the same.

Since freeing control mbuf in sendit() after checking (control != NULL)
may lead to double freeing of control mbuf in sendit(), we can free
control mbuf in kern_sendit() if there are any errors in the routine.

Submitted by:		    Lohith Bellad <lohith.bellad@me.com>
Reviewed by:		    glebius
MFC after:		    3 weeks
Differential Revision:	    https://reviews.freebsd.org/D8152
2016-10-21 18:27:30 +00:00
Mariusz Zaborski
4b83a77606 capsicum: perform copyout without the fildesc lock held in sys_cap_ioctls_get
Reviewed by:	pjd
2016-10-21 16:12:23 +00:00
Alexander Motin
a7a560be79 Add names for some DASP devices.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2016-10-21 15:23:54 +00:00
Ed Maste
485fb02571 netmap: if_ptnet depends on inet 2016-10-21 15:17:42 +00:00
Ed Maste
984ff0d910 netmap: fix kernel build on GCC-using architectures
GCC produced a multiple declaration warning from the
SYSCTL_DECL(_dev_netmap).
2016-10-21 13:51:47 +00:00
Michael Tuexen
3e1465754f Make ICMPv6 hard error handling for TCP consistent with the ICMPv4
handling. Ensure that:
* Protocol unreachable errors are handled by indicating ECONNREFUSED
  to the TCP user for both IPv4 and IPv6. These were ignored for IPv6.
* Communication prohibited errors are handled by indicating ECONNREFUSED
  to the TCP user for both IPv4 and IPv6. These were ignored for IPv6.
* Hop Limited exceeded errors are handled by indicating EHOSTUNREACH
  to the TCP user for both IPv4 and IPv6.
  For IPv6 the TCP connected was dropped but errno wasn't set.

Reviewed by: gallatin, rrs
MFC after: 1 month
Sponsored by: Netflix
Differential Revision: 7904
2016-10-21 10:32:57 +00:00
Sepherosa Ziehau
525607d10c hyperv/hn: Function renaming; consistent w/ hardware capabilities query.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8296
2016-10-21 08:21:23 +00:00
Sepherosa Ziehau
970ead008d hyperv/hn: Add network change support.
Currently the network change is simulated by link status changes.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8295
2016-10-21 08:02:05 +00:00
Sepherosa Ziehau
31f05efd89 hyperv/hn: Check NVS version for HASHVAL pktinfo on sending path.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8293
2016-10-21 07:46:35 +00:00
Sepherosa Ziehau
0634f75c72 hyperv/hn: Always query RSS capabilities.
- This avoid distributing NDIS version check.
- Only NDIS 6.20 required (earlier NDIS uses different indirect table
  format).

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8291
2016-10-21 07:37:29 +00:00
Sepherosa Ziehau
e0e8479b87 LINT: Unhook netmap from LINT-NOIP and LINT-NOINET temporarily.
After fixing ptnet NOINET support, netmap can be linked back to
these two LINTs.

Sponsored by:	Microsoft
2016-10-21 07:35:49 +00:00
Jung-uk Kim
69d410eeb1 Implement BPF_MOD and BPF_XOR instructions.
These two ALU instructions first appeared on Linux.  Then, libpcap adopted
and made them available since 1.6.2.  Now more platforms including NetBSD
have them in kernel.  So do we.
 --이 줄 이하는 자동으로 제거됩니다--
2016-10-21 06:55:07 +00:00
Sepherosa Ziehau
ffaa5deb38 netmap: Unbreak LINT-VIMAGE building
Sponsored by:	Microsoft
2016-10-21 06:32:45 +00:00