]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoFix IPv6 regression introduced by r362900.
melifaro [Fri, 3 Jul 2020 08:06:26 +0000 (08:06 +0000)]
Fix IPv6 regression introduced by r362900.

PR: kern/247729

3 years agoFix build breakage caused by r362903. Only pmap.h is needed now, but
rmacklem [Fri, 3 Jul 2020 05:21:05 +0000 (05:21 +0000)]
Fix build breakage caused by r362903. Only pmap.h is needed now, but
vm_page.h and vm_pageout.h is needed later, so put them in now.

Pointy hat goes on me.

3 years agocxgbe(4): changes in the Tx path to help increase tx coalescing.
np [Fri, 3 Jul 2020 04:44:23 +0000 (04:44 +0000)]
cxgbe(4): changes in the Tx path to help increase tx coalescing.

- Ask the firmware for the number of frames that can be stuffed in one
  work request.

- Modify mp_ring to increase the likelihood of tx coalescing when there
  are just one or two threads that are doing most of the tx.  Add teeth
  to the abdication mechanism by pushing the consumer lock into mp_ring.
  This reduces the likelihood that a consumer will get stuck with all
  the work even though it is above its budget.

- Add support for coalesced tx WR to the VF driver.  This, with the
  changes above, results in a 7x improvement in the tx pps of the VF
  driver for some common cases.  The firmware vets the L2 headers
  submitted by the VF driver and it's a big win if the checks are
  performed for a batch of packets and not each one individually.

Reviewed by: jhb@
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25454

3 years agoTemporarily skip sys.netinet6.redirect.valid_redirect in CI
lwhsu [Fri, 3 Jul 2020 02:02:34 +0000 (02:02 +0000)]
Temporarily skip sys.netinet6.redirect.valid_redirect in CI

PR: 247729
Sponsored by: The FreeBSD Foundation

3 years agoAdd support for ext_pgs mbufs to nfsm_build().
rmacklem [Fri, 3 Jul 2020 01:19:29 +0000 (01:19 +0000)]
Add support for ext_pgs mbufs to nfsm_build().

This is the first of a series of commits that add support to the NFS client
and server for building RPC messages in ext_pgs mbufs with anonymous pages.
This is useful so that the entire mbuf list does not need to be
copied before calling sosend() when NFS over TLS is enabled.

Since ND_EXTPG is never set yet, there is no semantic change at this time.

3 years agoConsolidate duplicated logic in csu Makefiles to lib/csu/Makefile.inc.
jhb [Fri, 3 Jul 2020 00:09:41 +0000 (00:09 +0000)]
Consolidate duplicated logic in csu Makefiles to lib/csu/Makefile.inc.

Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25537

3 years agoUse canonical description for Schlacht bei Königgrätz, add year.
grog [Thu, 2 Jul 2020 22:59:05 +0000 (22:59 +0000)]
Use canonical description for Schlacht bei Königgrätz, add year.

3 years agoComplete conversions from fib<4|6>_lookup_nh_<basic|ext> to fib<4|6>_lookup().
melifaro [Thu, 2 Jul 2020 21:04:08 +0000 (21:04 +0000)]
Complete conversions from fib<4|6>_lookup_nh_<basic|ext> to fib<4|6>_lookup().

fib[46]_lookup_nh_ represents pre-epoch generation of fib api, providing less guarantees
 over pointer validness and requiring on-stack data copying.

With no callers remaining, remove fib[46]_lookup_nh_ functions.

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Differential Revision: https://reviews.freebsd.org/D25445

3 years agoFix page fault in zfsctl_snapdir_getattr
asomers [Thu, 2 Jul 2020 13:17:31 +0000 (13:17 +0000)]
Fix page fault in zfsctl_snapdir_getattr

Must acquire the z_teardown_lock before accessing the zfsvfs_t object. I
can't reproduce this panic on demand, but this looks like the correct
solution.

PR: 247668
Reviewed by: avg
MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D25543

3 years agocred: add a prediction to crfree for td->td_realucred == cr
mjg [Thu, 2 Jul 2020 12:58:07 +0000 (12:58 +0000)]
cred: add a prediction to crfree for td->td_realucred == cr

This matches crhold and eliminates an assembly maze in the common case.

3 years agocache: add missing call to cache_ncp_invalid for negative hits
mjg [Thu, 2 Jul 2020 12:56:20 +0000 (12:56 +0000)]
cache: add missing call to cache_ncp_invalid for negative hits

Note the dtrace probe can fire even the entry is gone, but I don't think that's
worth fixing.

3 years agocache: fix misplaced fence in cache_ncp_invalidate
mjg [Thu, 2 Jul 2020 12:54:50 +0000 (12:54 +0000)]
cache: fix misplaced fence in cache_ncp_invalidate

The intent was to mark the entry as invalid before cache_zap starts messing
with it.

While here add some comments.

3 years agomlx5_core: remove unneccessary LFENCE instruction.
kib [Thu, 2 Jul 2020 10:44:45 +0000 (10:44 +0000)]
mlx5_core: remove unneccessary LFENCE instruction.

Use fence instead of barrier, which is optimized to take advantage of
the x86 TSO memory model.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
MFC after: 1 week

3 years agolinuxkpi: improvements for linux_pid_task() and linux_get_pid_task().
kib [Thu, 2 Jul 2020 10:42:58 +0000 (10:42 +0000)]
linuxkpi: improvements for linux_pid_task() and linux_get_pid_task().

Unify functions bodies.
Do not call tdfind() if pid is passed, and do not call pfind() if tid
is supplied.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25534

3 years agoUse tdfind() in pget().
kib [Thu, 2 Jul 2020 10:40:47 +0000 (10:40 +0000)]
Use tdfind() in pget().

Reviewed by: jhb, hselasky
Sponsored by: Mellanox Technologies
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25532

3 years agoloader: zfs reader does not need BOOT2 bits
tsoome [Thu, 2 Jul 2020 07:15:48 +0000 (07:15 +0000)]
loader: zfs reader does not need BOOT2 bits

After switching zfsloader to use full libsa, we do not need
spa_get_primary() and spa_get_primary_vdev() any more.

Sponsored by: Netflix, Klara Inc.

3 years agoloader: potential memory leak and check return values
tsoome [Thu, 2 Jul 2020 07:03:15 +0000 (07:03 +0000)]
loader: potential memory leak and check return values

Need to free nvlist before return from vdev_from_nvlist().

Sponsored by: Netflix, Klara Inc.

3 years agoriscv pmap: zero reserved pte bits in ppn
kp [Wed, 1 Jul 2020 19:15:43 +0000 (19:15 +0000)]
riscv pmap: zero reserved pte bits in ppn

The top 10 bits of a pte are reserved by specification[1] and are not part of
the PPN.

[1] 'Volume II: RISC-V Privileged Architectures V20190608-Priv-MSU-Ratified',
'4.4.1 Addressing and Memory Protection', page 72: "The PTE format for Sv39 is
shown in Figure 4.18. ... Bits 63–54 are reserved for future use and must be
zeroed by software for forward compatibility."

Submitted by: Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Reviewed by: kp, mhorne
Differential Revision: https://reviews.freebsd.org/D25523

3 years agoriscv locore.S: load constant prior to loop
kp [Wed, 1 Jul 2020 19:12:47 +0000 (19:12 +0000)]
riscv locore.S: load constant prior to loop

A very minor micro-optimization; t0 is not clobbered between the loop top and
bottom and there appear to be no other branches to this label.

Submitted by: Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Reviewed by: mhorne
Differential Revision: https://reviews.freebsd.org/D25524

3 years agoriscv: Log missing registers in dump_regs()
kp [Wed, 1 Jul 2020 19:11:02 +0000 (19:11 +0000)]
riscv: Log missing registers in dump_regs()

If we panic we dump the registers for debugging. This is very useful, but it
missed several registers (ra, sp, gp and tp).

Log these as well. Especially the return address value is extremely useful.

Sponsored by: Axiado

3 years agoFix the cleanup handling in a error path for TCP BBR.
tuexen [Wed, 1 Jul 2020 17:17:06 +0000 (17:17 +0000)]
Fix the cleanup handling in a error path for TCP BBR.

Reported by: syzbot+df7899c55c4cc52f5447@syzkaller.appspotmail.com
Reviewed by: rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D25486

3 years agoRead the CPU 0 arm64 ID registers early in initarm
andrew [Wed, 1 Jul 2020 16:57:57 +0000 (16:57 +0000)]
Read the CPU 0 arm64 ID registers early in initarm

We also update the kernel view early in the boot. This will allow the
use of the common kernel view in ifunc resolvers.

Sponsored by: Innovate UK

3 years agoprintf(1): Add EXAMPLES section
fernape [Wed, 1 Jul 2020 16:33:32 +0000 (16:33 +0000)]
printf(1): Add EXAMPLES section

 * Small addition with four simple examples
 * While here, remove three obsolete .Tn macros

Approved by: manpages (gbe)
Differential Revision: https://reviews.freebsd.org/D25462

3 years agoMove ID reading signatures to a better header
andrew [Wed, 1 Jul 2020 16:17:51 +0000 (16:17 +0000)]
Move ID reading signatures to a better header

The functions to read the common user and kernel ID registers should be
in cpu.h rather than undefined.h as they are related to CPU details and
used by undefined instruction handlers.

Sponsored by: Innovate UK

3 years agoFix a possible next-hop refcount leak when handling IPSec traffic.
markj [Wed, 1 Jul 2020 15:42:48 +0000 (15:42 +0000)]
Fix a possible next-hop refcount leak when handling IPSec traffic.

It may be possible to fix this by deferring the lookup, but let's
keep the initial change simple to make MFCs easier.

PR: 246951
Reviewed by: melifaro
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25519

3 years agoUpdate with the members of the 11th core team, core.xi
bofh [Wed, 1 Jul 2020 15:30:27 +0000 (15:30 +0000)]
Update with the members of the 11th core team, core.xi
- Update the core-secretary role.
- Update the comment to mention that the sorting is done based on FreeBSD
  login name

Reported by: bofh (with core-secretary@ hat on)
Reviewed by: bcr
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D25526

3 years agoRead the arm64 ID registers earlier in the boot process.
andrew [Wed, 1 Jul 2020 15:17:45 +0000 (15:17 +0000)]
Read the arm64 ID registers earlier in the boot process.

Also move parsing the registers to just after the secondary CPUs have
started. This means the kernel register view from all CPUs is available
after the CPU SYSINITs have finished, e.g. for use by ifunc resolvers.

Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D25505

3 years agoSimplify the flow when getting/setting an isrc
andrew [Wed, 1 Jul 2020 12:07:28 +0000 (12:07 +0000)]
Simplify the flow when getting/setting an isrc

Rather than unlocking and returning we can just perform the needed action
only when the interrupt source is valid and reuse the unlock in both the
valid irq and invalid irq cases.

Sponsored by: Innovate UK

3 years agoRework linux accept(2). This makes the code flow easier to follow,
trasz [Wed, 1 Jul 2020 10:37:08 +0000 (10:37 +0000)]
Rework linux accept(2).  This makes the code flow easier to follow,
and fixes a bug where calling accept(2) could result in closing fd 0.

Note that the code still contains a number of problems: it makes
assumptions about l_sockaddr_in being the same as sockaddr_in,
the EFAULT-related code looks like it doesn't work at all, and the
socket type check is racy.  Those will be addressed later on;
I'm trying to work in small steps to avoid breaking one thing while
fixing another.

It fixes Redis, among other things.

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

3 years agoThe "pid" field in the LinuxKPI task struct is typically set to the thread ID
hselasky [Wed, 1 Jul 2020 08:23:57 +0000 (08:23 +0000)]
The "pid" field in the LinuxKPI task struct is typically set to the thread ID
and not the process ID. Make sure the linux_task_exiting() function uses tdfind()
to lookup the BSD procedure structure pointer by the "pid" field, and only
fallback to pfind() when no match is found! This makes linux_task_exiting()
in line with the rest of the code.

Differential Revision: https://reviews.freebsd.org/D25509
Submitted by: Greg V <greg@unrelenting.technology>
MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agocache: lockless forward lookup with smr
mjg [Wed, 1 Jul 2020 05:59:08 +0000 (05:59 +0000)]
cache: lockless forward lookup with smr

This eliminates the need to take bucket locks in the common case.

Concurrent lookup utilizng the same vnodes is still bottlenecked on referencing
and locking path components, this will be taken care of separately.

Reviewed by: kib
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D23913

3 years agovfs: protect vnodes with smr
mjg [Wed, 1 Jul 2020 05:56:29 +0000 (05:56 +0000)]
vfs: protect vnodes with smr

vget_prep_smr and vhold_smr can be used to ref a vnode while within vfs_smr
section, allowing consumers to get away without locking.

See vhold_smr and vdropl for comments explaining caveats.

Reviewed by: kib
Testec by: pho
Differential Revision: https://reviews.freebsd.org/D23913

3 years agoAllow some Bluetooth LE related HCI request to non-root user.
takawata [Wed, 1 Jul 2020 04:00:54 +0000 (04:00 +0000)]
Allow some Bluetooth LE related HCI request to non-root user.

PR: 247588
Reported by: Greg V (greg@unrelenting.technology)
Reviewed by: emax
Differential Revision: https://reviews.freebsd.org/D25516

3 years agolibifconfig: Add function to get bridge status
freqlabs [Wed, 1 Jul 2020 02:32:41 +0000 (02:32 +0000)]
libifconfig: Add function to get bridge status

The new function operates similarly to ifconfig_lagg_get_lagg_status and
likewise is accompanied by a function to free the bridge status data structure.

I have included in this patch the relocation of some strings describing STP
parameters and the PV2ID macro from ifconfig into net/if_bridgevar.h as they
are useful for consumers of libifconfig.

Reviewed by: kp, melifaro, mmacy
Approved by: mmacy (mentor)
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D25460

3 years agogeom(4): Kill GEOM_PART_EBR_COMPAT option
cem [Wed, 1 Jul 2020 02:16:36 +0000 (02:16 +0000)]
geom(4): Kill GEOM_PART_EBR_COMPAT option

Take advantage of Warner's nice new real GEOM aliasing system and use it for
aliased partition names that actually work.

Our canonical EBR partition name is the weird, not-default-on-x86-prior-to-
this-revision "da1p4+00001234."  However, if compatibility mode (tunable
kern.geom.part.ebr.compat_aliases) is enabled (1, default), we continue to
provide the alias names like "da1p5" in addition to the weird canonical
names.

Naming partition providers was just one aspect of the COMPAT knob; in
addition it limited mutability, in part because it did not preserve existing
EBR header content aside from that of LBA 0.  This change saves the EBR
header for LBA 0, as well as for every EBR partition encountered.  That way,
when we write out the EBR partition table on modification, we can restore
any bootloader or other metadata in both LBA0 (the first data-containing EBR
may start after 0) as well as every logical EBR we read from the disk, and
only update the geometry metadata and linked list pointers that describe the
actual partitioning.

(This change does not add support for the 'bootcode' verb to EBR.)

PR: 232463
Reported by: Manish Jain <bourne.identity AT hotmail.com>
Discussed with: ae (no objection)
Relnotes: maybe
Differential Revision: https://reviews.freebsd.org/D24939

3 years agoReplace OPENSSL_NO_SSL3_METHODs with dummies
cem [Wed, 1 Jul 2020 00:59:28 +0000 (00:59 +0000)]
Replace OPENSSL_NO_SSL3_METHODs with dummies

SSLv3 has been deprecated since 2015 (and broken since 2014: "POODLE"); it
should not have shipped in FreeBSD 11 (2016) or 12 (2018).  No one should use
it, and if they must, they can use some implementation outside of base.

There are three symbols removed with OPENSSL_NO_SSL3_METHOD:

SSLv3_client_method
SSLv3_method
SSLv3_server_method

These symbols exist to request an explicit SSLv3 connection to a server.
There is no good reason for an application to link or invoke these symbols
instead of TLS_method(), et al (née SSLv23_method, et al).  Applications
that do so have broken cryptography.

Define these symbols for some pedantic definition of ABI stability, but
remove the functionality again (r361392) after r362620.

Reviewed by: gordon, jhb (earlier-but-equivalent version both)
Discussed with: bjk, kib
Differential Revision: https://reviews.freebsd.org/D25493

3 years agoAdd i.MX 8M Quad support
gonzo [Wed, 1 Jul 2020 00:33:16 +0000 (00:33 +0000)]
Add i.MX 8M Quad support

- Add CCM driver and clocks implementations for i.MX 8M
- Add GPC driver for iMX8
- Add clock tree for i.MX 8M Quad
- Add clocks support and new compat strings (where required) for existing i.MX 6 UART, I2C, and GPIO drivers
- Enable aarch64-compatible drivers form i.MX 6 in arm64 GENERIC kernel config
- Add dtb/imx8 kernel module with DTBs for Nitrogen8M and iMX8MQ EVK

With this patch both Nitrogen8M and iMX8MQ EVK boot with NFS root up to multiuser login prompt

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D25274

3 years ago[net80211] Commit files missing in the previous commit
adrian [Wed, 1 Jul 2020 00:24:55 +0000 (00:24 +0000)]
[net80211] Commit files missing in the previous commit

These belong to my previous commit, but apparently I typed ieee80211_vhf.[ch]
and forgot ht.h.  Le oops.

3 years ago[net80211] Migrate HT/legacy protection mode and preamble calculation to per-VAP...
adrian [Wed, 1 Jul 2020 00:23:49 +0000 (00:23 +0000)]
[net80211] Migrate HT/legacy protection mode and preamble calculation to per-VAP flags

The later firmware devices (including iwn!) support multiple configuration
contexts for a lot of things, leaving it up to the firmware to decide
which channel and vap is active.  This allows for things like off-channel
p2p sta/ap operation and other weird things.

However, net80211 is still focused on a "net80211 drives all" when it comes to driving
the NIC, and as part of this history a lot of these options are global and not per-VAP.
This is fine when net80211 drives things and all VAPs share a single channel - these
parameters importantly really reflect the state of the channel! - but it will increasingly
be not fine when we start supporting more weird configurations and more recent NICs.
Yeah, recent like iwn/iwm.

Anyway - so, migrate all of the HT protection, legacy protection and preamble
stuff to be per-VAP.  The global flags are still there; they're now calculated
in a deferred taskqueue that mirrors the old behaviour.  Firmware based drivers
which have per-VAP configuration of these parameters can now just listen to the
per-VAP options.

What do I mean by per-channel? Well, the above configuration parameters really
are about interoperation with other devices on the same channel. Eg, HT protection
mode will flip to legacy/mixed if it hears ANY BSS that supports non-HT stations or
indicates it has non-HT stations associated.  So, these flags really should be
per-channel rather than per-VAP, and then for things like "do i need short preamble
or long preamble?" turn into a "do I need it for this current operating channel".
Then any VAP using it can query the channel that it's on, reflecting the real
required state.

This patch does none of the above paragraph just yet.

I'm also cheating a bit - I'm currently not using separate taskqueues for
the beacon updates and the per-VAP configuration updates.  I can always further
split it later if I need to but I didn't think it was SUPER important here.

So:

* Create vap taskqueue entries for ERP/protection, HT protection and short/long
  preamble;
* Migrate the HT station count, short/long slot station count, etc - into per-VAP
  variables rather than global;
* Fix a bug with my WME work from a while ago which made it per-VAP - do the WME
  beacon update /after/ the WME update taskqueue runs, not before;
* Any time the HT protmode configuration changes or the ERP protection mode
  config changes - schedule the task, which will call the driver without the
  net80211 lock held and all correctly serialised;
* Use the global flags for beacon IEs and VAP flags for probe responses and
  other IE situations.

The primary consumer of this is ath10k.  iwn could use it when sending RXON,
but we don't support IBSS or AP modes on it yet, and I'm not yet sure whether
it's required in STA mode (ie whether the firmware parses beacons to change
protection mode or whether we need to.)

Tested:

* AR9280, STA/AP
* AR9380, DWDS STA+STA/AP
* ath10k work, STA/AP
* Intel 6235, STA
* Various rtwn / run NICs, DWDS STA and STA configurations

3 years agoConvert cryptostats to a counter_u64 array.
markj [Tue, 30 Jun 2020 22:01:21 +0000 (22:01 +0000)]
Convert cryptostats to a counter_u64 array.

The global counters were not SMP-friendly.  Use per-CPU counters
instead.

Reviewed by: jhb
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D25466

3 years agoFix a bug introduced in https://svnweb.freebsd.org/changeset/base/362173
tuexen [Tue, 30 Jun 2020 21:50:05 +0000 (21:50 +0000)]
Fix a bug introduced in https://svnweb.freebsd.org/changeset/base/362173

Reported by: syzbot+f3a6fccfa6ae9d3ded29@syzkaller.appspotmail.com
MFC after: 1 week

3 years agoboot1.efi: use malloc family from libsa
tsoome [Tue, 30 Jun 2020 21:48:58 +0000 (21:48 +0000)]
boot1.efi: use malloc family from libsa

The zfs reader development did reach to the point where linking boot1,
we will get errors about duplicate symbols Malloc, Free, Calloc.

We can just use libsa version, just as loader.efi does. The only concern is,
libsa zalloc is using fixed size heap region, I did pick 64MB as other
stage instances are using, but this size is likely not optimal. In any case,
with limited memory setups, we should boot loader.efi directly.

Sponsored by: Netflix, Klara Inc.

3 years agoDecode APEI tables (BERT, EINJ, ERST, HEST).
mav [Tue, 30 Jun 2020 21:40:34 +0000 (21:40 +0000)]
Decode APEI tables (BERT, EINJ, ERST, HEST).

MFC after: 2 weeks

3 years agoMention FreeBSD in the HISTORY sections of apropos(1) and makewhatis(8).
gbe [Tue, 30 Jun 2020 18:08:59 +0000 (18:08 +0000)]
Mention FreeBSD in the HISTORY sections of apropos(1) and makewhatis(8).

PR: 223520, 223521
Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D25521

3 years agoiovctl(8): Correct a typo in the manpage and correct the SYNOPSIS
gbe [Tue, 30 Jun 2020 17:21:28 +0000 (17:21 +0000)]
iovctl(8): Correct a typo in the manpage and correct the SYNOPSIS

PR: 246831
Submitted by: Jose Luis Duran <jlduran at gmail dot com>
Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
MFC after: 7 days

3 years agoFix misplaced voltages/temperatures labels in 'sesutil show'.
trasz [Tue, 30 Jun 2020 16:49:43 +0000 (16:49 +0000)]
Fix misplaced voltages/temperatures labels in 'sesutil show'.

PR: bin/247384
Reported by: brd
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25353

3 years agoMake linprocfs(5) create the /proc/<PID>/task/ directores.
trasz [Tue, 30 Jun 2020 16:24:28 +0000 (16:24 +0000)]
Make linprocfs(5) create the /proc/<PID>/task/ directores.
This is to silence down some Chromium assertions.

PR: kern/240991
Analyzed by: Alex S <iwtcex@gmail.com>
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25256

3 years agoCross-reference style(9) and style.mdoc(5)
0mp [Tue, 30 Jun 2020 16:23:51 +0000 (16:23 +0000)]
Cross-reference style(9) and style.mdoc(5)

Suggested by: yuripv
MFC after: 3 days

3 years agoMake linux(4) ignore SA_INTERRUPT. The zsh(1) binary from Bionic uses it.
trasz [Tue, 30 Jun 2020 16:18:09 +0000 (16:18 +0000)]
Make linux(4) ignore SA_INTERRUPT.  The zsh(1) binary from Bionic uses it.

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

3 years agoAdd dwc_otg_acpi
andrew [Tue, 30 Jun 2020 15:58:29 +0000 (15:58 +0000)]
Add dwc_otg_acpi

Create an acpi attachment for the DWC USB OTG device. This is present in
the Raspberry Pi 4 in the USB-C port normally used to power the board. Some
firmware presents the kernel with ACPI tables rather than FDT so we need
an ACPI attachment.

Submitted by: Greg V <greg_unrelenting.technology>
Approved by: hselasky (removal of All rights reserved)
Differential Revision: https://reviews.freebsd.org/D25203

3 years agoRemove unused 32-bit compatibility structures from cryptodev.
markj [Tue, 30 Jun 2020 15:57:11 +0000 (15:57 +0000)]
Remove unused 32-bit compatibility structures from cryptodev.

The counters are exported by a sysctl and have the same width on all
platforms anyway.

Reviewed by: cem, delphij, jhb
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D25465

3 years agoRemove CRYPTO_TIMING.
markj [Tue, 30 Jun 2020 15:56:54 +0000 (15:56 +0000)]
Remove CRYPTO_TIMING.

It was added a very long time ago.  It is single-threaded, so only
really useful for basic measurements, and in the meantime we've gotten
some more sophisticated profiling tools.

Reviewed by: cem, delphij, jhb
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D25464

3 years agoDocument the is_signed(), type_max() and type_min() function macros in the
hselasky [Tue, 30 Jun 2020 08:41:33 +0000 (08:41 +0000)]
Document the is_signed(), type_max() and type_min() function macros in the
LinuxKPI. Try to make the function argument more readable.

Suggested by: several
MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoMake EC2 AMIs use portsnap and freebsd-update mirrors hosted in AWS
cperciva [Tue, 30 Jun 2020 06:14:34 +0000 (06:14 +0000)]
Make EC2 AMIs use portsnap and freebsd-update mirrors hosted in AWS

This adjusts freebsd-update.conf and portsnap.conf files in EC2 AMIs to
point at the new AWS-hosted mirror network.

Approved by: re (delphij)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D25498

3 years agosavecore: accept device names without the /dev/ prefix
asomers [Mon, 29 Jun 2020 22:12:23 +0000 (22:12 +0000)]
savecore: accept device names without the /dev/ prefix

dumpon has accepted device names without the prefix ever since r291207.
Since dumpon and savecore are always paired, they ought to accept the same
arguments. Prior to this change, specifying 'dumpdev="da3"' in
/etc/rc.conf, for example, would result in dumpon working just fine but
savecore complaining that "Dump device does not exist".

PR: 247618
Reviewed by: cem, bcr
MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D25500

3 years agoFix a panic when unloading firmware
gallatin [Mon, 29 Jun 2020 21:35:50 +0000 (21:35 +0000)]
Fix a panic when unloading firmware

LIST_FOREACH_SAFE() is not safe in the presence
of other threads removing list entries when a
mutex is released.

This is not in the critical path, so just restart
the scan each time we drop the lock, rather than
using a marker.

Reviewed by: jhb, markj
Sponsored by: Netflix

3 years agoFix printf(3) output of long doubles on RISC-V
mhorne [Mon, 29 Jun 2020 19:30:35 +0000 (19:30 +0000)]
Fix printf(3) output of long doubles on RISC-V

When the RISC-V port was initially committed to FreeBSD, GCC would
generate 64-bit long doubles, and the definitions in _fpmath.h reflected
that. This was changed to 128-bit in GCC later that year [1], but the
definitions were never updated, despite the documented workaround. This
causes printf(3) and friends to interpret only the low 64-bits of a long
double in ldtoa, thereby printing incorrect values.

Update the definitions now that both clang and GCC generate 128-bit long
doubles.

[1] https://github.com/riscv/riscv-gcc/commit/54b21fc5ae83cefec44bc2caed4a8c664c274ba0

PR: 242067
Reported by: Dennis Clarke <dclarke@blastwave.org>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25420

3 years agomailwrapper: switch mailer.conf to CONFS
kevans [Mon, 29 Jun 2020 18:06:00 +0000 (18:06 +0000)]
mailwrapper: switch mailer.conf to CONFS

This matches what was already being done in dma(8), and should again make
this merge with etcupdate/mergemaster.

Reported by: jhb

3 years agolinux: reposition the comment for bsd_to_linux_bits/linux_to_bsd_bits
kevans [Mon, 29 Jun 2020 17:47:00 +0000 (17:47 +0000)]
linux: reposition the comment for bsd_to_linux_bits/linux_to_bsd_bits

rpokala notes that splitting the definitions like this is kind of silly,
since the comment applies to both.  Move the comment up (or the definition
down, depending on your perspective on life) accordingly.

Reported by: rpokala

3 years agoStop using STATIC_CFLAGS.
jhb [Mon, 29 Jun 2020 17:19:08 +0000 (17:19 +0000)]
Stop using STATIC_CFLAGS.

This was added in r293648 to pass -mlong-calls for crt1.o and gcrt1.o.
The use of -mlong-calls was removed in r358851 for LLVM 10.0, leaving
STATIC_CFLAGS empty.

Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25305

3 years agovm: Add missing WITNESS warnings for M_WAITOK allocation
cem [Mon, 29 Jun 2020 16:54:00 +0000 (16:54 +0000)]
vm: Add missing WITNESS warnings for M_WAITOK allocation

vm_map_clip_{end,start} and lookup_clip_start allocate memory M_WAITOK
for !system_map vm_maps.  Add WITNESS warning annotation for !system_map
callers who may be holding non-sleepable locks.

Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D25283

3 years agohexdump(1): Add EXAMPLES section
fernape [Mon, 29 Jun 2020 15:15:14 +0000 (15:15 +0000)]
hexdump(1): Add EXAMPLES section

 * Add examples showing the use of -f, -C, -s, -n
 * Rework the two already present examples that were *format* examples
 * Remove .Tn suggested by mandoc(1)
 * Remove reference to gdb(1) since it is not present in current

Approved by: manpages (gbe)
Differential Revision: https://reviews.freebsd.org/D25406

3 years agoRevert r362261, "Re-apply r333944 to unbreak ports"
emaste [Mon, 29 Jun 2020 13:30:48 +0000 (13:30 +0000)]
Revert r362261, "Re-apply r333944 to unbreak ports"

A file update in 2018 broke many ports as it misidentified shared
libraries as PIE binaries.  r333944 reverted part of the change,
restoring ports builds but misidentifying objects in the opposite
direction.

Earlier this month file 5.39 was imported, and then the change
originally from r333944 was recommitted as r362261.  However, the
issue was fixed upstream, so r362261 serves no purpose.

PR: 246960, 247461 [exp-run]
Sponsored by: The FreeBSD Foundation

3 years agoImplement is_signed(), type_max() and type_min() function macros in the
hselasky [Mon, 29 Jun 2020 13:08:40 +0000 (13:08 +0000)]
Implement is_signed(), type_max() and type_min() function macros in the
LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoCoresight: provide device_attach method for FDT bus.
br [Mon, 29 Jun 2020 12:59:09 +0000 (12:59 +0000)]
Coresight: provide device_attach method for FDT bus.

Sponsored by: DARPA, AFRL

3 years agogre(4): Add a STANDARDS section
gbe [Mon, 29 Jun 2020 10:30:43 +0000 (10:30 +0000)]
gre(4): Add a STANDARDS section

Expand the mentioned RFC in the SEE ALSO section
and reference RFC1701 and RFC1702.

PR: 240250
Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
Obtained from: OpenBSD
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D25504

3 years agoFix the spelling of identify in the arm64 identcpu code
andrew [Mon, 29 Jun 2020 09:37:07 +0000 (09:37 +0000)]
Fix the spelling of identify in the arm64 identcpu code

Sponsored by: Innovate UK

3 years agoCreate a kernel arm64 ID register view
andrew [Mon, 29 Jun 2020 09:08:36 +0000 (09:08 +0000)]
Create a kernel arm64 ID register view

In preparation for using ifuncs in the kernel is is useful to have a common
view of the arm64 ID registers across all CPUs. Add this and extract the
logic for finding the lower value of two fields to a new helper function.

Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D25463

3 years agoFix CTYPE for ja_JP.eucJP and ja_JP.SJIS.
hrs [Mon, 29 Jun 2020 03:23:13 +0000 (03:23 +0000)]
Fix CTYPE for ja_JP.eucJP and ja_JP.SJIS.

PR: 163168
MFC after: 3 days

3 years agolinuxolator: implement memfd_create syscall
kevans [Mon, 29 Jun 2020 03:09:14 +0000 (03:09 +0000)]
linuxolator: implement memfd_create syscall

This effectively mirrors our libc implementation, but with minor fudging --
name needs to be copied in from userspace, so we just copy it straight into
stack-allocated memfd_name into the correct position rather than allocating
memory that needs to be cleaned up.

The sealing-related fcntl(2) commands, F_GET_SEALS and F_ADD_SEALS, have
also been implemented now that we support them.

Note that this implementation is still not quite at feature parity w.r.t.
the actual Linux version; some caveats, from my foggy memory:

- Need to implement SHM_GROW_ON_WRITE, default for memfd (in progress)
- LTP wants the memfd name exposed to fdescfs
- Linux allows open() of an fdescfs fd with O_TRUNC to truncate after dup.
  (?)

Interested parties can install and run LTP from ports (devel/linux-ltp) to
confirm any fixes.

PR: 240874
Reviewed by: kib, trasz
Differential Revision: https://reviews.freebsd.org/D21845

3 years agobhyve: fix NVMe Active Namespace list
chuck [Mon, 29 Jun 2020 00:32:24 +0000 (00:32 +0000)]
bhyve: fix NVMe Active Namespace list

The NVMe specification requires unused entries in the Identify, Active
Namespace ID data to be zero. Fix is bzero the provided page, similar to
what is done for the Namespace Descriptors list.

Fixes UNH Tests 2.6 and 2.9

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24901

3 years agobhyve: NVMe handle zero length DSM ranges
chuck [Mon, 29 Jun 2020 00:32:21 +0000 (00:32 +0000)]
bhyve: NVMe handle zero length DSM ranges

Dataset Management range specifications may have a zero length (a.k.a.
an empty range definition). Handle the case of all ranges being empty by
completing with Success (DSM commands are advisory only). For
Deallocate, skip empty range definitions when sending TRIM's to the
backing storage.

Fixes UNH Test 2.2.4

Reviewed by: imp
Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24900

3 years agobhyve: fix NVMe Get Features, Predictable Latency
chuck [Mon, 29 Jun 2020 00:32:18 +0000 (00:32 +0000)]
bhyve: fix NVMe Get Features, Predictable Latency

If the Predictable Latency Mode is not supported, NVMe Controllers must
return Invalid Field in Command status for the Get Features command
with IDs:
 - Predictable Latency Mode Config
 - Predictable Latency Mode Window

Fixes UNH Tests 3.6

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24899

3 years agobhyve: add NVMe Feature Interrupt Vector Config
chuck [Mon, 29 Jun 2020 00:32:15 +0000 (00:32 +0000)]
bhyve: add NVMe Feature Interrupt Vector Config

This adds support for NVMe Get Features, Interrupt Vector Config
parameter error checking done by the UNH compliance tests.

Fixes UNH Tests 1.6.8 and 5.5.6

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24898

3 years agobhyve: add basic NVMe Firmware Commit support
chuck [Mon, 29 Jun 2020 00:32:11 +0000 (00:32 +0000)]
bhyve: add basic NVMe Firmware Commit support

This commit updates the Identify Controller data to advertise the
Controller supports a single firmware slot and that firmware slot 1 is
read-only. Additionally, it returns an "Invalid Firmware Slot" error
when the host issues any Firmware Commit command (a.k.a. Firmware
Activate).

Fixes UNH Test 5.5.3

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24897

3 years agobhyve: Add AER support to NVMe emulation
chuck [Mon, 29 Jun 2020 00:32:08 +0000 (00:32 +0000)]
bhyve: Add AER support to NVMe emulation

This adds support to bhyve's NVMe device emulation for processing Async
Event Requests but not returning them (i.e. Async Event Notifications).

Fixes UNH Test 5.5.2

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24896

3 years agobhyve: validate the NVMe LBA start and count
chuck [Mon, 29 Jun 2020 00:32:04 +0000 (00:32 +0000)]
bhyve: validate the NVMe LBA start and count

Add checks that the combination of Starting LBA and Number of Logical
Blocks in a command will not exceed the range of the underlying storage.

Note that because NVMe specifices the Starting LBA as a uint64_t, care
must be taken when converting it and the block count to avoid an integer
overflow.

Fixes UNH Tests 2.2.3, 2.3.2, and 2.4.2

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24895

3 years agobhyve: implement NVMe SMART data I/O statistics
chuck [Mon, 29 Jun 2020 00:32:01 +0000 (00:32 +0000)]
bhyve: implement NVMe SMART data I/O statistics

SMART data in NVMe includes statistics for number of read and write
commands issued as well as the number of "data units" read and written.
NVMe defines "data unit" as thousands of 512 byte blocks (e.g. 1 data
unit is 1-1,000 512 byte blocks, 3 data units are 2,001-3,000 512 byte
blocks).

This patch implements counters for:
 - Data Units Read
 - Data Units Written
 - Host Read Commands
 - Host Write Commands
and exposes the values when the guest reads the SMART/Health Log Page.

Fixes UNH Test 1.3.8

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24894

3 years agobhyve: validate NVMe deallocate range values
chuck [Mon, 29 Jun 2020 00:31:58 +0000 (00:31 +0000)]
bhyve: validate NVMe deallocate range values

For NVMe emulation, validate the Data Set Management LBA ranges do not
exceed the capacity of the backing storage. If they do, return an "LBA
Out of Range" error.

Fixes UNH Test 2.2.3

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24893

3 years agobhyve: base pci_nvme_ioreq size on advertised MDTS
chuck [Mon, 29 Jun 2020 00:31:54 +0000 (00:31 +0000)]
bhyve: base pci_nvme_ioreq size on advertised MDTS

NVMe controllers advertise their Max Data Transfer Size (MDTS) to limit
the number of page descriptors in an I/O request. Take advantage of this
and size the struct pci_nvme_ioreq accordingly.

Ensuring these values match both future-proofs the code and allows
removing some complexity which only exists to handle this possibility.

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24891

3 years agobhyve: refactor NVMe I/O read/write
chuck [Mon, 29 Jun 2020 00:31:51 +0000 (00:31 +0000)]
bhyve: refactor NVMe I/O read/write

Split the NVM I/O function (i.e. nvme_opc_write_read) into separate
functions - one for RAM based backing-store and another for disk based
backing-store for easier maintenance. No functional changes.

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24890

3 years agobhyve: implement NVMe Format NVM command
chuck [Mon, 29 Jun 2020 00:31:47 +0000 (00:31 +0000)]
bhyve: implement NVMe Format NVM command

The Format NVM command mainly allows the host to specify the block size
and protection information used for the Namespace. As the bhyve
implementation simply maps the capabilities of the backing storage
through to the guest, there isn't anything to implement. But a side
effect of the format is the NVMe Controller shall not return any data
previously written (i.e. erase previously written data). This patch
implements this later behavior to provide a compliant implementation.

Fixes UNH Test 1.6

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24889

3 years agobhyve: make unsupported NVMe commands a debug message
chuck [Mon, 29 Jun 2020 00:31:44 +0000 (00:31 +0000)]
bhyve: make unsupported NVMe commands a debug message

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24888

3 years agobhyve: add more compliant NVMe Get/Set Features
chuck [Mon, 29 Jun 2020 00:31:41 +0000 (00:31 +0000)]
bhyve: add more compliant NVMe Get/Set Features

Create a generic Get/Set Features by saving off the contents of CDW11
from the Set command and returning the saved value in the completion of
the Get command. Implementation allows providing optional implementation
for both Set and Get.

Add infrastructure to determine which feature ID's are namespace
specific and flag violations of this category of error.

Also adds the feature specific behavior of Set Features, Number of
Queues to only allow this command once per Controller reset.

Fixes UNH Tests 1.2, 5.4, and 5.5.6

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24887

3 years agobhyve: fix NVMe queue creation and deletion
chuck [Mon, 29 Jun 2020 00:31:37 +0000 (00:31 +0000)]
bhyve: fix NVMe queue creation and deletion

Add checks for various types of invalid I/O Queue Create and Delete
command parameters, including:
 - QID=0
 - QID>MAX
 - QID already in use
 - Delete an Active CQ
 - Invalid QSIZE
 - Invalid CQID (SQ creation)
 - Invalid interrupt vector (CQ creation)

Fixes UNH Tests 1.4.2-5,7-8

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24886

3 years agobhyve: fix NVMe Get Log Page command
chuck [Mon, 29 Jun 2020 00:31:34 +0000 (00:31 +0000)]
bhyve: fix NVMe Get Log Page command

Fix the logic in nvme_opc_get_log_page to calculate the number of DWORDS
(uint32_t) instead of WORDS (uint16_t) for the byte length. And only
return the allowed number of Log Page bytes as determined by the user
request and actual size of the requested log page.

Fixes UNH Test 1.3

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24885

3 years agobhyve: implement NVMe Namespace Identification Descriptor
chuck [Mon, 29 Jun 2020 00:31:30 +0000 (00:31 +0000)]
bhyve: implement NVMe Namespace Identification Descriptor

NVMe 1.3 compliant controllers must implement the Namespace
Identification Descriptor structure (i.e. CNS=3). Previously this was
unimplemented.

Fixes UNH Test 1.1.4-0

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24884

3 years agobhyve: Consolidate NVMe CQ update
chuck [Mon, 29 Jun 2020 00:31:27 +0000 (00:31 +0000)]
bhyve: Consolidate NVMe CQ update

Consolidate the code which writes Completion Queue entries and updates
the CQ doorbell value. While in the neighborhood, convert the "toggle CQ
phase bit" code to use an XOR operation instead of an "if/else" branch.

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24882

3 years agobhyve: add locks around NVMe queue accesses
chuck [Mon, 29 Jun 2020 00:31:24 +0000 (00:31 +0000)]
bhyve: add locks around NVMe queue accesses

The NVMe code attempted to ensure thread safety through a combination of
using atomics and a "busy" flag. But this approach leads to unavoidable
race conditions.

Fix is to use per-queue mutex locks to ensure thread safety within the
queue processing code. While in the neighborhood, move all the queue
initialization code to a common function.

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19841

3 years agobhyve: add a comment explaining NVME dsm option
chuck [Mon, 29 Jun 2020 00:31:20 +0000 (00:31 +0000)]
bhyve: add a comment explaining NVME dsm option

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24881

3 years agobhyve: implement NVMe Flush command
chuck [Mon, 29 Jun 2020 00:31:17 +0000 (00:31 +0000)]
bhyve: implement NVMe Flush command

This adds support for the NVMe I/O command Flush. For block-based
devices, submit a DIOCGFLUSH to the backing storage. Otherwise, command
is treated like a NOP and completes with a Successful status.

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24880

3 years agobhyve: refactor NVMe IO command handling
chuck [Mon, 29 Jun 2020 00:31:14 +0000 (00:31 +0000)]
bhyve: refactor NVMe IO command handling

This refactors the NVMe I/O command processing function to make adding
new commands easier. The main change is to move command specific
processing (i.e. Read/Write) to separate functions for each NVMe I/O
command and leave the common per-command processing in the existing
pci_nvme_handle_io_cmd() function.

While here, add checks for some common errors (invalid Namespace ID,
invalid opcode, LBA out of range).

Add myself to the Copyright holders

Reviewed by: imp
Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24879

3 years agobhyve: convert NVMe logging statements
chuck [Mon, 29 Jun 2020 00:31:11 +0000 (00:31 +0000)]
bhyve: convert NVMe logging statements

Convert the debug and warning logging macros to be parameterized and
correctly use bhyve's PRINTLN macro.

Reviewed by: imp
Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24878

3 years agoDo not use macros in the argument to -width
0mp [Sun, 28 Jun 2020 22:04:52 +0000 (22:04 +0000)]
Do not use macros in the argument to -width

This patch improves the presentation of the FILES section dramatically.

MFC after: 2 weeks

3 years agoDocument that Intel Dual Band Wireless AC 8265 is supported by iwm(4)
0mp [Sun, 28 Jun 2020 21:48:56 +0000 (21:48 +0000)]
Document that Intel Dual Band Wireless AC 8265 is supported by iwm(4)

MFC after: 2 weeks

3 years agoFix UMA's first-touch policy on systems with empty domains.
markj [Sun, 28 Jun 2020 21:35:04 +0000 (21:35 +0000)]
Fix UMA's first-touch policy on systems with empty domains.

Suppose a thread is running on a CPU in a NUMA domain with no physical
RAM.  When an item is freed to a first-touch zone, it ends up in the
cross-domain bucket.  When the bucket is full, it gets placed in another
domain's bucket queue.  However, when allocating an item, UMA will
always go to the keg upon a per-CPU cache miss because the empty
domain's bucket queue will always be empty.  This means that a non-empty
domain's bucket queues can grow very rapidly on such systems.  For
example, it can easily cause mbuf allocation failures when the zone
limit is reached.

Change cache_alloc() to follow a round-robin policy when running on an
empty domain.

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

3 years agoRemove some redundant assignments and computations.
markj [Sun, 28 Jun 2020 21:34:38 +0000 (21:34 +0000)]
Remove some redundant assignments and computations.

Reported by: alc
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25400

3 years agosh/tests: Re-enable bin.sh.execution.functional_test.bg12.0
jilles [Sun, 28 Jun 2020 21:33:08 +0000 (21:33 +0000)]
sh/tests: Re-enable bin.sh.execution.functional_test.bg12.0

This reverts r362646.

PR: 247559
MFC after: 1 week

3 years agosh/tests: Fix flaky execution/bg12.0
jilles [Sun, 28 Jun 2020 21:15:29 +0000 (21:15 +0000)]
sh/tests: Fix flaky execution/bg12.0

When job control is not enabled, the shell ignores SIGINT while waiting for
a foreground process unless that process exits on SIGINT. In this case, the
foreground process is sleep and it does not exit on SIGINT because the
signal is only sent to the shell. Depending on order of events, this could
cause the SIGINT to be unexpectedly ignored.

On lightly loaded bare metal, the chance of this happening tends to be less
than 0.01% but with higher loads and/or virtualization it becomes more
likely.

Starting the sleep in background and using the wait builtin ensures SIGINT
will not be ignored.

PR: 247559
Reported by: lwhsu
MFC after: 1 week

3 years agoConfigure rx_delay/tx_delay values for RK3399/RK3328 GMAC
gonzo [Sun, 28 Jun 2020 21:11:10 +0000 (21:11 +0000)]
Configure rx_delay/tx_delay values for RK3399/RK3328 GMAC

For 1000Mb mode to work reliably TX/RX delays need to be configured
between the TX/RX clock and the respective signals on the PHY
to compensate for differing trace lengths on the PCB.

Reviewed by: manu
MFC after: 1 week