r339635:
Fix regex for extracting SHM_* values for libsysdecode
r350301:
libsysdecode: add explicit dependencies on recently changed headers
r350327:
libsysdecode: use the proper include directory
r351151:
Rework r339635 to fix .depend.tables.h handling.
Ian Lepore [Thu, 5 Sep 2019 17:20:48 +0000 (17:20 +0000)]
Fix LINT kernel builds on powerpc64 and sparc64. This is a direct commit
to 12-stable because the nandfs code no longer exists in 13-current.
The build was failing with
nandfs_dat.c:301:
warning: comparison is always false due to limited range of data type
I tried to fix it with an inline (size_t) cast of nargv->nv_nmembs in the
if() expression, but that didn't help (which seems a bit buggy), but using
an intermediate variable fixed it. Elegance doesn't matter as much as
suppressing the warning; this code is long-dead even on this branch.
Ian Lepore [Thu, 5 Sep 2019 16:46:16 +0000 (16:46 +0000)]
MFC r350838, r350840-r350841, r350849, r350879
r350838:
Switch the am335x_pmic driver to using iicdev_readfrom/writeto.
PR: 239697
Submitted by: Chuhong Yuan
r350840:
Garbage collect the no-longer-necessary MAX_IIC_DATA_SIZE (there is not a
buffer allocated at that fixed size anymore).
r350841:
When responding to an interrupt in the am335x_pmic driver, use a taskqueue
thread to do the work that involves i2c IO, which sleeps while the IO is
in progress.
r350849:
Remove use of intr_config_hook from the am335x_pmic and tda19988 drivers.
Long ago this was needed, but now low-level i2c controller drivers cleverly
defer attachment of the bus until interrupts are enabled (if they require
interrupts to function), so that every i2c slave device doesn't have to.
r350879:
Revert r350841. I didn't realize that on this chip, reading the interrupt
status register clears pending interrupts. By moving that code out of the
interrupt handler into a taskqueue task, I effectively created an interrupt
storm by returning from the handler with the interrupt source still active.
We'll have to find a different solution for this driver's need to sleep
in an ithread context.
Ian Lepore [Thu, 5 Sep 2019 16:37:10 +0000 (16:37 +0000)]
MFC r350591, r350971, r351724
r350591:
Add a driver for Texas Instruments ADS101x/ADS111x i2c ADC chips.
Instances of the device can be configured using hints or FDT data.
Interfaces to reconfigure the chip and extract voltage measurements from
it are available via sysctl(8).
r350971:
Fix the driver name in ads111x.4, and hook the manpage up to the build.
The driver was originally written with the name ads1115, but at the last
minute it got renamed to ads111x to reflect its support for many related
chips, but I forgot to update the manpage to match the renaming before
committing it all.
r351724:
Fix the name of the devicetree bindings document file cited in the manpage.
Rick Macklem [Wed, 4 Sep 2019 20:14:21 +0000 (20:14 +0000)]
MFC: r350395
Fix printing of Server Re-Failed and Server Faults.
nfsstat -s prints bogus large numbers for the Server Re-Failed and Server
Faults fields. This was introduced by r328588.
Although I know nothing about libxo, these lines aren't titles and this
patch seems to fix the problem, so I am committing it for rea@ who emailed
it to me.
It also deleted the trailing ':' from the title lines, since those were not
in the pre-r328588 output.
If there is a more correct fix, someone conversant with libxo will need
to do so.
MFC r351408-r351410: reduce pollution from mips machine/regnum.h
r351408:
libsa: mips: use _JB_* from machine/asm.h, remove regnum dep
This brings the libsa/mips _setjmp implementation closer to parity with the
libc version.
r351409:
mips: hide regnum definitions behind _KERNEL/_WANT_MIPS_REGNUM
machine/regnum.h ends up being included by sys/procfs.h and sys/ptrace.h via
machine/reg.h. Many of the regnum definitions are too short and too generic
to be exposing to any userland application including one of these two
headers. Moreover, these actively cause build failures in googletest
(template <typename T1 ...> expanding to template <typename 9 ...>).
Hide the definitions behind _KERNEL or _WANT_MIPS_REGNUM, and patch all of
the userland consumers to define as needed.
r351410:
libsa: mips: fix typo that had slipped into the diff on local machine
MFC r349951, r349994, r349995, r350005, r350023 (by jhibbits), r350478:
Provide protection against starvation of the ll/sc loops when accessing
userpace.
Initialize the frentry (the control block that defines a rule) checksum
to zero. Matching checksums save time and effort by mitigating the need
for full rule compare.
Pull in r368867 from upstream libc++ trunk (by Marshall Clow):
Rework recursive_timed_mutex so that it uses __thread_id instead of
using the lower-level __libcpp_thread_id. This is prep for fixing
PR42918. Reviewed as https://reviews.llvm.org/D65895
Pull in r368916 from upstream libc++ trunk (by Marshall Clow):
Fix thread comparison by making sure we never pass our special 'not a
thread' value to the underlying implementation. Fixes PR#42918.
This should fix std::thread::id::operator==() attempting to call
pthread_equal(3) with zero values.
Ed Maste [Tue, 3 Sep 2019 16:57:32 +0000 (16:57 +0000)]
MFC r350989: Remove some more leftover rlogin man page xrefs
rcmds were removed in r32435 and these three man pages can trivially
drop the references.
There's still a reference in pts.4 because it describes a mode
(TIOCPKT_NOSTOP), and only lists rlogin/rlogind as examples of programs
that use that mode. To update later.
Ed Maste [Tue, 3 Sep 2019 16:25:27 +0000 (16:25 +0000)]
MFC r351395: msdosfs_fat: reduce diffs with NetBSD and makefs
Use pointer arithmetic (as now done in makefs, and in NetBSD) instead of
taking the address of array element. No functional change, but this
makes it easier to compare different versions of this file.
Alexander Motin [Tue, 3 Sep 2019 16:20:04 +0000 (16:20 +0000)]
MFC r351606: Take proper lock in ses_setphyspath_callback().
XPT_DEV_ADVINFO call should be protected by the lock of the specific
device it is addressed to, not the lock of SES device. In some weird
case, probably with hardware violating standards, it sometimes caused
NULL dereference due to race.
To protect from it further, add lock assertion to *_dev_advinfo().
Alexander Motin [Tue, 3 Sep 2019 14:52:39 +0000 (14:52 +0000)]
MFC r351550: Always check cam_periph_error() status for ERESTART.
Even if we do not expect retries, we better be sure, since otherwise it
may result in use after free kernel panic. I've noticed that it retries
SCSI_STATUS_BUSY even with SF_NO_RECOVERY | SF_NO_RETRY.
Cy Schubert [Thu, 29 Aug 2019 19:13:27 +0000 (19:13 +0000)]
MFC r351397:
MFV r346563:
Update wpa 2.8 --> 2.9
hostapd:
* SAE changes
- disable use of groups using Brainpool curves
- improved protection against side channel attacks
[https://w1.fi/security/2019-6/]
* EAP-pwd changes
- disable use of groups using Brainpool curves
- improved protection against side channel attacks
[https://w1.fi/security/2019-6/]
* fixed FT-EAP initial mobility domain association using PMKSA caching
* added configuration of airtime policy
* fixed FILS to and RSNE into (Re)Association Response frames
* fixed DPP bootstrapping URI parser of channel list
* added support for regulatory WMM limitation (for ETSI)
* added support for MACsec Key Agreement using IEEE 802.1X/PSK
* added experimental support for EAP-TEAP server (RFC 7170)
* added experimental support for EAP-TLS server with TLS v1.3
* added support for two server certificates/keys (RSA/ECC)
* added AKMSuiteSelector into "STA <addr>" control interface data to
determine with AKM was used for an association
* added eap_sim_id parameter to allow EAP-SIM/AKA server pseudonym and
fast reauthentication use to be disabled
* fixed an ECDH operation corner case with OpenSSL
wpa_supplicant:
* SAE changes
- disable use of groups using Brainpool curves
- improved protection against side channel attacks
[https://w1.fi/security/2019-6/]
* EAP-pwd changes
- disable use of groups using Brainpool curves
- allow the set of groups to be configured (eap_pwd_groups)
- improved protection against side channel attacks
[https://w1.fi/security/2019-6/]
* fixed FT-EAP initial mobility domain association using PMKSA caching
(disabled by default for backwards compatibility; can be enabled
with ft_eap_pmksa_caching=1)
* fixed a regression in OpenSSL 1.1+ engine loading
* added validation of RSNE in (Re)Association Response frames
* fixed DPP bootstrapping URI parser of channel list
* extended EAP-SIM/AKA fast re-authentication to allow use with FILS
* extended ca_cert_blob to support PEM format
* improved robustness of P2P Action frame scheduling
* added support for EAP-SIM/AKA using anonymous@realm identity
* fixed Hotspot 2.0 credential selection based on roaming consortium
to ignore credentials without a specific EAP method
* added experimental support for EAP-TEAP peer (RFC 7170)
* added experimental support for EAP-TLS peer with TLS v1.3
* fixed a regression in WMM parameter configuration for a TDLS peer
* fixed a regression in operation with drivers that offload 802.1X
4-way handshake
* fixed an ECDH operation corner case with OpenSSL
Brooks Davis [Wed, 28 Aug 2019 07:53:10 +0000 (07:53 +0000)]
MFC r340424:
Use the main capabilities.conf for freebsd32.
Allow the location of capabilities.conf to be configured.
Also allow a per-abi syscall prefix to be configured with the
abi_func_prefix syscalls.conf variable and check syscalls against
entries in capabilities.conf with and without the prefix amended.
Take advantage of these two features to allow use shared
capabilities.conf
between the default syscall vector and the freebsd32 compatability
layer. We've been inconsistent about keeping the two in sync as
evidenced by the bugs fixed in r340294. This eliminates that problem
going forward.
Brooks Davis [Wed, 28 Aug 2019 07:37:34 +0000 (07:37 +0000)]
MFC r339624:
Remove the need for backslashes in syscalls.master.
Join non-special lines together until we hit a line containing a '}'
character. This allows the function declaration body to be split
across multiple lines without backslash continuation characters.
Continue to join lines ending with backslashes to allow gradual
migration and to support out-of-tree syscall vectors
Alexander Motin [Tue, 27 Aug 2019 04:16:42 +0000 (04:16 +0000)]
MFC r351105, r351107: Limit memory window usage in ntb_transport to 256MB.
This adds safety net for the case of misconfigured NTB with too big
memory window, for which we may be unable to allocate a memory buffer,
which does not make much sense for the network interface. While there,
fix the code to really work with asymmetric window sizes setup.
This makes driver just print warning message on boot instead of hanging
if too large memory window is configured.
Alexander Motin [Tue, 27 Aug 2019 04:15:21 +0000 (04:15 +0000)]
MFC r351072: Implement new methods for Intel and PLX NTB.
This restores parity with AMD NTB driver. Though without any drivers
supporting more then one peer and respective KPI modification to pass
peer index to most of the calls this addition is pretty useless now.
Alexander Motin [Tue, 27 Aug 2019 04:13:22 +0000 (04:13 +0000)]
MFC r349594, r349595, r349601: Add driver for NTB in AMD SoC.
This patch is the driver for NTB hardware in AMD SoCs (ported from Linux)
and enables the NTB infrastructure like Doorbells, Scratchpads and Memory
window in AMD SoC. This driver has been validated using ntb_transport and
if_ntb driver already available in FreeBSD.
Alexander Motin [Tue, 27 Aug 2019 04:04:19 +0000 (04:04 +0000)]
MFC r351352: Improve NVMe hot unplug handling.
If device is unplugged from the system (CSTS register reads return
0xffffffff), it makes no sense to send any more recovery requests or
expect any responses back. If there is a detach call in such state,
just stop all activity and free resources. If there is no detach
call (hot-plug is not supported), rely on normal timeout handling,
but when it trigger controller reset, do not wait for impossible and
quickly report failure.
Alexander Motin [Tue, 27 Aug 2019 04:03:42 +0000 (04:03 +0000)]
MFC r351320: Formalize NVMe controller consumer life cycle.
This fixes possible double call of fail_fn, for example on hot removal.
It also allows ctrlr_fn to safely return NULL cookie in case of failure
and not get useless ns_fn or fail_fn call with NULL cookie later.
Alexander Motin [Tue, 27 Aug 2019 04:01:56 +0000 (04:01 +0000)]
MFC r351028: Report NOIOB and NPWG fields as stripe size.
Namespace Optimal I/O Boundary field added in NVMe 1.3 and Namespace
Preferred Write Granularity added in 1.4 allow upper layers to align
I/Os for improved SSD performance and endurance.
I don't have hardware reportig those yet, but NPWG could probably be
reported by bhyve.
Alexander Motin [Tue, 27 Aug 2019 03:55:38 +0000 (03:55 +0000)]
MFC r350676, r350677: Make `camcontrol modepage` support block descriptors.
It allows to read and write block descriptors alike to mode page parameters.
It allows to change block size or short-stroke HDDs or overprovision SSDs.
Depenting on -P parameter the change can be either persistent or till reset.
In case of block size change device may need reformat after the setting.
In case of SSD overprovisioning format or sanitize may be needed to really
free the flash.
During implementation appeared that csio_encode_visit() can not handle
integers of more then 4 bytes, that makes 8-byte LBA handling awkward.
I had to split it into two 4-byte halves now.
Alexander Motin [Tue, 27 Aug 2019 03:05:57 +0000 (03:05 +0000)]
MFC r351348 (by markj):
Modify pipe_poll() to properly check for pending direct writes.
With r349546, it is a responsibility of the writer to clear PIPE_DIRECTW
after pinned data has been read. In particular, once a reader has
drained this data, there is a small window where the pipe is empty but
PIPE_DIRECTW is set. pipe_poll() was using the presence of PIPE_DIRECTW
to determine whether to return POLLIN, so in this window it would
claim that data was available to read when this was not the case.
Fix this by modifying several checks for PIPE_DIRECTW to instead look
at the number of residual bytes in data pinned by a direct writer. In
some cases we really do want to check for PIPE_DIRECTW, since the
presence of this flag indicates that any attempt to write to the pipe
will block on the existing direct writer.
Kyle Evans [Mon, 26 Aug 2019 17:34:07 +0000 (17:34 +0000)]
MFC r351119, r351135-r351136, r351412: stand xtoolchain-llvm90 fixes
r351119:
stand: push LIBC_SRC up into defs.mk
Other parts of stand/ that don't use libsa will need to grab bits from libc
shortly. Push LIBC_SRC up to defs.mk in advance of this so that they can use
it, and rename it to LIBCSRC to match the convention of the rest of the *SRC
variables in this file.
r351135:
stand: boot2: fix build with xtoolchain-llvm90
ufsread.c grows a dependency on __ashldi3 with llvm90. Grab ashldi3.c out of
compiler-rt rather than trying to link against libsa (for now).
-Wno-missing-prototypes is necessary to compile ashldi3.c standalone.
r351136:
stand: gptboot: fix build with xtoolchain-llvm90
ufsread.c grows a dependency on __ashldi3 with llvm90. For gptboot, just
start pulling in ashldi3.c ashrdi3.c lshrdi3.c into libsa for all archs as
the number of archs requiring one or more of them keeps growing. qdivrem.c
and quad.h can be trivially kicked out of libsa if we start pulling these
from compiler-rt as qdivrem was only used to implement umoddi3, divdi3,
moddi3 (also in qdivrem.c).
Cy Schubert [Sun, 25 Aug 2019 13:36:20 +0000 (13:36 +0000)]
MFC r350881:
Calculate the number interface array elements using the new FR_NUM macro
instead of the hard-coded value of 4. This is a precursor to increasing
the number of interfaces speficied in "on {interface, ..., interface}".
Note that though this feature is coded in ipf_y.y, it is partially
supported in the ipfilter kld, meaning it does not work yet (and is yet
to be documented in ipf.5 too).