]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agowg(4): Fix Copyright statement in man page
Gordon Bergling [Tue, 2 Feb 2021 19:16:52 +0000 (20:16 +0100)]
wg(4): Fix Copyright statement in man page

(cherry picked from commit 064e52c2d874abc83dd2af61644d14dc90e26ec3)

3 years agoAdd a wg(4) manual page
Gordon Bergling [Tue, 2 Feb 2021 19:13:53 +0000 (20:13 +0100)]
Add a wg(4) manual page

Reviewed by: brueffer, donner, debdrup, ygy
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D27783

(cherry picked from commit e59d9cb412846cb5d2bc4c641d3cc44d243cd52d)

3 years agoriscv: add SBI system reset extension
Mitchell Horne [Wed, 27 Jan 2021 21:27:15 +0000 (17:27 -0400)]
riscv: add SBI system reset extension

(cherry picked from commit 9bae4ce661c59be88fec89b2531148e36dd1a23e)
(cherry picked from commit a6405133b7e14929f8e8e61cf30d7152b1410e59)

3 years agoipfw(8) crashes when ext6hdr option is omitted
Evgeniy Khramtsov [Mon, 1 Feb 2021 19:03:57 +0000 (20:03 +0100)]
ipfw(8) crashes when ext6hdr option is omitted

Verify that the option is passed, error out if it's not.
The problem can be trivially triggered with `ipfw add allow ext6hdr`.

PR: 253169
Reviewed by: kp@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28447

(cherry picked from commit 682c31db4ecfb8fc6cac0e8ad4945c03379ea3d1)

3 years agobridge: fix STP roles and protos strings
Jonah Caplan [Sat, 30 Jan 2021 13:54:09 +0000 (14:54 +0100)]
bridge: fix STP roles and protos strings

Add the missing commas that got lost in e5539fb618cc7.

PR: 252532
Reviewd by: kp@, donner@, freqlabs@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28425

(cherry picked from commit 88be0e11205e4a2dc77e29f7b4a2e82b8d7c9a5c)

3 years agosrc.conf.5: regenerate
Mitchell Horne [Thu, 4 Feb 2021 14:00:11 +0000 (10:00 -0400)]
src.conf.5: regenerate

Direct commit to stable/13.

3 years agosrc.opts.mk: set MK_ZFS conditional on MK_OPENSSL
Mitchell Horne [Sat, 30 Jan 2021 19:04:08 +0000 (15:04 -0400)]
src.opts.mk: set MK_ZFS conditional on MK_OPENSSL

PR: 252841
Reviewed by: kevans, freqlabs

(cherry picked from commit e5cc1c47484160969e0a7c13cdbc71081d7dd60e)

3 years agodu: tests: use dollar-single quotes where appropriate
Kyle Evans [Fri, 29 Jan 2021 03:01:12 +0000 (21:01 -0600)]
du: tests: use dollar-single quotes where appropriate

No need for "foo$(printf "\t")", $'\t' is both more readable and still
functional.

(cherry picked from commit bf59049c27ef86669a94ffd43f7216107b5c57ff)

3 years ago[POWERPC64BE] add mrsas driver to GENERIC64
Alfredo Dal'Ava Junior [Thu, 4 Feb 2021 01:02:28 +0000 (22:02 -0300)]
[POWERPC64BE] add mrsas driver to GENERIC64

Submitted by:   Andre Fernando da Silva <andre.silva@eldorado.org.br>
Reviewed by:    luporl, alfredo, kadesai (on email)
Sponsored by:   Eldorado Research Institute (eldorado.org.br)
Differential Revision:  https://reviews.freebsd.org/D26531

3 years ago[POWERPC64BE] mrsas: add big-endian support
Alfredo Dal'Ava Junior [Thu, 4 Feb 2021 00:52:19 +0000 (21:52 -0300)]
[POWERPC64BE] mrsas: add big-endian support

Add endiannes conversions in order to support big-endian platforms

Submitted by: Andre Fernando da Silva <andre.silva@eldorado.org.br>
Reviewed by: luporl, alfredo, kadesai (on email)
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D26531

3 years agobuild: options: mention ports in the WITH_OPENLDAP description
Kyle Evans [Sat, 30 Jan 2021 06:09:10 +0000 (00:09 -0600)]
build: options: mention ports in the WITH_OPENLDAP description

There's a third party dependency on this option; currently,
net/openldap24-{,sasl-}client.  At least mention that an openldap from ports
is needed for this option.

PR: 252866

(cherry picked from commit 7587d9823a8257b9a2d5b2e58c707026061058c6)

3 years agokerberos5: fix the WITH_OPENLDAP build
Kyle Evans [Sat, 30 Jan 2021 06:07:17 +0000 (00:07 -0600)]
kerberos5: fix the WITH_OPENLDAP build

Restore WARNS to its former glory prior to the global WARNS change to fix
the build.

(cherry picked from commit e948d980f78dd2789060b46d3d03ba0d96b23b59)

3 years agoofed: fix the WITH_OFED_EXTRA build
Kyle Evans [Sat, 30 Jan 2021 05:48:28 +0000 (23:48 -0600)]
ofed: fix the WITH_OFED_EXTRA build

This option was not tested when WARNS was globally lifted in the src tree up
to 6.  Drop WARNS back down to unbreak the build; note that this is still
enabling more warnings than it had before the WARNS change, so the gcc build
may need to be independently evaluated at this level.

PR: 252865

(cherry picked from commit 9ca71db4959f674d75f7b4fd0f72bdc1e2e99abb)

3 years agoRevert "Reimplement strlen"
Mateusz Guzik [Wed, 3 Feb 2021 19:38:10 +0000 (19:38 +0000)]
Revert "Reimplement strlen"

This reverts commit 710e45c4b8539d028877769f1a4ec088c48fb5f1.

It breaks for some corner cases on big endian ppc64.
Given the stage of the release process it is best to revert for now.

Reported by: jhibbits

(cherry picked from commit 33f0540b13d949c7cc226a79927ddc2062ff98bf)

3 years agoqat: Add support for separate AAD and output buffers
Mark Johnston [Wed, 27 Jan 2021 20:30:58 +0000 (15:30 -0500)]
qat: Add support for separate AAD and output buffers

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit bd674d8b1fa808dff1afdcb6afc70226077ee78a)

3 years agopf: Improve pf_rule input validation
Kristof Provost [Tue, 26 Jan 2021 07:56:51 +0000 (08:56 +0100)]
pf: Improve pf_rule input validation

Move the validation checks to pf_rule_to_krule() to reduce duplication.
This also makes the checks consistent across different ioctls.

Reported-by: syzbot+e9632d7ad17398f0bd8f@syzkaller.appspotmail.com
Reviewed by: tuexen@, donner@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28362

(cherry picked from commit 7a808c5ee3296fdb72d8e8bc6c7ad6f316a520ab)

3 years agostand/multiboot: adjust the protocol between loader and kernel
Roger Pau Monné [Wed, 27 Jan 2021 10:12:07 +0000 (11:12 +0100)]
stand/multiboot: adjust the protocol between loader and kernel

There's a currently ad-hoc protocol to hand off the FreeBSD kernel
payload between the loader and the kernel itself when Xen is in the
middle of the picture. Such protocol wasn't very resilient to changes
to the loader itself, because it relied on moving metadata around to
package it using a certain layout. This has proven to be fragile, so
replace it with a more robust version.

The new protocol requires using a xen_header structure that will be
used to pass data between the FreeBSD loader and the FreeBSD kernel
when booting in dom0 mode. At the moment the only data conveyed is the
offset of the start of the module metadata relative to the start of the
module itself.

This is a slightly disruptive change since it also requires a change
to the kernel which is contained in this patch. In order to update
with this change the kernel must be updated before updating the
loader, as described in the handbook. Note this is only required when
booting a FreeBSD/Xen dom0. This change doesn't affect the normal
FreeBSD boot protocol.

This fixes booting FreeBSD/Xen in dom0 mode after
3630506b9daec9167a89bc4525638ea45a00769e.

(cherry picked from commit b6d85a5f51e4147452b35d76478fb9e191b7734b)

3 years agobc: Vendor import of Gavin Howard's bc version 3.2.6
Stefan Eßer [Sun, 31 Jan 2021 19:56:48 +0000 (20:56 +0100)]
bc: Vendor import of Gavin Howard's bc version 3.2.6

(cherry picked from commit 47a52dc4d48f259ab7d9f9ba6b65f4f2331a22dc)

3 years agolualoader: position hyphens at the beginning of character classes
Kyle Evans [Sun, 31 Jan 2021 15:51:39 +0000 (09:51 -0600)]
lualoader: position hyphens at the beginning of character classes

According to the Lua 5.4 manual section 6.4.1 ("Patterns"), the interaction
between ranges and classes is not defined and hyphens must be specified at
either the beginning or the end of a set if they are not escaped.

Move all such occurrences to the beginning.

(cherry picked from commit b24872cf7b13314669ed2136c0262bb2eb007695)

3 years agostand: lua: enhance lfs.dir() to speed up kernels_autodetect
Kyle Evans [Sun, 24 Jan 2021 01:32:38 +0000 (19:32 -0600)]
stand: lua: enhance lfs.dir() to speed up kernels_autodetect

This eliminates a lot of stat() calls that happen when lualoader renders the
menu with the default settings, and greatly speeds up rendering on my
laptop.

ftype is nil if loader/loader.efi hasn't been updated yet, falling back to
lfs.attributes() to test.

This is technically incompatible with lfs, but not in a particularly
terrible way.

(cherry picked from commit e25ee296c919d6567aa76058a7049eac974797fb)

3 years agoMFC: mips: fix early kernel panic when setting up interrupt counters
Oleksandr Tymoshenko [Mon, 1 Feb 2021 07:56:22 +0000 (23:56 -0800)]
MFC: mips: fix early kernel panic when setting up interrupt counters

Commit 248f0ca converted intrcnt and intrnames from u_long[]
and char[] to u_long* and char* respectively, but for non-INTRNG mips
these symbols were defined in .S file as a pre-allocated static arrays,
so the problem wasn't cought at compile time. Conversion from an array
to a pointer requires pointer initialization and it wasn't done
for MIPS, so whatever happenned to be in the begginning of intcnt[]
array was used as a pointer value.

Move intrcnt/intrnames to C code and allocate them dynamically
although with a fixed size at the moment.

Reviewed by: emaste
PR: 253051
Differential Revision: https://reviews.freebsd.org/D28424
MFC after: 1 day

(cherry picked from commit e0a0a3efcb09a10ad1de29aca622ea580b2663d2)

mips: fix NLM platforms breakage caused by e0a0a3ef

NetLogic platforms have their own implementation of cpu_init_interrupts.
Apply the same logic to it as to intr_machdep.c.

PR: 253051

(cherry picked from commit d6f9c5a6d2f87865f9714d2b8dfd1a9f3080c71e)

3 years agocxgb(4): Remove assumption of physically contiguous mbufs.
Alexander Motin [Sun, 31 Jan 2021 17:46:57 +0000 (12:46 -0500)]
cxgb(4): Remove assumption of physically contiguous mbufs.

Investigation of iSCSI target data corruption reports brought me to
discovery that cxgb(4) expects mbufs to be physically contiguous, that
is not true after I've started using m_extaddref() in software iSCSI
for large zero-copy transmissions.  In case of fragmented memory the
driver transmitted garbage from pages following the first one due to
simple use of pmap_kextract() for the first pointer instead of proper
bus_dmamap_load_mbuf_sg().  Seems like it was done as some optimization
many years ago, and at very least it is wrong in a world of IOMMUs.

This patch just removes that optimization, plus limits packet coalescing
for mbufs crossing page boundary, also depending on assumption of one
segment per packet.

Sponsored by: iXsystems, Inc.

(cherry picked from commit 9dc7c250b8bd2d5e669c7633e189a700a02c0571)

3 years agocache: fix trailing slash support in face of permission problems
Mateusz Guzik [Tue, 2 Feb 2021 18:06:56 +0000 (18:06 +0000)]
cache: fix trailing slash support in face of permission problems

Reported by: Johan Hendriks <joh.hendriks gmail.com>
Tested by: kevans

(cherry picked from commit 45456abc4ce71053d07cf03ca63bd1ce459fec55)

3 years agouserboot: provide stub gfx functions
Toomas Soome [Sat, 30 Jan 2021 19:16:20 +0000 (21:16 +0200)]
userboot: provide stub gfx functions

Make sure we have needed functions present, to avoi getting undefined
symbols error(s).

PR: 253088
Reported by: John Kennedy

(cherry picked b79f2bc6c5c7431fa1f7c02937ec97a64653ade1)

3 years agovt: panic while changing vt font
Toomas Soome [Sun, 24 Jan 2021 18:59:36 +0000 (20:59 +0200)]
vt: panic while changing vt font

Set refcount for loader provided font to 1 to prevent this font
from being released (so we can reset to default).

As we get started with no memory allocator, we set up static font data
for font passed by loader (if there is any). At this time, we also must
set refcount 1, and refcount will get incremented in cnprobe() callback.

At some point the memory allocator will be available, and we will set up
properly allocated font data, but we should not disturb the refcount.

PR: 252833
PR: 253147

(cherry picked and squashed 93ebd6307efeb95a29bc614edd0c67c2af850e98 and
1912d2b15e6d6f4a1d8c3886b03ab30d2f21f3fd)

3 years agoloader: create built in font from bold font face
Toomas Soome [Fri, 22 Jan 2021 11:06:58 +0000 (13:06 +0200)]
loader: create built in font from bold font face

We did replace full version of default font 8x16v with bold, also
use bold version for built in font.

(cherry picked from commit 6c789c55c4ba11014bfd1b59942c204615412ba6)

3 years agomarvell: ap806_clock: add missing frequency modes
Marcin Wojtas [Tue, 26 Jan 2021 10:49:35 +0000 (11:49 +0100)]
marvell: ap806_clock: add missing frequency modes

In the driver init routine the CPU clock frequency
value is obtained from a dedicated register. Until now
only part of the values were handled by the mv_ap806_clock
driver. Fix that by adding missing cases.

Submitted by: Zyta Szpak <zr@semihalf.com>
MFC after: 1 week
Obtained from: Semihalf
Sponsored by: Marvell

(cherry picked from commit a86b0839d7bf3fc06b1ae9c50e055b53c50a9d0b)

3 years ago__FreeBSD_version: update the references to the doc tree
Bjoern A. Zeeb [Fri, 29 Jan 2021 10:57:50 +0000 (10:57 +0000)]
__FreeBSD_version: update the references to the doc tree

Update the reference of which file to update in the doc tree when
bumping __FreeBSD_version.

(cherry picked from commit abd619045a54c73f41a95b3e038a5ba083391400)

3 years agoBump __FreeBSD_version for multiple LinuxKPI updates conflicting
Bjoern A. Zeeb [Tue, 2 Feb 2021 11:52:50 +0000 (11:52 +0000)]
Bump __FreeBSD_version for multiple LinuxKPI updates conflicting
with DRM.  Be sure to update your drm-kmod port to after the update.

Sponsored-by: The FreeBSD Foundation

3 years agoLinuxKPI: implement devres() framework parts and two examples
Bjoern A. Zeeb [Thu, 28 Jan 2021 16:32:43 +0000 (16:32 +0000)]
LinuxKPI: implement devres() framework parts and two examples

This code implements a version of the devres framework found
working for various iwlwifi use cases and also providing functions
for ttm_page_alloc_dma.c from DRM.

Part of the framework replicates the consumed KPI, while others
are internal helper functions.

In addition the simple devm_k*malloc() consumers were implemented
and kvasprintf() was enhanced to also work for the devm_kasprintf()
case.
Addmittingly lkpi_devm_kmalloc_release() could be avoided but for
the overall understanding of the code and possible memory tracing
it may still be helpful.

Further devsres consumer are implemented for iwlwifi but will follow
later as the main reason for this change is to sort out overlap with
DRM.

Sponsored-by: The FreeBSD Foundation
Obtained-from: bz_iwlwifi
MFC After: 3 days
Reviewed-by: hselasky, manu
Differential Revision: https://reviews.freebsd.org/D28189

(cherry picked from commit fa765ca73e553399ffbad382e579e4c2b4d0fc12)

3 years agoLinuxKPI: enhance PCI bits for DRM
Bjoern A. Zeeb [Thu, 28 Jan 2021 16:23:19 +0000 (16:23 +0000)]
LinuxKPI: enhance PCI bits for DRM

In pci_domain_nr() directly return the domain which got set in
lkpifill_pci_dev() in all cases.  This was missed between D27550
and 105a37cac76b971f7a94409fbdc4f508a7e97fa0 .

In order to implement pci_dev_put() harmonize further code
(which was started in the aforementioned commit) and add kobj
related bits (through the now common lkpifill_pci_dev() code)
to the DRM specific calls without adding the DRM allocated
pci devices to the pci_devices list.
Add a release for the lkpinew_pci_dev() (DRM) case so freeing
will work.
This allows the DRM created devices to use the normal kobj/refcount
logic and work with, e.g., pci_dev_put().
(For a slightly more detailed code walk see the review).

Sponsored-by: The FreeBSD Foundation
Obtained-from: bz_iwlwifi (partially)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28188

(cherry picked from commit 1fac2cb4d6e5cfa1b8ff689213011b0fe077ffa7)

3 years agoLinuxKPI: upstream a collection of drm-kmod conflicting changes
Bjoern A. Zeeb [Thu, 28 Jan 2021 16:15:12 +0000 (16:15 +0000)]
LinuxKPI: upstream a collection of drm-kmod conflicting changes

The upcoming in-kernel implementations for LinuxKPI based on work on
iwlwifi (and other wireless drivers) conflicts in a few places with
the drm-kmod graphics work outside the base system.

In order to transition smoothly extract the conflicting bits.
This included "unaligned" accessor functions, sg_pcopy_from_buffer(),
IS_*() macros (to be further restricted in the future), power management
bits (possibly no longer conflicting with DRM), and other minor changes.

Obtained-from:  bz_iwlwifi
Sponsored-by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: kib, hselasky, manu, bdragon (looked at earlier versions)
Differential Revision: https://reviews.freebsd.org/D26598

(cherry picked from commit 4abbf816bf06aa70200c5d1d976dd61c2752bdaf)

3 years agoLinuxKPI: add firmware loading support
Bjoern A. Zeeb [Thu, 28 Jan 2021 16:05:32 +0000 (16:05 +0000)]
LinuxKPI: add firmware loading support

Implement linux firmware KPI compat code.
This includes: request_firmware() request_firmware_nowait(),
request_firmware_direct(), firmware_request_nowarn(),
and release_firmware().

Given we will try to map requested names from natively ported
or full-linuxkpi-using drivers to a firmware(9) auto-loading
name format (.ko file name and image name matching),
we quieten firmware(9) and print success or failure (unless
the _nowarn() version was called) in the linuxkpi implementation.
At the moment we try up-to 4 different naming combinations,
with path stripped, original name, and requested name with '/'
or '.' replaced.

We do not currently defer loading in the "nowait" case.

Sponsored-by: The FreeBSD Foundation
Sponsored-by: Rubicon Communications, LLC ("Netgate")
(firmware(9) nowarn update from D27413)
MFC after: 3 days
Reviewed by: kib, manu (looked at older versions)
Differential Revision: https://reviews.freebsd.org/D27414

(cherry picked from commit a6c2507d1baedb183268e31bc6b6f659a9529904)
(cherry picked from commit 4a26380ba6dc487a7525d909ee29fbc710b558d1)

3 years agonewvers: tweak uname to be more useful
Warner Losh [Mon, 25 Jan 2021 19:53:31 +0000 (12:53 -0700)]
newvers: tweak uname to be more useful

The current uname is branch-cXXXX-gHASH

Three changes to make uname more useful.
1. Move from using git rev-list --count to git rev-lis --count --first-parent
   since that gives a better, incrementing number.
2. Report this count as 'nXXXXX' rather than 'cXXXXX' because c is part of
   a hash and we've changed the sematnics of XXXXX
3. Remove g to make HASH cut and pastable.

Durting review, #1 & #3 had the largest consensus. There was a diversity of
opinion on #2, but on the whole it was positive so I'll acknowledge the dissent,
but move forward with something seems to have support since the dissent was all
about what letter to use where I chose 'n'.

MFC After: 3 days
Reviewed by: rgrimes, emaste (earlier version)
Differential Revision: https://reviews.freebsd.org/D28338

(cherry picked from commit 8a51f14a7833fd14e1f125e63a0af9d260dcd287)

3 years agobsdinstall: riscv-specific tweaks
Mitchell Horne [Fri, 15 Jan 2021 16:34:54 +0000 (12:34 -0400)]
bsdinstall: riscv-specific tweaks

Make the installer more useful, by allowing it to create a bootable
installation. Also, enable the menu option for ZFS-on-root.

Like arm64, RISC-V boots by UEFI only, so arm64's partedit
implementation is renamed and shared among the two platforms.

Reviewed by: gjb

(cherry picked from commit 7b08a307e88bb1abe17d13d11288392a8e4739ce)

3 years agobsdinstall: create /efi/boot directory in ESP
Mitchell Horne [Fri, 15 Jan 2021 16:14:27 +0000 (12:14 -0400)]
bsdinstall: create /efi/boot directory in ESP

If the installer is creating a new ESP, then this directory will not
exist and the subsequent cp will fail silently. This is usually of no
consequence if /efi/freebsd/loader.efi is set up correctly.

Reviewed by: imp

(cherry picked from commit 676b7d077c2c5f548334cea7fccfbfb5d097c9df)

3 years agodiff: fix incorrectly displaying files as duplicates
Jamie Landeg-Jones [Mon, 25 Jan 2021 17:42:26 +0000 (18:42 +0100)]
diff: fix incorrectly displaying files as duplicates

When diff hits certain access errors, function diffreg() shows the error
message, and then returns to the calling function, which calls
print_status() with the return value.

However, in these cases, the return value isn't changed from the initial
default value of D_SAME.

Normally, print_status() with a value of D_SAME does nothing, so this
works out ok, however, if the "-s" flag is set, a message is displayed
showing identicality:

case D_SAME:
                if (sflag)
                        printf("Files %s%s and %s%s are identical\n",                                                                                                       path1, entry, path2, entry);
                break;

This then produces such results as:

% diff  -s /COPYRIGHT /var/run/rpcbind.sock
diff: /var/run/rpcbind.sock: Operation not supported
Files /COPYRIGHT and /var/run/rpcbind.sock are identical

% diff  -s /COPYRIGHT /etc/master.passwd
diff: /etc/master.passwd: Permission denied
Files /COPYRIGHT and /etc/master.passwd are identical

Create a D_ERROR status which is returned in such cases, and
print_status() then deals with that status seperately from D_SAME

PR: 252614
MFC after: 1 week

(cherry picked from commit fefb3c46a80fdde6f307e73a2b5b5aed806df1ce)

3 years agodiff: add a test case for failed -s option
Baptiste Daroussin [Mon, 25 Jan 2021 17:40:12 +0000 (18:40 +0100)]
diff: add a test case for failed -s option

(cherry picked from commit 13860e71eb501f498a2263f44ea9244f6830b61c)

3 years agoDrop temporary compat in setproctitle
Mateusz Guzik [Sun, 31 Jan 2021 12:23:42 +0000 (13:23 +0100)]
Drop temporary compat in setproctitle

(cherry picked from commit 46f168bc665a1aee79d91bd102aef7d4754e7917)

3 years agocache: add trailing slash support
Mateusz Guzik [Tue, 26 Jan 2021 00:38:21 +0000 (01:38 +0100)]
cache: add trailing slash support

Tested by: pho

(cherry picked from commit e027e24bfac7dd311ddacaec73d6c42102069511)

3 years agocache: handle NOFOLLOW requests for symlinks
Mateusz Guzik [Tue, 26 Jan 2021 22:14:49 +0000 (23:14 +0100)]
cache: handle NOFOLLOW requests for symlinks

Tested by: pho

(cherry picked from commit 8cbd164a179c182e8fd4a71f366bc48fe840eafb)

3 years agoamd64: retire sse2_pagezero
Mateusz Guzik [Sat, 30 Jan 2021 00:17:15 +0000 (00:17 +0000)]
amd64: retire sse2_pagezero

All page zeroing is using temporal stores with rep movs*, the routine is
unused for several years.

Should a need arise for zeroing using non-temporal stores, a more
optimized variant can be implemented with a more descriptive name.

(cherry picked from commit d1de5698dfe6109308d4e5d6536a2ac93941d23a)

3 years agoamd64: add missing ALIGN_TEXT to loops in memset and memmove
Mateusz Guzik [Fri, 29 Jan 2021 15:09:14 +0000 (16:09 +0100)]
amd64: add missing ALIGN_TEXT to loops in memset and memmove

(cherry picked from commit 164c3b81848bc81dc200b12370999474225447a3)

3 years agoReimplement strlen
Mateusz Guzik [Fri, 29 Jan 2021 21:48:11 +0000 (22:48 +0100)]
Reimplement strlen

The previous code neglected to use primitives which can find the end
of the string without having to branch on every character.

While here augment the somewhat misleading commentary -- strlen as
implemented here leaves performance on the table, especially so for
userspace. Every arch should get a dedicated variant instead.

In the meantime this commit lessens the problem.

Tested with glibc test suite.

Naive test just calling strlen in a loop on Haswell (ops/s):

$(perl -e "print 'A' x 3"):
before: 211198039
after: 338626619

$(perl -e "print 'A' x 100"):
before: 83151997
after: 98285919

(cherry picked from commit 710e45c4b8539d028877769f1a4ec088c48fb5f1)

3 years agopoll: use fget_unlocked or fget_only_user when feasible
Mateusz Guzik [Thu, 28 Jan 2021 23:52:08 +0000 (00:52 +0100)]
poll: use fget_unlocked or fget_only_user when feasible

This follows select by eleminating the use of filedesc lock.
This is a win for single-threaded processes and a mixed bag for others
as at small concurrency it is faster to take the lock instead of
refing/unrefing each file descriptor.

Nonetheless, removal of shared lock usage is a step towards a
mtx-protected fd table.

(cherry picked from commit 45e1f8541428c19f63dba65d78a8d138e1bc6915)

3 years agoselect: employ fget_only_user
Mateusz Guzik [Thu, 28 Jan 2021 23:33:46 +0000 (00:33 +0100)]
select: employ fget_only_user

Since most select users are single-threaded this avoid a lot of work
in the common case.

For example select of 16 fds (ops/s):
before: 2114536
after: 2991010

(cherry picked from commit 6affe1b71238df7bbbca6e2059e5494d91e68d2d)

3 years agofd: add fget_only_user
Mateusz Guzik [Thu, 28 Jan 2021 23:27:44 +0000 (00:27 +0100)]
fd: add fget_only_user

This can be used by single-threaded processes which don't share a file
descriptor table to access their file objects without having to
reference them.

For example select consumers tend to match the requirement and have
several file descriptors to inspect.

(cherry picked from commit eaad8d1303da500ed691bd774742a4555a05e729)

3 years agocache: add missing MNT_NOSYMFOLLOW check to symlink traversal
Mateusz Guzik [Wed, 27 Jan 2021 14:59:53 +0000 (15:59 +0100)]
cache: add missing MNT_NOSYMFOLLOW check to symlink traversal

(cherry picked from commit 5c325977b1138828367f39a3f2034af24c3654f0)

3 years agocache: fallback when encountering a mount point during .. lookup
Mateusz Guzik [Wed, 27 Jan 2021 12:52:23 +0000 (13:52 +0100)]
cache: fallback when encountering a mount point during .. lookup

The current abort is overzealous.

(cherry picked from commit 5fc384d1810a3a0a0acefc67abe1daf6d6cd09e4)

3 years agoconf/kern.mk: save some work by using realpath instead of cd ; pwd
Mateusz Guzik [Wed, 27 Jan 2021 12:25:21 +0000 (13:25 +0100)]
conf/kern.mk: save some work by using realpath instead of cd ; pwd

I did not check if the entire ordeal can be avoided in the first place.

(cherry picked from commit bcb7f57aa22757dd0206e88894bc003a93d0c351)

3 years agocache: tidy up handling of foo/bar lookups where foo is not a directory
Mateusz Guzik [Tue, 26 Jan 2021 16:19:12 +0000 (17:19 +0100)]
cache: tidy up handling of foo/bar lookups where foo is not a directory

The code was performing an avoidable check for doomed state to account
for foo being a VDIR but turning VBAD. Now that dooming puts a vnode
in a permanent "modify" state this is no longer necessary as the final
status check will catch it.

(cherry picked from commit a098a831a162fcd55b0097c95e6840621d8c720a)

3 years agocache: stop referring to removing entries as invalidating them
Mateusz Guzik [Tue, 26 Jan 2021 20:31:16 +0000 (21:31 +0100)]
cache: stop referring to removing entries as invalidating them

Said use is a remnant from the old code and clashes with the NCF_INVALID
flag.

(cherry picked from commit a51eca7936db50a57d2324d945c3be715df749cd)

3 years agocache: convert cache_fplookup_parse to void now that it always succeeds
Mateusz Guzik [Tue, 26 Jan 2021 00:40:47 +0000 (01:40 +0100)]
cache: convert cache_fplookup_parse to void now that it always succeeds

(cherry picked from commit 6943671b481e571f2f1ffbe407a4d75241d1174e)

3 years agocache: change ->v_cache_dd synchronisation rules
Mateusz Guzik [Mon, 25 Jan 2021 20:49:09 +0000 (21:49 +0100)]
cache: change ->v_cache_dd synchronisation rules

Instead of resorting to seqc modification take advantage of immutability
of entries and check if the entry still matches after everything got
prepared.

(cherry picked from commit e7cf562a40fc093df054bd7fa6f34746069a984a)

3 years agocache: make ->v_cache_dd accesses atomic-clean for lockless usage
Mateusz Guzik [Mon, 25 Jan 2021 20:29:54 +0000 (21:29 +0100)]
cache: make ->v_cache_dd accesses atomic-clean for lockless usage

(cherry picked from commit 6f0842764946ed57382293cc3361b86955308084)

3 years agocache: make ->nc_flag accesses atomic-clean for lockless usage
Mateusz Guzik [Mon, 25 Jan 2021 20:58:59 +0000 (21:58 +0100)]
cache: make ->nc_flag accesses atomic-clean for lockless usage

(cherry picked from commit 6ef8fede86f3feed7fb1e15b0e8a32ecfec33c6c)

3 years agocache: store vnodes in local vars in cache_zap_locked
Mateusz Guzik [Sat, 23 Jan 2021 19:41:40 +0000 (20:41 +0100)]
cache: store vnodes in local vars in cache_zap_locked

(cherry picked from commit ffcf8f97f8a8fb92689793003acabc0a2fe97af4)

3 years agotmpfs: drop acq fence now that vn_load_v_data_smr has consume semantics
Mateusz Guzik [Mon, 25 Jan 2021 20:17:48 +0000 (21:17 +0100)]
tmpfs: drop acq fence now that vn_load_v_data_smr has consume semantics

(cherry picked from commit c09f7992714559eaa874f13ea4a1d648f199cd08)

3 years agozfs: use atomic_load_consume_ptr for z_cached_symlink
Mateusz Guzik [Mon, 25 Jan 2021 20:15:19 +0000 (21:15 +0100)]
zfs: use atomic_load_consume_ptr for z_cached_symlink

(cherry picked from commit 7af02ef0b222eebad4827a264454e85134692e94)

3 years agovfs: use atomic_load_consume_ptr in vn_load_v_data_smr
Mateusz Guzik [Mon, 25 Jan 2021 20:19:08 +0000 (21:19 +0100)]
vfs: use atomic_load_consume_ptr in vn_load_v_data_smr

(cherry picked from commit 8d2a230e996c8aec2ec4883d45f7ac38070bd38f)

3 years agoatomic: add stub atomic_load_consume_ptr
Mateusz Guzik [Mon, 25 Jan 2021 20:09:41 +0000 (21:09 +0100)]
atomic: add stub atomic_load_consume_ptr

(cherry picked from commit 054ce2b0371042c0dbc4b3ab1d7e7795ad75d51e)

3 years agoatomic: make atomic_store_ptr type-aware
Mateusz Guzik [Mon, 25 Jan 2021 19:39:14 +0000 (20:39 +0100)]
atomic: make atomic_store_ptr type-aware

(cherry picked from commit cc96f92a570e05636a20fdd15d4616b127bb9ecc)

3 years agozfs: fix panics with invariant kernels from zfs_replay_setattr
Mateusz Guzik [Mon, 25 Jan 2021 21:28:05 +0000 (21:28 +0000)]
zfs: fix panics with invariant kernels from zfs_replay_setattr

(cherry picked from commit f40d6217f20d69427b58d82ce4e29d88bf4dfbd6)

3 years agocache: assorted cleanups
Mateusz Guzik [Sun, 24 Jan 2021 20:04:01 +0000 (21:04 +0100)]
cache: assorted cleanups

(cherry picked from commit 868643e7229b7959024880cda396fef87602b948)

3 years agocache: track calls to cache_symlink_alloc with unsupported size
Mateusz Guzik [Sun, 24 Jan 2021 20:00:03 +0000 (21:00 +0100)]
cache: track calls to cache_symlink_alloc with unsupported size

While here assert on size passed to free.

(cherry picked from commit 1c7a65adb002cf96bda1f72d9a26dd4237368263)

3 years agolibc: try to skip memcpy in _gettemp
Mateusz Guzik [Sun, 24 Jan 2021 04:34:22 +0000 (05:34 +0100)]
libc: try to skip memcpy in _gettemp

(cherry picked from commit b22fdf45ff8ef1d1f9a6c28f1d7f59ca4b012da6)

3 years agolibc: remove open-coded strlen in _gettemp
Mateusz Guzik [Sun, 24 Jan 2021 04:32:46 +0000 (05:32 +0100)]
libc: remove open-coded strlen in _gettemp

(cherry picked from commit 6fe328ace8f418bab0ab7f78c6fa1f2e757dd8a9)

3 years agolibc: skip spurious stat in _gettemp
Mateusz Guzik [Sun, 24 Jan 2021 04:15:13 +0000 (05:15 +0100)]
libc: skip spurious stat in _gettemp

It was only done to catch ENOTDIR, but the kernel already returns the
error where appropriate.

(cherry picked from commit 97a463120bf99819fcb21a781e410fb43dde2a43)

3 years agocache: add back target entry on rename
Mateusz Guzik [Sat, 23 Jan 2021 17:21:42 +0000 (18:21 +0100)]
cache: add back target entry on rename

(cherry picked from commit 02ec31bdf60fa3a8530544cb3c8c4ec1df6cde0d)

3 years agozfs: add support for lockless symlink lookup
Mateusz Guzik [Sat, 23 Jan 2021 13:46:32 +0000 (13:46 +0000)]
zfs: add support for lockless symlink lookup

Reviewed by: kib (previous version)
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D27488

(cherry picked from commit 3110d4ebd6c0848cf5e25890d01791bb407e2a9b)

3 years agotmpfs: add support for lockless symlink lookup
Mateusz Guzik [Sat, 23 Jan 2021 13:45:01 +0000 (13:45 +0000)]
tmpfs: add support for lockless symlink lookup

Reviewed by: kib (previous version)
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D27488

(cherry picked from commit 618029af508be2c01a84162c1bad02bfd000db27)

3 years agoufs: denote lack of support for lockless symlink lookup
Mateusz Guzik [Sat, 23 Jan 2021 13:42:16 +0000 (13:42 +0000)]
ufs: denote lack of support for lockless symlink lookup

It is unclear without investigating if it can be provided without using
extra memory, so for the time being just don't.

(cherry picked from commit c892d60a1d3e11c7e0651705bc4167b218a7415c)

3 years agocache: add symlink support to lockless lookup
Mateusz Guzik [Sat, 23 Jan 2021 13:40:48 +0000 (13:40 +0000)]
cache: add symlink support to lockless lookup

Reviewed by: kib (previous version)
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D27488

3 years agoMFC 064009e79462:
Hans Petter Selasky [Mon, 25 Jan 2021 10:22:55 +0000 (11:22 +0100)]
MFC 064009e79462:
Add support for enabling and disabling IFCAP_VLAN_HWTSO via
ifconfig(8) in mlx5en(4).

Sponsored by: Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 064009e79462dea517aa7f1a857fb4d5393caa69)

3 years agoMFC b8051298b0a3:
Hans Petter Selasky [Tue, 26 Jan 2021 16:01:34 +0000 (17:01 +0100)]
MFC b8051298b0a3:
Fix missing value in uar_page field for ratelimit in mlx5en(4).
This is a regression issue after the new UAR API was introduced
by f8f5b459d21e .

Sponsored by: Mellanox Technologies // NVIDIA Networking

(cherry picked from commit b8051298b0a345ae0bdfcd2ddf89bca1b96c6c2a)

3 years agofirmware(9): extend firmware_get() by a "no warn" flag.
Bjoern A. Zeeb [Mon, 25 Jan 2021 22:41:50 +0000 (22:41 +0000)]
firmware(9): extend firmware_get() by a "no warn" flag.

With the upcoming usage from LinuxKPI but also from drivers
ported natively we are seeing more probing of various
firmware (names).

Add the ability to firmware(9) to silence the
"firmware image loading/registering errors" by adding a new
firmware_get_flags() functions extending firmware_get() and
taking a flags argument as firmware_put() already does.

Requested-by: zeising (for future LinuxKPI/DRM)
Sponsored-by: The FreeBSD Foundation
Sponsored-by: Rubicon Communications, LLC ("Netgate")
MFC after: 3 days
Reviewed-by: markj
Differential Revision: https://reviews.freebsd.org/D27413

(cherry picked from commit 6f65b505468aa8cedc57235604bd8df540d42735)

3 years agotmpfs: push VEXEC check into tmpfs_lookup()
Kyle Evans [Thu, 28 Jan 2021 14:27:28 +0000 (08:27 -0600)]
tmpfs: push VEXEC check into tmpfs_lookup()

vfs_cache_lookup() has already done the appropriate VEXEC check, therefore
we must not re-check in VOP_CACHEDLOOKUP.

This fixes O_SEARCH semantics on tmpfs and removes a redundant descent into
VOP_ACCESS() in the common case.

(cherry picked from commit 0f919ed4ae4df082eefb517afe02752b1790afd3)

3 years agoDecode NFIT Platform Capabilities.
Alexander Motin [Mon, 25 Jan 2021 21:08:06 +0000 (16:08 -0500)]
Decode NFIT Platform Capabilities.

(cherry picked from commit 1b109c69ed625ebf292c1d16f7a3efcab96722e5)

3 years agoAdd missing newlines.
Alexander Motin [Thu, 28 Jan 2021 23:18:53 +0000 (18:18 -0500)]
Add missing newlines.

(cherry picked from commit 8fee65d0c70c99999b2fe5b49b267547b7ed2a49)

3 years agoMake software iSCSI more configurable.
Alexander Motin [Thu, 28 Jan 2021 20:53:49 +0000 (15:53 -0500)]
Make software iSCSI more configurable.

Move software iSCSI tunables/sysctls into kern.icl.soft subtree.
Replace several hardcoded length constants there with variables.

While there, stretch the limits to better match Linux' open-iscsi
and our own initiator with new MAXPHYS of 1MB.  Our CTL target is
also optimized for up to 1MB I/Os, so there is also a match now.
For Windows 10 and VMware 6.7 initiators at default settings it
should make no change, since previous limits were sufficient there.

Tests of QD1 1MB writes from FreeBSD over 10GigE link show throughput
increase by 29% on idle connection and 132% with concurrent QD8 reads.

Sponsored by: iXsystems, Inc.

(cherry picked from commit b75168ed24ca74f65929e5c57d4fed5f0ab08f2a)

3 years agorelease: ROCKPRO64: Remove the quirk that disable the big cores
Emmanuel Vadot [Wed, 27 Jan 2021 22:31:18 +0000 (23:31 +0100)]
release: ROCKPRO64: Remove the quirk that disable the big cores

It's not needed anymore.

(cherry picked from commit 183d6cc0e0db8bd4653245abc1ca30b34ed09d9f)

3 years agonetmap: simplify parameter passing
Vincenzo Maffione [Sun, 24 Jan 2021 21:59:02 +0000 (21:59 +0000)]
netmap: simplify parameter passing

Changes imported from the netmap github.

(cherry picked from commit ee0005f11f2b38a714bc66b7d79832108f6fee77)

3 years agoiflib: netmap: move per-packet operation out of fragments loop
Vincenzo Maffione [Sun, 24 Jan 2021 21:38:59 +0000 (21:38 +0000)]
iflib: netmap: move per-packet operation out of fragments loop

MFC after: 1 week

(cherry picked from commit f80efe5016ba01b2948ca1f0eb8fe34adab5b864)

3 years agoiflib: netmap: add support for NS_MOREFRAG
Vincenzo Maffione [Sun, 24 Jan 2021 21:12:41 +0000 (21:12 +0000)]
iflib: netmap: add support for NS_MOREFRAG

The NS_MOREFRAG flag can be set in a netmap slot to represent a
multi-fragment packet. Only the last fragment of a packet does
not have the flag set. On TX rings, the flag may be set by the
userspace application. The kernel will look at the flag and use it
to properly set up the NIC TX descriptors.
On RX rings, the kernel may set the flag if the packet received
was split across multiple netmap buffers. The userspace application
should look at the flag to know when the packet is complete.

Submitted by: rajesh1.kumar_amd.com
Reviewed by: vmaffione
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27799

(cherry picked from commit aceaccab659c9eb846fb21ff99be34434a9616c7)

3 years agoaxgbe: fix some link related issues
Vincenzo Maffione [Sat, 23 Jan 2021 13:44:24 +0000 (13:44 +0000)]
axgbe: fix some link related issues

By default, axgbe driver does a receiver reset after predefined number
of retries for the link to come up. However, this receiver reset
doesn't always suffice, due to an hardware issue.
In that case, as a workaround, a complete phy reset is necessary.
This patch introduces a sysctl that can be set to 1 to let the driver
reset the phy completely, rather than just doing receiver reset.
The workaround will be removed once the issue is fixed by means
of firmware update.

This patch also fixes the handling of the direct attach cables
properly.

Submitted by: rajesh1.kumar_amd.com
Differential Revision: https://reviews.freebsd.org/D28266

(cherry picked from commit bfd75d45571958398a043517060d8c3d352e7dbd)

3 years agoMFC 0e01ea872ee475d7aef11d21588504e2ef4eb32c:
Cy Schubert [Thu, 28 Jan 2021 05:52:08 +0000 (21:52 -0800)]
MFC 0e01ea872ee475d7aef11d21588504e2ef4eb32c:

Fix a typo.

(cherry picked from commit 0e01ea872ee475d7aef11d21588504e2ef4eb32c)

3 years agoMFC: 83edbc3cb54fba6b37a68270c232df7b785bd222
Cy Schubert [Fri, 15 Jan 2021 04:32:16 +0000 (20:32 -0800)]
MFC: 83edbc3cb54fba6b37a68270c232df7b785bd222

ipfilter: Retire pre-standard C support.

All C compilers in 2021 support standard C and architectures that did
not were retired long ago. Simplify by removing now redundant
pre-standard C code.

(cherry picked from commit 83edbc3cb54fba6b37a68270c232df7b785bd222)

3 years agolibllvmminimal: Add missing Support/ABIBreak.cpp
Jessica Clarke [Wed, 27 Jan 2021 19:19:00 +0000 (19:19 +0000)]
libllvmminimal: Add missing Support/ABIBreak.cpp

When building natively on RISC-V, linking the bootstrap clang-tblgen
fails with:

  ld: error: undefined symbol: llvm::EnableABIBreakingChecks
  >>> referenced by PrettyStackTrace.cpp
  >>>               PrettyStackTrace.o:(.sdata+0x0) in archive
  /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
  >>> referenced by Signals.cpp
  >>>               Signals.o:(.sdata+0x8) in archive
  /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
  >>> referenced by Timer.cpp
  >>>               Timer.o:(.sdata+0x28) in archive
  /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a

This is likely due to Error.h's inclusion of abi-breaking.h. It's
unclear why this only affects RISC-V, but perhaps relates to its more
eager use of .sdata due to the ABI's support for linker relaxations.
Regardless, this is theoretically an issue for all architectures.

Reported by: Dennis Clarke <dclarke@blastwave.org>

(cherry picked from commit 48397f6c7d2d693602105d8ec24c5741202e264d)

3 years agoMFC: 8c22cf9b
Kirk McKusick [Tue, 26 Jan 2021 19:46:38 +0000 (11:46 -0800)]
MFC: 8c22cf9b

Fix fsck_ffs incorrectly reporting "CANNOT READ BLK: NNNN" errors.

A long-standing bug in Pass 1 of fsck_ffs in which it is reading in
blocks of inodes to check their block pointers. It failed to round
up the size of the read to a disk block size. When disks would
accept 512-byte aligned reads, the bug rarely manifested itself.
But many recent disks will no longer accept 512-byte aligned reads
but require 4096-byte aligned reads, so the failure to properly
round-up read sizes to multiples of 4096 bytes makes the error
much more likely to occur.

Reported by:  Peter Holm and others
Tested by:    Peter Holm and Rozhuk Ivan
MFC after:    3 days
Sponsored by: Netflix

(cherry picked from commit 8c22cf9b0997566ff6f576cfc9296b29bb055f65)

3 years agoMFC: a63eae6
Kirk McKusick [Sat, 30 Jan 2021 08:03:37 +0000 (00:03 -0800)]
MFC: a63eae6

Revert 2d4422e7991a, Eliminate lock order reversal in UFS ffs_unmount().

After discussion with Chuck Silvers (chs@) we have decided that
there is a better way to resolve this lock order reversal which
will be committed separately.

Sponsored by: Netflix

(cherry picked from commit a63eae65ff8789994c40573a0aa65128022c8bf2)

3 years agostand: ensure that the efi directory's dependencies are correct
Kyle Evans [Wed, 27 Jan 2021 18:54:07 +0000 (12:54 -0600)]
stand: ensure that the efi directory's dependencies are correct

efi, like the various ${MACHINE} directories, should have a dependency on
the enabled interpreters.

The general rule here is that any top-level directory that has a program at
any depth within that includes loader.mk should add ${INTERP_DEPENDS} added
to its dependencies so that the appropriate ficl/lua bits are ready before
they begin.

Note that the only directories in-tree that require it but will not get it
in a more appropriate manner are i386 (on amd64), efi, and userboot. i386
and userboot are handled explicitly in Makefile.amd64 where they are added
to S.yes.

Reported-by: bcran
(cherry picked from commit 7012461c9bf6375cd0b14de16b3b4a753c5c1c7a)

3 years agoqat.4: Minor tweaks
Mark Johnston [Wed, 27 Jan 2021 20:31:10 +0000 (15:31 -0500)]
qat.4: Minor tweaks

- Document a constraint on the AAD size for AES-GCM.
- Note that the list of supported platforms and add-on devices is not
  complete and indicate that QAT devices will show up in pciconf
  output. [1]

PR: 252984 [1]
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit e1b50e8184fca00520774d43bd7bdd0ccbe9a1d2)

3 years agosafexcel: Disallow unsupported buffer layouts
Mark Johnston [Wed, 27 Jan 2021 20:31:10 +0000 (15:31 -0500)]
safexcel: Disallow unsupported buffer layouts

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 2fccd4f9b6b96d75de87df4922eb2bf04fb0a67d)

3 years agoRevert "Define PNP info after defining driver modules"
Mark Johnston [Sat, 23 Jan 2021 15:55:09 +0000 (10:55 -0500)]
Revert "Define PNP info after defining driver modules"

This reverts commit aa37baf3d7cf51da92fd367476182802e71838ae.

The reverted commit was motivated by a problem observed on stable/12,
but it turns out that a better solution was committed in r348309 but not
MFCed.  So, revert this change since it is unnecessary and not really
correct: it assumes that the order in which module metadata records is
defined determines their order in the output linker set.  While this
seems to hold in my testing, it is not guaranteed.

Reported by: cem
Discussed with: imp

(cherry picked from commit 519b64e27fddf10c0b7f6a615edbad730b8c6c45)

3 years agoFix clang assertion when compiling the devel/onetbb port
Dimitry Andric [Tue, 26 Jan 2021 13:07:47 +0000 (14:07 +0100)]
Fix clang assertion when compiling the devel/onetbb port

Merge commit 740a164de from llvm git (by Richard Smith):

  PR46377: Fix dependence calculation for function types and typedef
  types.

  We previously did not treat a function type as dependent if it had a
  parameter pack with a non-dependent type -- such a function type depends
  on the arity of the pack so is dependent even though none of the
  parameter types is dependent. In order to properly handle this, we now
  treat pack expansion types as always being dependent types (depending on
  at least the pack arity), and always canonically being pack expansion
  types, even in the unusual case when the pattern is not a dependent
  type. This does mean that we can have canonical types that are pack
  expansions that contain no unexpanded packs, which is unfortunate but
  not inaccurate.

  We also previously did not treat a typedef type as
  instantiation-dependent if its canonical type was not
  instantiation-dependent. That's wrong because instantiation-dependence
  is a property of the type sugar, not of the type; an
  instantiation-dependent type can have a non-instantiation-dependent
  canonical type.

Merge commit 9cf98d26e from llvm git (by Richard Smith):

  PR46637: Fix handling of placeholder types in trailing-return-types.

  Only permit a placeholder type in a trailing-return-type if it would
  also have been permitted in the decl-specifier sequence of a
  corresponding declaration with no trailing-return-type. The standard
  doesn't actually say this, but this is the only thing that makes sense.

  Also fix handling of an 'auto' in a trailing-return-type in a parameter
  of a generic lambda. We used to crash if we saw such a thing.

Merge commit 234f51a65 from llvm git (by Richard Smith):

  Don't crash if we deserialize a pack expansion type whose pattern
  contains no packs.

  Fixes a regression from 740a164dec483225cbd02ab6c82199e2747ffacb.

PR: 252892
Reported by: thierry

(cherry picked from commit e63539f3059728ff58328ac0ecb2a7bf4e2f08e8)

Bump __FreeBSD_version after e63539f3059728ff58328ac0ecb2a7bf4e2f08e8

This is to allow ports to detect the clang fix applied in the above
commit.

PR: 252892

(cherry picked from commit 2cf84258922f306a3f84866685d2f5346f67db58)

3 years agoTCP PRR: Patch div/0 in tcp_prr_partialack
Richard Scheffenegger [Tue, 26 Jan 2021 15:06:32 +0000 (16:06 +0100)]
TCP PRR: Patch div/0 in tcp_prr_partialack

Adding a safety net prior to the division in tcp_prr_partialack
function, which was missed in D28114.

Reviewed-by: tuexen, mm, @transport
MFC: 3 days

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

(cherry picked from commit 6a376af0cd212be4e16d013d35a0e2eec1dbb8ae)

3 years agoAdjust line length in tcp_prr_partialack
Richard Scheffenegger [Tue, 26 Jan 2021 13:47:19 +0000 (14:47 +0100)]
Adjust line length in tcp_prr_partialack

No functional changes.

Reviewed By: tuexen, mm, #transport

MFC: 3 days

Subscribers: imp, melifaro

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

(cherry picked from commit 84761f3df508aed50783b60f028af9d98a684b41)

3 years agolualoader: improve loader.conf var processing
Kyle Evans [Sun, 24 Jan 2021 19:25:34 +0000 (13:25 -0600)]
lualoader: improve loader.conf var processing

lualoader was previously not processing \ as escapes; this commit fixes
that and does better error checking on the value as well.

Additionally, loader.conf had some odd restrictions on values that make
little sense. Previously, lines like:

kernel=foo

Would simply be discarded with a malformed line complaint you might not
see unless you disable beastie.

lualoader tries to process these as well as it can and manipulates the
environment, while forthloader did minimal processing and constructed a
`set` command to do the heavy lifting instead. The lua approach was
re-envisioned from building a `set` command so that we can appropriately
reset the environment when, for example, boot environments change.

Lift the previous restrictions to allow unquoted values on the right hand
side of an expression.  Note that an unquoted value is effectively:

[A-Za-z0-9-][A-Za-z0-9-_.]*

This commit also stops trying to weirdly limit what it can handle in a
quoted value. Previously it only allowed spaces, alphanumeric, and
punctuation, which is kind of weird. Change it here to grab as much as it
can between two sets of quotes, then let processEnvVar() do the needful and
complain if it finds something malformed looking.

My extremely sophisticated test suite is as follows:

<<EOF
X_01_simple_string="simple"
X_02_escaped_string="s\imple"

X_03_unquoted_val=3
X_04_unquoted_strval=simple_test

X_05_subval="${X_03_unquoted_val}"
X_06_escaped_subval="\${X_03_unquoted_val}"

X_07_embedded="truth${X_03_unquoted_val}"
X_08_escaped_embedded="truth\${X_03_unquoted_val}"

X_09_unknown="${unknown_val}"
X_10_unknown_embedded="truth${unknown_val}"

X_11_crunchy="crunch$unknown_val crunch"
X_12_crunchy="crunch${unknown_val}crunch"

Y_01_badquote="te"lol"
Y_02_eolesc="lol\"
Y_02_noteolesc="lol\\"
Y_03_eolvar="lol$"
Y_03_noteolvar="lol\$"
Y_04_badvar="lol${"

exec="echo Done!"
EOF

Future work may provide a stub loader module in userland so that we can
formally test the loader scripts rather than sketchy setups like the above
in conjunction with the lua-* tools in ^/tools/boot.

(cherry picked from commit 576562856efbec31520aca6a1f72f2b11298e9a7)

3 years agoRegenerate src.conf(5) after 03d837b565a9
Kyle Evans [Fri, 29 Jan 2021 01:21:58 +0000 (19:21 -0600)]
Regenerate src.conf(5) after 03d837b565a9

(direct commit)

3 years agobuild: remove LIBPTHREAD/LIBTHR build options
Kyle Evans [Wed, 20 Jan 2021 14:01:25 +0000 (08:01 -0600)]
build: remove LIBPTHREAD/LIBTHR build options

WITHOUT_LIBTHR has been broken for a little over five years now, since the
xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building
a useful system without threading support is becoming increasingly more
difficult.

Additionally, in the five plus years that it's been broken more reverse
dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among
others) that make it more and more difficult to reconcile the effort needed
to fix these options.

Remove the broken options.

PR: 252760

(cherry picked from commit 123ae3045dd21badb93ce52445e18e364b3ac807)
(cherry picked from commit 251a6ddfbdcd72e0de922e8320d2f0cc6806a423)