]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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)

3 years agosbin/sysctl: Fix CTLFLAG_SKIP for adjacent nodes
Ryan Moeller [Wed, 27 Jan 2021 19:27:46 +0000 (14:27 -0500)]
sbin/sysctl: Fix CTLFLAG_SKIP for adjacent nodes

The OID is saved when we encounter CTLFLAG_SKIP so that descendants can
be skipped as well. We then must not update the skip OID until we are
out of the node. This was achieved by resetting the skip OID once the
prefix no longer matches, but the case where the OID we reset on has
CTLFLAG_SKIP was not accounted for.

Reported by: mav
Reviewed by: mav
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D28364

(cherry picked from commit 65efb73fbddd44116fd39b03991386a67422ba6d)

3 years agorelease: set stable/13 to ALPHA3 as part of the 13.0 cycle
Glen Barber [Thu, 28 Jan 2021 23:59:57 +0000 (18:59 -0500)]
release: set stable/13 to ALPHA3 as part of the 13.0 cycle

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agoRemove Binutils from src.conf(5) option descriptions
Ed Maste [Sun, 24 Jan 2021 17:22:01 +0000 (12:22 -0500)]
Remove Binutils from src.conf(5) option descriptions

All binutils remnants have been removed before FreeBSD 13.

PR: 252842
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b23665f3169b7b0364416060855541b450204d6d)

3 years agoelfctl: allow features to be specified by value
Ed Maste [Fri, 22 Jan 2021 17:22:35 +0000 (12:22 -0500)]
elfctl: allow features to be specified by value

This will allow elfctl on older releases to set bits that are not yet
known there, so that the binary will have the correct settings applied
if run on a later FreeBSD version.

PR: 252629 (related)
Suggested by: kib
Reviewed by: gbe (manpage, earlier), kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28284

(cherry picked from commit 86f33b5fcf6087bf4439881011b920ff99e6e300)

elfctl: fix typo from last-minute refactoring

Reported by: jkim

(cherry picked from commit f302fd1aa6730facd53a3f761e0a57302731b03e)

elfctl: Fix type errors.

Target value for val has uint32_t type, not uint, adjust used constant.
Change val type to unsigned so that left and right sides of comparision
operator do not expose different signed types of same range [*].

Switch to unsigned long long and strtoll(3) so that 0x80000000 is
accepted by conversion function [**].

Reported by: kargl [*]
Noted by: emaste [**]
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28301

(cherry picked from commit 9940ac808de7b7d4ed0408c3e739f667dca06d3b)

3 years agoAdd RELNOTES entry for AES-GCM in armv8crypto(4)
Oleksandr Tymoshenko [Tue, 26 Jan 2021 04:50:26 +0000 (20:50 -0800)]
Add RELNOTES entry for AES-GCM in armv8crypto(4)

Reviewed by: gjb, jhb
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D28297

3 years agocontrib/tzdata: import tzdata 2021a
Philip Paeps [Mon, 25 Jan 2021 21:52:24 +0000 (05:52 +0800)]
contrib/tzdata: import tzdata 2021a

Merge commit '4cd7e1071de16a7392b0e466287f13e9e6f2081a'

Changes: https://github.com/eggert/tz/blob/2021a/NEWS

(cherry picked from commit 8c5bef2eb24cb191c87712a56a9860d8c29415a0)

3 years agogdb: only return signal values for powerpc's gdb_cpu_signal()
Mitchell Horne [Fri, 22 Jan 2021 18:56:56 +0000 (14:56 -0400)]
gdb: only return signal values for powerpc's gdb_cpu_signal()

Reviewed by: alfredo

(cherry picked from commit 57a543d8b85065f77e0b68162d09a03335970f90)

3 years agoarmv8crypto: add AES-GCM support
Oleksandr Tymoshenko [Wed, 13 Jan 2021 06:27:10 +0000 (22:27 -0800)]
armv8crypto: add AES-GCM support

Add support for AES-GCM using OpenSSL's accelerated routines.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D27454
Sponsored by: Ampere Computing
Submitted by: Klara, Inc.
Approved by: re (kib)

(cherry picked from commit ed9b7f4414663703e0e9581a730c4bdfaca5687f)

3 years agoRegenerate src.conf(5)
Kyle Evans [Fri, 22 Jan 2021 23:24:28 +0000 (17:24 -0600)]
Regenerate src.conf(5)

3 years agojemalloc: restore JEMALLOC_DEBUG when building WITHOUT_MALLOC_PRODUCTION
Kyle Evans [Fri, 22 Jan 2021 23:13:42 +0000 (17:13 -0600)]
jemalloc: restore JEMALLOC_DEBUG when building WITHOUT_MALLOC_PRODUCTION

The default for MALLOC_PRODUCTION was switched to ON in 02611ef8ee9f.  This
effectively reverts the jemalloc header change from bfd15705156b so that
the knob behaves exactly as it does on a -CURRENT; that is, we are
effectively doing:

WITH_MALLOC_PRODUCTION -> -DMALLOC_PRODUCTION (default for stable/* and on)
WITHOUT_MALLOC_PRODUCTION -> -DJEMALLOC_DEBUG (default for main)

This allows the knob to be used for debugging on stable branches, too, which
is believed to be the main reason one would want to twist it off.

(direct commit)

3 years agopowerpc64le: don't enable COMPAT_* options in GENERIC64LE
Piotr Kubaj [Fri, 22 Jan 2021 16:39:15 +0000 (17:39 +0100)]
powerpc64le: don't enable COMPAT_* options in GENERIC64LE

Support for powerpc64le appeared in 13, so there's no point to enable COMPAT_* for older releases.

Also disable COMPAT_FREEBSD32, since there's no powerpcle. Since that may change in the future, leave the option commented out.

Approved by: bdragon, jhibbits (on IRC)

3 years agopowerpc: fix build without DDB
Mateusz Guzik [Fri, 22 Jan 2021 14:29:01 +0000 (14:29 +0000)]
powerpc: fix build without DDB

(cherry picked from commit eb61de5b7871e2ee2122b31418d1cd50ae43964e)

3 years agonewvers.sh: restore reporting branch names
Mateusz Guzik [Fri, 22 Jan 2021 13:00:24 +0000 (13:00 +0000)]
newvers.sh: restore reporting branch names

It got removed arguably without much discussion in the commit which
added gitup support.

(cherry picked from commit ace7209ce04d0e4dc0e84d5e2eb27fc762e67a01)

3 years agoRevert "[mips] revert r366664 - flip mips back from -O2 to -O"
Mateusz Guzik [Fri, 22 Jan 2021 10:17:34 +0000 (10:17 +0000)]
Revert "[mips] revert r366664 - flip mips back from -O2 to -O"

This reverts commit bd72252aace382921840ddbceea712b96f4ad242.

The commit at hand breaks the build for all mips targets and does not
have a one-liner fix.

make[5]: "/usr/src/share/mk/sys.mk" line 169: Malformed conditional (${MACHINE_CPUARCH} == "mips" && ${COMPILER_TYPE} == "gcc")

(cherry picked from commit bb3b6995c4d0ced1a87ec57407f216ece69ab674)

3 years agoTurn on MALLOC_PRODUCTION
Glen Barber [Fri, 22 Jan 2021 00:28:07 +0000 (19:28 -0500)]
Turn on MALLOC_PRODUCTION

Approved by: re (implicit)
Noticed by: kevans
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agoCreate the stable/13 branch
Glen Barber [Fri, 22 Jan 2021 00:06:26 +0000 (19:06 -0500)]
Create the stable/13 branch

Prune *-NODEBUG kernels.
Turn off debug options.
Bump to ALPHA2.

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agokvprintf(9): add missing FALLTHROUGH
Marius Strobl [Thu, 21 Jan 2021 23:16:37 +0000 (00:16 +0100)]
kvprintf(9): add missing FALLTHROUGH

Reported by: Coverity
CID: 1005166

3 years agommcsd(4): properly set BIO error when partition switching fails
Marius Strobl [Thu, 21 Jan 2021 23:09:09 +0000 (00:09 +0100)]
mmcsd(4): properly set BIO error when partition switching fails

While at it, remove redundant braces and goto in mmcsd_task().

Reported by: Coverity
CID: 1419639

3 years agosym(4): handle mixed tagged/untagged commands gracefully
Marius Strobl [Thu, 21 Jan 2021 22:48:08 +0000 (23:48 +0100)]
sym(4): handle mixed tagged/untagged commands gracefully

Handle the case of a tagged command arriving when there's an untagged
one still outstanding gracefully instead of panicing.

While at it:
- Replace fancy arithmetics with a simple assignment as busy_itl can
  only ever be either 0 or 1.
- Fix a comment typo in sym_free_ccb().

3 years agosym(4): fix nits reported by Coverity
Marius Strobl [Thu, 21 Jan 2021 22:34:19 +0000 (23:34 +0100)]
sym(4): fix nits reported by Coverity

- In ___dma_getp(), remove dead code. [1]
- In sym_sir_bad_scsi_status(), add missing FALLTHROUGH. [2]

While at it:
- For getbaddrcb(), remove __unused from the nseg argument as it's in
  fact used when compiling with INVARIANTS.
- In sym_int_sir(), ensure in all branches that cp is not NULL before
  using it.

Reported by: Coverity
CID: 1008861 [1], 114996 [2]

3 years agofb_if: remove unused method
Marius Strobl [Sun, 17 Jan 2021 13:31:56 +0000 (14:31 +0100)]
fb_if: remove unused method

Apparently, it never came into play.

3 years agoboot_font(4): remove obsolete font
Marius Strobl [Sun, 17 Jan 2021 13:21:49 +0000 (14:21 +0100)]
boot_font(4): remove obsolete font

It's no longer used since 4e421792ec80df7a5fa82e97dcc3575c3ec6740a
and r325892 respectively.

3 years agoFurther refactor IPv4 interface route creation.
Alexander V. Chernikov [Tue, 19 Jan 2021 23:50:34 +0000 (23:50 +0000)]
Further refactor IPv4 interface route creation.

* Fix bug with /32 aliases introduced in 81728a538d24.
* Explicitly document business logic for IPv4 ifa routes.
* Remove remnants of rtinit()
* Deduplicate ifa->route prefix code by moving it into ia_getrtprefix()
* Deduplicate conditional check for ifa_maintain_loopback_route()  by
 moving into ia_need_loopback_route()
* Remove now-unused flags argument from in_addprefix().

Reviewed by: donner
PR: 252883
Differential Revision: https://reviews.freebsd.org/D28246

3 years agoFix typo in pwait.c introduced in 5bdce6ff546e
Alexander V. Chernikov [Thu, 21 Jan 2021 21:43:27 +0000 (21:43 +0000)]
Fix typo in pwait.c introduced in 5bdce6ff546e

Reported by: kevans

3 years agoRemove deadlock in rc caused by pwait waiting for itself.
Alexander V. Chernikov [Thu, 21 Jan 2021 21:26:15 +0000 (21:26 +0000)]
Remove deadlock in rc caused by pwait waiting for itself.

The following situation can trigger the deadlock:
1) Long time ago a_service was started through rc.d
2) We want to restart a_service and issue service a_service restart
3) rc.subr reads current process PID (via file or process),
   sends TERM signal and runs pwait with PID harvested
4) a_service process dies very quickly so it's PID becomes available.
   It is possible that while original process was running,
   PID counter overflowed and pwait got assigned a_service's PID.

This patch ignores pid(s) to wait that are equal to pwait PID.

Reported by: Dan McGregor, Boris Lytochkin
Submitted by: Boris Lytochkin <lytboris at gmail.com>
Reviewed By: 0mp
MFC after: 2 weeks
PR: 218598
Differential Revision: https://reviews.freebsd.org/D28240

3 years agomalloc_aligned: roundup allocation size up to next power of two
Konstantin Belousov [Mon, 18 Jan 2021 21:17:21 +0000 (23:17 +0200)]
malloc_aligned: roundup allocation size up to next power of two

to make it use the right aligned zone.

Reported by: melifaro
Reviewed by: alc, markj (previous version)
Discussed with: jrtc27
Tested by: pho (previous version)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28219

3 years agoRestrict supported alignment for malloc_domainset_aligned(9) to PAGE_SIZE.
Konstantin Belousov [Mon, 18 Jan 2021 09:01:23 +0000 (11:01 +0200)]
Restrict supported alignment for malloc_domainset_aligned(9) to PAGE_SIZE.

UMA page_alloc() does not take an alignment, so UMA can only handle
alignment less then page size.

Noted by: alc
Reviewed by: alc, markj (previous version)
Discussed with: jrtc27
Tested by: pho (previous version)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28219

3 years agoFix manpage markup in 2c8bb126de56ce49637ad752e78957d9ebafba02
Allan Jude [Thu, 21 Jan 2021 20:32:15 +0000 (20:32 +0000)]
Fix manpage markup in 2c8bb126de56ce49637ad752e78957d9ebafba02

3 years agobhyve: Add missing man page section on the nodelete block-device-option
Allan Jude [Thu, 21 Jan 2021 17:17:57 +0000 (17:17 +0000)]
bhyve: Add missing man page section on the nodelete block-device-option

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

3 years agolibcasper/cap_grp tests: Reset the group database handle
Mark Johnston [Thu, 21 Jan 2021 19:30:19 +0000 (14:30 -0500)]
libcasper/cap_grp tests: Reset the group database handle

Some tests verify that the capgrp capability does not permit calls to
setgrent(3), but all tests need to ensure that they reset the
capability's group database handle, otherwise the local process and
casper process will be out of sync.

The cap_pwd tests already handle this.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

3 years agolibc/nss: Ensure that setgroupent(3) actually works as advertised
Mark Johnston [Thu, 21 Jan 2021 19:30:19 +0000 (14:30 -0500)]
libc/nss: Ensure that setgroupent(3) actually works as advertised

Because the "files" and "compat" implementations failed to set the
"stayopen", keyed lookups would close the database handle, contrary to
the purpose of setgroupent(3).  setpassent(3)'s implementation does not
have this bug.

PR: 165527
Submitted by: Andrey Simonenko
MFC after: 1 month

3 years agolibc/nss tests: Add regression tests for commit 55444c823e1f
Mark Johnston [Thu, 21 Jan 2021 19:30:19 +0000 (14:30 -0500)]
libc/nss tests: Add regression tests for commit 55444c823e1f

PR: 252094
Sponsored by: The FreeBSD Foundation
MFC after: 1 month

3 years agolibc/nss: Restore iterator state when doing passwd/group lookups
Mark Johnston [Thu, 21 Jan 2021 19:30:19 +0000 (14:30 -0500)]
libc/nss: Restore iterator state when doing passwd/group lookups

The getpwent(3) and getgrent(3) implementations maintain some internal
iterator state.  Interleaved calls to functions which do passwd/group
lookups using a key, such as getpwnam(3), would in some cases clobber
this state, causing a subsequent getpwent() or getgrent() call to
restart iteration from the beginning of the database or to terminate
early.  This is particularly troublesome in programming environments
where execution of green threads is interleaved within a single OS
thread.

Take care to restore any iterator state following a keyed lookup.  The
"files" provider for the passwd database was already handling this
correctly, but "compat" was not, and both providers had this problem
when accessing the group database.

PR: 252094
Submitted by: Viktor Dukhovni <ietf-dane@dukhovni.org>
MFC after: 1 month

3 years agolibc/nss tests: Fix getpw and getgr single-pass tests
Mark Johnston [Thu, 21 Jan 2021 19:30:19 +0000 (14:30 -0500)]
libc/nss tests: Fix getpw and getgr single-pass tests

Some NSS regression tests for getgrent(3) and getpwent(3) were not
testing anything because the test incorrectly requested creation of a
database snapshot.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

3 years agolibc/nss tests: Style
Mark Johnston [Thu, 21 Jan 2021 19:30:18 +0000 (14:30 -0500)]
libc/nss tests: Style

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

3 years agoDefine PNP info after defining driver modules
Mark Johnston [Thu, 21 Jan 2021 19:30:18 +0000 (14:30 -0500)]
Define PNP info after defining driver modules

PNP info definitions currently have an unfortunate requirement in that
they must follow the associated module definition in the module metadata
linker set.  Otherwise devmatch can segfault while processing the linker
hints file since kldxref maintains the order in the linker set.

A number of drivers violate this requirement.  In some cases this can
cause devmatch(8) to segfault when processing the linker hints file.
Work around the problem for now simply by adjusting the drivers.

Reviewed by: imp
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D28260

3 years agonewvers.sh: avoid bare git invocation
Ed Maste [Thu, 21 Jan 2021 15:00:20 +0000 (10:00 -0500)]
newvers.sh: avoid bare git invocation

git may not be in the path, and $git_cmd includes some commandline
arguments.

Reported by: mjg
Tested by: mjg

3 years agoiflib: Fix a NULL pointer deref
Andrew Gallatin [Thu, 21 Jan 2021 14:45:15 +0000 (09:45 -0500)]
iflib: Fix a NULL pointer deref

rxd_frag_to_sd() have pf_rv parameter as NULL with the current
code. This patch fixes the NULL pointer dereference in that
case thus avoiding a possible panic.

Submitted by: rajesh1.kumar at amd.com
Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D28115

3 years agox86: switch vdso TSC timecounter to RDTSCP on AMD Zen CPUs
Konstantin Belousov [Thu, 21 Jan 2021 12:54:28 +0000 (14:54 +0200)]
x86: switch vdso TSC timecounter to RDTSCP on AMD Zen CPUs

Reported by: many
Tested by: gallatin, mikael, rhurlin
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agox86: switch kernel TSC timecounter to RDTSCP on AMD Zen CPUs
Konstantin Belousov [Thu, 21 Jan 2021 12:53:15 +0000 (14:53 +0200)]
x86: switch kernel TSC timecounter to RDTSCP on AMD Zen CPUs

Reported by: many
Tested by: gallatin, mikael, rhurlin
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agoelf: add some definitions for i386 and amd64 relocations
Konstantin Belousov [Sun, 17 Jan 2021 07:03:31 +0000 (09:03 +0200)]
elf: add some definitions for i386 and amd64 relocations

I believe that rtld does not need to implement them, they are mostly for
the static linker.  'Mostly' because for amd64 our kernel linker loads
object files, and amd64 relocation types could be observed.

Defines were taken from glibc sources.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28205

3 years agoRemove FirstBurstLength limit for software iSCSI.
Alexander Motin [Thu, 21 Jan 2021 02:33:14 +0000 (21:33 -0500)]
Remove FirstBurstLength limit for software iSCSI.

For hardware offload solicited data may potentially be handled more
efficiently than unsolicited due to direct data placement.  Or there
can be some unsolicited write buffering limitations.  It may create
situations where FirstBurstLength limit is really useful.

Software driver though has no those factors, having to do memcopy()
any way and having no so hard limit on the temporary storage.  Same
time more active use of unsolicited transfers allows to avoid some
of Ready To Transfer (R2T) PDU round-trip times and processing.

This change effectively doubles from 64KB to 128KB the maximum size
of write command that can be transferred within one link RTT.  Tests
of (64KB, 128KB] QD1 writes mixed with simultaneous QD8 reads over
the same connection, increasing RTT, shows almost double write speed
and half latency, while we should be able to afford few megabytes of
RAM for additional buffering on a target these days.

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

3 years agopkgbase: allow update-packages for first-run of packaging
Kyle Evans [Mon, 18 Jan 2021 20:11:58 +0000 (14:11 -0600)]
pkgbase: allow update-packages for first-run of packaging

If ${REPODIR}/${PKG_ABI} does not exist when we begin real-update-packages,
skip the comparison with the non-existent previous repository and just
finish the repo off. This allows external scripts to just assume they can
run `update-packages` rather than figuring out if they'd previously run
`packages` for this Version/Arch combo.

PKG_VERSION_FROM_DIR was added so that we could perhaps detect the three
distinct cases:

1.) If the repo has not yet been created, PKG_VERSION_FROM_DIR will be
  empty.
2.) If the repo is in some intermediate state between created and fully
  initialized, PKG_VERSION_FROM_DIR may point to the ABI directory.
3.) If the repo is fully initialized, then PKG_VERSION_FROM_DIR points to
  the latest build to compare to.

Option #2 is explicitly unhandled at the moment, but this is no different
than it was before.

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

3 years agovirtio_mmio: Delete a stale #if 0'ed debug print
Jessica Clarke [Thu, 21 Jan 2021 02:14:41 +0000 (02:14 +0000)]
virtio_mmio: Delete a stale #if 0'ed debug print

This was blindly moved in r360722 but the variable being printed is not
yet initialised. It's of little use and can easily be added back in the
right place if needed by someone debugging, so just delete it.

Reported by: bryanv

3 years agolinux64: Don't pass unnecessary -S and -g to objcopy
Jessica Clarke [Thu, 21 Jan 2021 01:54:52 +0000 (01:54 +0000)]
linux64: Don't pass unnecessary -S and -g to objcopy

Since we use --input-type binary these options are rather meaningless. Both
binutils and elftoolchain ignore the option in this case, but LLVM does not,
and instead strips all symbols from the output file, causing missing symbols at
run time if building with llvm-objcopy. Thus simply remove the options; the
linux module has never included them for building its VDSO (added in r283407),
but for some reason the original commit of linux64 (r283424) added them.

These should however eventually be changed to use template assembly files as is
now done for firmware and MFS_IMAGE.

Reviewed by: emaste, trasz
Differential Revision: https://reviews.freebsd.org/D27740

3 years agoRename i386's Linux ELF to Linux ELF32
Jessica Clarke [Thu, 21 Jan 2021 01:54:12 +0000 (01:54 +0000)]
Rename i386's Linux ELF to Linux ELF32

This is what amd64 calls the i386 Linux ABI in order to distinguish it
from the amd64 Linux ABI, and matches the nomenclature used for the
FreeBSD ABIs where they always have the size suffix in the name.

Reviewed by: trasz
Differential Revision: https://reviews.freebsd.org/D27647

3 years agoBuild VirtIO modules on all architectures
Jessica Clarke [Thu, 21 Jan 2021 01:21:35 +0000 (01:21 +0000)]
Build VirtIO modules on all architectures

Currently only amd64, i386 and powerpc build VirtIO modules, yet all other
architectures have at least one kernel configuration that includes the
transport drivers, and so they lack drivers for all the devices they don't
statically compile into the kernel. Instead, enable the build everywhere so all
architectures have the full set of device drivers available.

Reviewed by: bryanv (earlier version), imp (earlier version)
Differential Revision: https://reviews.freebsd.org/D28058