]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agompt.4: Warn about unexpected behaviour on older controllers
Sebastian Oswald [Sat, 16 Jan 2021 23:27:43 +0000 (00:27 +0100)]
mpt.4: Warn about unexpected behaviour on older controllers

Older controllers have errata which causes the disk controller to wrap
data to other LBAs, causing data to be overwritten. [1]

While here, fix a small typo.

1: https://www.broadcom.com/support/knowledgebase/1211161496563/3-terabyte-3tb-capacity-drives-on-lsi-megaraid-and-3ware-control

PR: 220343
Submitted by: Sebastian Oswald <sebastian at rostwald.de>
Reviewed by: 0mp
Event: January 2021 Bugathon
Differential Revision: <https://reviews.freebsd.org/D28201

3 years agoloader.efi: handle multiple gop instances
Toomas Soome [Sat, 16 Jan 2021 17:51:23 +0000 (19:51 +0200)]
loader.efi: handle multiple gop instances

Some systems may provide multiple GOP instances and not all are
bound to hardware. The current loader is picking up the first GOP,
which may not be usable. Instead we load the GOP handle array,
and test every handle to have registered ConOut protocol. If ConOut is
present, we can use this GOP handle to open GOP protocol.

3 years agowl(4): remove obsolete header
Marius Strobl [Sat, 16 Jan 2021 22:54:50 +0000 (23:54 +0100)]
wl(4): remove obsolete header

It's unused since 09b9789b28dd8453a54cb424115f31a6d3672527 and r304506
respectively and should have gone along with these.

3 years agoman4: bring back ofw_console.4 and openfirm.4
Marius Strobl [Sat, 16 Jan 2021 15:58:38 +0000 (16:58 +0100)]
man4: bring back ofw_console.4 and openfirm.4

Back when I wrote openfirm.4, sparc64 was the only architecture to
include the corresponding device. However, nowadays all supported
architectures will provied this Open Firmware interface, even x86
when built with FDT support.
As for ofw_console(4), powerpc actually was the first architecture
to ship it but we'll probably not see another consumer in future.

This partially reverts 702547720ca01437081fb1b6f9eb281c9541021b and
r357794 respectively, adjusting paths and content as appropriate.

3 years agoopenpromio(4): remove obsolete pseudo device driver
Marius Strobl [Sat, 16 Jan 2021 11:49:47 +0000 (12:49 +0100)]
openpromio(4): remove obsolete pseudo device driver

It's unused since 58aa35d42975c298ca0adba705c042596303c9f5 and r357455
respectively and should have gone along with these.

3 years agokerneldoc: remove Doxyfile for cmx(4)
Marius Strobl [Sat, 9 Jan 2021 11:31:40 +0000 (12:31 +0100)]
kerneldoc: remove Doxyfile for cmx(4)

The latter has been removed in 0d3a424a89c1f61c2a46791c097a06f1d139cd5e.

3 years agotargets: no longer depend on bt3cfw(8)
Marius Strobl [Sat, 9 Jan 2021 11:10:07 +0000 (12:10 +0100)]
targets: no longer depend on bt3cfw(8)

The latter has been removed in 23e124c78bcb46ac78d9f06449c4454f43732805.

3 years agobluetooth: remove support for bt3c(4)
Marius Strobl [Sat, 9 Jan 2021 11:07:37 +0000 (12:07 +0100)]
bluetooth: remove support for bt3c(4)

The latter has been removed in 23e124c78bcb46ac78d9f06449c4454f43732805.

3 years agobluetooth.device.conf.5/netgraph.4: remove reference to ng_bt3c(4)
Marius Strobl [Sat, 9 Jan 2021 11:01:39 +0000 (12:01 +0100)]
bluetooth.device.conf.5/netgraph.4: remove reference to ng_bt3c(4)

The latter has been removed in 23e124c78bcb46ac78d9f06449c4454f43732805.

3 years agohier.7/wlan.4: remove reference to wi(4)
Marius Strobl [Sat, 9 Jan 2021 10:52:40 +0000 (11:52 +0100)]
hier.7/wlan.4: remove reference to wi(4)

The latter has been removed in a21def4d568fd2f6723252c16e116b5e7d8125eb.

3 years agosym(4): Remove remainder of SYM_SETUP_LP_PROBE_MAP support
Marius Strobl [Sun, 27 Dec 2020 18:38:58 +0000 (19:38 +0100)]
sym(4): Remove remainder of SYM_SETUP_LP_PROBE_MAP support

Missed in 221ac8f4cd823a2b047c2807e2cf744c7176dd1f and r339575
respectively.

3 years agoSplit rtinit() into multiple functions.
Alexander V. Chernikov [Sat, 9 Jan 2021 00:19:25 +0000 (00:19 +0000)]
Split rtinit() into multiple functions.

rtinit[1]() is a function used to add or remove interface address prefix routes,
  similar to ifa_maintain_loopback_route().
It was intended to be family-agnostic. There is a problem with this approach
 in reality.

1) IPv6 code does not use it for the ifa routes. There is a separate layer,
  nd6_prelist_(), providing interface for maintaining interface routes. Its part,
  responsible for the actual route table interaction, mimics rtenty() code.

2) rtinit tries to combine multiple actions in the same function: constructing
  proper route attributes and handling iterations over multiple fibs, for the
  non-zero net.add_addr_allfibs use case. It notably increases the code complexity.

3) dstaddr handling. flags parameter re-uses RTF_ flags. As there is no special flag
 for p2p connections, host routes and p2p routes are handled in the same way.
 Additionally, mapping IFA flags to RTF flags makes the interface pretty messy.
 It make rtinit() to clash with ifa_mainain_loopback_route() for IPV4 interface
 aliases.

4) rtinit() is the last customer passing non-masked prefixes to rib_action(),
 complicating rib_action() implementation.

5) rtinit() coupled ifa announce/withdrawal notifications, producing "false positive"
 ifa messages in certain corner cases.

To address all these points, the following has been done:

* rtinit() has been split into multiple functions:
- Route attribute construction were moved to the per-address-family functions,
 dealing with (2), (3) and (4).
- funnction providing net.add_addr_allfibs handling and route rtsock notificaions
 is the new routing table inteface.
- rtsock ifa notificaion has been moved out as well. resulting set of funcion are only
 responsible for the actual route notifications.

Side effects:
* /32 alias does not result in interface routes (/32 route and "host" route)
* RTF_PINNED is now set for IPv6 prefixes corresponding to the interface addresses

Differential revision: https://reviews.freebsd.org/D28186

3 years agoservice.8: Use entire section of literally displayed text
Daniel Ebdrup Jensen [Sat, 16 Jan 2021 21:19:20 +0000 (22:19 +0100)]
service.8: Use entire section of literally displayed text

.Dl indents literal display text for one line, but .Bd can do it for a
whole subsection.

Pointy hat to: debdrup
Reported by: 0mp
Reviewed by: 0mp
Differential Revision: https://reviews.freebsd.org/D28198

3 years agoservice.8: Provide example for adding completions to (t)csh
Daniel Ebdrup Jensen [Sat, 16 Jan 2021 20:55:20 +0000 (21:55 +0100)]
service.8: Provide example for adding completions to (t)csh

service(8) has an example for bash completion, however bash is third
party and in /usr/share/examples/csh/dot.cshrc is a working example for
csh.

Since I use (t)csh, I've tested it, and it works for me.

PR: 179497
Submitted by: ohauer@

Reviewed by: kp (tentatively)
Differential Revision: https://reviews.freebsd.org/D28197

3 years agoloader.efi: Use Blt with gop as default
Toomas Soome [Sat, 16 Jan 2021 15:35:51 +0000 (17:35 +0200)]
loader.efi: Use Blt with gop as default

System with FB address 0x4000000000 does not draw, Blt() is doing fine.
I think, we can assume the Blt will usually work.

3 years agoAdd libclang_rt.profile-powerpc64le.a to (Optional)?ObsoleteFiles.inc
Dimitry Andric [Sat, 16 Jan 2021 16:25:56 +0000 (17:25 +0100)]
Add libclang_rt.profile-powerpc64le.a to (Optional)?ObsoleteFiles.inc

On little-endian PowerPC64, this prevented /usr/lib/clang/11.0.0 being
cleaned up completely after upgrading to clang 11.0.1.

Noticed by: pkubaj
MFC after: 4 weeks
X-MFC-With: r364284

3 years agocat: style nits
Mariusz Zaborski [Sat, 16 Jan 2021 11:58:23 +0000 (12:58 +0100)]
cat: style nits

3 years agocat: persistent errno
Mariusz Zaborski [Sat, 16 Jan 2021 11:55:42 +0000 (12:55 +0100)]
cat: persistent errno

There is no guarantee that after close(2)/free the errno will remain
persistent. The caller of the udom_open function depends on the errno
for reporting errors.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D28185

3 years agomips: Fix build by using the correct device-tree include path
Emmanuel Vadot [Sat, 16 Jan 2021 10:34:10 +0000 (11:34 +0100)]
mips: Fix build by using the correct device-tree include path

3 years agomips: Add the device-tree path to the include paths
Emmanuel Vadot [Sat, 16 Jan 2021 10:33:37 +0000 (11:33 +0100)]
mips: Add the device-tree path to the include paths

3 years agoriscv: Fix build by using the correct device-tree include path
Emmanuel Vadot [Sat, 16 Jan 2021 10:31:39 +0000 (11:31 +0100)]
riscv: Fix build by using the correct device-tree include path

3 years agoriscv: Add the device-tree path to the include path
Emmanuel Vadot [Sat, 16 Jan 2021 10:31:17 +0000 (11:31 +0100)]
riscv: Add the device-tree path to the include path

3 years agoSave on getpid in setproctitle by supporting -1 as curproc.
Mateusz Guzik [Sat, 16 Jan 2021 08:26:17 +0000 (09:26 +0100)]
Save on getpid in setproctitle by supporting -1 as curproc.

3 years agoaxgbe: driver changes for netmap support
Vincenzo Maffione [Sat, 16 Jan 2021 08:23:19 +0000 (08:23 +0000)]
axgbe: driver changes for netmap support

AMD 10GbE hardware is designed to have two buffers per receive descriptor to
support split header feature. For this purpose, the driver was designed to use
2 iflib freelists per receive queue. So, that buffers from 2 freelists are used
to refill an entry in the receive descriptor. The current design holds good
with regular data traffic.

But, when netmap comes into play, the current design will not fit in. The
current netmap interfaces and netmap implementation in iflib doesn't seem
to accomodate the design of 2 freelists per receive queue. So, exercising
Netmap capability with inbuilt tools like bridge, pkt-gen doesn't work with
the 2 freelists driver design.

So, the driver design is changed to accomodate the current netmap interfaces
and netmap implementation in iflib by using single freelist per receive queue
approach when Netmap capability is exercised without disturbing the current
2 freelists approach.
The dev.ax.sph_enable tunable can be set to 0 to configure the single
free list mode.

Thanks to Stephan Dewt for his Initial set of code changes for the stated
problem.

Submitted by: rajesh1.kumar_amd.com
Approved by: vmaffione
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D27797

3 years agoloader: create local copy of mode list provided by vbeinfoblock
Toomas Soome [Sat, 16 Jan 2021 10:18:32 +0000 (12:18 +0200)]
loader: create local copy of mode list provided by vbeinfoblock

Apparently some systems do corrupt mode list memory area, so we need
to use local copy instead.

3 years agomake check: suppress echo of kyua binary location
Kyle Evans [Sat, 16 Jan 2021 06:06:49 +0000 (00:06 -0600)]
make check: suppress echo of kyua binary location

986deea5b518ee5bf6b8b1486056a21819bd8bd2 inadvertently removed this; fix it.

3 years agobectl: remove spurious aok variable
Kyle Evans [Sat, 16 Jan 2021 06:02:43 +0000 (00:02 -0600)]
bectl: remove spurious aok variable

This rode in with the OpenZFS import. It may have been necessary at some
point, but it is no longer and it breaks the WITHOUT_DYNAMICROOT build as
it collides with the definition in libspl.

Reported-by: Michael Dexter

3 years agobectl: tests: use -R <mount> instead of specifying altroot
Kyle Evans [Sat, 16 Jan 2021 05:58:12 +0000 (23:58 -0600)]
bectl: tests: use -R <mount> instead of specifying altroot

-R is currently shorthand for cachefile=none, altroot=<mount>.  This is
functionally the same, but perhaps more resilient to future changes that
could be necessary that may be added when -R is specified.

MFC after:  1 week

3 years agoEliminate a locking panic when cleaning up UFS snapshots after a
Kirk McKusick [Sat, 16 Jan 2021 00:33:00 +0000 (16:33 -0800)]
Eliminate a locking panic when cleaning up UFS snapshots after a
disk failure.

Each vnode has an embedded lock that controls access to its contents.
However vnodes describing a UFS snapshot all share a single snapshot
lock to coordinate their access and update. As part of mounting a
UFS filesystem with snapshots, each of the vnodes describing a
snapshot has its individual lock replaced with the snapshot lock.
When the filesystem is unmounted the vnode's original lock is
returned replacing the snapshot lock.

When a disk fails while the UFS filesystem it contains is still
mounted (for example when a thumb drive is removed) UFS forcibly
unmounts the filesystem. The loss of the drive causes the GEOM
subsystem to orphan the provider, but the consumer remains until
the filesystem has finished with the unmount. Information describing
the snapshot locks was being prematurely cleared during the orphaning
causing the return of the snapshot vnode's original locks to fail.
The fix is to not clear the needed information prematurely.

Sponsored by: Netflix

3 years agoEliminate lock order reversal in UFS when unmounting filesystems
Kirk McKusick [Sat, 16 Jan 2021 00:00:17 +0000 (16:00 -0800)]
Eliminate lock order reversal in UFS when unmounting filesystems
with snapshots.

Each vnode has an embedded lock that controls access to its contents.
However vnodes describing a UFS snapshot all share a single snapshot
lock to coordinate their access and update.  As part of mounting a
UFS filesystem with snapshots, each of the vnodes describing a
snapshot has its individual lock replaced with the snapshot lock.
When the filesystem is unmounted the vnode's original lock is
returned replacing the snapshot lock.

The lock order reversal happens because vnode locks must be acquired
before snapshot locks. When unmounting we must lock both the snapshot
lock and the vnode lock before swapping them so that the vnode will
be continuously locked during the swap. For each vnode representing
a snapshot, we must first acquire the snapshot lock to ensure
exclusive access to it and its original lock.  We then face a lock
order reversal when we try to acquire the original vnode lock. The
problem is eliminated by doing a non-blocking exclusive lock on the
original lock which will always succeed since there are no users
of that lock.

Sponsored by: Netflix

3 years agolualoader: use floor division to get correct type
Kyle Evans [Fri, 15 Jan 2021 14:15:40 +0000 (08:15 -0600)]
lualoader: use floor division to get correct type

This fixes the positioning of the "Welcome to FreeBSD" heading, which was
misplaced after the recent update to Lua 5.4. The issue was previously
masked by a compatibility knob in Lua 5.3 that would cause float-tagged
numbers to render faithfully without the decimal component. Lua 5.4 dropped
that and ensures that it always prints a decimal component, even if it has
to append a ".0" to the value.

Standard division produces a "float", floor division (//) can be used to
guarantee an integer. Floating point operations have been completely ripped
out of the liblua compiled for the bootloader, so this is a nop. This is
decidedly better than trying to hack out the float tag entirely.

Reported-by: mjg, probably others
MFC-after: 3 days

3 years agocat: Fix potential memory leak
Mariusz Zaborski [Fri, 15 Jan 2021 20:48:39 +0000 (21:48 +0100)]
cat: Fix potential memory leak

This was introduced in aefe30c5437159a5399bdbc1974d6fbf40f2ba0f.

3 years agoAdd 'tmp' to the list of FILESYSTEMS dependencies. Some scripts that
Gleb Smirnoff [Mon, 11 Jan 2021 19:11:29 +0000 (11:11 -0800)]
Add 'tmp' to the list of FILESYSTEMS dependencies.  Some scripts that
depend on FILESYSTEMS run mktemp(1).  For systems that have read-only
root this is broken until memory disk based /tmp is instantiated.  At
least 'os-release' and 'motd' are subject to this problem.

Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D28097

3 years agoRevert 97ec6eba653a07. There shouldn't be a dependency of 'tmp' on
Gleb Smirnoff [Mon, 11 Jan 2021 20:13:41 +0000 (12:13 -0800)]
Revert 97ec6eba653a07.  There shouldn't be a dependency of 'tmp' on
remote filesystems.  Discussed this with Brooks and he can't find
evidence that provoked the change in 2005.  If anything gets broken
I will fix it in a different way, not via rc sequence change.

Discussed with: brooks
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D28097

3 years agocat: capsicumize it
Mariusz Zaborski [Fri, 15 Jan 2021 20:22:29 +0000 (21:22 +0100)]
cat: capsicumize it

Reviewed by: markj, arichardson
Differential Revision: https://reviews.freebsd.org/D28083

3 years agoExtract the logic from pmap_kextract
Andrew Turner [Fri, 15 Jan 2021 18:48:43 +0000 (18:48 +0000)]
Extract the logic from pmap_kextract

This allows us to use it when we only need to check if the virtual address
is valid. For example when checking if an address in the DMAP region is
mapped.

Reviewed by: kib, markj
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D27621

3 years agoRemove the old dts imported tree.
Emmanuel Vadot [Fri, 15 Jan 2021 18:12:04 +0000 (19:12 +0100)]
Remove the old dts imported tree.

The new one is in sys/contrib/device-tree

3 years agoSwitch to the new device-tree vendor tree
Emmanuel Vadot [Fri, 15 Jan 2021 14:28:46 +0000 (15:28 +0100)]
Switch to the new device-tree vendor tree

The old vendor tree was never fully merged and doing partial merge isn't
supported with git subtree merge so a new one was created.
Switch the build to use the new DTS from sys/contrib/device-tree
This also bump the DTS used to be in sync with Linux 5.9
While here change the way to get the linux version, simply hardcode
the value in sys/dts/freebsd-compatible.dts and use awk to get that
to put it in the CFLAGS.
As a bonus we now have the bindings docs available
in sys/contrib/device-tree/Bindings/ so no need to link to the Linux repo
or to the vendor tree.

3 years agogpiokeys: Use the new device-tree vendor include
Emmanuel Vadot [Fri, 15 Jan 2021 18:26:34 +0000 (19:26 +0100)]
gpiokeys: Use the new device-tree vendor include

3 years agoarm64: Directly use #include <dt-binding/...>
Emmanuel Vadot [Fri, 15 Jan 2021 18:26:02 +0000 (19:26 +0100)]
arm64: Directly use #include <dt-binding/...>

We have it in the includes path and this will help the transition to the
new device-tree import in sys/contrib

3 years agoRe-apply f81b2b9a8abd to the new device-tree import
Emmanuel Vadot [Fri, 15 Jan 2021 18:54:14 +0000 (19:54 +0100)]
Re-apply f81b2b9a8abd to the new device-tree import

3 years agoRevert upstream commit 27c90e5e48d0
Emmanuel Vadot [Fri, 15 Jan 2021 18:02:37 +0000 (19:02 +0100)]
Revert upstream commit 27c90e5e48d0

It changed the #pinctrl-cells value to be equal to 2 and the macro
that generates the values.
Based on the bindings docs a value of 2 is only acceptable if the node
used pinctrl-single,bits and not pinctrl-single,pins

This allow booting further on the beaglebone black with 5.9 DTS

3 years agoriscv: fix kernel build
Mitchell Horne [Fri, 15 Jan 2021 15:41:51 +0000 (11:41 -0400)]
riscv: fix kernel build

A more complete fix for this function is being worked on in D28054. Fix
the uninitialized variable error so that builds can at least proceed.

Reported by: several

3 years agoUnify Intel CODEC naming.
Alexander Motin [Fri, 15 Jan 2021 14:56:15 +0000 (09:56 -0500)]
Unify Intel CODEC naming.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week

3 years agoAdd Intel Gemini Lake AHCI ID.
Alexander Motin [Fri, 15 Jan 2021 14:53:35 +0000 (09:53 -0500)]
Add Intel Gemini Lake AHCI ID.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week

3 years agoarm: arm64: Directly use #include <dt-binding/...>
Emmanuel Vadot [Fri, 15 Jan 2021 13:17:03 +0000 (14:17 +0100)]
arm: arm64: Directly use #include <dt-binding/...>

We have it in the includes path and this will help the transition to the
new device-tree import in sys/contrib

3 years agoarm64: Add the dts include directory to the includes dir
Emmanuel Vadot [Fri, 15 Jan 2021 13:15:31 +0000 (14:15 +0100)]
arm64: Add the dts include directory to the includes dir

We do that for arm so we can directly #include <dt-bindings/...>

3 years agoloader: do not update palette in text mode (real fix)
Toomas Soome [Fri, 15 Jan 2021 12:58:12 +0000 (14:58 +0200)]
loader: do not update palette in text mode (real fix)

Apparently palette update while in text mode, will cause
some adapters to end up with blank display. Previous update had
condition reversed.

3 years agoAdd 'sys/contrib/device-tree/' from commit '5ee353c36d3c9c7f63df7c7671875e73fba70958'
Emmanuel Vadot [Fri, 15 Jan 2021 11:28:57 +0000 (12:28 +0100)]
Add 'sys/contrib/device-tree/' from commit '5ee353c36d3c9c7f63df7c7671875e73fba70958'

git-subtree-dir: sys/contrib/device-tree
git-subtree-mainline: 94611a838866cba8d7366a3107724af98c75e953
git-subtree-split: 5ee353c36d3c9c7f63df7c7671875e73fba70958

3 years agoAdd missing no-ctfconvert to C generation rules
Andrew Turner [Thu, 14 Jan 2021 15:34:30 +0000 (15:34 +0000)]
Add missing no-ctfconvert to C generation rules

Stop running ctfconvert over generated C files in the kernel by marking
them with no-ctfconvert.

This fixes warnings from ctfconvert trying to parse C files:

ctfconvert: file.c: Couldn't read ehdr: Invalid argument

Reviewed by: emaste, mmel
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D28156

3 years agopkgfs_open: follow symlinks
Simon J. Gerraty [Fri, 15 Jan 2021 01:33:05 +0000 (17:33 -0800)]
pkgfs_open: follow symlinks

Caller is not interested in symlinks follow them.
Throw an error if too many links encountered.

Reviewed by: stevek
Sponsored by: Juniper Networks
--This line, and those below, will be ignored--
> Description of fields to fill in above:                     76 columns --|
> PR:                       If a GNATS PR is affected by the change.
> Differential Revision:    https://reviews.freebsd.org/D### (*full* phabric URL needed).
> Submitted by:             If someone else sent in the change.
> Reviewed by:              If someone else reviewed your modification.
> Approved by:              If you needed approval for this commit.
> Obtained from:            If the change is from a third party.
> MFC after:                N [day[s]|week[s]|month[s]].  Request a reminder email.
> MFH:                      Ports tree branch name.  Request approval for merge.
> Relnotes:                 Set to 'yes' for mention in release notes.
> Security:                 Vulnerability reference (one per line) or description.
> Sponsored by:             If the change was sponsored by an organization.
> Empty fields above will be automatically removed.

Change-Id: I4ef92ff256f503c620dc5bba79ed93b32cb2330d

3 years agouart: Improve console specification parsing
Warner Losh [Thu, 14 Jan 2021 20:43:15 +0000 (13:43 -0700)]
uart: Improve console specification parsing

Print warning when we can't parse a console specification (this may
not appear on the console, but will appear in dmesg).

Also, accept key:value and key=value. There's no reason not to
and it makes this more forgiving of mistakes.

Reviewed by: rpokala@
Differential Revision: https://reviews.freebsd.org/D28168

3 years agoRELNOTES: correct elfctl(1) man page section
Ed Maste [Thu, 14 Jan 2021 21:45:58 +0000 (16:45 -0500)]
RELNOTES: correct elfctl(1) man page section

3 years agoNote aesni/armv8crypto in GENERIC, W^X, and AES-XTS for armv8crypto.
John Baldwin [Thu, 14 Jan 2021 20:59:37 +0000 (12:59 -0800)]
Note aesni/armv8crypto in GENERIC, W^X, and AES-XTS for armv8crypto.

3 years agoMerge llvm-project llvmorg-11.0.1-0-g43ff75f2c3f (aka 11.0.1 release)
Dimitry Andric [Thu, 14 Jan 2021 20:45:55 +0000 (21:45 +0100)]
Merge llvm-project llvmorg-11.0.1-0-g43ff75f2c3f (aka 11.0.1 release)

There were no functional changes after 11.0.1 rc2, so only the version
strings changed.

MFC after:      4 weeks
X-MFC-With:     r364284

3 years agoelfctl: prefix disable flags with "no"
Ed Maste [Wed, 13 Jan 2021 18:08:31 +0000 (13:08 -0500)]
elfctl: prefix disable flags with "no"

Some ELF feature flags indicate a request to opt-out of some feature,
for example NT_FREEBSD_FCTL_ASLR_DISABLE indicates that ASLR should be
disabled for the tagged binary.  Using "aslr" as the short name for the
flag is confusing as it seems to indicate a request for ASLR to be
enabled.  Rename "noaslr", and make a similar change for other opt-out
flags.

Reviewed by: bapt, manu, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28139

3 years agoelfctl: add backwards compatibility for "no" prefixes
Ed Maste [Wed, 13 Jan 2021 19:21:38 +0000 (14:21 -0500)]
elfctl: add backwards compatibility for "no" prefixes

I am going to prefix opt-out ELF feature flag names with "no" to make
their meaning more clear (review D28139), but there are some uses of the
existing names already (e.g., the PR referenced below).

For now accept the older, unprefixed name as well, and emit a warning.
We can revert this after FreeBSD 13 branches.

% elfctl -e +aslr foo
elfctl: interpreting aslr as noaslr; please specify noaslr

PR: 239873 (related)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28140

3 years agohid: Add missing input enter/exit epoch pairs.
Vladimir Kondratyev [Thu, 14 Jan 2021 19:48:53 +0000 (22:48 +0300)]
hid:  Add missing input enter/exit epoch pairs.

This was affecting unloading keyboard driver and kdb-related code.

3 years agohid: Replace USBHID_ENABLED kernel config option with loader tunable
Vladimir Kondratyev [Tue, 12 Jan 2021 19:36:21 +0000 (22:36 +0300)]
hid: Replace USBHID_ENABLED kernel config option with loader tunable

usbhid(4) is disabled by default to avoid conflicts with existing USB HID
drivers. To enable it place following lines to /boot/loader.conf:

hw.usb.usbhid.enable=1
usbhid_load="YES"

Suggested by: jhb
Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D28124

3 years agotcp: add sysctl to tolerate TCP segments missing timestamps
Michael Tuexen [Wed, 13 Jan 2021 21:48:17 +0000 (22:48 +0100)]
tcp: add sysctl to tolerate TCP segments missing timestamps

When timestamp support has been negotiated, TCP segements received
without a timestamp should be discarded. However, there are broken
TCP implementations (for example, stacks used by Omniswitch 63xx and
64xx models), which send TCP segments without timestamps although
they negotiated timestamp support.
This patch adds a sysctl variable which tolerates such TCP segments
and allows to interoperate with broken stacks.

Reviewed by: jtl@, rscheff@
Differential Revision: https://reviews.freebsd.org/D28142
Sponsored by: Netflix, Inc.
PR: 252449
MFC after: 1 week

3 years agoFix a typo
Mateusz Piotrowski [Thu, 14 Jan 2021 18:12:55 +0000 (19:12 +0100)]
Fix a typo

"and" is not a flag.

MFC after: 3 days

3 years agoSplit out the NODEBUG options to a common file
Andrew Turner [Thu, 14 Jan 2021 10:54:18 +0000 (10:54 +0000)]
Split out the NODEBUG options to a common file

This is the superset of the nooptions found in the -DEBUG kernels.

Reviewed by: emaste, manu
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D28152

3 years agoqat: Free counters during detach
Mark Johnston [Thu, 14 Jan 2021 16:41:28 +0000 (11:41 -0500)]
qat: Free counters during detach

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

3 years agoqat: Count request allocation failures
Mark Johnston [Thu, 14 Jan 2021 16:41:28 +0000 (11:41 -0500)]
qat: Count request allocation failures

This can be useful for troubleshooting performance problems.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

3 years agoqat: Fix DH895XCC firmware module autoloading
Mark Johnston [Thu, 14 Jan 2021 16:41:28 +0000 (11:41 -0500)]
qat: Fix DH895XCC firmware module autoloading

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

3 years agolibifconfig: Add a symbol map
Mark Johnston [Thu, 14 Jan 2021 16:41:28 +0000 (11:41 -0500)]
libifconfig: Add a symbol map

This is a no-op for now since libifconfig is only built as a static lib.

Reviewed by: freqlabs, kp, adrian
Differential Revision: https://reviews.freebsd.org/D28119

3 years agoiwm(4): Add support for Intel Killer(R) Wireless-AC 1550i
Mark Johnston [Thu, 14 Jan 2021 16:41:28 +0000 (11:41 -0500)]
iwm(4): Add support for Intel Killer(R) Wireless-AC 1550i

PR: 252578
Submitted by: shu <ankohuu@outlook.com>
MFC after: 1 week

3 years agogitignore: expand list of ignored files
Roger Pau Monné [Mon, 11 Jan 2021 17:31:56 +0000 (18:31 +0100)]
gitignore: expand list of ignored files

Add the *.swp and *~ pattern for vim temporary files. Expand the
cscope ones to include all files possibly generated by cscope and also
add some known object formats.

Also remove the leading '?' from cscope.out, or else it doesn't match
the cscope.out file generated by default (as it expects an extra
character in front).

Reviewed by: gjb, uqs, lwhsu
Sponsored by: Citrix Systems R&D
Differential Revision: https://reviews.freebsd.org/D28095

3 years agoImport device tree files from Linux 5.9
Emmanuel Vadot [Thu, 14 Jan 2021 15:25:07 +0000 (16:25 +0100)]
Import device tree files from Linux 5.9

3 years agoamd64: use builtins for all ffs* variants
Mateusz Guzik [Thu, 14 Jan 2021 12:33:24 +0000 (12:33 +0000)]
amd64: use builtins for all ffs* variants

While here even up whitespace.

3 years agotcp: fix handling of TCP RST segments missing timestamps
Michael Tuexen [Wed, 13 Jan 2021 22:43:40 +0000 (23:43 +0100)]
tcp: fix handling of TCP RST segments missing timestamps

A TCP RST segment should be processed even it is missing TCP
timestamps.

Reported by: dmgk@, kevans@
Reviewed by: rscheff@, dmgk@
Sponsored by: Netflix, Inc.
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28143

3 years agoRevert "pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases"
Emmanuel Vadot [Thu, 14 Jan 2021 13:15:05 +0000 (14:15 +0100)]
Revert "pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases"

This reverts commit aef769614f921660cb0262412426034cf5395ae5.

While the package names are a bit prettier this confuse pkg about upgrading :
$ pkg version -t 13.0.s2021011313063 13.0.a1
>
$ pkg version -t 13.0.s2021011313063 13.0_ALPHA1
<

Note that the current scheme isn't good when bumping from ALPHA to BETA or
even BETA to RC:
$ pkg version -t 13.0_ALPHA1 13.0_BETA1
=
$ pkg version -t 13.0_BETA1 13.0_RC1
=

But more thoughts have to be put into this renaming.

3 years agopkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases
Emmanuel Vadot [Thu, 14 Jan 2021 12:56:38 +0000 (13:56 +0100)]
pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases

The current postfix conversions are:

    CURRENT / STABLE -> .sYYYYMMDDhhmmss
    ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1
    BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2
    RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3
    PRERELEASE -> .p, so 11.3-PRERELEASE becomes 11.3.p
    RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1

Submitted by: rene (original version)
Differential Revision: https://reviews.freebsd.org/D20734

3 years agotmpfs_reclaim: detach unlinked node on dereferencing.
Konstantin Belousov [Tue, 12 Jan 2021 16:10:07 +0000 (18:10 +0200)]
tmpfs_reclaim: detach unlinked node on dereferencing.

Otherwise it is dereferenced one extra time at unmount, if it survives
long enough.  One way to hold the reference on such node is to keep it
open.

tmpfs_vptocnp() now needs to account for the possibility that unlocked
node was removed from the list.

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

3 years agotmpfs_reclaim: style
Konstantin Belousov [Wed, 13 Jan 2021 06:55:38 +0000 (08:55 +0200)]
tmpfs_reclaim: style

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

3 years agoAdd missing init of new fields after new UAR API was introduced
Hans Petter Selasky [Thu, 14 Jan 2021 10:42:31 +0000 (11:42 +0100)]
Add missing init of new fields after new UAR API was introduced
by f8f5b459d21e in mlx5ib.

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

3 years agolinux: mute "unsupported socket(AF_NETLINK, 3, NETLINK_AUDIT)" warnings
Edward Tomasz Napierala [Tue, 12 Jan 2021 18:00:18 +0000 (18:00 +0000)]
linux: mute "unsupported socket(AF_NETLINK, 3, NETLINK_AUDIT)" warnings

They are way too noisy with Focal.

Sponsored by: The FreeBSD Foundation

3 years agovm_map_protect(): remove not needed recalculations of new_prot, new_maxprot
Konstantin Belousov [Wed, 13 Jan 2021 03:04:18 +0000 (05:04 +0200)]
vm_map_protect(): remove not needed recalculations of new_prot, new_maxprot

Requested by: alc
Sponsored by: The FreeBSD Foundation

3 years ago[mips] revert r366664 - flip mips back from -O2 to -O
Adrian Chadd [Tue, 12 Jan 2021 21:13:20 +0000 (13:13 -0800)]
[mips] revert r366664 - flip mips back from -O2 to -O

Now that I have -head fitting in 8MB of flash again, I can test
out freebsd-head on my home AP test setup.  Unfortunately,
the introduction of -O2 in r366664 causes the following infinite
loop shortly after boot:

------

MAP: No valid partition found at map/rootfs.uzip
Warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin/init
BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x4042c320 got a read fault (type 0x2) at 0x2e3a0
Trapframe Register Dump:
        zero: 0 at: 0   v0: 0   v1: 0
        a0: 0x1af34     a1: 0   a2: 0   a3: 0x7fffeff0
        t0: 0   t1: 0   t2: 0   t3: 0
        t4: 0   t5: 0   t6: 0   t7: 0
        t8: 0   t9: 0x152e8     s0: 0x7fffee84  s1: 0
        s2: 0   s3: 0   s4: 0   s5: 0
        s6: 0   s7: 0   k0: 0   k1: 0
        gp: 0x362c0     sp: 0x7fffedf0  s8: 0   ra: 0x40417df0
        sr: 0xf413      mullo: 0        mulhi: 0        badvaddr: 0x2e3a0
        cause: 0xffffffff80000008       pc: 0x4042c31c
Page table info for pc address 0x4042c320: pde = 0x80712000, pte = 0xa002065a
Dumping 4 words starting at pc address 0x4042c320:
8f9980e0 80820000 10400067 00809825
Page table info for bad address 0x2e3a0: pde = 0, pte = 0

------

I'm not yet sure why, but until I figure it out with the mips64/cheri
folk this should be reverted.

This should only use -O on GCC generated code for MIPS platforms.

Tested:

* QCA934x (mips74k) - WDR-3600/WDR-4300 APs

Differential Revision: https://reviews.freebsd.org/D28122

3 years agobuild: `make check`: use a PATH search instead for Kyua
Kyle Evans [Thu, 14 Jan 2021 06:34:29 +0000 (00:34 -0600)]
build: `make check`: use a PATH search instead for Kyua

which(1) accepts both relative/absolute paths as well as lone binary
names.  Set KYUA to kyua and use which(1) to confirm that it can find one;
if it cannot, just advise the user to set KYUA directly to the kyua binary
rather than assuming a relative location from LOCALBASE.

This allows `make check` to be operated with the version of kyua in base
without losing the flexibility of specifying another one.

ngie@ notes that the original intention was to avoid redundant $PATH lookups
and improve the determinism of the target. A future change will likely push
us back to this state, perhaps in the form of reverting this entirely and
just switching to using kyua in base. Accepting any in $PATH should be
considered a transitional move, at least until it's declared otherwise,
since kyua was only semi-recently added to base.

Reviewed-by: brooks, emaste, lwhsu, ngie
Differential-Revision: https://reviews.freebsd.org/D28045

3 years agounifdef -D__FreeBSD__ to remove the OpenBSD support
David E. O'Brien [Thu, 14 Jan 2021 04:45:54 +0000 (20:45 -0800)]
unifdef -D__FreeBSD__ to remove the OpenBSD support

OpenBSD never accepted this driver, and instead wrote their
own minimal one (sys/dev/acpi/tpm.c for suspending the device).

Reviewed by:    stevek, emaste
Differential Revision:  D10321

3 years agotools: git hooks: drop "submitted by" from commit template
Kyle Evans [Thu, 14 Jan 2021 06:33:07 +0000 (00:33 -0600)]
tools: git hooks: drop "submitted by" from commit template

With the switch to git, we should strive to properly attribute every
commit appropriately with the metadata that's provided to do so. In this
case, the submitter should be recorded via the author metadata.  Committing
an arbitrary patch, one can set it as such:

git commit --author="John Smith <smith@example.com>"

Reviewed-by: emaste
Differential-Revision: https://reviews.freebsd.org/D28069

3 years agoMerge bmake-20210110
Simon J. Gerraty [Thu, 14 Jan 2021 06:21:37 +0000 (22:21 -0800)]
Merge bmake-20210110

Quite a lot of churn on style, but lots of
good work refactoring complicated functions
and lots more unit-tests.
Thanks mostly to rillig at NetBSD

Some interesting entries from ChangeLog

o .MAKE.{UID,GID} represent uid and gid running make.

o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o add more unit tests for META MODE

Merge commit '8e11a9b4250be3c3379c45fa820bff78d99d5946' into main

Change-Id: I464fd4c013067f0915671c1ccc96d2d8090b2b9c

3 years agocontrib/lua: update to 5.4.2
Kyle Evans [Thu, 14 Jan 2021 05:56:18 +0000 (23:56 -0600)]
contrib/lua: update to 5.4.2

Merge commit '0ea45b9cd43ce1247eb3eee9bfd5cee3d19068e7' into main

3 years agoImport bmake-20210110
Simon J. Gerraty [Thu, 14 Jan 2021 01:24:34 +0000 (17:24 -0800)]
Import bmake-20210110

Quite a lot of churn on style, but lots of
good work refactoring complicated functions
and lots more unit-tests.
Thanks mostly to rillig at NetBSD

Some interesting entries from ChangeLog

o .MAKE.{UID,GID} represent uid and gid running make.

o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o add more unit tests for META MODE

Change-Id: I4d3bcf08b4c864d98b343f602efe5a75dbfa7a94

3 years agonewvers.sh: set to ALPHA1 as part of the 13.0 cycle
Glen Barber [Thu, 14 Jan 2021 00:01:30 +0000 (19:01 -0500)]
newvers.sh: set to ALPHA1 as part of the 13.0 cycle

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

3 years agoarm64: fix early devmap assertion
Mitchell Horne [Wed, 13 Jan 2021 18:30:50 +0000 (14:30 -0400)]
arm64: fix early devmap assertion

The purpose of this KASSERT is to ensure that we do not run out of space
in the early devmap. However, the devmap grew beyond its initial size of
2MB in r336519, and this assertion did not grow with it.

A devmap mapping of a 1080p framebuffer requires 1920x1080 bytes, or
1.977 MB, so it is just barely able to fit without triggering the
assertion, provided no other devices are mapped before it. With the
addition of `options GDB` in GENERIC by bbfa199cbc16, the uart is now
mapped for the purposes of a debug port, before mapping the framebuffer.
The presence of both these conditions pushes the selected virtual
address just below the threshold, triggering the assertion.

To fix this, use the correct size of the devmap, defined by
PMAP_MAPDEV_EARLY_SIZE. Since this code is shared with RISC-V, define
it for that platform as well (although it is a different size).

PR: 25241
Reported by: gbe
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

3 years agoEnable accelerated AES-XTS software crypto in GENERIC.
John Baldwin [Wed, 13 Jan 2021 21:13:01 +0000 (13:13 -0800)]
Enable accelerated AES-XTS software crypto in GENERIC.

In particular, using GELI on a root filesystem will only use
accelerated software crypto drivers if they are available before the
root filesystem is mounted.  While these modules can be loaded from
the loader, including them in GENERIC provides a better out-of-the-box
experience for users.

Both aesni(4) and armv8crypto(4) provide accelerated implementations
of the default cipher used by GELI (AES-XTS) in addition to other
ciphers.

Reviewed by: mhorne, allanjude, markj
Differential Revision: https://reviews.freebsd.org/D28100

3 years agopf tests: pass NULL buffer to DIOCRCLRTSTATS
Kristof Provost [Wed, 13 Jan 2021 18:41:07 +0000 (19:41 +0100)]
pf tests: pass NULL buffer to DIOCRCLRTSTATS

As discovered by syzcaller this used to provoke panics.

MFC after: 1 week

3 years agopf: Don't hold PF_RULES_WLOCK during copyin() on DIOCRCLRTSTATS
Kristof Provost [Wed, 13 Jan 2021 18:30:01 +0000 (19:30 +0100)]
pf: Don't hold PF_RULES_WLOCK during copyin() on DIOCRCLRTSTATS

We cannot hold a non-sleepable lock during copyin(). This means we can't
safely count the table, so instead we fall back to the pf_ioctl_maxcount
used in other ioctls to protect against overly large requests.

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

3 years agoRevert "loader.efi: disable workaround for serial console on non-x86"
Toomas Soome [Wed, 13 Jan 2021 18:18:35 +0000 (20:18 +0200)]
Revert "loader.efi: disable workaround for serial console on non-x86"

This patch is creating some issues, reverting it.

This reverts commit 8b18395487506d3602205e5844e0b67ba0c0dc80.

3 years agodwwdt: Add PNP info for the driver
Emmanuel Vadot [Wed, 13 Jan 2021 17:41:34 +0000 (18:41 +0100)]
dwwdt: Add PNP info for the driver

3 years agoAdd driver for Synopsys Designware Watchdog timer.
Emmanuel Vadot [Wed, 13 Jan 2021 17:23:51 +0000 (18:23 +0100)]
Add driver for Synopsys Designware Watchdog timer.

This driver supports some arm and arm64 boards equipped with
"snps,dw-wdt"-compatible watchdog device.
Tested on RK3399-based board (RockPro64).
Once started watchdog device cannot be stopped.
Interrupt handler has mode to kick watchdog even when software does not do it
properly.
This can be controlled via sysctl: dev.dwwdt.prevent_restart.
Also - driver handles system shutdown and prevents from restart when system
is asked to reboot.

Submitted by: kjopek@gmail.com
Differential Revision: https://reviews.freebsd.org/D26761

3 years agoloader.efi: initial terminal size should base on UEFI terminal size
Toomas Soome [Wed, 13 Jan 2021 17:05:51 +0000 (19:05 +0200)]
loader.efi: initial terminal size should base on UEFI terminal size

We do select font based on desired terminal size, we do query
UEFI terminal size with conout->QueryMode(), but by mistake, the fallback
values are used.

3 years agoSwitch the arm64 pcpu to a global register variable
Andrew Turner [Mon, 11 Jan 2021 15:43:39 +0000 (15:43 +0000)]
Switch the arm64 pcpu to a global register variable

This removes an unneeded instruction to move the pointer from x18 to a
temporary register.

Reviewed by: emaste
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D26971

3 years agoCreate a stack frame when needed in the arm64 kernel
Andrew Turner [Tue, 12 Jan 2021 14:18:59 +0000 (14:18 +0000)]
Create a stack frame when needed in the arm64 kernel

When building the arm64 kernel for use with dtrace or hwpmc we need
to include a stack frame so they can extract a stack trace.

As with amd64 also build a stack frame in modules.

Sponsored by: Innovate UK

3 years agoRevert "x86 busdma_bounce: do not make assumptions about alignment of malloc(9) results."
Konstantin Belousov [Wed, 13 Jan 2021 15:40:54 +0000 (17:40 +0200)]
Revert "x86 busdma_bounce: do not make assumptions about alignment of malloc(9) results."

This reverts commit 8f54940f019ca586bcfbf189ef9974eeb0a8194a.
The free needs to be called on the address returned by malloc,
not the realigned address.

Noted by: andrew
Sponsored by: The FreeBSD Foundation

3 years agovfs: set NC_KEEPPOSENTRY alongside NOCACHE when creating a file
Mateusz Guzik [Wed, 13 Jan 2021 14:53:55 +0000 (15:53 +0100)]
vfs: set NC_KEEPPOSENTRY alongside NOCACHE when creating a file

Arguably the entire NOCACHE logic should get retired, in the meantime
at least prevent the code from evicting existing entries.

3 years agofd: add refcount argument to falloc_noinstall
Mateusz Guzik [Wed, 13 Jan 2021 14:16:38 +0000 (15:16 +0100)]
fd: add refcount argument to falloc_noinstall

This lets callers avoid atomic ops by initializing the count to required
value from the get go.

While here add falloc_abort to backpedal from this without having to
fdrop.

3 years agox86 busdma_bounce: do not make assumptions about alignment of malloc(9) results.
Konstantin Belousov [Mon, 11 Jan 2021 23:42:30 +0000 (01:42 +0200)]
x86 busdma_bounce: do not make assumptions about alignment of malloc(9) results.

Reported by: dim
Reviewed by: dim, jah
Tested by: dim, pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28108