]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoAdd product ID strings for a couple Microchip usb hubs. Also, update the
ian [Mon, 14 Sep 2020 17:33:28 +0000 (17:33 +0000)]
Add product ID strings for a couple Microchip usb hubs.  Also, update the
vendor ID string to say just "Microchip Technology" -- the buyout of
Standard Microsystems happened in 2012 and the SMC/SMSC names are pretty
much retired at this point.

PR: 241406

3 years agoCleanups for gprof:
andrew [Mon, 14 Sep 2020 16:18:53 +0000 (16:18 +0000)]
Cleanups for gprof:

 * Remove identical or almost identical headers
 * Only build aout.c on amd64 and i386. None of the the other current
   architectures ever supported running a.out binaries
 * Enable on all architectures

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

3 years agoUse MACHINE_CPUARCH when checking for arm64
andrew [Mon, 14 Sep 2020 16:12:28 +0000 (16:12 +0000)]
Use MACHINE_CPUARCH when checking for arm64

Use MACHINE_CPUARCH with arm64 (aarch64) when we build code that could run
on any 64-bit Arm instruction set. This will simplify checks in downstream
consumers targeting prototype instruction sets.

The only place we check for MACHINE_ARCH == aarch64 is when building the
device tree blobs. As these are targeting current generation ISAs.

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

3 years agoFix setting RELENGDIR when release.sh is called from an external
gjb [Mon, 14 Sep 2020 15:58:10 +0000 (15:58 +0000)]
Fix setting RELENGDIR when release.sh is called from an external
script.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agostand/ficl 64-bit compatibility
bdragon [Mon, 14 Sep 2020 15:48:30 +0000 (15:48 +0000)]
stand/ficl 64-bit compatibility

Currently, the only thing that prevents a functioning 64-bit FICL build is
a few integer types that were intended to be fixed-width.

Changing them to C99 integer types allows building a functioning 64-bit
FICL.

While this isn't applicable to the default settings of any in-tree loaders,
it is necessary for a future Petitboot loader, due to the requirement that
it be compiled as a 64-bit program.

Reviewed by: tsoome, imp (earlier revision)
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D26364

3 years ago[PowerPC] Make cpu frequency detection endian-independent
bdragon [Mon, 14 Sep 2020 15:20:37 +0000 (15:20 +0000)]
[PowerPC] Make cpu frequency detection endian-independent

On ibm,extended-clock-frequency, ensure we be64toh() the value.

On clock-frequency, remove the right-shifting hack (which was needed due to
reading a 32 bit value into a 64 bit variable) and switch to OF_getencprop()
for reading (which will handle endian conversion internally.)

Reviewed by: jhibbits (in irc)
Sponsored by: Tag1 Consulting, Inc.

3 years agoPartially revert r346018 and use the if/then construct instead of shell.
gordon [Mon, 14 Sep 2020 14:45:30 +0000 (14:45 +0000)]
Partially revert r346018 and use the if/then construct instead of shell.

There are a couple of places in the tree that directly parse the newvers.sh
script looking for the BRANCH variable. I found two locations, one in
release/Makefile and the other in bin/freebsd-version/Makefile.

While there is a good argument that BRANCH_OVERRIDE should properly
propagate in those circumstances and the new behavior is thus better, the
reality is this change broke freebsd-update's ability to find timestamps in
binaries and resulted in a large number of gratuitous changes.

Reported by: freebsd-update
Discussed with: cperciva
MFC after: 1 day

3 years agoPoll statistics more frequently in mlx5en(4).
hselasky [Mon, 14 Sep 2020 14:24:54 +0000 (14:24 +0000)]
Poll statistics more frequently in mlx5en(4).

This makes traffic steering algorithms more accurate.

MFC after: 1 week
Submitted by: gallatin @
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoSkip armv7 bectl tests on CI; they deadlock (""KSTACK_PAGES is 2").
trasz [Mon, 14 Sep 2020 10:35:39 +0000 (10:35 +0000)]
Skip armv7 bectl tests on CI; they deadlock (""KSTACK_PAGES is 2").

PR: 249229
Sponsored by: DARPA

3 years agoMove td_softdep_cleanup() from userret() to ast(); it's infrequent
trasz [Mon, 14 Sep 2020 10:17:07 +0000 (10:17 +0000)]
Move td_softdep_cleanup() from userret() to ast(); it's infrequent
at best.  The schedule_cleanup() function already sets TDF_ASTPENDING.

Reviewed by: kib, mckusick
Tested by: pho
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26375

3 years agoMove TDP_GEOM check from userret() to ast(); this code path is quite
trasz [Mon, 14 Sep 2020 10:14:03 +0000 (10:14 +0000)]
Move TDP_GEOM check from userret() to ast(); this code path is quite
infrequent.

Reviewed by: kib
No objections: mav
Tested by: pho
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26374

3 years agoMove racct/rctl throttling from userret() to ast(). There's no reason
trasz [Mon, 14 Sep 2020 09:44:24 +0000 (09:44 +0000)]
Move racct/rctl throttling from userret() to ast().  There's no reason
for it to sit in the syscall fast path.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26368

3 years agoAllow for interrupts on pl061 children
andrew [Mon, 14 Sep 2020 08:59:16 +0000 (08:59 +0000)]
Allow for interrupts on pl061 children

Add enough infrastructure for interrupts on children of the pl061 GPIO
controller. As gpiobus already provided these the pl061 driver also needs
to pass requests up the newbus hierarchy.

Currently there are no children that expect to configure interrupts, however
this is expected to change to support the ACPI Event Information interface.

Sponsored by: Innovate UK

3 years agopfctl_test: avoid 200 calls to atf_get_srcdir
arichardson [Mon, 14 Sep 2020 08:51:18 +0000 (08:51 +0000)]
pfctl_test: avoid 200 calls to atf_get_srcdir

I have been trying to reduce the time that testsuite runs take for CheriBSD
on QEMU (currently about 22 hours). One of the slowest tests is pfctl_test:
Just listing the available test cases currently takes 98 seconds on a
CheriBSD RISC-V system due to all the processes being spawned. This trivial
patch reduces the time to 92 seconds. The better solution would be to
rewrite the test in C/C++ which I may do as a follow-up change.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D26417

3 years agoUpdate bus_dma.9 for the expanded template API. Add some
scottl [Mon, 14 Sep 2020 06:26:36 +0000 (06:26 +0000)]
Update bus_dma.9 for the expanded template API.  Add some
clarifying language about the operation of parent tags in templates.

3 years agoRefine the busdma template interface. Provide tools for filling in fields
scottl [Mon, 14 Sep 2020 05:58:12 +0000 (05:58 +0000)]
Refine the busdma template interface.  Provide tools for filling in fields
that can be extended, but also ensure compile-time type checking.  Refactor
common code out of arch-specific implementations.  Move the mpr and mps
drivers to this new API.  The template type remains visible to the consumer
so that it can be allocated on the stack, but should be considered opaque.

3 years ago__FreeBSD_version bump for r365605 (crunchgen producing WARNS-clean)
kevans [Mon, 14 Sep 2020 01:56:29 +0000 (01:56 +0000)]
__FreeBSD_version bump for r365605 (crunchgen producing WARNS-clean)

The change in D26397 will need a __FreeBSD_version to base off of for
bootstrapping crunchgen, to avoid avoidable build failures just because the
host has an outdated crunchgen.

3 years agoFix a case where the NFSv4.0 server might crash if delegations are enabled.
rmacklem [Mon, 14 Sep 2020 00:44:50 +0000 (00:44 +0000)]
Fix a case where the NFSv4.0 server might crash if delegations are enabled.

asomers@ reported a crash on an NFSv4.0 server with a backtrace of:
kdb_backtrace
vpanic
panic
nfsrv_docallback
nfsrv_checkgetattr
nfsrvd_getattr
nfsrvd_dorpc
nfssvc_program
svc_run_internal
svc_thread_start
fork_exit
fork_trampoline
where the panic message was "docallb", which indicates that a callback
was attempted when the ClientID is unconfirmed.
This would not normally occur, but it is possible to have an unconfirmed
ClientID structure with delegation structure(s) chained off it if the
client were to issue a SetClientID with the same "id" but different
"verifier" after acquiring delegations on the previously confirmed ClientID.

The bug appears to be that nfsrv_checkgetattr() failed to check for
this uncommon case of an unconfirmed ClientID with a delegation structure
that no longer refers to a delegation the client knows about.

This patch adds a check for this case, handling it as if no delegation
exists, which is the case when the above occurs.
Although difficult to reproduce, this change should avoid the panic().

PR: 249127
Reported by: asomers
Reviewed by: asomers
MFC after: 1 week
Differential Revision: https://reviews.freebbsd.org/D26342

3 years agoMakefile.inc1: remove more old stale depend hacks
emaste [Sun, 13 Sep 2020 23:05:19 +0000 (23:05 +0000)]
Makefile.inc1: remove more old stale depend hacks

Current stale dependency hacks are in tools/build/depend-cleanup.sh.
These ones were almost a year old; remove them from Makefile.inc1.

3 years agoIn the newfs(8) utility, use the more appropriate sbwrite() and cgwrite()
mckusick [Sun, 13 Sep 2020 22:57:50 +0000 (22:57 +0000)]
In the newfs(8) utility, use the more appropriate sbwrite() and cgwrite()
libufs interfaces rather than sbput() and cgput().

No functional change.

MFC after:    7 days
Sponsored by: Netflix

3 years ago[PowerPC] bus_space cleanup part 2: Convert to c99 initializers.
bdragon [Sun, 13 Sep 2020 21:34:32 +0000 (21:34 +0000)]
[PowerPC] bus_space cleanup part 2: Convert to c99 initializers.

To make it easier to work with this in the future, convert to c99
designated initializer syntax.

Tested on powerpc, powerpc64, and powerpc64le. No functional change.

Sponsored by: Tag1 Consulting, Inc.

3 years ago[PowerPC] bus_space cleanup part 1 - rename bs_be / bs_le functions
bdragon [Sun, 13 Sep 2020 21:27:30 +0000 (21:27 +0000)]
[PowerPC] bus_space cleanup part 1 - rename bs_be / bs_le functions

The intention of the bus_be naming was for those to be the no-endian-swapping
and for the bus_le to be endian-swapping in all the functions.

This naming breaks down when we're actually are running in LE and need to
use the opposite sense.

As such, rename bs_be_* to native_bs_* and rename bs_le_* to swapped_bs_*.

No functional change.

Sponsored by: Tag1 Consulting, Inc.

3 years ago[PowerPC64LE] Bus space prep for LE
bdragon [Sun, 13 Sep 2020 21:22:39 +0000 (21:22 +0000)]
[PowerPC64LE] Bus space prep for LE

Swap the BE and LE bus_space tags when on LE, and adjust the nexus tag
to match.

This is prep for a a followup that makes the powerpc bus_space macros easier
to maintain in the future.

Sponsored by: Tag1 Consulting, Inc.

3 years agoSpawn the DHCPv6 client in EC2 instances via rtsold.
cperciva [Sun, 13 Sep 2020 19:56:53 +0000 (19:56 +0000)]
Spawn the DHCPv6 client in EC2 instances via rtsold.

Prior to this commit, EC2 AMIs used a "dual-dhclient" tool which was
launched in place of dhclient and spawned both the base system dhclient
for IPv4 and the ISC dhclient from ports for IPv6.

Now that rtsold supports the "M bit" (managed configuration), we can go
back to having the base system dhclient spawned normally, and provide a
script to rtsold which spawns the ISC dhclient from ports when rtsold
decides that it is appropriate.

Thanks to: bz
MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva

3 years agoBump the size of EC2 AMIs up to 5 GB.
cperciva [Sun, 13 Sep 2020 19:11:45 +0000 (19:11 +0000)]
Bump the size of EC2 AMIs up to 5 GB.

The FreeBSD base system continues to expand.  4GB is now insufficient;
we passed 3 GB in May 2019; we passed 2 GB in August 2017.  Over half
of the disk space used is in /usr/lib/debug/.

Without this change, instances boot but are unusable, since the first
thing which breaks when VM filesystems are too small is the "pkg install"
in the VM building process.

3 years ago[PowerPC64LE] Ensure nvram is built on powerpc64le.
bdragon [Sun, 13 Sep 2020 18:24:15 +0000 (18:24 +0000)]
[PowerPC64LE] Ensure nvram is built on powerpc64le.

Fix some cases where conditionals that were trying to exclude powerpcspe
were also excluding powerpc64le.

Sponsored by: Tag1 Consulting, Inc.

3 years ago[PowerPC64LE] Adjust ELF definitions for LE.
bdragon [Sun, 13 Sep 2020 17:36:43 +0000 (17:36 +0000)]
[PowerPC64LE] Adjust ELF definitions for LE.

Set ELF_TARG_DATA correctly on PowerPC64LE.

Sponsored by: Tag1 Consulting, Inc.

3 years agoRemove WITHOUT_BMAKE description
emaste [Sun, 13 Sep 2020 17:13:32 +0000 (17:13 +0000)]
Remove WITHOUT_BMAKE description

The option was retired in r265423 and bmake is the only make in tree.

3 years ago[PowerPC] Implement pmap_mincore() for moea
bdragon [Sun, 13 Sep 2020 16:46:03 +0000 (16:46 +0000)]
[PowerPC] Implement pmap_mincore() for moea

Do the same as previous for moea.

Tested on G4.

3 years ago[PowerPC64] Implement pmap_mincore() for moea64
bdragon [Sun, 13 Sep 2020 16:42:49 +0000 (16:42 +0000)]
[PowerPC64] Implement pmap_mincore() for moea64

Implement pmap_mincore() for moea64.

This will need some slight tweaks when large page support in HPT lands.

Submitted by: Fernando Eckhardt Valle <fernando.valle@eldorado.org.br>
Reviewed by: bdragon
Differential Revision: https://reviews.freebsd.org/D26314

3 years agoAdd a -C option to netstat to display the congestion control for
tuexen [Sun, 13 Sep 2020 09:14:32 +0000 (09:14 +0000)]
Add a -C option to netstat to display the congestion control for
TCP connections.

Reviewed by: rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D26414

3 years agoAdd a -C option to sockstat to display the congestion control for TCP
tuexen [Sun, 13 Sep 2020 09:12:25 +0000 (09:12 +0000)]
Add a -C option to sockstat to display the congestion control for TCP
connections.

Reviewed by: rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D26413

3 years agoExport the name of the congestion control. This will be used by sockstat
tuexen [Sun, 13 Sep 2020 09:06:50 +0000 (09:06 +0000)]
Export the name of the congestion control. This will be used by sockstat
and netstat.

Reviewed by: rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D26412

3 years agoAdd a -t option to traceroute6 to control the traffic class used when
tuexen [Sun, 13 Sep 2020 09:00:00 +0000 (09:00 +0000)]
Add a -t option to traceroute6 to control the traffic class used when
sending probe packets.

Reviewed by: rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D26410

3 years ago[PowerPC] Add PVO_PADDR macro to mmu_oea.c to match mmu_oea64.c changes
bdragon [Sat, 12 Sep 2020 23:54:57 +0000 (23:54 +0000)]
[PowerPC] Add PVO_PADDR macro to mmu_oea.c to match mmu_oea64.c changes

Use a PVO_PADDR macro on 32 bit as well, to reduce the difference between
mmu_oea.c and mmu_oea64.c.

Equivilent to the changes in r363222.

3 years agobcm2838_pci.c: Respect DMA limits of controller.
karels [Sat, 12 Sep 2020 23:49:43 +0000 (23:49 +0000)]
bcm2838_pci.c: Respect DMA limits of controller.

Fixes for Raspberry Pi 4B PCIe / USB:
- Pass through a DMA tag for the controller.
- In theory the controller can access the lower 3 GB, but testing found
  that unreliable. OpenBSD also restricts DMA to the lowest 960 MiB.
- Rename some constants to be a bit more meaningful.

Submitted by: Robert Crowston, crowston at protonmail.com
Reviewed by: mkarels, outside reviewers
Differential Revision: https://reviews.freebsd.org/D26344

3 years ago[PowerPC64LE] Fix platform definitions for powerpc64le-*-freebsd*
bdragon [Sat, 12 Sep 2020 18:23:27 +0000 (18:23 +0000)]
[PowerPC64LE] Fix platform definitions for powerpc64le-*-freebsd*

Teach clang that powerpc64le-*-freebsd* is a valid triple.

This is already in upstream clang, but was too late for llvm 11.0.0.
Apply it directly for now, until it can be backported to llvm 11.0.1.

See upstream https://reviews.llvm.org/D73425 for details.

Reviewed by: dim (upstream version), emaste
Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D26400

3 years agoUpdate flp test for new diskinfo output
imp [Sat, 12 Sep 2020 17:24:04 +0000 (17:24 +0000)]
Update flp test for new diskinfo output

The floppy test passes with this. The others fail due to 'integrity
checks' failing in GPART. It's not at all clear those integrity
checks are legit or if the test samples were bogusly generated
by FreeBSD.

3 years agoFix trailing whitespace
imp [Sat, 12 Sep 2020 17:24:00 +0000 (17:24 +0000)]
Fix trailing whitespace

3 years agoMake this compile again by fixing err args to have formats
imp [Sat, 12 Sep 2020 17:23:51 +0000 (17:23 +0000)]
Make this compile again by fixing err args to have formats

Also, add NO_OBJ=t top the Makefie, since the test-harnest expects to
run it in place.

3 years agoFix the length of probe packets when using UDP.
tuexen [Sat, 12 Sep 2020 11:24:36 +0000 (11:24 +0000)]
Fix the length of probe packets when using UDP.
Since https://svnweb.freebsd.org/changeset/base/365378 a raw socket is
used for sending UDP probe packets instead of a UDP socket. So don't
compensate for the UDP header anymore.

3 years agoSimplify code, no functional change.
tuexen [Sat, 12 Sep 2020 11:19:54 +0000 (11:19 +0000)]
Simplify code, no functional change.

Since https://svnweb.freebsd.org/base?view=revision&revision=365378
UDP is handled the same way as SCTP and TCP (using a raw socket).
Therefore use the same code path.

3 years agoamd64: prevent KCSan false positives on LAPIC mapping
jah [Sat, 12 Sep 2020 07:04:00 +0000 (07:04 +0000)]
amd64: prevent KCSan false positives on LAPIC mapping

For configurations without x2APIC support (guests, older hardware), the global
LAPIC MMIO mapping will trigger false-positive KCSan reports as it will appear
that multiple CPUs are concurrently reading and writing the same address.
This isn't actually true, as the underlying physical access will be performed
on the local CPU's APIC. Additionally, because LAPIC access can happen during
event timer configuration, the resulting KCSan printf can produce a panic due
to attempted recursion on event timer resources.

Add a __nosanitizethread preprocessor define to prevent the compiler from
inserting TSan hooks, and apply it to the x86 LAPIC accessors.

PR: 249149
Reported by: gbe
Reviewed by: andrew, kib
Tested by: gbe
Differential Revision: https://reviews.freebsd.org/D26354

3 years agoA major update to the ure driver.
jmg [Sat, 12 Sep 2020 00:33:11 +0000 (00:33 +0000)]
A major update to the ure driver.

This update adds support for:
HW VLAN tagging
HW checksum offload for IPv4 and IPv6
tx and rx aggreegation (for full gige speeds)
multiple transactions

In my testing, I am able to get 900-950Mbps depending upon
TCP or UDP, which is a significant improvement over the previous
91Mbps (~8kint/sec*1500bytes/packet*1packet/int).

Reviewed by: hselasky
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D25809

3 years agoEnclose BRANCH_OVERRIDE in quotes in order to fix an issue with
gjb [Sat, 12 Sep 2020 00:06:45 +0000 (00:06 +0000)]
Enclose BRANCH_OVERRIDE in quotes in order to fix an issue with
freebsd-update(8) builds, where BRANCH is suffixed with -p0 for
builds.

Noticed by: gordon
With help from: cperciva
MFC after: 3 days
MFC note: before 12.2-BETA2
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoRemove disk images / tests from alpha, sun and pc98
imp [Fri, 11 Sep 2020 23:37:49 +0000 (23:37 +0000)]
Remove disk images / tests from alpha, sun and pc98

These images are no longer relevant...  However, I've also not tested
the regression test here to see if it still works or not... It needs
a lot of love regardless...

3 years agoConvert the mps driver to use busdma templates
scottl [Fri, 11 Sep 2020 22:27:35 +0000 (22:27 +0000)]
Convert the mps driver to use busdma templates

3 years agocp: fall back to read/write if copy_file_range fails
asomers [Fri, 11 Sep 2020 20:49:36 +0000 (20:49 +0000)]
cp: fall back to read/write if copy_file_range fails

Even though copy_file_range has a file-system agnostic version, it still
fails on devfs (perhaps because the file descriptor is non-seekable?) In
that case, fallback to old-fashioned read/write. Fixes
"cp /dev/null /tmp/null"

PR: 249248
Reported by: Michael Butler
Reviewed by: mjg
MFC-With: 365549
Differential Revision: https://reviews.freebsd.org/D26395

3 years agoAdd constant for the DE_CFG MSR on AMD CPUs.
jhb [Fri, 11 Sep 2020 20:32:40 +0000 (20:32 +0000)]
Add constant for the DE_CFG MSR on AMD CPUs.

Reported by: Patrick Mooney <pmooney@pfmooney.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25885

3 years agoImprove the documenation for bus_dma templates. Also add notes to
scottl [Fri, 11 Sep 2020 19:45:26 +0000 (19:45 +0000)]
Improve the documenation for bus_dma templates.  Also add notes to
make it clear that filters may not work correctly and that their use
is deprecated.

MFC after: 3 days

3 years agoImprovements for the src.conf(5) and build(7) man pages
gbe [Fri, 11 Sep 2020 18:09:49 +0000 (18:09 +0000)]
Improvements for the src.conf(5) and build(7) man pages

PR: 203863 (based on)
Submitted by: Russell Haley <russ dot haley at gmail dot com>
Reviewed by: bcr, imp
Approved by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26343

3 years agoFix indentation following r365638. No functional changes.
gjb [Fri, 11 Sep 2020 17:05:09 +0000 (17:05 +0000)]
Fix indentation following r365638.  No functional changes.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoAdd a NOGIT option to avoid explicitly requiring devel/git if the
gjb [Fri, 11 Sep 2020 17:04:09 +0000 (17:04 +0000)]
Add a NOGIT option to avoid explicitly requiring devel/git if the
sources are obtained through a different mechanism.

Reported and tested by: Ruslan Garipov
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoMFV r365636: libarchive: import fix for WARNS=6 builds in testing bits
kevans [Fri, 11 Sep 2020 16:13:45 +0000 (16:13 +0000)]
MFV r365636: libarchive: import fix for WARNS=6 builds in testing bits

Two more cases of explicitly marking globals for internal linkage where they
need not be shared. Committed upstream as of a38e62314a1f.

MFC after: 1 week

3 years agoiwm: fix regression from r365419 (ieee80211_media_change())
bz [Fri, 11 Sep 2020 14:18:47 +0000 (14:18 +0000)]
iwm: fix regression from r365419 (ieee80211_media_change())

In r365419 ieee80211_media_change() callers were updated to not longer
act on the obselete ENETRESET return code.
While in the old days iwm has done a stop/init cycle in these cases,
this was not executed since r193340.
As a consequence simplify iwm code as well by passing ieee80211_media_change()
right to ieee80211_vap_attach() as there is no more need for a local
implementation.

Reported by: Tomoaki AOKI (junchoon dec.sakura.ne.jp)
Tested by: Tomoaki AOKI (junchoon dec.sakura.ne.jp)
MFC after: 3 days
X-MFC: fix is already in stable/12
PR: 248955

3 years agoOnly set WARNS if not defined
kevans [Fri, 11 Sep 2020 13:28:37 +0000 (13:28 +0000)]
Only set WARNS if not defined

This would allow interested parties to do experimental runs with an
environment set appropriately to raise all the warnings throughout the
build; e.g. env WARNS=6 NO_WERROR=yes buildworld.

Not currently touching the numerous instances in ^/tools.

MFC after: 1 week

3 years agoFix compatibility regression after r364117.
ae [Fri, 11 Sep 2020 10:07:09 +0000 (10:07 +0000)]
Fix compatibility regression after r364117.

Properly handle the case, when some opcode keywords follow after
the `frag` opcode without additional options.

Reported by: Evgeniy Khramtsov <evgeniy at khramtsov org>

3 years agodtrace: fix fbt return probes on RISC-V
kp [Fri, 11 Sep 2020 09:15:49 +0000 (09:15 +0000)]
dtrace: fix fbt return probes on RISC-V

Return values are passed in a0, so read it from there. We also pass a1 through
to userspace, as the ABI allows small structs to be returned in registers
a0/a1. While here read the register values directly from the trapframe rather
than rtval, and remove the now unneeded argument from dtrace_invop().

Set fbtp_roffset so that we get the correct return location in arg0.

Reviewed by: markj
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D26389

3 years agoRevert r365592 and r365603 as the tests are fixed by r365593
lwhsu [Fri, 11 Sep 2020 05:45:27 +0000 (05:45 +0000)]
Revert r365592 and r365603 as the tests are fixed by r365593

PR: 249236
Sponsored by: The FreeBSD Foundation

3 years agomemfd_create: simplify HUGETLB support a little bit
kevans [Fri, 11 Sep 2020 02:02:15 +0000 (02:02 +0000)]
memfd_create: simplify HUGETLB support a little bit

This also fixes a minor issue that was missed in the initial review; the
layout of the MFD_HUGE_* flags is actually not 1:1 bit:flag -- it instead
borrowed the Linux convention of how this is laid out since it was
originally implemented on Linux, the top 6 bits represent the shift required
for the requested page size.

This allows us to remove the flag <-> pgsize mapping table and simplify the
logic just prior to validation of the requested page size.

While we're here, fix two small nits:

- HUGETLB memfd shouldn't exhibit the SHM_GROW_ON_WRITE behavior. We can
  only grow largepage shm by appropriately aligned (i.e. requested pagesize)
  sizes, so it can't work in the typical/sane fashion. Furthermore, Linux
  does the same, so let's be compatible.

- We don't allow MFD_HUGETLB without specifying a pagesize, so no need to
  check for that later.

Reviewed by: kib (slightly earlier version)

3 years agoDon't clear reserved bits per RealTek
jmg [Fri, 11 Sep 2020 02:02:13 +0000 (02:02 +0000)]
Don't clear reserved bits per RealTek

MFC after: 3 days

3 years agoDisable WITNESS for spin locks by default.
jhb [Fri, 11 Sep 2020 00:06:16 +0000 (00:06 +0000)]
Disable WITNESS for spin locks by default.

This matches all other architectures and removes substantial overhead.

Reported by: arichardson (indirectly)
Reviewed by: imp, arichardson
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26403

3 years agoice(4): Update to 0.26.16
erj [Thu, 10 Sep 2020 23:46:13 +0000 (23:46 +0000)]
ice(4): Update to 0.26.16

Summary of changes:

- Assorted bug fixes
- Support for newer versions of the device firmware
- Suspend/resume support
- Support for Lenient Link Mode for E82X devices (e.g. can try to link with
  SFP/QSFP modules with bad EEPROMs)
- Adds port-level rx_discards sysctl, similar to ixl(4)'s

This version of the driver is intended to be used with DDP package 1.3.16.0,
which has already been updated in a previous commit.

Tested by: Jeffrey Pieper <jeffrey.e.pieper@intel.com>
MFC after: 3 days
MFC with: r365332, r365550
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D26322

3 years agoUse vmcb_read/write for the vmcb snapshot functions.
jhb [Thu, 10 Sep 2020 22:22:23 +0000 (22:22 +0000)]
Use vmcb_read/write for the vmcb snapshot functions.

This avoids some unnecessary layers of indirection.

3 years agomemfd_create: fix return values
kevans [Thu, 10 Sep 2020 21:25:16 +0000 (21:25 +0000)]
memfd_create: fix return values

Literally returning EINVAL from a function designed to return an fd makes
for interesting scenarios.

I cannot assign enough pointy hats to cover this one.

3 years agoFix interaction between largepages and seals/writes.
kib [Thu, 10 Sep 2020 20:54:44 +0000 (20:54 +0000)]
Fix interaction between largepages and seals/writes.

On write with SHM_GROW_ON_WRITE, use proper truncate.
Do not allow to grow largepage shm if F_SEAL_GROW is set. Note that
shrinks are not supported at all due to unmanaged mappings.
Call to vm_pager_update_writecount() is only valid for swap objects,
skip it for unmanaged largepages.
Largepages cannot support write sealing.
Do not writecnt largepage mappings.

Reported by: kevans
Reviewed by: kevans, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D26394

3 years agoAdd basic test for net.fibs dynamic growth.
melifaro [Thu, 10 Sep 2020 19:25:51 +0000 (19:25 +0000)]
Add basic test for net.fibs dynamic growth.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D26382

3 years ago[PowerPC64LE] Add LOAD_LR_NIA and RETURN_TO_NATIVE_ENDIAN defines.
bdragon [Thu, 10 Sep 2020 18:41:15 +0000 (18:41 +0000)]
[PowerPC64LE] Add LOAD_LR_NIA and RETURN_TO_NATIVE_ENDIAN defines.

* Add LOAD_LR_NIA define. This is preferred to "bl 1f; 1:" because it
doesn't pollute the branch predictor.

* Add magic sequence to return the CPU to the correct endianness after
jumping to cross-endian code, similar to the sequence from Linux.

Sponsored by: Tag1 Consulting, Inc.

3 years agourndis(4): Add support of Inseego/Novatel Wireless MiFi 8800/8000
lwhsu [Thu, 10 Sep 2020 18:27:52 +0000 (18:27 +0000)]
urndis(4): Add support of Inseego/Novatel Wireless MiFi 8800/8000

PR: 245152
Submitted by: rootless@gmail.com
Reviewed by: hselasky
MFC after: 3 days

3 years agocrunchgen(8): fix crunched application build with WARNS=6
kevans [Thu, 10 Sep 2020 18:19:45 +0000 (18:19 +0000)]
crunchgen(8): fix crunched application build with WARNS=6

This was revealed by the rescue build with a patch I'm working on to default
WARNS=6 everywhere. The issues resolved were:

- Missing prototype for _crunched_${ident}_stub in the *_stub.c generated
  bits
- Missing prototype for crunched_main
- Incomplete prototype for _crunched_${ident}_stub in the generated parts of
  crunched_main
- Literal strings in the stub table must drop const qualifier, unless we
  const'ify name
- f field in struct stub didn't have a proper prototype

Most of these issues are minor formalities and easily addressed.

I note that if my patch to eventually raise WARNS for the rescue build
lands, we'll need to bump the __FreeBSD_version requirement for
bootstrapping crunchgen and wipe out the rescue .OBJDIR if it's stale, which
we should be able to detect pretty easily from a couple of the issues that
have been fixed here.

Reviewed by: arichardson
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26363

3 years agoFix the build after r365592
kevans [Thu, 10 Sep 2020 17:58:24 +0000 (17:58 +0000)]
Fix the build after r365592

r365592 accidentally mixed atf-c and atf-sh; convert atf_skip -> atf_tc_skip

3 years agolibrt: tests: fix minor issues with higher WARNS
kevans [Thu, 10 Sep 2020 17:53:00 +0000 (17:53 +0000)]
librt: tests: fix minor issues with higher WARNS

got_sigalrm is a global with external linkage and must therefore have a
previous extern declaration. There's no reason to maintain the status quo
there, so just make it static.

The result var is unused.

This part of the test has not been upstreamed, presumably because it exists
solely for sem_clockwait_np. We should perhaps consider moving it into its
own test file outside of ^/contrib/netbsd-tests, but this can happen later.

MFC after: 1 week

3 years agoMFV r365599: import fix for a libexecinfo warning at higher WARNS
kevans [Thu, 10 Sep 2020 17:48:27 +0000 (17:48 +0000)]
MFV r365599: import fix for a libexecinfo warning at higher WARNS

v1.17 of this file included a fix that I just submitted upstream to fix a
warning about prevent_inline with external linkage not having been
previously declared.

MFC after: 1 week

3 years agoFix memfd_create tests after r365524
kevans [Thu, 10 Sep 2020 17:23:30 +0000 (17:23 +0000)]
Fix memfd_create tests after r365524

r365524 did accidentally invert this check that sets SHM_LARGEPAGE, leading
non-hugetlb memfd as unconfigured largepage shm and thus test failures when
we try to ftruncate or write to them.

PR: 249236
Discussed with: kib

3 years agoTemporarily skip failing sys.kern.memfd_test.* tests in CI
lwhsu [Thu, 10 Sep 2020 17:15:44 +0000 (17:15 +0000)]
Temporarily skip failing sys.kern.memfd_test.* tests in CI

PR: 249236
Sponsored by: The FreeBSD Foundation

3 years agoFollow-up r364753 by only using arm's stdatomic.c implementation, as it
dim [Thu, 10 Sep 2020 16:47:12 +0000 (16:47 +0000)]
Follow-up r364753 by only using arm's stdatomic.c implementation, as it
already covers the functions in compiler-rt's atomic.c, leading to
conflicts when linking.

PR: 230888
MFC after: 3 days
X-MFC-With: r364753

3 years agoEnsure that the makewhatis symlink is added in the bootstrap-tools stage
arichardson [Thu, 10 Sep 2020 15:37:29 +0000 (15:37 +0000)]
Ensure that the makewhatis symlink is added in the bootstrap-tools stage

We currently set MK_MAN=no in $BSARGS so MK_MAN_UTILS will also be false
which means that the makewhatis symlink will not be created.
This change fixes the build when using both -DBUILD_WITH_STRICT_TMPPATH and
-DBOOTSTRAP_ALL_TOOLS.

Tested by: andrew
Differential Revision: https://reviews.freebsd.org/D16761

3 years agoSilence GCC's -Wno-unused-result during bootstrap
arichardson [Thu, 10 Sep 2020 15:37:24 +0000 (15:37 +0000)]
Silence GCC's -Wno-unused-result during bootstrap

Unlike clang, GCC still warns even with (void) casts (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425)

3 years agoFix -Wpointer-sign warnings in bwstring.c
arichardson [Thu, 10 Sep 2020 15:37:19 +0000 (15:37 +0000)]
Fix -Wpointer-sign warnings in bwstring.c

3 years agoFix a noisy -Wundef warning when bootstrapping tools
arichardson [Thu, 10 Sep 2020 15:37:15 +0000 (15:37 +0000)]
Fix a noisy -Wundef warning when bootstrapping tools

3 years agoRemove -I flag for include path that doesn't exist
arichardson [Thu, 10 Sep 2020 15:37:07 +0000 (15:37 +0000)]
Remove -I flag for include path that doesn't exist

Found this while trying to get macOS bootstrap to work again after OpenZFS merge.

Reviewed By: #zfs, freqlabs
Differential Revision: https://reviews.freebsd.org/D26192

3 years agoMove the pl061 acpi attachment earlier
andrew [Thu, 10 Sep 2020 14:58:46 +0000 (14:58 +0000)]
Move the pl061 acpi attachment earlier

As the pl061 driver can be an interrupt controller attach it earlier in the
boot so other drivers can use it.

Use a new GPIO xref to not conflict with the existing root interrupt
controller.

Sponsored by: Innovate UK

3 years agoIgnore the .interp section in the arm64 EFI loader
andrew [Thu, 10 Sep 2020 14:13:49 +0000 (14:13 +0000)]
Ignore the .interp section in the arm64 EFI loader

When building the loader an unneeded .interp section may be added. Move
this to the unused section region so offsets of used sections don't
change.

Obtained from: CheriBSD
Sponsored by: Innovate UK

3 years agoMove the rid variable to the generic iommu context.
br [Thu, 10 Sep 2020 14:12:25 +0000 (14:12 +0000)]
Move the rid variable to the generic iommu context.
It could be used in various IOMMU platforms, not only DMAR.

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D26373

3 years agoSet AlignTrailingComments in the clang-format config
arichardson [Thu, 10 Sep 2020 14:11:29 +0000 (14:11 +0000)]
Set AlignTrailingComments in the clang-format config

This seems to be fairly common in existing code and often looks better when
adding trailing comments to e.g. enumerators or array initializers.
See D26340 for more context.

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D26391

3 years agoUse the correct config names for some .clang-format entries
arichardson [Thu, 10 Sep 2020 14:11:24 +0000 (14:11 +0000)]
Use the correct config names for some .clang-format entries

Those values are enum entries and should use "Never" instead of "false".
clang-format currently accepts false, but it's better to use the correct
syntax in case that changes in the future.

3 years agoAdd author entity for rhurlin, part 2
rhurlin [Thu, 10 Sep 2020 13:57:57 +0000 (13:57 +0000)]
Add author entity for rhurlin, part 2

Forgot to submit step 5 from procedure 1 in Chap. 6 of the Committers Guide:
Update Mentor and Mentee Information

Reviewed by: arrowd (mentor), tcberner (mentor)
Approved by: arrowd (mentor), tcberner (mentor)

3 years agoSwitch the name of the pl061 driver to gpio
andrew [Thu, 10 Sep 2020 09:50:43 +0000 (09:50 +0000)]
Switch the name of the pl061 driver to gpio

We need it to be named gpio for gpiobus to work.

Sponsored by: Innovate UK

3 years agoOnly manage ofw gpio providers on ofw systems
andrew [Thu, 10 Sep 2020 09:42:37 +0000 (09:42 +0000)]
Only manage ofw gpio providers on ofw systems

On arm64 we may boot via ACPI. In this case we will still try to manage the
gpio providers as if we are using FDT. Fix this by checking if the FDT node
is valid before registering a cross reference.

Sponsored by: Innovate UK

3 years agoUse the correct variable to check which interrupt mode to use
andrew [Thu, 10 Sep 2020 09:37:30 +0000 (09:37 +0000)]
Use the correct variable to check which interrupt mode to use

In the PL061 driver we incorrectly used the mask rather than mode to find
how to configure the interrupt.

Sponsored by: Innovate UK

3 years agoFix RADIX_MPATH build broken by r365521.
melifaro [Thu, 10 Sep 2020 07:05:31 +0000 (07:05 +0000)]
Fix RADIX_MPATH build broken by r365521.

Reported by: jenkins, Hartmann, O. <ohartmann at walstatt.org>

3 years agoRemove vm_map_create(9) KPI's manpage according to r364302
lwhsu [Thu, 10 Sep 2020 06:32:25 +0000 (06:32 +0000)]
Remove vm_map_create(9) KPI's manpage according to r364302

Submitted by: Ka Ho Ng <khng300@gmail.com>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26372

3 years agoice_ddp: Fix 1.3.16.0 package
erj [Thu, 10 Sep 2020 04:00:13 +0000 (04:00 +0000)]
ice_ddp: Fix 1.3.16.0 package

The version uploaded in the previous commit was far too small. This one
should be the right size.

MFC after: 1 day
Sponsored by: Intel Corporation

3 years agocp: use copy_file_range(2)
asomers [Thu, 10 Sep 2020 02:48:55 +0000 (02:48 +0000)]
cp: use copy_file_range(2)

This has three advantages over write(2)/read(2):

* Fewer context switches and data copies
* Mostly preserves a file's sparseness
* On some file systems (currently NFS 4.2) the file system will perform the
  copy in an especially efficient way.

Reviewed by: rmacklem
MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D26377

3 years ago[PowerPC] Fix setting of time in OPAL
bdragon [Thu, 10 Sep 2020 01:49:53 +0000 (01:49 +0000)]
[PowerPC] Fix setting of time in OPAL

There were multiple bugs in the OPAL RTC code which had never been
discovered, as the default configuration of OPAL machines is to
have the BMC / FSP control the RTC.

* Fix calling convention for setting the time -- the variables are passed
directly in CPU registers, not via memory.

* Fix bug in the bcd encoding routines. (from jhibbits)

Tested on POWER9 Talos II (BE) and POWER9 Blackbird (LE).

Reviewed by: jhibbits (in irc)
Sponsored by: Tag1 Consulting, Inc.

3 years agoAdd -z "TOS" option to ping6, to test DSCP/ECN values
rscheff [Thu, 10 Sep 2020 00:50:18 +0000 (00:50 +0000)]
Add -z "TOS" option to ping6, to test DSCP/ECN values

ping has the option to add the (deprecated) TOS byte
using the -z option. Adding the same option, with the
same (deprecated) Traffic Class Byte (nowadays actually
DSCP and ECN fields) to ping6 to validate proper QoS
processing in network switches.

Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26384

3 years agocc_mod: remove unused CCF_DELACK definition
rscheff [Thu, 10 Sep 2020 00:46:38 +0000 (00:46 +0000)]
cc_mod: remove unused CCF_DELACK definition

During the DCTCP improvements, use of CCF_DELACK was
removed. This change is just to rename the unused flag
bit to prevent use of it, without also re-implementing
the tcp_input and tcp_output interfaces.

No functional change.

Reviewed by: chengc_netapp.com, tuexen
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26181

3 years agoAdd posixshmcontrol(1) support for largepage shm objects.
kib [Wed, 9 Sep 2020 22:22:02 +0000 (22:22 +0000)]
Add posixshmcontrol(1) support for largepage shm objects.

Create op with -l <largepage> option can create it, stat displays
configured page size.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D24652

3 years agoAdd shm_create_largepage(3) helper for creation and configuration of
kib [Wed, 9 Sep 2020 22:20:36 +0000 (22:20 +0000)]
Add shm_create_largepage(3) helper for creation and configuration of
largepage shm objects.

And since we can, add memfd_create(MFD_HUGETLB) support, hopefully
close enough to the Linux feature.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D24652

3 years agoFix compilation of libsysdecode after r365522, should have been part of it.
kib [Wed, 9 Sep 2020 22:18:44 +0000 (22:18 +0000)]
Fix compilation of libsysdecode after r365522, should have been part of it.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D24652