]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agovfs: add VOP_NEED_INACTIVE
Mateusz Guzik [Wed, 28 Aug 2019 20:34:24 +0000 (20:34 +0000)]
vfs: add VOP_NEED_INACTIVE

vnode usecount drops to 0 all the time (e.g. for directories during path lookup).
When that happens the kernel would always lock the exclusive lock for the vnode
in order to call vinactive(). This blocks other threads who want to use the vnode
for looukp.

vinactive is very rarely needed and can be tested for without the vnode lock held.

This patch gives filesytems an opportunity to do it, sample total wait time for
tmpfs over 500 minutes of poudriere -j 104:

before: 557563641706 (lockmgr:tmpfs)
after:   46309603301 (lockmgr:tmpfs)

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21371

4 years agoamd64: clean up cpu_switch.S
Mateusz Guzik [Wed, 28 Aug 2019 19:40:57 +0000 (19:40 +0000)]
amd64: clean up cpu_switch.S

- LK macro (conditional on SMP for the lock prefix) is unused
- SETLK unnecessarily performs xchg. obtained value is never used and the
  implicit lock prefix adds avoidable cost. Barrier provided by it does
  not appear to be of any use.
- the lock waited for is almost never blocked, yet the loop starts with
  a pause. Move it out of the common case.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19563

4 years agovm: only lock tmpfs vnode shared in vm_object_deallocate
Mateusz Guzik [Wed, 28 Aug 2019 19:28:27 +0000 (19:28 +0000)]
vm: only lock tmpfs vnode shared in vm_object_deallocate

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21455

4 years agoAvoid direct accesses of the vm_page wire_count field.
Mark Johnston [Wed, 28 Aug 2019 18:01:54 +0000 (18:01 +0000)]
Avoid direct accesses of the vm_page wire_count field.

No functional change intended.

Sponsored by: Netflix

4 years agoMFV/ZoL: Fix wrong assertion in libzfs diff error handling
Alexander Motin [Wed, 28 Aug 2019 17:39:46 +0000 (17:39 +0000)]
MFV/ZoL: Fix wrong assertion in libzfs diff error handling

In compare(), all error cases set the error code to EPIPE, so when an
error is set, the correct assertion to make is that the error is EPIPE,
not EINVAL.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@freqlabs.com>
Closes #8743
zfsonlinux/zfs@9dc41a769df164875d974c2431b2453e70e16c41

Submitted by: Ryan Moeller <ryan@freqlabs.com>
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D20118

4 years agoDocument fetchReqHTTP().
Mark Johnston [Wed, 28 Aug 2019 17:01:28 +0000 (17:01 +0000)]
Document fetchReqHTTP().

Submitted by: Farhan Khan <khanzf@gmail.com>
Reviewed by: 0mp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18788

4 years agoproc: eliminate the zombproc list
Mateusz Guzik [Wed, 28 Aug 2019 16:18:23 +0000 (16:18 +0000)]
proc: eliminate the zombproc list

It is not needed by anything in the kernel and it slightly drives up contention
on both proctree and allproc locks.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21447

4 years agoWire pages in vm_page_grab() when appropriate.
Mark Johnston [Wed, 28 Aug 2019 16:08:06 +0000 (16:08 +0000)]
Wire pages in vm_page_grab() when appropriate.

uiomove_object_page() and exec_map_first_page() would previously wire a
page after having grabbed it.  Ask vm_page_grab() to perform the wiring
instead: this removes some redundant code, and is cheaper in the case
where the requested page is not resident since the page allocator can be
asked to initialize the page as wired, whereas a separate vm_page_wire()
call requires the page lock.

In vm_imgact_hold_page(), use vm_page_unwire_noq() instead of
vm_page_unwire(PQ_NONE).  The latter ensures that the page is dequeued
before returning, but this is unnecessary since vm_page_free() will
trigger a batched dequeue of the page.

Reviewed by: alc, kib
Tested by: pho (part of a larger patch)
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21440

4 years agoDocument ipf_nat_hashtab_add() return codes.
Cy Schubert [Wed, 28 Aug 2019 04:55:17 +0000 (04:55 +0000)]
Document ipf_nat_hashtab_add() return codes.

MFC after: 3 days

4 years agoDestroy the mutex in case of error.
Cy Schubert [Wed, 28 Aug 2019 04:55:03 +0000 (04:55 +0000)]
Destroy the mutex in case of error.

Obtained from: NetBSD ip_nat.c r1.7
MFC after: 3 days

4 years agoFixup typo in comment.
Cy Schubert [Wed, 28 Aug 2019 04:54:26 +0000 (04:54 +0000)]
Fixup typo in comment.

Obtained from: NetBSD ip_nat.c r1.7
MFC after: 3 days

4 years agofusefs: Fix some bugs regarding the size of the LISTXATTR list
Alan Somers [Wed, 28 Aug 2019 04:19:37 +0000 (04:19 +0000)]
fusefs: Fix some bugs regarding the size of the LISTXATTR list

* A small error in r338152 let to the returned size always being exactly
  eight bytes too large.

* The FUSE_LISTXATTR operation works like Linux's listxattr(2): if the
  caller does not provide enough space, then the server should return ERANGE
  rather than return a truncated list.  That's true even though in FUSE's
  case the kernel doesn't provide space to the client at all; it simply
  requests a maximum size for the list.  We previously weren't handling the
  case where the server returns ERANGE even though the kernel requested as
  much size as the server had told us it needs; that can happen due to a
  race.

* We also need to ensure that a pathological server that always returns
  ERANGE no matter what size we request in FUSE_LISTXATTR won't cause an
  infinite loop in the kernel.  As of this commit, it will instead cause an
  infinite loop that exits and enters the kernel on each iteration, allowing
  signals to be processed.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21287

4 years agoproc: remove zpfind
Mateusz Guzik [Wed, 28 Aug 2019 01:22:21 +0000 (01:22 +0000)]
proc: remove zpfind

It is not used by anything. If someone wants it back it should be reimplemented
to use the proc hash.

Sponsored by: The FreeBSD Foundation

4 years agoOnly define the 'tls' member of sfio in KERN_TLS is defined.
John Baldwin [Tue, 27 Aug 2019 22:21:18 +0000 (22:21 +0000)]
Only define the 'tls' member of sfio in KERN_TLS is defined.

This field was not initialized in the !KERN_TLS case triggering an
assertion failure when using sendfile(2).

Reported by: pho, asomers
Sponsored by: Netflix

4 years agoAdjust the deprecated warnings for /dev/crypto to be less noisy.
John Baldwin [Tue, 27 Aug 2019 21:29:37 +0000 (21:29 +0000)]
Adjust the deprecated warnings for /dev/crypto to be less noisy.

Warn when actual operations are performed instead of when sessions are
created.  The /dev/crypto engine in OpenSSL 1.0.x tries to create
sessions for all possible algorithms each time it is initialized
resulting in spurious warnings.

Reported by: Mike Tancsa
MFC after: 3 days
Sponsored by: Chelsio Communications

4 years agounionfs: stop passing LK_INTERLOCK to VOP_UNLOCK
Mateusz Guzik [Tue, 27 Aug 2019 20:51:17 +0000 (20:51 +0000)]
unionfs: stop passing LK_INTERLOCK to VOP_UNLOCK

This is part of the preparation to remove flags argument from VOP_UNLOCK.
Also has a side effect of fixing stacking on top of nullfs broken by r351472.

Reported by: cy
Sponsored by: The FreeBSD Foundation

4 years agovfs: stop passing LK_INTERLOCK to VOP_UNLOCK
Mateusz Guzik [Tue, 27 Aug 2019 20:30:56 +0000 (20:30 +0000)]
vfs: stop passing LK_INTERLOCK to VOP_UNLOCK

The plan is to drop the flags argument. There is also a temporary bug
now that nullfs ignores the flag.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21252

4 years agoMFV r351553:
Hiroki Sato [Tue, 27 Aug 2019 20:11:45 +0000 (20:11 +0000)]
MFV r351553:

Fix a problem which prevented -OServerSSLOptions or -OClientSSLOptions
specified in the command-line option from working.

This patch has been accepted by the upstream.

Reviewed by and discussed with: gshapiro

4 years agoFix a problem which prevented -OServerSSLOptions or -OClientSSLOptions
Hiroki Sato [Tue, 27 Aug 2019 19:37:19 +0000 (19:37 +0000)]
Fix a problem which prevented -OServerSSLOptions or -OClientSSLOptions
specified in the command-line option from working.

This patch has been accepted by the upstream.

Reviewed by and discussed with: gshapiro

4 years agoarm64: rk3399: pinctrl: Add gpio banks and fix iomux
Emmanuel Vadot [Tue, 27 Aug 2019 18:00:01 +0000 (18:00 +0000)]
arm64: rk3399: pinctrl: Add gpio banks and fix iomux

Since r351187 the pinctrl driver need to know the gpio bank as it
directly attach the gpio driver to handle some setup that might
be present in the dts, add the gpio banks table for rk3399.
While here fix some IOMUX definition that prevented to boot
on RK3399 as pinctrl wasn't configured correctly.

Submitted by: mmel (original version)
MFC after: 2 weeks
MFC With: r351187

4 years agoarm64: rk3328: pinctrl: Add gpio banks and fix iomux
Emmanuel Vadot [Tue, 27 Aug 2019 17:59:09 +0000 (17:59 +0000)]
arm64: rk3328: pinctrl: Add gpio banks and fix iomux

Since r351187 the pinctrl driver need to know the gpio bank as it
directly attach the gpio driver to handle some setup that might
be present in the dts, add the gpio banks table for rk3328.
While here fix some IOMUX definition that prevented to boot
on RK3328 as pinctrl wasn't configured correctly.

Submitted by: mmel (original version)
MFC after: 2 weeks
MFC With: r351187

4 years agoAlways check cam_periph_error() status for ERESTART.
Alexander Motin [Tue, 27 Aug 2019 16:41:06 +0000 (16:41 +0000)]
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.

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

4 years agoRemove an extraneous + 1 in _domainset_create().
Mark Johnston [Tue, 27 Aug 2019 15:42:08 +0000 (15:42 +0000)]
Remove an extraneous + 1 in _domainset_create().

DOMAINSET_FLS, like our fls(), is 1-indexed.

Reported by: alc
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoping: raise WARNS level to 6
Alan Somers [Tue, 27 Aug 2019 15:34:37 +0000 (15:34 +0000)]
ping: raise WARNS level to 6

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google LLC (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21405

4 years agoFix several logic issues in domainset_empty_vm().
Mark Johnston [Tue, 27 Aug 2019 14:06:34 +0000 (14:06 +0000)]
Fix several logic issues in domainset_empty_vm().

- Don't add 1 to the result of DOMAINSET_FLS.
- Do not modify domainsets containing only empty domains.
- Always flatten a _PREFER policy to _ROUNDROBIN if the preferred
  domain is empty.  Previously we were doing this only when ds_cnt > 1.

These bugs could cause hangs during boot if a VM domain is empty.

Tested by: hselasky
Reviewed by: hselasky, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21420

4 years agoRevert a part of r350883 that should never have gone in
Justin Hibbits [Tue, 27 Aug 2019 14:04:32 +0000 (14:04 +0000)]
Revert a part of r350883 that should never have gone in

The wire_count change is not part of the unification, and doesn't even make
sense.

Reported by: markj

4 years agoFix build on 32 bit archs.
Edward Tomasz Napierala [Tue, 27 Aug 2019 13:55:45 +0000 (13:55 +0000)]
Fix build on 32 bit archs.

4 years agoIntroduce <sys/qmath.h>, a fixed-point math library from Netflix.

Edward Tomasz Napierala [Tue, 27 Aug 2019 11:46:22 +0000 (11:46 +0000)]
Introduce <sys/qmath.h>, a fixed-point math library from Netflix.

This makes it possible to perform mathematical operations
on
fractional values without using floating point. It operates on Q
numbers, which are integer-sized, opaque structures initialized
to hold a chosen number of integer and fractional
bits.


For a general description of the Q number system, see the "Fixed Point
Representation & Fractional Math" whitepaper[1]; for the actual
API see the qmath(3) man page.

This is one of dependencies for the upcoming stats(3) framework[2]
that will be applied to the TCP stack in a later commit.

1. https://www.superkits.net/whitepapers/Fixed%20Point%20Representation%20&%20Fractional%20Math.pdf
2. https://reviews.freebsd.org/D20477

Reviewed by: bcr (man pages, earlier version), sef (earlier version)
Discussed with: cem, dteske, imp, lstewart
Sponsored By: Klara Inc, Netflix
Obtained from: Netflix
Differential Revision: https://reviews.freebsd.org/D20116

4 years agoAdd support for RK3288 into existing RockChip drivers.
Michal Meloun [Tue, 27 Aug 2019 09:20:01 +0000 (09:20 +0000)]
Add support for RK3288 into existing RockChip drivers.
This patch ensures only minimal level of compatibility necessary to boot
on RK3288 based boards. GPIO and pinctrl interaction, missing in current
implementation, will be improved by own patch in the near future.

MFC after: 2 weeks
MFC with: r351452

4 years agovn_vget_ino_gen(): relock the lower vnode on error.
Konstantin Belousov [Tue, 27 Aug 2019 08:28:38 +0000 (08:28 +0000)]
vn_vget_ino_gen(): relock the lower vnode on error.

The function' interface assumes that the lower vnode is passed and
returned locked always.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agocxgbe/t4_tom: Initialize all TOE connection parameters in one place.
Navdeep Parhar [Tue, 27 Aug 2019 04:19:40 +0000 (04:19 +0000)]
cxgbe/t4_tom: Initialize all TOE connection parameters in one place.
Remove now-redundant items from toepcb and synq_entry and the code to
support them.

Let the driver calculate tx_align, rx_coalesce, and sndbuf by default.

Reviewed by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D21387

4 years agocxgbe/t4_tom: Limit work requests with immediate payload to a single
Navdeep Parhar [Tue, 27 Aug 2019 01:16:02 +0000 (01:16 +0000)]
cxgbe/t4_tom: Limit work requests with immediate payload to a single
descriptor.  The per-tid tx credits are in demand during active Tx and
it's best not to use too many just for payload.

Sponsored by: Chelsio Communications

4 years agoAdd kernel-side support for in-kernel TLS.
John Baldwin [Tue, 27 Aug 2019 00:01:56 +0000 (00:01 +0000)]
Add kernel-side support for in-kernel TLS.

KTLS adds support for in-kernel framing and encryption of Transport
Layer Security (1.0-1.2) data on TCP sockets.  KTLS only supports
offload of TLS for transmitted data.  Key negotation must still be
performed in userland.  Once completed, transmit session keys for a
connection are provided to the kernel via a new TCP_TXTLS_ENABLE
socket option.  All subsequent data transmitted on the socket is
placed into TLS frames and encrypted using the supplied keys.

Any data written to a KTLS-enabled socket via write(2), aio_write(2),
or sendfile(2) is assumed to be application data and is encoded in TLS
frames with an application data type.  Individual records can be sent
with a custom type (e.g. handshake messages) via sendmsg(2) with a new
control message (TLS_SET_RECORD_TYPE) specifying the record type.

At present, rekeying is not supported though the in-kernel framework
should support rekeying.

KTLS makes use of the recently added unmapped mbufs to store TLS
frames in the socket buffer.  Each TLS frame is described by a single
ext_pgs mbuf.  The ext_pgs structure contains the header of the TLS
record (and trailer for encrypted records) as well as references to
the associated TLS session.

KTLS supports two primary methods of encrypting TLS frames: software
TLS and ifnet TLS.

Software TLS marks mbufs holding socket data as not ready via
M_NOTREADY similar to sendfile(2) when TLS framing information is
added to an unmapped mbuf in ktls_frame().  ktls_enqueue() is then
called to schedule TLS frames for encryption.  In the case of
sendfile_iodone() calls ktls_enqueue() instead of pru_ready() leaving
the mbufs marked M_NOTREADY until encryption is completed.  For other
writes (vn_sendfile when pages are available, write(2), etc.), the
PRUS_NOTREADY is set when invoking pru_send() along with invoking
ktls_enqueue().

A pool of worker threads (the "KTLS" kernel process) encrypts TLS
frames queued via ktls_enqueue().  Each TLS frame is temporarily
mapped using the direct map and passed to a software encryption
backend to perform the actual encryption.

(Note: The use of PHYS_TO_DMAP could be replaced with sf_bufs if
someone wished to make this work on architectures without a direct
map.)

KTLS supports pluggable software encryption backends.  Internally,
Netflix uses proprietary pure-software backends.  This commit includes
a simple backend in a new ktls_ocf.ko module that uses the kernel's
OpenCrypto framework to provide AES-GCM encryption of TLS frames.  As
a result, software TLS is now a bit of a misnomer as it can make use
of hardware crypto accelerators.

Once software encryption has finished, the TLS frame mbufs are marked
ready via pru_ready().  At this point, the encrypted data appears as
regular payload to the TCP stack stored in unmapped mbufs.

ifnet TLS permits a NIC to offload the TLS encryption and TCP
segmentation.  In this mode, a new send tag type (IF_SND_TAG_TYPE_TLS)
is allocated on the interface a socket is routed over and associated
with a TLS session.  TLS records for a TLS session using ifnet TLS are
not marked M_NOTREADY but are passed down the stack unencrypted.  The
ip_output_send() and ip6_output_send() helper functions that apply
send tags to outbound IP packets verify that the send tag of the TLS
record matches the outbound interface.  If so, the packet is tagged
with the TLS send tag and sent to the interface.  The NIC device
driver must recognize packets with the TLS send tag and schedule them
for TLS encryption and TCP segmentation.  If the the outbound
interface does not match the interface in the TLS send tag, the packet
is dropped.  In addition, a task is scheduled to refresh the TLS send
tag for the TLS session.  If a new TLS send tag cannot be allocated,
the connection is dropped.  If a new TLS send tag is allocated,
however, subsequent packets will be tagged with the correct TLS send
tag.  (This latter case has been tested by configuring both ports of a
Chelsio T6 in a lagg and failing over from one port to another.  As
the connections migrated to the new port, new TLS send tags were
allocated for the new port and connections resumed without being
dropped.)

ifnet TLS can be enabled and disabled on supported network interfaces
via new '[-]txtls[46]' options to ifconfig(8).  ifnet TLS is supported
across both vlan devices and lagg interfaces using failover, lacp with
flowid enabled, or lacp with flowid enabled.

Applications may request the current KTLS mode of a connection via a
new TCP_TXTLS_MODE socket option.  They can also use this socket
option to toggle between software and ifnet TLS modes.

In addition, a testing tool is available in tools/tools/switch_tls.
This is modeled on tcpdrop and uses similar syntax.  However, instead
of dropping connections, -s is used to force KTLS connections to
switch to software TLS and -i is used to switch to ifnet TLS.

Various sysctls and counters are available under the kern.ipc.tls
sysctl node.  The kern.ipc.tls.enable node must be set to true to
enable KTLS (it is off by default).  The use of unmapped mbufs must
also be enabled via kern.ipc.mb_use_ext_pgs to enable KTLS.

KTLS is enabled via the KERN_TLS kernel option.

This patch is the culmination of years of work by several folks
including Scott Long and Randall Stewart for the original design and
implementation; Drew Gallatin for several optimizations including the
use of ext_pgs mbufs, the M_NOTREADY mechanism for TLS records
awaiting software encryption, and pluggable software crypto backends;
and John Baldwin for modifications to support hardware TLS offload.

Reviewed by: gallatin, hselasky, rrs
Obtained from: Netflix
Sponsored by: Netflix, Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D21277

4 years agoFix a few nits in vm_pqbatch_process_page().
Mark Johnston [Mon, 26 Aug 2019 20:20:10 +0000 (20:20 +0000)]
Fix a few nits in vm_pqbatch_process_page().

- Don't bother masking off non-queue state flags when loading the
  page's atomic state, since it is only required for one of the
  function's assertions.  Update the assertion instead.
- Remove an incorrect comment regarding synchronization with the
  page daemon.  The page daemon only ever checks for PGA_ENQUEUED
  with the page queue lock held.
- When clearing requeue flags, only clear the flags that have been
  acted upon.

Reviewed by: kib (previous version)
Discussed with: alc
Tested by: pho (part of a larger patch)
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21368

4 years agoAnnounce PCI Segment Groups supported to PCI host _OSC.
Alexander Motin [Mon, 26 Aug 2019 17:54:19 +0000 (17:54 +0000)]
Announce PCI Segment Groups supported to PCI host _OSC.

According to ACPI 6.3 specification:
    The OS sets this bit to 1 if it supports PCI Segment Groups as defined
    by the _SEG object, and access to the configuration space of devices
    in PCI Segment Groups as described by this specification.  Otherwise,
    the OS sets this bit to 0.

As far as I see we support both of those as PCI domains for quite a while.

MFC after: 2 months

4 years agoDon't consider PCIe hot-plug command timeout fatal.
Alexander Motin [Mon, 26 Aug 2019 17:27:36 +0000 (17:27 +0000)]
Don't consider PCIe hot-plug command timeout fatal.

According to my tests and errata to several generations of Intel CPUs,
PCIe hot-plug command completion reporting is not very reliable thing.
At least on my Supermicro X11DPi-NT board I never saw it reported.
Before this change timeout code detached devices and tried to disable
the slot, that in my case resulted in hot-plugged device being detached
just a second after it was successfully detected and attached.  This
change removes that, so in case of timeout it just prints the error and
continue operation.  Linux does the same.

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

4 years agoStop using des_cblock * for arguments to DES functions.
John Baldwin [Mon, 26 Aug 2019 17:25:07 +0000 (17:25 +0000)]
Stop using des_cblock * for arguments to DES functions.

This amounts to a char ** since it is a char[8] *.  Evil casts mostly
resolved the fact that what was actually passed in were plain char *.
Instead, change the DES functions to use 'unsigned char *' for keys
and for input and output buffers.

Reviewed by: cem, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D21389

4 years agoDon't hold the rs_mtx lock while calling malloc().
Michael Tuexen [Mon, 26 Aug 2019 16:23:47 +0000 (16:23 +0000)]
Don't hold the rs_mtx lock while calling malloc().

Reviewed by: rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D21416

4 years agoIdentify eMAG CPU used in Ampere Computing systems.
Michael Tuexen [Mon, 26 Aug 2019 16:12:14 +0000 (16:12 +0000)]
Identify eMAG CPU used in Ampere Computing systems.

Reviewed by: emaste@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21314

4 years agoMake it clear what the userland traces are in the ktrace(1) man page.
Edward Tomasz Napierala [Mon, 26 Aug 2019 10:18:19 +0000 (10:18 +0000)]
Make it clear what the userland traces are in the ktrace(1) man page.

MFC after: 2 weeks

4 years ago.Xr ports(7) and development(7).
Edward Tomasz Napierala [Mon, 26 Aug 2019 10:16:46 +0000 (10:16 +0000)]
.Xr ports(7) and development(7).

MFC after: 2 weeks

4 years agoComment boot block checks and perform additional sanity checks:
Xin LI [Mon, 26 Aug 2019 06:41:17 +0000 (06:41 +0000)]
Comment boot block checks and perform additional sanity checks:

The following checks are now being enforced:

 - bpbBytesPerSec: only accept 512, 1024, 2048 and 4096.
 - bpbSecPerClust: only accept 1, 2, 4, 8, 16, 32, 64 and 128.
 - bpbResSectors: require non-zero.
 - bpbFATs: require non-zero.
 - bpbSectors: require zero for FAT32.
 - bpbFATsmall: require zero for FAT32.
 - bpbHugeSectors: require non-zero for FAT32.

Bail out if the BPB contained values that do not meet these requirements.

We also require FATsecs * FATsecs to not overflow 32-bit unsigned
integer.

Check for backup boot block was removed because the checker does not take
corrective action, and msdosfs driver ignores it too.

4 years agoMFV r351500: Fix CLEAR_HASH macro to be usable as a single statement.
Xin LI [Mon, 26 Aug 2019 00:46:39 +0000 (00:46 +0000)]
MFV r351500:  Fix CLEAR_HASH macro to be usable as a single statement.

MFC after: 2 weeks

4 years agoImport vendor commit 38e8ce32afbaa82f67d992b9f3056f281fe69259:
Xin LI [Sun, 25 Aug 2019 23:51:44 +0000 (23:51 +0000)]
Import vendor commit 38e8ce32afbaa82f67d992b9f3056f281fe69259:
  Author: Mark Adler <madler@alumni.caltech.edu>
  Date:   Sun Jan 22 23:38:52 2017 -0800

    Fix CLEAR_HASH macro to be usable as a single statement.

    As it is used in deflateParams().

4 years agovfs: swap vop_unlock_post and vop_unlock_pre definitions to the logical order
Mateusz Guzik [Sun, 25 Aug 2019 22:30:18 +0000 (22:30 +0000)]
vfs: swap vop_unlock_post and vop_unlock_pre definitions to the logical order

The change is no-op.

Sponsored by: The FreeBSD Foundation

4 years agoReplace -Werror with ${WERROR} in pmcstudy
Warner Losh [Sun, 25 Aug 2019 22:06:26 +0000 (22:06 +0000)]
Replace -Werror with ${WERROR} in pmcstudy

4 years agoReplace -Werror with ${WERROR} in module builds
Warner Losh [Sun, 25 Aug 2019 22:06:17 +0000 (22:06 +0000)]
Replace -Werror with ${WERROR} in module builds

4 years agoHandle UMA_ANYDOMAIN in kstack_import().
Mark Johnston [Sun, 25 Aug 2019 21:14:46 +0000 (21:14 +0000)]
Handle UMA_ANYDOMAIN in kstack_import().

The kernel thread stack zone performs first-touch allocations by
default, and must handle the case where the local memory domain
is empty.  For most UMA zones this is handled in the keg layer,
but cache zones currently must implement a policy for this case.
Simply use a round-robin policy if UMA_ANYDOMAIN is passed.

Reported and tested by: bcran
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

4 years agoamd64: loose constraints on the APs dpcpu and nmi/dbg stack allocations.
Konstantin Belousov [Sun, 25 Aug 2019 21:01:40 +0000 (21:01 +0000)]
amd64: loose constraints on the APs dpcpu and nmi/dbg stack allocations.

Use DOMAINSET_PREF() instead of DOMAINSET_FIXED(), to gracefully
fallback in case of memory-less domain.

Reported and tested by: bcran
Reviewed by: markj
Sponsored by: The FreeBSD Foundation

4 years agoamd64: If domain-local page for pcpu cannot be allocated, keep use
Konstantin Belousov [Sun, 25 Aug 2019 20:57:39 +0000 (20:57 +0000)]
amd64: If domain-local page for pcpu cannot be allocated, keep use
existing one.

Allocation failure is possible for instance when cpu domain has no memory.

Reported and tested by: bcran
Reviewed by: markj
Sponsored by: The FreeBSD Foundation

4 years agonetmap: remove obsolete file
Vincenzo Maffione [Sun, 25 Aug 2019 20:16:03 +0000 (20:16 +0000)]
netmap: remove obsolete file

The netmap_pt.c module has become obsolete after
the refactoring that added netmap_kloop.c.
Remove it and unlink it from the build system.

MFC after: 1 week

4 years agopowerpc/booke: Clean up pmap a little for 64-bit
Justin Hibbits [Sun, 25 Aug 2019 20:11:35 +0000 (20:11 +0000)]
powerpc/booke: Clean up pmap a little for 64-bit

64-bit Book-E pmap doesn't need copy and zero bounce pages, nor the mutex.
Don't initialize them or reserve space for them.

4 years agopowerpc/booke: Use the DMAP if possible in pmap_map()
Justin Hibbits [Sun, 25 Aug 2019 20:08:48 +0000 (20:08 +0000)]
powerpc/booke: Use the DMAP if possible in pmap_map()

This avoids unnecessary TLB usage for statically mapped regions, such as
vm_page_array.

4 years agoFix bogusly declared WERRORs in kernel build
Warner Losh [Sun, 25 Aug 2019 19:39:31 +0000 (19:39 +0000)]
Fix bogusly declared WERRORs in kernel build

Many arm kernel configs bogusly specified WERROR=-Werror. There's no
reason for this because the default is that and there's no reason to
override. These date from a time when we needed to add additional
warning->error suppression. They are obsolete and were cut and paste
propagated from file to file.

Comment out all the WERROR=.... lines in powerpc. They aren't bogus,
but were appropriate for the old defaults for gcc4.2.1. Now that we've
made the policy decision to suppress -Werror by default on these
platforms, it is appropriate to comment these out. People wishing to
fix these errors can still un-comment them out, or say WERROR=-Werror
on the command line.

Fix two instances (cut and paste propagation) of hard-coded -Werror
in x86 code. Replace with ${WERROR} instead. This is a no-op change
except for people who build WERROR=-Wno-error :).

This should fix tinderbox / CI breakage.

4 years agoFix build (r351481).
Hiroki Sato [Sun, 25 Aug 2019 19:27:14 +0000 (19:27 +0000)]
Fix build (r351481).

4 years agoDocument soft updates journaling and GEOM-based UFS journaling.
Hiroki Sato [Sun, 25 Aug 2019 18:52:10 +0000 (18:52 +0000)]
Document soft updates journaling and GEOM-based UFS journaling.

Reviewed by: mckusick

4 years agoAdd MODULE_PNP_INFO() to vmci(4). This allows devd(8) to load the
Hiroki Sato [Sun, 25 Aug 2019 18:46:10 +0000 (18:46 +0000)]
Add MODULE_PNP_INFO() to vmci(4).  This allows devd(8) to load the
kernel module automatically when FreeBSD is running on VMware.

Reviewed by: mp
Differential Revision: https://reviews.freebsd.org/D21182

4 years agomixer(8): Report an error if the passed value is an empty string
Mateusz Piotrowski [Sun, 25 Aug 2019 17:55:31 +0000 (17:55 +0000)]
mixer(8): Report an error if the passed value is an empty string

This patch fixes a bug that made the mixer command enter
an infinite loop when instructed to set the value of a device
to an empty string (e.g., `mixer vol ""`).

Additionally, some tests for mixer(8) are being added.

PR: 240039
Reviewed by: hselasky, mav
Approved by: src (hselasky, mav)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21409

4 years agoRemove zlib 1.0.4 from kernel.
Xin LI [Sun, 25 Aug 2019 17:13:00 +0000 (17:13 +0000)]
Remove zlib 1.0.4 from kernel.

PR: 229763
Reviewed by: emaste, Yoshihiro Ota <ota j email ne jp>
Differential Revision: https://reviews.freebsd.org/D21375

4 years agoMove OBJT_VNODE specific code from vm_object_terminate() to
Konstantin Belousov [Sun, 25 Aug 2019 13:26:06 +0000 (13:26 +0000)]
Move OBJT_VNODE specific code from vm_object_terminate() to
vnode_destroy_vobject().

Reviewed by: alc, jeff (previous version), markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21357

4 years agoGZIO: Update to use zlib 1.2.11.
Xin LI [Sun, 25 Aug 2019 07:50:44 +0000 (07:50 +0000)]
GZIO: Update to use zlib 1.2.11.

PR: 229763
Submitted by: Yoshihiro Ota <ota j email ne jp>
Differential Revision: https://reviews.freebsd.org/D21408

4 years agovm_map_simplify_entry considers merging an entry with its two
Doug Moore [Sun, 25 Aug 2019 07:06:51 +0000 (07:06 +0000)]
vm_map_simplify_entry considers merging an entry with its two
neighbors, and is used in a way so that if entries a and b cannot be
merged, we consider them twice, first not-merging a with its successor
b, and then not-merging b with its predecessor a. This change replaces
vm_map_simplify_entry with vm_map_try_merge_entries, which compares
two adjacent entries only, and uses it to avoid duplicated
merge-checks.

Tested by: pho
Reviewed by: alc
Approved by: markj (implicit)
Differential Revision: https://reviews.freebsd.org/D20814

4 years agonullfs: reduce areas protected by vnode interlock
Mateusz Guzik [Sun, 25 Aug 2019 05:13:15 +0000 (05:13 +0000)]
nullfs: reduce areas protected by vnode interlock

Some places only take the interlock to hold the vnode, which was a requiremnt
before they started being manipulated with atomics. Use the newly introduced
vholdnz to bump the count.

Reviewed by: kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21358

4 years agovfs: add vholdnz (for already held vnodes)
Mateusz Guzik [Sun, 25 Aug 2019 05:11:43 +0000 (05:11 +0000)]
vfs: add vholdnz (for already held vnodes)

Reviewed by: kib (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21358

4 years agotests: shm_open(2): Verify FD_CLOEXEC
Kyle Evans [Sun, 25 Aug 2019 02:38:45 +0000 (02:38 +0000)]
tests: shm_open(2): Verify FD_CLOEXEC

Motivated by the fact that I'm messing around near the implementation and
wanting to ensure this doesn't get messed up in the process.

MFC after: 1 week

4 years agolast(1): fix style after r351459
Eugene Grosbein [Sun, 25 Aug 2019 01:05:01 +0000 (01:05 +0000)]
last(1): fix style after r351459

Reported by: cem
MFC after: 2 weeks
X-MFC-With: 351459

4 years agoping: fix unaligned access to ancillary data
Alan Somers [Sat, 24 Aug 2019 18:00:18 +0000 (18:00 +0000)]
ping: fix unaligned access to ancillary data

Use CMSG_FIRSTHDR rather than assume that an array is correctly aligned.
Fixes warnings on sparc64 and powerpcspe.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFH: 2 weeks
Sponsored by: Google LLC (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21406

4 years agolast(1): correction after r351413
Eugene Grosbein [Sat, 24 Aug 2019 15:50:13 +0000 (15:50 +0000)]
last(1): correction after r351413

Make that change no-op for C/POSIX locale just like for UTF-8
that it superset of US-ASCII.

MFC after: 2 weeks
X-MFC-With: r351413

4 years agoAdd nvdimm(4) man page.
Konstantin Belousov [Sat, 24 Aug 2019 15:38:07 +0000 (15:38 +0000)]
Add nvdimm(4) man page.

Reviewed by: emaste
Discussed with: scottl, scottph
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D21386

4 years agoamd64: rework PCPU allocation
Konstantin Belousov [Sat, 24 Aug 2019 15:31:31 +0000 (15:31 +0000)]
amd64: rework PCPU allocation

Move pcpu KVA out of .bss into dynamically allocated VA at
pmap_bootstrap().  This avoids demoting superpage mapping .data/.bss.
Also it makes possible to use pmap_qenter() for installation of
domain-local pcpu page on NUMA configs.

Refactor pcpu and IST initialization by moving it to helper functions.

Reviewed by: markj
Tested by: pho
Discussed with: jeff
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D21320

4 years agoDo not constrain allocations for doublefault, boot, and mce stacks.
Konstantin Belousov [Sat, 24 Aug 2019 15:28:40 +0000 (15:28 +0000)]
Do not constrain allocations for doublefault, boot, and mce stacks.

All these stacks are used only once (doublefault, boot) or very rare
(mce).

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D21320

4 years agoStyle.
Konstantin Belousov [Sat, 24 Aug 2019 15:25:53 +0000 (15:25 +0000)]
Style.

4 years agoRemove unecessary VM_ALLOC_ZERO from allocation of the domain-local
Konstantin Belousov [Sat, 24 Aug 2019 15:22:18 +0000 (15:22 +0000)]
Remove unecessary VM_ALLOC_ZERO from allocation of the domain-local
page for pcpu.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D21320

4 years agoMake stack grow use the same gap as stack create.
Konstantin Belousov [Sat, 24 Aug 2019 14:29:13 +0000 (14:29 +0000)]
Make stack grow use the same gap as stack create.

Store stack_guard_page * PAGE_SIZE into the gap->next_read field at
the time of the stack creation.  This makes the used guard size
consistent between stack creation and stack grow time.

Suggested by: alc
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21384

4 years agodtso: allwinner: Add an overlay for H3 thermal node
Ganbold Tsagaankhuu [Sat, 24 Aug 2019 13:26:34 +0000 (13:26 +0000)]
dtso: allwinner: Add an overlay for H3 thermal node

Reviewed by: manu

4 years agoFix failure test cases after r351423 due to ping6(8) options changed
Li-Wen Hsu [Sat, 24 Aug 2019 01:28:39 +0000 (01:28 +0000)]
Fix failure test cases after r351423 due to ping6(8) options changed

Failure test cases:
    sys.netpfil.common.pass_block.pf_v6
    sys.netpfil.pf.pass_block.noalias
    sys.netpfil.pf.pass_block.v6

Sponsored by: The FreeBSD Foundation

4 years agoRemove the obsolete pcpu_zone_ptr zone.
Mateusz Guzik [Sat, 24 Aug 2019 00:01:19 +0000 (00:01 +0000)]
Remove the obsolete pcpu_zone_ptr zone.

It was only used by flowtable (removed in r321618).

Sponsored by: The FreeBSD Foundation

4 years agoIt turns out the duplication is only mostly harmless.
Warner Losh [Fri, 23 Aug 2019 22:52:58 +0000 (22:52 +0000)]
It turns out the duplication is only mostly harmless.

While it worked with the kenrel, it wasn't working with the loader.
It failed to handle dependencies correctly. The reason for that is
that we never created a nvme module with the DRIVER_MODULE, but
instead a nvme_pci and nvme_ahci module. Create a real nvme module
that nvd can be dependent on so it can import the nvme symbols it
needs from there.

Arguably, nvd should just be a simple child of nvme, but transitioning
to that (and winning that argument given why it was done this way) is
beyond the scope of this change.

Reviewed by: jhb@
Differential Revision: https://reviews.freebsd.org/D21382

4 years agocxgbe/t4_tom: Any invalid scaling factor in the hardware's wsf field
Navdeep Parhar [Fri, 23 Aug 2019 22:41:16 +0000 (22:41 +0000)]
cxgbe/t4_tom: Any invalid scaling factor in the hardware's wsf field
implies that window scaling is not in use.

MFC after: 3 days
Sponsored by: Chelsio Communications

4 years agowhitespace nit.
Navdeep Parhar [Fri, 23 Aug 2019 22:34:14 +0000 (22:34 +0000)]
whitespace nit.

4 years agocxgbe(4): Use the same buffer size for TOE rx queues as the NIC rx queues.
Navdeep Parhar [Fri, 23 Aug 2019 22:22:34 +0000 (22:22 +0000)]
cxgbe(4): Use the same buffer size for TOE rx queues as the NIC rx queues.

This is a minor simplification.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoping: Fix alignment errors
Alan Somers [Fri, 23 Aug 2019 22:04:26 +0000 (22:04 +0000)]
ping: Fix alignment errors

This fixes -Wcast-align errors when compiled with WARNS=6.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google LLC (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21327

4 years agovfs: assert the lock held in MNT_REF/MNT_REL
Mateusz Guzik [Fri, 23 Aug 2019 21:05:37 +0000 (21:05 +0000)]
vfs: assert the lock held in MNT_REF/MNT_REL

Sponsored by: The FreeBSD Foundation

4 years agoStop clearing page flags in vm_page_pqbatch_submit().
Mark Johnston [Fri, 23 Aug 2019 19:53:11 +0000 (19:53 +0000)]
Stop clearing page flags in vm_page_pqbatch_submit().

All existing callers guarantee that the page does not have a
pre-existing dequeue pending.  Thus, if the page is dequeued before
pqbatch_submit() acquires the page queue lock, we do not need to do
anything since vm_page_dequeue_complete() takes care of clearing all
page queue state flags for us.

With this change, vm_page_pqbatch_submit() has the nice property that it
does not directly modify any fields in the page structure.

Reviewed by: alc, kib
Tested by: pho (part of a larger change)
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21372

4 years agoMake vm_pqbatch_submit_page() externally visible.
Mark Johnston [Fri, 23 Aug 2019 19:49:29 +0000 (19:49 +0000)]
Make vm_pqbatch_submit_page() externally visible.

It will become useful for the page daemon to be able to directly create
a batch queue entry for a page, and without modifying the page
structure.  Rename vm_pqbatch_submit_page() to vm_page_pqbatch_submit()
to keep the namespace consistent.  No functional change intended.

Reviewed by: alc, kib
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21369

4 years agoDe-commision the MNTK_NOINSMNTQ kernel mount flag.
Konstantin Belousov [Fri, 23 Aug 2019 19:40:10 +0000 (19:40 +0000)]
De-commision the MNTK_NOINSMNTQ kernel mount flag.

After all the changes, its dynamic scope is same as for MNTK_UNMOUNT,
but to allow the syncer vnode to be re-installed on unmount failure.
But the case of syncer was already handled by using the VV_FORCEINSMQ
flag for quite some time.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoFix universe to include arm LINT kernel configs.
John Baldwin [Fri, 23 Aug 2019 18:26:34 +0000 (18:26 +0000)]
Fix universe to include arm LINT kernel configs.

Strip comments from the NOTES.armv[57] files as is done for other
NOTES files when building the corresponding LINT configs.  Without
this, the LINT configs contained the NO_UNIVERSE comment from the
NOTES.armv[57] files.

Reviewed by: imp
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21264

4 years agoTurn off -Werror for gcc 4.2.1 for userland
Warner Losh [Fri, 23 Aug 2019 16:42:39 +0000 (16:42 +0000)]
Turn off -Werror for gcc 4.2.1 for userland

As discussed on arch@, gcc 4.2.1 is on its way out. Turn off Werror on gcc
versions < 5.0 permantly. This will allow older platforms to continue to compile
w/o new errors once we take them out of universe by default. This will also free
developers from chasing down obsolete warnings that produce no beneficial
changes to the source.

Discussed on: arch@
Reviewed by: jhb@, emaste@, pfg@
Differential Revision: https://reviews.freebsd.org/D21378

4 years agoTurn off -Werror for gcc 4.2.1
Warner Losh [Fri, 23 Aug 2019 16:42:04 +0000 (16:42 +0000)]
Turn off -Werror for gcc 4.2.1

As part of marching gcc 4.2.1 out of the tree, turn off -Werror on gcc 4.2.1
compiles by default. It generates too many false positives and breaks CI
for no benefit.

Discussed on: arch@
Reviewed by: jhb@, emaste@, pfg@
Differential Revision: https://reviews.freebsd.org/D21378

4 years agovtfontcvt: simplify rshift_row
Ed Maste [Fri, 23 Aug 2019 16:03:23 +0000 (16:03 +0000)]
vtfontcvt: simplify rshift_row

We don't need to specify the buffer size in both bytes and bits.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoping: fix include guard symbol name to reflect the header file name
Alan Somers [Fri, 23 Aug 2019 15:24:18 +0000 (15:24 +0000)]
ping: fix include guard symbol name to reflect the header file name

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
MFC-With: 351171
Sponsored by: Google LLC (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21374

4 years agoping6: Rename options for better consistency with ping
Alan Somers [Fri, 23 Aug 2019 15:22:20 +0000 (15:22 +0000)]
ping6: Rename options for better consistency with ping

Now equivalent options have the same flags, and nonequivalent options have
different flags.  This is a prelude to merging the two commands.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC: Never
Sponsored by: Google LLC (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21345

4 years agoReport Clock Power Management support and status.
Alexander Motin [Fri, 23 Aug 2019 15:17:04 +0000 (15:17 +0000)]
Report Clock Power Management support and status.

Since we already report ASPM, why not to go further.

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

4 years agonetpfil tests: Add forward test for the three firewalls
Kristof Provost [Fri, 23 Aug 2019 12:11:46 +0000 (12:11 +0000)]
netpfil tests: Add forward test for the three firewalls

Submitted by: Ahsan Barkati
Reviewed by: kp
Sponsored by: Google, Inc. (GSoC 2019)
Differential Revision: https://reviews.freebsd.org/D21321

4 years agoConvert ng_deflate to use new zlib.
Xin LI [Fri, 23 Aug 2019 07:24:36 +0000 (07:24 +0000)]
Convert ng_deflate to use new zlib.

This removes the last consumer of the modified zlib originally
bundled with Paul's PPP implementation, which will be removed
in a follow up commit.

PR: 229763
Differential Revision: https://reviews.freebsd.org/D21186

4 years agoINVARIANTS: treat LA_LOCKED as the same of LA_XLOCKED in mtx_assert.
Xin LI [Fri, 23 Aug 2019 06:39:40 +0000 (06:39 +0000)]
INVARIANTS: treat LA_LOCKED as the same of LA_XLOCKED in mtx_assert.

The Linux lockdep API assumes LA_LOCKED semantic in lockdep_assert_held(),
meaning that either a shared lock or write lock is Ok.  On the other hand,
the timeout code uses lc_assert() with LA_XLOCKED, and we need both to
work.

For mutexes, because they can not be shared (this is unique among all lock
classes, and it is unlikely that we would add new lock class anytime soon),
it is easier to simply extend mtx_assert to handle LA_LOCKED there, despite
the change itself can be viewed as a slight abstraction violation.

Reviewed by: mjg, cem, jhb
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D21362

4 years agolib.libc.gen.getmntinfo_test.getmntinfo_test is unstable since 8/20, skip it
Li-Wen Hsu [Fri, 23 Aug 2019 05:25:21 +0000 (05:25 +0000)]
lib.libc.gen.getmntinfo_test.getmntinfo_test is unstable since 8/20, skip it
in CI env temporarily for more offline diagnosis

PR: 240049
Sponsored by: The FreeBSD Foundation

4 years agoProperly update FSInfo block after generation.
Xin LI [Fri, 23 Aug 2019 05:23:45 +0000 (05:23 +0000)]
Properly update FSInfo block after generation.

After populating the filesystem, write a FSInfo block with
proper information.

Reviewed by: emaste, cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21363

4 years agolast(1): unbreak for 8-bit locales
Eugene Grosbein [Fri, 23 Aug 2019 01:25:38 +0000 (01:25 +0000)]
last(1): unbreak for 8-bit locales

Ouput format of last(1) is broken for non UTF-8 locales
since it got libxo(3) support. It uses strftime(3) that produces
non UTF-8 strings passed to xo_emit(3) with wrong %s format -
it should be %hs in this case, so xo_emit(3) produces empty output.

This change is basically no-op when locale is of UTF-8 type,
f.e. en_GB.UTF-8 or ru_RU.UTF-8 or sr_RS.UTF-8@latin.
It fixes output for other locales.

MFC after: 2 weeks

4 years agostand: boot2: fix amd64-xtoolchain-gcc build
Kyle Evans [Fri, 23 Aug 2019 01:16:12 +0000 (01:16 +0000)]
stand: boot2: fix amd64-xtoolchain-gcc build

-Wno-missing-declarations is the GCC equivalent of
-Wno-missing-prototypes... this was overlooked in r351135.

MFC after: 3 days
X-MFC-With: r351135