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

Reported-by: Jamie Landeg-Jones <jamie@catflap.org>

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.

Reported-by: arichardson (via CheriBSD Jenkins CI)
Reviewed-by: kib
MFC-after: 3 days
Differential Revision: https://reviews.freebsd.org/D28401

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

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

MFC after: 3 days

3 years agoAdd support for some more Intel VMD controllers. Some of the
Doug Ambrisko [Thu, 28 Jan 2021 23:12:14 +0000 (15:12 -0800)]
Add support for some more Intel VMD controllers.  Some of the
newer controller have a sparce bus space that can be figured
out by probing the HW.  This gives the starting bus number.
When reading the PCI config. space behind the VMD controller,
the offset of the starting bus needs to be subtracted from
the bus being read.

Fixed a bug in which in which not all of the devices
directly attached to the VMD controller would be probed.
On my initial test HW, a switch was found at bus 0, slot 0
and function 0.  All of the NVME drives were behind that
switch.  Now scan for all slots and functions attached to
bus 0.  If a something was found then run attach after the
scan.  On detach also go through all slots and functions
on bus 0.

Tested with device ID's: 0x201d & 0x9a0b

Tested by: nc@
MFC after: 7 days
PR: 252253

3 years agohsctrl: Fix manpage typo
Vladimir Kondratyev [Thu, 28 Jan 2021 21:35:11 +0000 (00:35 +0300)]
hsctrl: Fix manpage typo

Use hsctrl_load to load the module at boot time.

Submitted by: Shunchao Hu <ankohuu_outlook.com>
Reviewed by: wulf
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D28343

3 years agoRegenerate src.conf.5 after enabling MK_OPENSSL_KTLS for arm64
Allan Jude [Thu, 28 Jan 2021 21:31:40 +0000 (21:31 +0000)]
Regenerate src.conf.5 after enabling MK_OPENSSL_KTLS for arm64

3 years agoFlip the default for OPENSSL_KTLS to arm64
Allan Jude [Thu, 28 Jan 2021 21:28:18 +0000 (21:28 +0000)]
Flip the default for OPENSSL_KTLS to arm64

This is required to make use of KERN_TLS

Reviewed by: jhb
Sponsored by: Ampere Computing
Submitted by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D28405

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.

MFC after: 3 days
Sponsored by: iXsystems, Inc.

3 years agoBump date after ae257282ae5b.
John Baldwin [Thu, 28 Jan 2021 20:18:54 +0000 (12:18 -0800)]
Bump date after ae257282ae5b.

3 years agoEnable KERN_TLS by default in ARM64 GENERIC
Allan Jude [Thu, 28 Jan 2021 20:48:37 +0000 (20:48 +0000)]
Enable KERN_TLS by default in ARM64 GENERIC

Sponsored-by: Ampere Computing
Submitted-by: Klara, Inc.

3 years agoarch.7: update 11.x to 11.4 as the last FreeBSD 11 release
Ed Maste [Thu, 28 Jan 2021 20:02:24 +0000 (15:02 -0500)]
arch.7: update 11.x to 11.4 as the last FreeBSD 11 release

armeb and pc98 were both discontinued after FreeBSD 11.  FreeBSD 11.4
is now known to be the final 11.x release, so update to the specific
version.

3 years agoFix getblk() with GB_NOCREAT returning false-negatives.
Bryan Drewery [Wed, 27 Jan 2021 17:59:50 +0000 (09:59 -0800)]
Fix getblk() with GB_NOCREAT returning false-negatives.

It is possible for a buf to be reassigned between the dirty and clean
lists while gbincore_unlocked() looks in each list.  Avoid creating
a buffer in that case and fallback to a locked lookup.

This fixes a regression from r363482.

More discussion on potential improvements to the clean and dirty lists
handling is in the review.

Reviewed by: cem, kib, markj, vangyzen, rlibby
Reported by: Suraj.Raju at dell.com
Submitted by: Suraj.Raju at dell.com, cem, [based on both]
MFC after: 2 weeks
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D28375

3 years agoRegenerate src.conf.5 for MK_OPENSSL_KTLS
John Baldwin [Tue, 26 Jan 2021 22:33:08 +0000 (14:33 -0800)]
Regenerate src.conf.5 for MK_OPENSSL_KTLS

3 years agoOpenSSL: Regenerate manual pages.
Jung-uk Kim [Tue, 26 Jan 2021 22:26:51 +0000 (14:26 -0800)]
OpenSSL: Regenerate manual pages.

MFC after: 1 week

3 years agoOpenSSL: Support for kernel TLS offload (KTLS)
John Baldwin [Sat, 16 Jan 2021 00:17:31 +0000 (16:17 -0800)]
OpenSSL: Support for kernel TLS offload (KTLS)

This merges upstream patches from OpenSSL's master branch to add
KTLS infrastructure for TLS 1.0-1.3 including both RX and TX
offload and SSL_sendfile support on both Linux and FreeBSD.

Note that TLS 1.3 only supports TX offload.

A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with
KTLS support.  It defaults to enabled on amd64 and disabled on all
other architectures.

Reviewed by: jkim (earlier version)
Approved by: secteam
Obtained from: OpenSSL (patches from master)
MFC after: 1 week
Relnotes: yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28273

3 years agousr.sbin/pkg: Don't re-define roundup2
Alex Richardson [Thu, 28 Jan 2021 17:25:50 +0000 (17:25 +0000)]
usr.sbin/pkg: Don't re-define roundup2

The file already includes sys/param.h and should use that definition.
I found this while testing D28332.

Reviewed By: bapt
Differential Revision: https://reviews.freebsd.org/D28331

3 years agotests/sys/audit: fix timeout calculation
Alex Richardson [Thu, 28 Jan 2021 17:23:27 +0000 (17:23 +0000)]
tests/sys/audit: fix timeout calculation

This changes the behaviour to a 30s total timeout (needed when running
on slow emulated uniprocessor systems) and timing out after 10s without
any input. This also uses timespecsub() instead of ignoring the
nanoseconds field.

After this change the tests runs more reliably on QEMU and time out less
frequently.

Reviewed By: asomers
Differential Revision: https://reviews.freebsd.org/D28391

3 years agoUn-XFAIL two tests with Clang > 10
Alex Richardson [Thu, 28 Jan 2021 17:17:49 +0000 (17:17 +0000)]
Un-XFAIL two tests with Clang > 10

SVN r343917 fixed this for in-tree clang, but when building with a newer
out-of-tree clang the test was still marked as XFAIL.

Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D28390

3 years agorc.d/auditd: set pidfile
Alex Richardson [Thu, 28 Jan 2021 17:17:07 +0000 (17:17 +0000)]
rc.d/auditd: set pidfile

auditd creates a pidfile so we should use it for status checks.
This also seems to speed up the frequent onestatus checks used in
tests/sys/audit.

Reviewed By: asomers
Differential Revision: https://reviews.freebsd.org/D28389

3 years agoThis pulls over all the changes that are in the netflix
Randall Stewart [Tue, 26 Jan 2021 16:54:42 +0000 (11:54 -0500)]
This pulls over all the changes that are in the netflix
tree that fix the ratelimit code. There were several bugs
in tcp_ratelimit itself and we needed further work to support
the multiple tag format coming for the joint TLS and Ratelimit dances.

    Sponsored by: Netflix Inc.
    Differential Revision:  https://reviews.freebsd.org/D28357

3 years agopf tests: Test that dup-to doesn't produce extra duplicate packets
Kristof Provost [Thu, 28 Jan 2021 10:02:20 +0000 (11:02 +0100)]
pf tests: Test that dup-to doesn't produce extra duplicate packets

3 years agopf: duplicate frames only once when using dup-to pf rule
Yannis Planus [Thu, 28 Jan 2021 13:59:07 +0000 (14:59 +0100)]
pf: duplicate frames only once when using dup-to pf rule

When using DUP-TO rule, frames are duplicated 3 times on both output
interfaces and duplication interface. Add a flag to not duplicate a
duplicated frame.

Inspired by a patch from MiƂosz Kaniewski milosz.kaniewski at gmail.com
https://lists.freebsd.org/pipermail/freebsd-pf/2015-November/007886.html

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

3 years agoBump __FreeBSD_version for multiple LinuxKPI updates conflicting
Bjoern A. Zeeb [Thu, 28 Jan 2021 16:37:28 +0000 (16:37 +0000)]
Bump __FreeBSD_version for multiple LinuxKPI updates conflicting
with DRM.  Be sure to update your drm-kmod port to after the update.

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

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

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

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

3 years agoFix missing value in uar_page field for ratelimit in mlx5en(4).
Hans Petter Selasky [Tue, 26 Jan 2021 16:01:34 +0000 (17:01 +0100)]
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 .

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

3 years agoRemove obsolete code gated on _ARM_ARCH_*
Andrew Turner [Thu, 28 Jan 2021 10:41:45 +0000 (10:41 +0000)]
Remove obsolete code gated on _ARM_ARCH_*

This is all code only run on ARMv4 and ARMv5. Support for these have
been dropped from FreeBSD.

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

3 years agoRemove the old ARMv4 memcpy
Andrew Turner [Thu, 28 Jan 2021 10:39:38 +0000 (10:39 +0000)]
Remove the old ARMv4 memcpy

This was only used when building for ARMv4 or some ARMv5 or when
_STANDALONE is defined. As ARMv4 and ARMv5 support has been removed,
and we only define _STANDALONE in the bootloader where we don't use
this version of memcpy we can remove it.

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

3 years agoRemove leftover big-endian arm support
Andrew Turner [Thu, 28 Jan 2021 10:33:40 +0000 (10:33 +0000)]
Remove leftover big-endian arm support

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D28312

3 years agopci_vendors: update to 2021.01.11
Baptiste Daroussin [Thu, 28 Jan 2021 08:19:50 +0000 (09:19 +0100)]
pci_vendors: update to 2021.01.11

3 years agoloader: unload command should reset tg_kernel_supported in gfx_state
Toomas Soome [Thu, 28 Jan 2021 07:45:47 +0000 (09:45 +0200)]
loader: unload command should reset tg_kernel_supported in gfx_state

While loading kernel, we check if vt/vbe backend support is included in
kernel and set the tg_kernel_supported flag in gfx_state. unload
command needs to reset this flag to allow next load to perform
this check with new kernel.

Reported by: jhb

3 years agoFix a typo.
Cy Schubert [Thu, 28 Jan 2021 05:52:08 +0000 (21:52 -0800)]
Fix a typo.

MFC after: 3 days

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
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D28180

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
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D28176

3 years agoriscv: add SBI system reset extension
Danjel Qyteza [Wed, 27 Jan 2021 16:28:48 +0000 (12:28 -0400)]
riscv: add SBI system reset extension

The System Reset extension provides functions to shutdown or reboot the
system via SBI firmware. This newly defined extension supersedes the
functionality of the legacy shutdown extension.

Update the SBI code to use the new System Reset extension when
available, and fall back to the legacy one.

Reviewed By: kp, jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28226

3 years agoriscv: style(9) nits in sbi.c
Mitchell Horne [Wed, 27 Jan 2021 21:27:15 +0000 (17:27 -0400)]
riscv: style(9) nits in sbi.c

Wrap a few lines at 80 columns, which were overlooked in recent commits.

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.

3 years agoFix loader detection of vbefb support on !amd64
Dimitry Andric [Wed, 27 Jan 2021 21:28:43 +0000 (22:28 +0100)]
Fix loader detection of vbefb support on !amd64

On i386, after 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd, the vbefb vt
driver was no longer detected by the loader, if any kernel module was
loaded after the kernel itself.

This was caused by the parse_vt_drv_set() function being called multiple
times, resetting the detection flag. (It was called multiple times,
becuase i386 .ko files are shared objects like the kernel proper, while
this is not the case on amd64.)

Fix this by skipping the set_vt_drv_set lookup if vbefb was already
detected.

Reviewed by: tsoome

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

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

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]
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

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

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agonetgraph/ng_car: Add color marking code
Lutz Donnerhacke [Wed, 27 Jan 2021 20:19:14 +0000 (21:19 +0100)]
netgraph/ng_car: Add color marking code

Chained policing should be able to reuse the classification of
traffic.  A new mbuf_tag type is defined to handle gereral QoS
marking.  A new subtype is defined to track the color marking.

Reviewed by: manpages (bcr), melifaro, kp
Approved by: kp (mentor)
Sponsored by: IKS Service GmbH
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D22110

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
MFC after: 2 days
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D28364

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>
Reviewed by: dim
Tested by: mhorne
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28367

3 years agoRemove redundantcy from the arm GIC softc
Andrew Turner [Mon, 25 Jan 2021 20:03:47 +0000 (20:03 +0000)]
Remove redundantcy from the arm GIC softc

A struct recource already contains the bus_space_tag_t and
bus_space_handle_t. There is no neec to read them and store them again
in the drivers softc. Remove them and use the struct resource directly
with bus_read_* and bus_write_*.

Reviewed by: mmel
Differential Revision: https://reviews.freebsd.org/D28339

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
MFC-after: 3 days

3 years agoWhen we are about to send down to the driver layer
Randall Stewart [Wed, 27 Jan 2021 18:32:52 +0000 (13:32 -0500)]
When we are about to send down to the driver layer
we need to make sure that the m_nextpkt field is NULL
else the lower layers may do unwanted things.

Reviewed By:  gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D28377

3 years agokerberos5: Silence compiler warnings
Alex Richardson [Wed, 27 Jan 2021 10:41:57 +0000 (10:41 +0000)]
kerberos5: Silence compiler warnings

Building the kerberos5 subdirectory currently produces lots of warnings.
Since there are many instances of these warnings and it's contrib code,
this change silences the warnings instead of fixing them.

Reviewed By: jhb, cy, bjk
Differential Revision: https://reviews.freebsd.org/D28025

3 years agoVOP_BMAP(9): Remove obsolete comma
Gordon Bergling [Wed, 27 Jan 2021 17:20:04 +0000 (18:20 +0100)]
VOP_BMAP(9): Remove obsolete comma

3 years agocnv(9): Use a proper manual page section
Gordon Bergling [Wed, 27 Jan 2021 17:18:17 +0000 (18:18 +0100)]
cnv(9): Use a proper manual page section

3 years agoaltq: Fix typo in features sysctl description
Kristof Provost [Tue, 26 Jan 2021 15:02:45 +0000 (16:02 +0100)]
altq: Fix typo in features sysctl description

Reported by: Jose Luis Duran

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

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

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.

3 years agoe1000: fix build after c1655b0f
Marius Strobl [Wed, 27 Jan 2021 14:28:25 +0000 (15:28 +0100)]
e1000: fix build after c1655b0f

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

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.

3 years agodiff: eleminitate useless macros
Baptiste Daroussin [Wed, 27 Jan 2021 10:47:17 +0000 (11:47 +0100)]
diff: eleminitate useless macros

The diff_output was not bringing any values but was obfuscating
the code.

3 years agodiff: simplify the hash functions
Baptiste Daroussin [Tue, 26 Jan 2021 15:25:00 +0000 (16:25 +0100)]
diff: simplify the hash functions

Instead of 3 different complex case they have all been folded into a
simple on based on switch

3 years agodiff: fix typo in a comment
Baptiste Daroussin [Tue, 26 Jan 2021 14:20:44 +0000 (15:20 +0100)]
diff: fix typo in a comment

3 years agodiff: remove stalled entries in headers
Baptiste Daroussin [Wed, 27 Jan 2021 11:13:47 +0000 (12:13 +0100)]
diff: remove stalled entries in headers

3 years agodiff: eliminate space at end of line
Baptiste Daroussin [Wed, 27 Jan 2021 10:46:15 +0000 (11:46 +0100)]
diff: eliminate space at end of line

No functionnal changes

3 years agodiff: eliminate a useless lseek
Baptiste Daroussin [Tue, 26 Jan 2021 10:42:20 +0000 (11:42 +0100)]
diff: eliminate a useless lseek

fdopen with the "r" already position the stream at the beginning
of the file.

3 years agodiff: add a test case about the non regular file support
Baptiste Daroussin [Tue, 26 Jan 2021 10:38:36 +0000 (11:38 +0100)]
diff: add a test case about the non regular file support

3 years agocp: fix indentation
Baptiste Daroussin [Tue, 26 Jan 2021 09:52:22 +0000 (10:52 +0100)]
cp: fix indentation

No functional changes

3 years agoRemove old Marvell drivers
Andrew Turner [Tue, 26 Jan 2021 21:58:16 +0000 (21:58 +0000)]
Remove old Marvell drivers

These have probe functions that can only match device tree files that
have been removed because the boards they describe are unsupported.

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

3 years agoRemove DTS files for arm boards we don't support
Andrew Turner [Tue, 26 Jan 2021 21:13:29 +0000 (21:13 +0000)]
Remove DTS files for arm boards we don't support

These are all FreeBS-specific device tree files. We don't support any
of these anymore, remove them.

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

3 years agoloader: start kernel in text mode when there is no vbefb vt driver
Toomas Soome [Tue, 26 Jan 2021 22:47:56 +0000 (00:47 +0200)]
loader: start kernel in text mode when there is no vbefb vt driver

If kernel is built without VT vbefb driver, make sure
we start kernel in text mode.

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).

PR: 252833

3 years agorc.conf(5): regenerate after WITHOUT_NDIS removal
Marius Strobl [Tue, 26 Jan 2021 22:02:39 +0000 (23:02 +0100)]
rc.conf(5): regenerate after WITHOUT_NDIS removal

ndis(4) has been removed in bfc99943b04b46a6c1c885ce7bcc6f235b7422aa
and its build option in 84876bf70222c4e10144d034119f7f455f99813c.

3 years agobuild: remove NDIS option
Marius Strobl [Tue, 26 Jan 2021 21:59:36 +0000 (22:59 +0100)]
build: remove NDIS option

ndis(4) has been removed in bfc99943b04b46a6c1c885ce7bcc6f235b7422aa.

3 years agoKDB: remove obsolete KDB_WHY_NDIS
Marius Strobl [Tue, 26 Jan 2021 21:51:24 +0000 (22:51 +0100)]
KDB: remove obsolete KDB_WHY_NDIS

ndis(4) has been removed in bfc99943b04b46a6c1c885ce7bcc6f235b7422aa.

3 years agoman: remove stale references to ndis(4)
Marius Strobl [Tue, 26 Jan 2021 21:46:59 +0000 (22:46 +0100)]
man: remove stale references to ndis(4)

The latter has been removed in bfc99943b04b46a6c1c885ce7bcc6f235b7422aa.

3 years agoe1000: consistently use the hw variables
Marius Strobl [Sat, 23 Jan 2021 18:18:28 +0000 (19:18 +0100)]
e1000: consistently use the hw variables

It's rather confusing when adapter->hw and hw are mixed and matched
within a particular function.
Some of this was missed in cd1cf2fc1d49c509ded05dcd41b7600a5957fb9a
and r353778 respectively.

3 years agotests: Skip cap_fileargs if build without capsicum capabilities
Olivier Cochard [Tue, 26 Jan 2021 21:19:36 +0000 (22:19 +0100)]
tests: Skip cap_fileargs if build without capsicum capabilities

Approved by:    oshogbo
Sponsored by:   Netflix
Differential Revision: https://reviews.freebsd.org/D2834

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.

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.

3 years agoFix fsck_ffs incorrectly reporting "CANNOT READ BLK: NNNN" errors.
Kirk McKusick [Tue, 26 Jan 2021 19:46:38 +0000 (11:46 -0800)]
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

3 years agoBump __FreeBSD_version after e63539f3059728ff58328ac0ecb2a7bf4e2f08e8
Dimitry Andric [Tue, 26 Jan 2021 18:43:55 +0000 (19:43 +0100)]
Bump __FreeBSD_version after e63539f3059728ff58328ac0ecb2a7bf4e2f08e8

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

PR: 252892
MFC after: 3 days

3 years agoReserve gaps in syscall numbers for local use
Brooks Davis [Tue, 26 Jan 2021 18:27:45 +0000 (18:27 +0000)]
Reserve gaps in syscall numbers for local use

It is best for auditing of syscalls.master if we only append to the
file.  Reserving unimplemented system call numbers for local use makes
this policy and provides a large set of syscall numbers FreeBSD
derivatives can use without risk of conflict.

Reviewed by: jhb, kevans, kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D27988

3 years agosyscalls.master: Add a new syscall type: RESERVED
Brooks Davis [Tue, 26 Jan 2021 18:27:44 +0000 (18:27 +0000)]
syscalls.master: Add a new syscall type: RESERVED

RESERVED syscall number are reserved for local/vendor use.  RESERVED is
identical to UNIMPL except that comments are ignored.

Reviewed by: kevans
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D27988

3 years agoRemove documentation of unimplemented syscalls
Brooks Davis [Tue, 26 Jan 2021 18:27:44 +0000 (18:27 +0000)]
Remove documentation of unimplemented syscalls

We have not been able to run binaries from other BSDs well over a
decade.  There is no need to document their allocation decisions here.

We also don't need to reserve syscall numbers of never-implemented
syscalls.

Reviewed by: jhb, kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D27988

3 years agovm_map_protect.9: update after code changes
Konstantin Belousov [Sat, 23 Jan 2021 20:19:06 +0000 (22:19 +0200)]
vm_map_protect.9: update after code changes

Reviewed by: brooks, markj
Discussed with: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28311

3 years agoAdd missing decrement of active ratelimit connections.
Hans Petter Selasky [Tue, 26 Jan 2021 15:59:42 +0000 (16:59 +0100)]
Add missing decrement of active ratelimit connections.

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

3 years agoDon't allow allocating a new send tag on an INP which is being torn down.
Hans Petter Selasky [Tue, 26 Jan 2021 14:01:38 +0000 (15:01 +0100)]
Don't allow allocating a new send tag on an INP which is being torn down.
This fixes a potential send tag leak.

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

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
MFC after: 3 days

3 years agonetgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type
Lutz Donnerhacke [Tue, 26 Jan 2021 15:50:04 +0000 (16:50 +0100)]
netgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type

This node is part of an A10-NSP (L2-BSA) development.

Carrier networks tend to stack three or more tags for internal
purposes and therefore hiding the service tags deep inside of the
stack. When decomposing such an access network frame, the processing
order is typically reversed: First distinguish by service, than by
other means.

This new netgragh node allows to bring the relevant VLAN in front (to
the out-most position). This way other netgraph nodes (like ng_vlan)
can operate on this specific type.

Reviewed by: manpages (gbe), brueffer (manpages), kp
Approved by: kp (mentor)
MFC after: 1 month
Relnotes: yes
Sponsored by: IKS Service GmbH
Differential Revision: https://reviews.freebsd.org/D22076

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

With clearing of recover_fs in bc7ee8e5bc555, div/0
was observed while processing partial_acks.

Suspect that rewind of an erraneous RTO may be
causing this - with the above change, recover_fs
would no longer retained at the last calculated
value, and reset. But CC_RTO_ERR can reenable
IN_RECOVERY(), without setting this again.

Adding a safety net prior to the division in that
function, which I missed in D28114.

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

Summary:
Wrap lines before column 80 in new prr code checked in recently.

No functional changes.

Reviewers: tuexen, rrs, jtl, mm, kbowling, #transport

Reviewed By: tuexen, mm, #transport

Subscribers: imp, melifaro

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

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

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

3 years agoImport sqlite 3.34.1 (3340100).
Cy Schubert [Mon, 25 Jan 2021 17:45:04 +0000 (09:45 -0800)]
Import sqlite 3.34.1 (3340100).

3 years agoRemove ndis(4) remnants from kernel configs
Mateusz Guzik [Tue, 26 Jan 2021 00:04:13 +0000 (00:04 +0000)]
Remove ndis(4) remnants from kernel configs

Unbreaks LINT kernels.

3 years agoFix build following bfc99943b04b46a6c1c885ce7bcc6f235b7422aa.
Cy Schubert [Mon, 25 Jan 2021 22:34:22 +0000 (14:34 -0800)]
Fix build following bfc99943b04b46a6c1c885ce7bcc6f235b7422aa.

bfc99943b04b46a6c1c885ce7bcc6f235b7422aa removed ndis(4) support however
wpa as delivered by the wpa upstream (w1.fi) enables NDIS by default.
This commit disables NDIS suppport in the w1.fi delivered build config,
circumventing the build failure.

3 years agoipfilter: Retire pre-standard C support.
Cy Schubert [Fri, 15 Jan 2021 04:32:16 +0000 (20:32 -0800)]
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.

MFC after: 1 week

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.

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