Commit Graph

218686 Commits

Author SHA1 Message Date
Enji Cooper
c3f095c6da Fix the build by moving the initializers for len/nswapdev down below the
declarations

MFC after:	3 days
Pointyhat to:	ngie
2016-12-28 08:11:41 +00:00
Michal Meloun
4642c8c5ea Limit number of stripes supported by HDA codec to maximum number
announced by HDA controller.
Incorrectly implermented HDA codec may report support for more stripes
that HDA controller already have. Due to this, always limit number of
enabled stripes by global controller maximum.

Reviewed by:	mav
MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D8922
2016-12-28 07:37:26 +00:00
Enji Cooper
c5cf639fd9 style(9): clean up whitespace
MFC after:	3 days
2016-12-28 06:10:58 +00:00
Enji Cooper
2229fa01bc style(9) fixes: clean up leading whitespace
MFC after:	3 days
2016-12-28 05:43:14 +00:00
Enji Cooper
6ebc234490 style(9) fixes: clean up leading whitespace
MFC after:	3 days
2016-12-28 05:42:41 +00:00
Enji Cooper
c4648c7562 style(9) fixes
- Clean up trailing whitespace
- Fix variable type alignment in storage_OS_get_swap(..)

MFC after:	3 days
2016-12-28 05:41:53 +00:00
Enji Cooper
4568bf74f4 Only build/install usr.sbin/bsnmpd/modules/snmp_hast if MK_HAST != no
MFC after:	1 week
2016-12-28 05:21:22 +00:00
Enji Cooper
38bf4fd787 Only build/install usr.sbin/bsnmpd/modules/snmp_wlan if MK_WIRELESS != no
MFC after:	1 week
2016-12-28 05:16:41 +00:00
Enji Cooper
b3972edb64 style(9): ip_get(..): clean up whitespace
MFC after:	3 days
2016-12-28 05:05:08 +00:00
Enji Cooper
700d391fb8 style(9): snmp_send_packet(..): fix whitespace
MFC after:	3 days
2016-12-28 04:56:15 +00:00
Ed Maste
62652acf3a loader: use strip -o instead of cp and strip in place
It is simpler and cleaner to have strip produce the stripped output
directly than copying the input to the output first.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2016-12-28 04:55:43 +00:00
Enji Cooper
bc54857ed0 style(9): fix whitespace in pdu_encode_secparams(..)
MFC after:	3 days
2016-12-28 04:53:52 +00:00
Sepherosa Ziehau
f1b0a43ff6 hyperv/hn: Factor out function to set rxfilter.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8928
2016-12-28 04:47:17 +00:00
Sepherosa Ziehau
c08f7b2c28 hyperv/hn: Function renaming; no functional changes.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8908
2016-12-28 04:35:52 +00:00
Enji Cooper
5120d21c63 style(9): sort alignment in udp_recv(..)
MFC after:	3 weeks
2016-12-28 04:31:07 +00:00
Enji Cooper
8d7f605b6c Fix bsnmpd sending/receiving with multi-homed configurations or INADDR_ANY used
as the listening address in snmpd_input(..)

Stash the IPv4 address of the receiver via the recv(..) callback and use it in
the send(..) callback for the transport by specifying IP_SENDSRCADDR for the
control message type.

Add sendmsg logic to the UDP transport's send(..) callback and use the
respective send(..) callback for the transport instead of calling sendto in
snmpd_input(..).

MFC after:      3 weeks
Obtained from:  Isilon OneFS (^/onefs/branches/BR_8_0_0_DEV@r507595)
Submitted by:   Thor Steingrimsson <thor.steingrimsson@isilon.com>
Sponsored by:   Dell EMC Isilon
2016-12-28 04:29:09 +00:00
Enji Cooper
f66b889d00 Install snmpmod.3 as all of the bsnmpd APIs it documents
MFC after:	3 days
2016-12-28 03:56:25 +00:00
Justin Hibbits
d5a30121f4 Restrict SLB handler to powerpc64 and AIM
Only Book-S has SLBs.  Book-E does not, so restrict it to only Book-S (which we
call AIM).
2016-12-28 03:40:54 +00:00
Sepherosa Ziehau
87f8129d28 hyperv/hn: Consolidate hn_{suspend,resume}
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8907
2016-12-28 03:19:59 +00:00
Sepherosa Ziehau
69d2eb82d7 hyperv/vmbus: Nuke unnecessary critical sections.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8906
2016-12-28 03:07:58 +00:00
Alexander Kabaev
a0e41d3784 Implement pmap_change_attr and related APIs on MIPS
On platforms that have uncached-accelerate cache attribute, map it
to VM_MEMATTR_WRITE_COMBINING. Otherwise, leave write comining
undefined.

Reviewed by:	adrian, jhb (glance)
Differential Revision:	https://reviews.freebsd.org/D8894
2016-12-28 02:55:26 +00:00
Alexander Motin
e67ac203a6 Allow more efficient use of private area.
There are 16 bytes of space, so we may store two pointers in one.

MFC after:	2 weeks
2016-12-27 23:56:46 +00:00
Enji Cooper
e1d581b289 style(9): clean up trailing whitespace
MFC after:	3 weeks
2016-12-27 23:32:54 +00:00
Mark Johnston
c71c814a97 Remove an obsolete pragma from dtrace.h.
It triggers a compiler warning and has been removed upstream.

MFC after:	1 week
2016-12-27 23:31:32 +00:00
Alexander Motin
ca734d8a13 Do not update "saved" mode page on every MODE SELECT.
We do not have non-volatile memory to really save those values, so we
neither report nor support this capability.  Also saved mode pages are
not replicated between HA peers now.

MFC after:	2 weeks
2016-12-27 22:38:44 +00:00
Oleksandr Tymoshenko
d786719d90 [intelspi] Add SPI driver for Intel BayTrail SoC
Add SPI mode (PIO-only) support for Intel Synchronous Serial Port that
can be found in several Intel's products starting from PXA family.
Most of implementations have slight differences in behavior and in
addresses for registers subset. This driver covers only BayTrail SoC
implementation for it's the only hardware I have to test it on.

Driver attaches to ACPI bus only and does not have PCI or FDT support
for now due to lack of hardware to test it on.

"intelspi" is the best name I've managed to come up with. Linux driver
name (spi-pxa2xx) does not make sense because current implementation
does not support actual PXA2xx SoCs. And as far as I know there is no
codename assigned to Intel SSP chip.

Reviewed by:	br, manu
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D8896
2016-12-27 22:37:24 +00:00
Alexander Motin
2e0a1f828e Fix/synchronize field types in struct ctl_modepage_header.
MFC after:	2 weeks
2016-12-27 22:31:06 +00:00
Alexander Motin
2c966e8500 Missed piece of r310640.
MFC after:	2 weeks
2016-12-27 22:28:14 +00:00
Michael Tuexen
2048d80aa3 Consistent handling of errors reported from the lower layer.
MFC after:	3 days
2016-12-27 22:14:41 +00:00
Alexander Motin
3722787c8a Add support for revert to defaults (RTD) bit in MODE SELECT.
MFC after:	2 weeks
2016-12-27 21:11:54 +00:00
John Baldwin
1fabda45c3 Regen after r310638.
Differential Revision:	https://reviews.freebsd.org/D8854
2016-12-27 20:22:17 +00:00
John Baldwin
34ed0c63c8 Rename the 'flags' argument to getfsstat() to 'mode' and validate it.
This argument is not a bitmask of flags, but only accepts a single value.
Fail with EINVAL if an invalid value is passed to 'flag'.  Rename the
'flags' argument to getmntinfo(3) to 'mode' as well to match.

This is a followup to r308088.

Reviewed by:	kib
MFC after:	1 month
2016-12-27 20:21:11 +00:00
Oleksandr Tymoshenko
3a48aebfbe [rpi] Fix bcm2835_audio locking and samples starvation
Rework general approach to locking and working with audio worker thread:

- Use flags to signal requested worker action
- Fix submitted buffer calculations to avoid samples starvation
- Protect buffer pointers with locks to fix race condition between callback
  and audio worker thread
- Remove unnecessary vchi_service_use
- Do not use lock to serialize VCHI requests since only one thread issues them now
- Fix unloading signaling per hselasky@ suggestion
- Add output to detect inconsistent callback data caused by possible firmware bug
  https://github.com/raspberrypi/firmware/issues/696
- Add stats/debug sysctls to troubleshoot possible bugs

PR:		213687, 205979, 215194
MFC after:	1 week
2016-12-27 19:08:08 +00:00
Alexander Motin
ee5e44e076 Decouple limits on number of LUNs per port and LUs per CTL.
Those two values are not directly related, so make them independent.
This does not change any limits immediately, but makes number of LUNs
per port controllable via tunable/sysctl kern.cam.ctl.lun_map_size.
After this change increasing CTL_MAX_LUNS should be pretty cheap,
and even making it tunable should be easy.

MFC after:	2 weeks
2016-12-27 18:23:16 +00:00
Ed Maste
d0aa56451e elfcopy: fix PE object section name corruption and crash
Fixed a bug that the PE object section names are generated incorrectly
using the section name table found in the original input ELF object
instead of the intermediate ELF object.

Ticket:		#541

Do not try to copy section content from a NULL d_buf when creating
uninitialized data COFF section for PE object.

Ticket:		#540

Obtained from:	ELF Tool Chain r3507, r3508
MFC after:	1 week
2016-12-27 17:31:07 +00:00
Alexander Motin
dad99db247 Add MAX_LUNS overflow safety checks.
While this MAX_LUNS limitation is too synthetic and should be removed,
it is better to enforce it while it is here.

MFC after:	2 weeks
2016-12-27 17:13:31 +00:00
Andriy Gapon
7502cc401b libkvm: support access to vmm guest memory, allow writes to fwmem and vmm
This change consists of two parts:
- allow libkvm to recognize /dev/vmm/* character devices as devices that
  provide access to the physical memory of a system (similarly to /dev/fwmem*)
- allow libkvm to recognize that /dev/vmm/* and /dev/fwmem* devices provide
  access to the physical memory of live remote systems and, thus, the memory
  is writable

As a result, it should be possible to run commands like
$ kgdb -w /path/to/kernel /dev/fwmem0.0
$ kgdb /path/to/kernel /dev/vmm/guest

Reviewed by:	kib, jhb
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Panzura
Differential Revision: https://reviews.freebsd.org/D8679
2016-12-27 10:17:56 +00:00
Andrew Rybchenko
44fcad033f sfxge(4): do not limit driver RSS table to RSS channels max
Specification of entire RSS table in the driver allows to spread traffic
more equally across CPUs/RSS channels if number of RSS channels is not
power of 2.

Reviewed by:    philip
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D8910
2016-12-27 08:51:26 +00:00
Adrian Chadd
781487cfc6 [net80211] turn the default TX key configuration (for WEP) into a vap callback.
The ath10k firmware supports hardware WEP offload, and in native wifi mode
(or 802.3 ethernet mode, for that matter) the WEP key isn't actually included
in the TX payload from net80211.  Instead, a separate firmware command is issued
that sets the default TX key to be the specified key.

However, net80211 doesn't at all inform the driver layer that this is
occuring - it just "expects" to be inserting WEP header information
when doing WEP TX, even with hardware encryption.

So, to better support the newer world order, turn the default TX key assignment
into a VAP method that can be overridden by the driver and ensure its wrapped
in a crypto begin/end set.  That way it should be correctly atomic from the
point of view of keychanges (as long as the driver does the right thing.)

It'd be nice if we passed through to the key_set call a flag that says
"also make this the default key" - that's captured here by calling the
deftxkey method after the key_set method.  Maybe I can do that later.

Note: this is a net80211 ABI change, and will require a kernel+modules
recompile.  Happy Holidays, etc.

Tested:

* ath10k driver port
* rtwn_usb, WEP station
2016-12-27 06:10:28 +00:00
Martin Matuska
7105995c64 MFV r310622:
Sync libarchive with vendor.

Vendor bugfixes (relevant to FreeBSD):
PR 846: Spelling fixes
PR 850: Fix issues with reading certain jar files
OSS-Fuzz 286: Bugfix in archive_strncat_l()
2016-12-27 01:10:28 +00:00
Martin Matuska
cda329a1ca Update vendor/libarchive to git to 42a3408ac7df1e69bea9ea12b72e14f59f7400c0
Vendor bugfixes:

PR 844: Coverity bug fixes in tests
PR 846: Spelling fixes
PR 850: Fix issues with reading certain jar files
PR 826: OpenSSL 1.1 support
PR 830, 831, 833: Spelling fixes
OSS-Fuzz 227, 230, 239: Fix possible memory leak in archive_read_free()
OSS-Fuzz 237: Fix heap buffer overflow when reading invalid ar archives
OSS-Fuzz 286: Bugfix in archive_strncat_l()
2016-12-27 00:51:53 +00:00
Oleksandr Tymoshenko
5c5bcb1d70 [ig4] Add ACPI platform support for ig4 driver
Add ACPI part for ig4 driver to make it work on Intel BayTrail SoC where
ig4 device is available only through ACPI

Reviewed by:	avg
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D8742
2016-12-26 22:13:43 +00:00
Konstantin Belousov
fd30dd7c26 Make knote KN_INFLUX state counted. This is final fix for the issue
closed by r310302 for knote().

If KN_INFLUX | KN_SCAN flags are set for the note passed to knote() or
knote_fork(), i.e. the knote is scanned, we might erronously clear
INFLUX when finishing notification.  For normal knote() it was fixed
in r310302 simply by remembering the fact that we do not own
KN_INFLUX, since there we own knlist lock and scan thread cannot clear
KN_INFLUX until we drop the lock.  For knote_fork(), the situation is
more complicated, e must drop knlist lock AKA the process lock, since
we need to register new knotes.

Change KN_INFLUX into counter and allow shared ownership of the
in-flux state between scan and knote_fork() or knote().  Both in-flux
setters need to ensure that knote is not dropped in parallel.  Added
assert about kn_influx == 1 in knote_drop() verifies that in-flux state
is not shared when knote is destroyed.

Since KBI of the struct knote is changed by addition of the int
kn_influx field, reorder kn_hook and kn_hookid to fill pad on LP64
arches [1].  This keeps sizeof(struct knote) to same 128 bytes as it
was before addition of kn_influx, on amd64.

Reviewed by:	markj
Suggested by:	markj [1]
Tested by:	pho (previous version)
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D8898
2016-12-26 19:33:40 +00:00
Konstantin Belousov
8b590e9506 Remove redundancy in vmtotal().
There are two instances of inlined unlocks + continue in vmtotal()
switch statements, which are ordinary expressed with break from the
switch case and code after the switch.  Also, the combination of
continue and break statement is redundand.

Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-12-26 19:29:04 +00:00
Konstantin Belousov
5c36b2e8cb Change knlist_destroy() to assert that knlist is empty instead of
accepting the wrong state and printing warning.  Do not obliterate
kl_lock and kl_unlock pointers, they are often useful for post-mortem
analysis.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
X-Differential revision:	https://reviews.freebsd.org/D8898
2016-12-26 19:28:10 +00:00
Xin LI
760f2905be Don't assign rtjp twice.
Reported by:	clang static analyzer
MFC after:	2 weeks
2016-12-26 19:27:12 +00:00
Konstantin Belousov
34311568dc Style.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
X-Differential revision:	https://reviews.freebsd.org/D8898
2016-12-26 19:26:40 +00:00
Oleksandr Tymoshenko
71546cd96a [evdev] Fix build for older versions of clang
There was report of stable/11 build failure on older versions of
FreeBSD. The problem was a reference to static variable in inline
function. Although fairly recent versions of clang can cope with this
situation just fine there is no strict requirement to make functions
in question inline, they're not in any time-critical codepath. So to
keep HEAD and 11-STABLE buildable on older FreeBSDs some of the util
functions were converted from inline to normal.

Reported by:	hselasky
MFC after:	3 days
2016-12-26 17:48:13 +00:00
Xin LI
ed09c2c161 - pstat(8) does not accept any arguments other than getopt() args,
so don't bother to adjust argc/argv after getopt() loop.
 - Make a string pointer constant.

MFC after:	2 weeks
2016-12-26 17:34:27 +00:00
Xin LI
62b0ff4e66 Don't use high precision clock for expiration as only second portion is
used.

MFC after:	2 weeks
2016-12-26 17:23:09 +00:00