]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoscsi_cd: Improve TOC access validation
Mark Johnston [Wed, 3 Nov 2021 19:09:17 +0000 (15:09 -0400)]
scsi_cd: Improve TOC access validation

1. During CD probing, we read the TOC header to find the number of
   entries, then read the TOC itself.  The header determines the number
   of entries, which determines the amount of data to read from the
   device into the softc in the CD_STATE_MEDIA_TOC_FULL state.  We
   hard-code a limit of 99 tracks (plus one for the lead-out) in the
   softc, but were not validating that the size reported by the media
   would fit in this hard-coded limit.  Kernel memory corruption could
   occur if not.[1]  Add validation to check this, and refuse to cache
   the TOC if it would not fit.

2. The CDIOCPLAYTRACKS ioctl uses caller provided track numbers to index
   into the TOC, but we only validate the starting index.  Add
   validation of the ending index.

Also, raise the hard-coded limit from 100 tracks to 170, per a
suggestion from Ken.

Reported by: C Turt <ecturt@gmail.com> [1]
Reviewed by: ken, avg
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32803

2 years agoudp_input: remove a BSD stack relict
Gleb Smirnoff [Thu, 28 Oct 2021 07:07:02 +0000 (00:07 -0700)]
udp_input: remove a BSD stack relict

I should had removed it 9 years ago in 8ad458a471ca.  That commit
left save_ip as a write-only variable.

With save_ip removed we got one case when IP header can be modified:
the calculation of IP checksum with zeroed out header.  This place
already has had a header saver char b[9].  However, the b[9] saver
didn't cover the ip_sum field, which we explicitly overwrite aliased
as (struct ipovly *)->ih_len.  This was fine in cb34210012d4e, since
checksum doesn't need to be restored if packet is consumed.  Now we
need to extend up to ip_sum field.

In collaboration with: ae
Differential revision: https://reviews.freebsd.org/D32719

2 years agoDocument net.inet.tcp.nolocaltimewait enabled.
Gleb Smirnoff [Wed, 3 Nov 2021 17:31:44 +0000 (10:31 -0700)]
Document net.inet.tcp.nolocaltimewait enabled.

2 years agokasan: Disable validation of function parameters passed by value
Mark Johnston [Wed, 3 Nov 2021 16:28:48 +0000 (12:28 -0400)]
kasan: Disable validation of function parameters passed by value

It appears that the emitted code in the caller does not update shadow
state for values passed on the stack to the callee, which it seemingly
ought to do after pushing values on the stack and prior to the call
itself.  This leaves open a window where an interrupt handler can cause
regions of the stack containing these values to be poisoned, resulting
in rare false positive reports.  This happens particularly in the amd64
TLB invalidation code, where we liberally pass cpuset_t's around by
value.

LLVM has a flag to disable validation of accesses of function parameters
passed by value.  Such validation is itself a relatively new feature.
Turn it off for now.

Reported by: pho, syzkaller
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

2 years agoamd64: Deduplicate routines for expanding KASAN/KMSAN shadow maps
Mark Johnston [Wed, 3 Nov 2021 16:28:08 +0000 (12:28 -0400)]
amd64: Deduplicate routines for expanding KASAN/KMSAN shadow maps

When working on the ports these functions were slightly different, but
now there's no reason for them to be separate.

No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoocs_fs: Fix two typos in source code comments
Gordon Bergling [Wed, 3 Nov 2021 16:17:51 +0000 (17:17 +0100)]
ocs_fs: Fix two typos in source code comments

- s/maxium/maximum/
- s/maxiumum/maximum/

MFC after: 3 days

2 years agong_pptpgre(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 3 Nov 2021 16:15:59 +0000 (17:15 +0100)]
ng_pptpgre(4): Fix a typo in a source code comment

- s/mimimum/minimum/

MFC after: 3 days

2 years agogjournal(8): Fix a typo in a source code comment
Gordon Bergling [Wed, 3 Nov 2021 16:14:00 +0000 (17:14 +0100)]
gjournal(8): Fix a typo in a source code comment

- s/writting/writing/

MFC after: 3 days

2 years agofexecve(2): allow O_PATH file descriptors opened without O_EXEC
Konstantin Belousov [Wed, 3 Nov 2021 12:51:06 +0000 (14:51 +0200)]
fexecve(2): allow O_PATH file descriptors opened without O_EXEC

This improves compatibility with Linux.

Noted by: Drew DeVault <sir@cmpwn.com>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32821

2 years agoproc_get_binpath(): return empty string instead of NULL
Konstantin Belousov [Wed, 3 Nov 2021 15:11:33 +0000 (17:11 +0200)]
proc_get_binpath(): return empty string instead of NULL

for strange case where queried process does not have text.

Reported by: Michael Butler <imb@protected-networks.net>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agovmci: Avoid relying on macro expansion to provide correct syntax
Mark Johnston [Wed, 3 Nov 2021 15:19:53 +0000 (11:19 -0400)]
vmci: Avoid relying on macro expansion to provide correct syntax

No functional change intended.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 years agonetinet: Fix a common typo in source code comments
Gordon Bergling [Wed, 3 Nov 2021 15:21:49 +0000 (16:21 +0100)]
netinet: Fix a common typo in source code comments

- s/writting/writing/

MFC after: 3 days

2 years agomana: Fix a typo in a source code comment
Gordon Bergling [Wed, 3 Nov 2021 15:20:11 +0000 (16:20 +0100)]
mana: Fix a typo in a source code comment

- s/maxium/maximum/

MFC after: 1 week

2 years agoixgbe(4): Fix a few typos in source code comments
Gordon Bergling [Wed, 3 Nov 2021 15:16:20 +0000 (16:16 +0100)]
ixgbe(4): Fix a few typos in source code comments

- s/Manageblility/Managebility/
- s/alows/allows/

MFC after: 3 days
Obtained from: NetBSD

2 years agocam_periph: style change
Warner Losh [Wed, 3 Nov 2021 14:03:07 +0000 (08:03 -0600)]
cam_periph: style change

wrap a long line at 80 columns

Sponsored by: Netflix
Reviewed by: chs
Differential Revision: https://reviews.freebsd.org/D32679

2 years agoofwfb: fix vga/hdmi console with ASMEDIA during boot on powerpc64(le)
Alfredo Dal'Ava Junior [Wed, 3 Nov 2021 16:42:28 +0000 (13:42 -0300)]
ofwfb: fix vga/hdmi console with ASMEDIA during boot on powerpc64(le)

On recent OpenBMC firmware, the onboard ASMEDIA video card framebuffer
address was removed from device tree for security purposes (value is set
to zero to avoid leaking the address).

This patch works around the problem by taking framebuffer base address
from the "ranges" property of a parent node.

Reviewed by: luporl, jhibbits (on IRC)
MFC after: 2 weeks
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D30626

2 years agofexecve(2): restore the attempts to calculate the executable path
Konstantin Belousov [Wed, 3 Nov 2021 12:58:03 +0000 (14:58 +0200)]
fexecve(2): restore the attempts to calculate the executable path

vn_fullpath() call was not converted to pass newtextvp, instead it used
imgp->vp which is still NULL there.  As result vn_fullpath() always
returned EINVAL and execpath was recorded from the value of arg0.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agodate: Capitalize seconds string in synopses
Mateusz Piotrowski [Wed, 3 Nov 2021 11:59:49 +0000 (12:59 +0100)]
date: Capitalize seconds string in synopses

This makes it consistent with other date(1) implementations. Also, it
feels more consistent since hours and minutes are already represented as
HH and MM respectively.

MFC after: 3 days

2 years agodate: Clean up synopses
Mateusz Piotrowski [Wed, 3 Nov 2021 11:58:09 +0000 (12:58 +0100)]
date: Clean up synopses

MFC after: 3 days

2 years agodate.1: Fix some style issues and examples
Mateusz Piotrowski [Wed, 3 Nov 2021 10:26:46 +0000 (11:26 +0100)]
date.1: Fix some style issues and examples

- Use Cm instead of Ar or Sq for command modifiers of the -v flag.
- Remove unnecessary "Ar ..." from the synopsis. It's not clear what it
  was referring to.
- Add missing arguments to the -f and -v flags.
- Stylize the dot before "ss" with Cm in the default format in the -f
  flag description.
- Set LC_ALL=C in the last example so that the output format of
  date(1) always matches the specified format of the -f flag not matter
  the locale.
- List the -f flag as optional in all usage lines in the synopsis.

MFC after: 3 days

2 years agodevfs.rules: Correctly unhide pf in vnet jails
Zhenlei Huang [Wed, 3 Nov 2021 11:46:48 +0000 (12:46 +0100)]
devfs.rules: Correctly unhide pf in vnet jails

Revision 9e9be081d8 introduced a new devfs rule devfsrules_jail_vnet. It
includes rule devfsrules_jail which include other rules. Unfortunately
devfs could not recursively parse the action include and thus
devfsrules_jail_vnet will expose all nodes.

PR: 255660
Reviewed by: kp
Obtained from: Gijs Peskens <gijs@peskens.net>
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D32814

2 years agoip_divert: calculate delayed checksum for IPv6 adress family
Andrey V. Elsukov [Tue, 2 Nov 2021 16:59:06 +0000 (19:59 +0300)]
ip_divert: calculate delayed checksum for IPv6 adress family

Before passing an IPv6 packet to application apply delayed checksum
calculation. Mbuf flags will be lost when divert listener will return a
packet back, so we will not be able to do delayed checksum calculation
later. Also an application will get a packet with correct checksum.

Reviewed by: donner
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32807

2 years agopf tests: route_to:icmp_nat_head requires scapy
Kristof Provost [Wed, 3 Nov 2021 09:34:20 +0000 (10:34 +0100)]
pf tests: route_to:icmp_nat_head requires scapy

Document the requirement so the test is skipped if scapy is not
installed.

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

2 years agodevelopment(7): Use a more common architecture for examples
Edward Tomasz Napierala [Sun, 31 Oct 2021 13:27:29 +0000 (13:27 +0000)]
development(7): Use a more common architecture for examples

2 years agolinux: Make linux_ptrace.c portable
Edward Tomasz Napierala [Wed, 3 Nov 2021 08:54:30 +0000 (08:54 +0000)]
linux: Make linux_ptrace.c portable

Make sys/amd64/linux/linux_ptrace.c machine-independent,
in preparation for moving it into sys/compat/linux/.
No functional changes.

Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32756

2 years agolinux: mv sys/i386/linux/linux_ptrace{,_machdep}.c
Edward Tomasz Napierala [Wed, 3 Nov 2021 08:49:41 +0000 (08:49 +0000)]
linux: mv sys/i386/linux/linux_ptrace{,_machdep}.c

In preparation for machine-independent sys/compat/linux/linux_ptrace.c,
rename the i386-specific Linux ptrace(2) implementation.  No functional
changes.

Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32757

2 years agolinprocfs: Fix formatting of Uid and Gid lines
Edward Tomasz Napierala [Wed, 3 Nov 2021 08:40:49 +0000 (08:40 +0000)]
linprocfs: Fix formatting of Uid and Gid lines

The separator here should be tabs, not spaces.  This fixes a warning
from chromium-browser on Bionic:

[1022/162248.137612:ERROR:process_info_linux.cc(107)] format error: unrecognized Uid format

Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32612

2 years agokern: physmem: improve region coalescing logic
Kyle Evans [Thu, 28 Oct 2021 04:40:08 +0000 (23:40 -0500)]
kern: physmem: improve region coalescing logic

The existing logic didn't take into account newly inserted mappings
wholly contained by an existing region (or vice versa), nor did it
account for weird overlap scenarios.  The latter is probably unlikely
to happen, but the former may happen in UEFI: BootServicesData allocated
within a large chunk of ConventionalMemory.  This situation blows up vm
initialization.

While we're here, remove the "exact match" logic as it's likely wrong;
if an exact match exists with conflicting flags, for instance, then we
should probably be doing something else.  The new logic takes into
account exact matches as part of the overlapping efforts.

Reviewed by: kib, mhorne (both earlier version)
Differential Revision: https://reviews.freebsd.org/D32701

2 years agonfscl: Check for a forced dismount in nfscl_getref()
Rick Macklem [Wed, 3 Nov 2021 00:28:13 +0000 (17:28 -0700)]
nfscl: Check for a forced dismount in nfscl_getref()

The nfscl_getref() function is called within nfscl_doiods() when
the NFSv4.1/4.2 pNFS client is doing I/O on a DS.  As such,
nfscl_getref() needs to check for a forced dismount.
This patch adds that check.

Found during a recent IETF NFSv4 working group testing event.

MFC after: 2 weeks

2 years agogpart: Move MBR efimedia reporting to a separate routine
Warner Losh [Tue, 2 Nov 2021 23:08:48 +0000 (17:08 -0600)]
gpart: Move MBR efimedia reporting to a separate routine

Move the efimedia reporting to g_part_mbr_efimedia and use that from
g_part_mbr_dumpconf to report it.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D32781

2 years agogpart: Move GPT efimedia reporting to a separate routine
Warner Losh [Tue, 2 Nov 2021 23:08:37 +0000 (17:08 -0600)]
gpart: Move GPT efimedia reporting to a separate routine

Move the efimedia reporting to g_part_gpt_efimedia and use that from
g_part_gpt_dumpconf to report it.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D32780

2 years agoarm/pmu: add ACPI attachment.
Ruslan Bukin [Tue, 2 Nov 2021 19:35:29 +0000 (19:35 +0000)]
arm/pmu: add ACPI attachment.

This makes hwpmc(4) sampling work on ACPI-based AArch64 systems.
Tested on ARM Neoverse N1.

Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: jrtc27, mhorne
Differential Revision: https://reviews.freebsd.org/D24423

2 years agocrypto: Cleanup mtx_init() calls.
John Baldwin [Tue, 2 Nov 2021 18:27:20 +0000 (11:27 -0700)]
crypto: Cleanup mtx_init() calls.

Don't pass the same name to multiple mutexes while using unique types
for WITNESS.  Just use the unique types as the mutex names.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D32740

2 years agocrypto: Use a single "crypto" kproc for all of the OCF kthreads.
John Baldwin [Tue, 2 Nov 2021 18:26:21 +0000 (11:26 -0700)]
crypto: Use a single "crypto" kproc for all of the OCF kthreads.

Reported by: julian
Reviewed by: markj
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D32739

2 years agofstyp: fix build WITHOUT_ICONV
Ed Maste [Tue, 2 Nov 2021 13:43:56 +0000 (09:43 -0400)]
fstyp: fix build WITHOUT_ICONV

Reported by: Michael Dexter, Build Option Survey
Sponsored by: The FreeBSD Foundation

2 years agoepair: remove "All rights reserved"
Bjoern A. Zeeb [Tue, 2 Nov 2021 16:48:07 +0000 (16:48 +0000)]
epair: remove "All rights reserved"

Remove "All rights reserved" from The FreeBSD Foundation owned
copyrights on epair code and documentation.

Approved by: emaste (FreeBSD Foundation)

2 years agollvm BPF target: add missed source files
Dimitry Andric [Tue, 2 Nov 2021 16:49:34 +0000 (17:49 +0100)]
llvm BPF target: add missed source files

Otherwise, linking llvm binaries with this target enabled (which is not
the default) will fail with a number of undefined symbol errors:

  ld: error: undefined symbol: llvm::initializeBPFAdjustOptPass(llvm::PassRegistry&)
  ld: error: undefined symbol: llvm::initializeBPFCheckAndAdjustIRPass(llvm::PassRegistry&)
  ld: error: undefined symbol: llvm::createBPFCheckAndAdjustIR()
  ld: error: undefined symbol: llvm::createBPFAdjustOpt()
  ld: error: undefined symbol: llvm::BPFAdjustOptPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&)

Reported by: Michael Dexter <editor@callfortesting.org>
MFC after: 3 days

2 years agoLinuxKPI: Add sysctl(8) knob to control verbosity of WARN_ON's.
Hans Petter Selasky [Tue, 2 Nov 2021 15:52:46 +0000 (16:52 +0100)]
LinuxKPI: Add sysctl(8) knob to control verbosity of WARN_ON's.

The purpose of this change is to reduce the amount of dmesg(8) noise when
VT switching after a panic.

Submitted by: Greg V <greg@unrelenting.technology>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30174
Sponsored by: NVIDIA Networking

2 years agoarm: Fix handling of undefined instruction aborts in THUMB2 mode.
Michal Meloun [Sun, 17 Oct 2021 17:36:33 +0000 (19:36 +0200)]
arm: Fix handling of undefined instruction aborts in THUMB2 mode.

Correctly recognize NEON/SIMD and VFP instructions in THUMB2 mode and pass
these to the appropriate handler. Note that it is not necessary to filter
all undefined instruction variant or register combinations, this is a job
for given handler.

Reported by: Robert Clausecker <fuz@fuz.su>
PR: 259187
MFC after: 2 weks

2 years agocosl(): fix polynomial approximation coefficients for ld128 version
Steve Kargl [Tue, 2 Nov 2021 08:54:10 +0000 (10:54 +0200)]
cosl(): fix polynomial approximation coefficients for ld128 version

As mention previously, the minmax polynomial approximation
in the kernel for cosl() seem to have a bad set of coefficients.

In testing, cosl() in the interval [0.785, pi/4] for 1 million
values and pi/4 written to 37 decimal digits.  The old version
on an aarch64 system gave

% tlibm/tlibm_lmath -l -x 0.78 -X
7.85398163397448309615660845819875721e-1L cos
Interval tested for cosl: [0.78,0.785398]
count: 1000000
  xm =  7.80213913234863919029058821396125599e-01L
  libm =  7.10763080972549562455058499280609083e-01L
  mpfr =  7.10763080972549562455058499280608983e-01L
  ULP = 1.04431

The max ULP exceeds 1, which is not good.  So, I rinsed off a 10
year code and recomputed coefficients.  The new minmax polynomial
now yields

% tlibm/tlibm_lmath -l -x 0.78 -X
7.85398163397448309615660845819875721e-1L cos
Interval tested for cosl: [0.78,0.785398]
count: 1000000
  xm =  7.82916198746768272588844890973704219e-01L
  libm =  7.08859615479571058183956453286628396e-01L
  mpfr =  7.08859615479571058183956453286628469e-01L
  ULP = 0.75407

which is very good.

PR: 218514
MFC after: 1 week

2 years agoif_epair: rework
Bjoern A. Zeeb [Sat, 9 Oct 2021 14:09:04 +0000 (16:09 +0200)]
if_epair: rework

Rework if_epair(4) to no longer use netisr and dpcpu.
Instead use mbufq and swi_net.
This simplifies the code and seems to make it work better and
no longer hang.

Work largely by bz@, with minor tweaks by kp@.

Reviewed by: bz, kp
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D31077

2 years agodpv.1: Do not use mdoc macros for Bl width
Mateusz Piotrowski [Tue, 2 Nov 2021 07:17:19 +0000 (08:17 +0100)]
dpv.1: Do not use mdoc macros for Bl width

Macros do not expand there.

MFC after: 3 days

2 years agodpv.1: Fix an example
Mateusz Piotrowski [Tue, 2 Nov 2021 07:11:50 +0000 (08:11 +0100)]
dpv.1: Fix an example

dpv(1) requires a label to be specified.

MFC after: 3 days

2 years agodpv: Fix synopsis formatting & sort options
Mateusz Piotrowski [Tue, 2 Nov 2021 07:05:48 +0000 (08:05 +0100)]
dpv: Fix synopsis formatting & sort options

MFC after: 3 days

2 years agoefirt(9): Correct efi_var_set definition in the manpage
Lakshman [Tue, 2 Nov 2021 07:17:38 +0000 (03:17 -0400)]
efirt(9): Correct efi_var_set definition in the manpage

PR: 257531
MFC after: 3 days

2 years agoDocument my doc commit bit
Ed Maste [Tue, 2 Nov 2021 00:59:52 +0000 (20:59 -0400)]
Document my doc commit bit

Prodded by: ygy

2 years agonfscl: Use a smaller initial delay time for NFSERR_DELAY
Rick Macklem [Tue, 2 Nov 2021 00:21:31 +0000 (17:21 -0700)]
nfscl: Use a smaller initial delay time for NFSERR_DELAY

For NFS RPCs that receive a NFSERR_DELAY reply, the delay time
is initially 1sec and then increases exponentially to NFS_TRYLATERDEL.
It was found that this delay time is excessive for some NFSv4
servers, which work well with a 1msec delay.
A 1sec delay resulted in very slow performance for Remove and
Rename when delegations and pNFS were enabled.

This patch decreases the initial delay time to 1msec.

Found during a recent IETF NFSv4 working group testing event.

MFC after: 2 weeks

2 years agosystat: fix stack overflow when running -iostat
Mateusz Guzik [Mon, 1 Nov 2021 23:55:47 +0000 (23:55 +0000)]
systat: fix stack overflow when running -iostat

The new buffer is arbitrarily sized to likely "big enough".

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

2 years agosystat: mostly clean up warns
Mateusz Guzik [Mon, 1 Nov 2021 20:45:42 +0000 (20:45 +0000)]
systat: mostly clean up warns

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

2 years agoinet: remove tcp_debug from netinet/tcp_debug.h
Mateusz Guzik [Mon, 1 Nov 2021 21:28:54 +0000 (21:28 +0000)]
inet: remove tcp_debug from netinet/tcp_debug.h

It was a hack only needed for trpt, which can just define it locally.

This makes it possible to fix up systat which also includes the file.

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

2 years agopf: remove the flags argument from pf_unlink_state
Mateusz Guzik [Mon, 1 Nov 2021 13:14:02 +0000 (14:14 +0100)]
pf: remove the flags argument from pf_unlink_state

All consumers call it with PF_ENTER_LOCKED.

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

2 years agopf: fix use-after-free from pf_find_state_all
Mateusz Guzik [Mon, 1 Nov 2021 13:02:43 +0000 (14:02 +0100)]
pf: fix use-after-free from pf_find_state_all

state was returned without any locks nor references held

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

2 years agossh: disble internal security key support in generated config.h
Ed Maste [Wed, 27 Oct 2021 20:45:35 +0000 (16:45 -0400)]
ssh: disble internal security key support in generated config.h

We want to set ENABLE_SK_INTERNAL only when building with USB support.
We'll leave it off in config.h and enble it via our bespoke build's
Makefile.inc.

Sponsored by: The FreeBSD Foundation

2 years agoAdd entry in rtwn_usb(4) for TP-Link Archer T2U Plus
Michael Zhilin [Mon, 1 Nov 2021 19:39:50 +0000 (22:39 +0300)]
Add entry in rtwn_usb(4) for TP-Link Archer T2U Plus

This is missing documentation change of D24142.

Submitted by: kjopek@gmail.com
Reviewed by: gbe
Differential Revision: https://reviews.freebsd.org/D25114

2 years agoktls: Add simple transmit tests of kernel TLS.
John Baldwin [Mon, 1 Nov 2021 18:28:10 +0000 (11:28 -0700)]
ktls: Add simple transmit tests of kernel TLS.

Note that these tests test the kernel TLS functionality directly.
Rather than using OpenSSL to perform negotiation and generate keys,
these tests generate random keys send data over a pair of TCP sockets
manually decrypting the TLS records generated by the kernel.

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D32652

2 years agocarp tests: negative demotion
Marius Halden [Sun, 31 Oct 2021 20:22:10 +0000 (21:22 +0100)]
carp tests: negative demotion

PR: 259528
Reviewed by: donner
MFC after: 3 weeks
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32760

2 years agocarp: deal with negative net.inet.carp.demotion
Marius Halden [Sun, 31 Oct 2021 20:18:42 +0000 (21:18 +0100)]
carp: deal with negative net.inet.carp.demotion

Given nodes 1 and 2, where node 1 has an advskew of 0 and node 2 has an
advskew of 100, making them master and backup respectively.

If net.inet.carp.demotion is set to a negative value on node 1, node 2
might become master while node 1 still retains it master status. Wether
or not node 2 becomes master seems to depend on the nodes advskew and
what the demotion sysctl was set to on node 1.

The reason for node 2 becoming master seems to be that the calculated
advskew taking demotion into account is truncated to a single unsigned
byte when copied into the carp header for sending, and node 1 stays
master since it takes uses the whole non-truncated calculated advskew
when deciding wether to stay master.

PR: 259528
Reviewed by: donner, glebius
MFC after: 3 weeks
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32759

2 years agodevinfo(8): Remove cross-reference to pnpinfo(8)
Felix Johnson [Mon, 1 Nov 2021 16:29:12 +0000 (12:29 -0400)]
devinfo(8): Remove cross-reference to pnpinfo(8)

devinfo(8) manpage contains reference to pnpinfo(8) which existed at the
time. Remove it.

PR: 232587
MFC: 3 days
Reported by: Graham Perrin <grahamperrin@gmail.com>

2 years agosrc.conf.5: regen for WITH_ASAN and WITH_UBSAN descriptions
Ed Maste [Mon, 1 Nov 2021 13:27:49 +0000 (09:27 -0400)]
src.conf.5: regen for WITH_ASAN and WITH_UBSAN descriptions

2 years agoAdd descriptions for WITH_ASAN and WITH_UBSAN
Ed Maste [Mon, 1 Nov 2021 13:03:14 +0000 (09:03 -0400)]
Add descriptions for WITH_ASAN and WITH_UBSAN

Reviewed by: jrtc27
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32773

2 years agouma: Fix handling of reserves in zone_import()
Mark Johnston [Mon, 1 Nov 2021 13:27:52 +0000 (09:27 -0400)]
uma: Fix handling of reserves in zone_import()

Kegs with no items reserved have uk_reserve = 0.  So the check
keg->uk_reserve >= dom->ud_free_items will be true once all slabs are
depleted.  Then, rather than go and allocate a fresh slab, we return to
the cache layer.

The intent was to do this only when the keg actually has a reserve, so
modify the check to verify this first.  Another approach would be to
make uk_reserve signed and set it to -1 until uma_zone_reserve() is
called, but this requires a few casts elsewhere.

Fixes: 1b2dcc8c54a8 ("uma: Avoid depleting keg reserves when filling a bucket")
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32516

2 years agouma: Improve M_USE_RESERVE handling in keg_fetch_slab()
Mark Johnston [Mon, 1 Nov 2021 13:27:35 +0000 (09:27 -0400)]
uma: Improve M_USE_RESERVE handling in keg_fetch_slab()

M_USE_RESERVE is used in a couple of places in the VM to avoid unbounded
recursion when the direct map is not available, as is the case on 32-bit
platforms or when certain kernel sanitizers (KASAN and KMSAN) are
enabled.  For example, to allocate KVA, the kernel might allocate a
kernel map entry, which might require a new slab, which requires KVA.

For these zones, we use uma_prealloc() to populate a reserve of items,
and then in certain serialized contexts M_USE_RESERVE can be used to
guarantee a successful allocation.  uma_prealloc() allocates the
requested number of items, distributing them evenly among NUMA domains.
Thus, in a first-touch zone, to satisfy an M_USE_RESERVE allocation we
might have to check the slab lists of other domains than the current one
to provide the semantics expected by consumers.

So, try harder to find an item if M_USE_RESERVE is specified and the keg
doesn't have anything for current (first-touch) domain.  Specifically,
fall back to a round-robin slab allocation.  This change fixes boot-time
panics on NUMA systems with KASAN or KMSAN enabled.[1]

Alternately we could have uma_prealloc() allocate the requested number
of items for each domain, but for some existing consumers this would be
quite wasteful.  In general I think keg_fetch_slab() should try harder
to find free slabs in other domains before trying to allocate fresh
ones, but let's limit this to M_USE_RESERVE for now.

Also fix a separate problem that I noticed: in a non-round-robin slab
allocation with M_WAITOK, rather than sleeping after a failed slab
allocation we simply try again.  Call vm_wait_domain() before retrying.

Reported by: mjg, tuexen [1]
Reviewed by: alc
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32515

2 years agosrc.conf.5: regen
Ed Maste [Mon, 1 Nov 2021 13:07:37 +0000 (09:07 -0400)]
src.conf.5: regen

Pick up changes in option dependencies (WITHOUT_OPENSSL and WITHOUT_CXX)
and the addition of WITH_DETECT_TZ_CHANGES and WITH_LLVM_BINUTILS.

Sponsored by: The FreeBSD Foundation

2 years agoPrint the correct register for the arm64 elr
Andrew Turner [Mon, 1 Nov 2021 11:19:57 +0000 (11:19 +0000)]
Print the correct register for the arm64 elr

In 7ec86b6609912 ("Also print symbols when printing arm64 registers")
a new function was created to print most registers. Unfortunately the
Link Register (LR) was being printed when we should have printed the
Exception Link Register (ELR).

Fix this by adding the missing 'e'.

Sponsored by: The FreeBSD Foundation

2 years agofuser: restore functionality by fixing fsid type
Andriy Gapon [Mon, 1 Nov 2021 06:40:17 +0000 (08:40 +0200)]
fuser: restore functionality by fixing fsid type

Use types from sys/stat.h for the filesystem and inode numbers for extra
safety.

PR: 259504
Reported by: Markus Wild <freebsd-bugs@virtualtec.ch>
MFC after: 1 week

2 years agoriscv: add iicbus and iicoc to GENERIC
Philip Paeps [Mon, 1 Nov 2021 05:16:27 +0000 (13:16 +0800)]
riscv: add iicbus and iicoc to GENERIC

The iicoc driver supports the OpenCores I2C IP.  This is included in at
least the SiFive "Unleashed" and "Unmatched" cores and probably others.

Suggested by: jrtc27

2 years agoiicoc: support building as a module
Thomas Skibo [Mon, 1 Nov 2021 04:31:49 +0000 (12:31 +0800)]
iicoc: support building as a module

Only build on RISC-V for now, since we're not aware of any other cores
with this IP supported by FreeBSD.

Reviewed by: jrtc27, philip
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D32737

2 years agoiicoc: fix repeated start
Thomas Skibo [Mon, 1 Nov 2021 04:29:29 +0000 (12:29 +0800)]
iicoc: fix repeated start

Reviewed by: jrtc27, philip
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D32737

2 years agoiicoc: add support for SiFive HiFive Unmatched
Thomas Skibo [Mon, 1 Nov 2021 04:23:22 +0000 (12:23 +0800)]
iicoc: add support for SiFive HiFive Unmatched

Reviewed by: jrtc27, philip
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D32737

2 years agosinpi[fl] etc: Fix the ld128 implementations
Steve Kargl [Sun, 31 Oct 2021 22:26:20 +0000 (00:26 +0200)]
sinpi[fl] etc: Fix the ld128 implementations

Mark Murray graciously provided access to an aarch64 system
to test the ld128 implementations.  This patch address
* Misuses of copysignl() in sinpil() and tanpil().
* Redo the splitting of argument 'x' into an integer part and
  remainder.  The remainder must satify 0 <= r < 1.
* Update the reduction of the integer part to something that can
  easily be seen as even or odd, e.g., sin(pi*x) = (-1)^n*sin(pi*r)
  with n <= 2^112 and we an reduce n by subtracting integer powers
  of 2.
* In s_cospil.c, fix typos where 'x' is used where 'ax', the
  remainder, is required.
* In tanpil(), fix the use of an uninitialized variable, ax = fabsl(ax),
  ax should be x in fabsl().

One item of note, in the limited tested on aarch64, the max ULP
for sinpil() and cospil() were less than 1.1 ULP, which is higher
that the desired max ULP less than 1.  This was traced to the
kernel for cosl() in the fundamental interval [0,pi/4].
The coefficients in the minmax polynomial likely need refinement.

PR: 218514
MFC after: 1 week

2 years agonfscl: Do pNFS layout return_on_close synchronously
Rick Macklem [Sun, 31 Oct 2021 23:31:31 +0000 (16:31 -0700)]
nfscl: Do pNFS layout return_on_close synchronously

For pNFS servers that specify that Layouts are to be returned
upon close, they may expect that LayoutReturn to happen before
the associated Close.

This patch modifies the NFSv4.1/4.2 pNFS client so that this
is done.  This only affects a pNFS mount against a non-FreeBSD
NFSv4.1/4.2 server that specifies return_on_close in LayoutGet
replies.

Found during a recent IETF NFSv4 working group testing event.

MFC after: 2 weeks

2 years agogeli: eli data -> eli_data for consistency with other geom classes
Mateusz Guzik [Sun, 31 Oct 2021 20:36:51 +0000 (20:36 +0000)]
geli: eli data -> eli_data for consistency with other geom classes

PR: 259392
Reported by: dewayne@heuristicsystems.com.au
MFC after: 1 week

2 years agonet80211: add a driver-private pointer to struct ieee80211_node
Bjoern A. Zeeb [Sun, 31 Oct 2021 19:08:28 +0000 (19:08 +0000)]
net80211: add a driver-private pointer to struct ieee80211_node

Add a void *ni_drv_data field to struct ieee80211_node that drivers
can use to backtrack to their internal state from a net80211 node.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential Revision: https://reviews.freebsd.org/D30654 (abandoned)

2 years agoBump __FreeBSD_version following the libdialog shared library
Xin LI [Sun, 31 Oct 2021 06:09:29 +0000 (23:09 -0700)]
Bump __FreeBSD_version following the libdialog shared library
version number bump.

2 years agoprocfs: return right hardlink from /proc/curproc/file
Konstantin Belousov [Fri, 29 Oct 2021 01:43:32 +0000 (04:43 +0300)]
procfs: return right hardlink from /proc/curproc/file

Use proc_get_binpath() to get the hardlink right.

PR: 248184
Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32738

2 years agoExtract proc_get_binpath() from sysctl_kern_proc_pathname()
Konstantin Belousov [Fri, 29 Oct 2021 01:42:59 +0000 (04:42 +0300)]
Extract proc_get_binpath() from sysctl_kern_proc_pathname()

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

2 years agosys/proc.h: put proc_add_orphan() into proper place
Konstantin Belousov [Fri, 29 Oct 2021 22:02:32 +0000 (01:02 +0300)]
sys/proc.h: put proc_add_orphan() into proper place

Noted by: markj
Reviewed by: emaste, markjd
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32738

2 years agonfscl: Add setting n_localmodtime to the Write RPC code
Rick Macklem [Sun, 31 Oct 2021 00:08:28 +0000 (17:08 -0700)]
nfscl: Add setting n_localmodtime to the Write RPC code

Similar to commit 2be417843a, I believe there could be a race between
the NFS client VOP_LOOKUP() and file Writing that could result in stale
file attributes being loaded into the NFS vnode by VOP_LOOKUP().

I have not been able to reproduce a failure due to this race, but
I believe that there are two possibilities:

The Lookup RPC happens while VOP_WRITE() is being executed and loads
stale file attributes after VOP_WRITE() returns when it has already
completed the Write/Commit RPC(s).
--> For this case, setting the local modify timestamp at the end of
  VOP_WRITE() should ensure that stale file attributes are not loaded.

The Lookup RPC occurs after VOP_WRITE() has returned, while
asynchronous Write/Commit RPCs are in progress and then is
blocked by the vnode held by VOP_OPEN/VOP_CLOSE/VOP_FSYNC which
will flush writes via ncl_flush() or ncl_vinvalbuf(), clearing the
NMODIFIED flag (which indicates Writes-in-progress). The VOP_LOOKUP()
then acquires the NFS vnode lock and fills in stale file attributes.
 --> Setting the local modify timestamp in ncl_flsuh() and ncl_vinvalbuf()
   when they clear NMODIFIED should ensure that stale file attributes
   are not loaded.

This patch does the above.

PR: 259071
Reviewed by: asomers
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D32677

2 years agonfscl: Set n_localmodtime in Deallocate
Rick Macklem [Sat, 30 Oct 2021 23:46:14 +0000 (16:46 -0700)]
nfscl: Set n_localmodtime in Deallocate

Commit 2be417843a04 added n_localmodtime, which is used by Lookup
and ReaddirPlus to check to see if the file attributes in an RPC
reply might be stale.  This patch sets n_localmodtime in Deallocate.
Done as a separate commit, since Deallocate is not in stable/13.

PR: 259071
Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D32635

2 years agoPR#259071 provides a test program that fails for the NFS client.
Rick Macklem [Sat, 30 Oct 2021 23:35:02 +0000 (16:35 -0700)]
PR#259071 provides a test program that fails for the NFS client.
Testing with it, there appears to be a race between Lookup
and VOPs like Setattr-of-size, where Lookup ends up loading
stale attributes (including what might be the wrong file size)
into the NFS vnode's attribute cache.

The race occurs when the modifying VOP (which holds a lock
on the vnode), blocks the acquisition of the vnode in Lookup,
after the RPC (with now potentially stale attributes).

Here's what seems to happen:
Child                                Parent

does stat(), which does
VOP_LOOKUP(), doing the Lookup
RPC with the directory vnode
locked, acquiring file attributes
valid at this point in time

blocks waiting for locked file       does ftruncate(), which
vnode                                does VOP_SETATTR() of Size,
                                     changing the file's size
                                     while holding an exclusive
                                     lock on the file's vnode
                                     releases the vnode lock
acquires file vnode and fills in
now stale attributes including
the old wrong Size
                                     does a read() which returns
                                     wrong data size

This patch fixes the problem by saving a timestamp in the NFS vnode
in the VOPs that modify the file (Setattr-of-size, Allocate).
Then lookup/readdirplus compares that timestamp with the time just
before starting the RPC after it has acquired the file's vnode.
If the modifying RPC occurred during the Lookup, the attributes
in the RPC reply are discarded, since they might be stale.

With this patch the test program works as expected.

Note that the test program does not fail on a July stable/12,
although this race is in the NFS client code.  I suspect a
fairly recent change to the name caching code exposed this
bug.

PR: 259071
Reviewed by: asomers
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D32635

2 years agolinux: make PTRACE_SETREGS use a correct struct
Edward Tomasz Napierala [Sat, 30 Oct 2021 09:13:32 +0000 (10:13 +0100)]
linux: make PTRACE_SETREGS use a correct struct

Note that this is largely untested at this point, as was
the previous version; I'm committing this mostly to get
rid of `struct linux_pt_reg`.

Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32735

2 years agolinux: Add additional ptracestop only if the debugger is Linux
Edward Tomasz Napierala [Sat, 30 Oct 2021 08:53:55 +0000 (09:53 +0100)]
linux: Add additional ptracestop only if the debugger is Linux

In 6e66030c4c0, additional ptracestop was added in order
to implement PTRACE_EVENT_EXEC.  Make it only apply to cases
where the debugger is a Linux processes; native FreeBSD
debuggers can trace Linux processes too, but they don't
expect that additonal ptracestop.

Fixes: 6e66030c4c0
Reported By: kib
Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32726

2 years agousr.bin/stat: honour locale for "-t %+"
Stefan Eßer [Sat, 30 Oct 2021 07:00:34 +0000 (09:00 +0200)]
usr.bin/stat: honour locale for "-t %+"

The man page states that "-t %+" prints time information in the same
format as date with no format specifier.

This was not the case, the format used was always that of date for the
POSIX locale.

The fix suggested by the reporter leads to output that matches the
documentation.

Reported by: Jamie Landeg-Jones <jamie@catflap.org>
MFC after: 3 days

2 years agonfscl: Use NFSMNTP_DELEGISSUED in two more functions
Rick Macklem [Sat, 30 Oct 2021 03:35:02 +0000 (20:35 -0700)]
nfscl: Use NFSMNTP_DELEGISSUED in two more functions

Commit 5e5ca4c8fc53 added a NFSMNTP_DELEGISSUED flag to indicate when
a delegation has been issued to the mount.  For the common case
where an NFSv4 server is not issuing delegations, this flag
can be checked to avoid acquisition of the NFSCLSTATEMUTEX.

This patch adds checks for NFSMNTP_DELEGISSUED being set
to two more functions.

This change appears to be performance neutral for a small number
of opens, but should reduce lock contention for a large number of opens
for the common case where server is not issuing delegations.

MFC after: 2 week

2 years agotcp: Rack might retransmit forever.
Randall Stewart [Fri, 29 Oct 2021 21:37:49 +0000 (17:37 -0400)]
tcp: Rack might retransmit forever.

If we get a Sacked peer with an MTU change we can retransmit forever if the
last bytes are sacked and the client goes away (think power off). Then we
never see the end condition and continually retransmit.

Reviewed by: Michael Tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D32671

2 years agotimecounter: Load the currently selected tc once in tc_windup()
Mark Johnston [Fri, 29 Oct 2021 18:29:22 +0000 (14:29 -0400)]
timecounter: Load the currently selected tc once in tc_windup()

Reported by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32729

2 years agosort: Fix random sort
Mark Johnston [Fri, 29 Oct 2021 18:25:42 +0000 (14:25 -0400)]
sort: Fix random sort

bwsrawdata() is supposed to return the string buffer.

PR: 259451
Reported by: sigsys@gmail.com
Fixes: d053fb22f6d3 ("usr.bin/sort: Avoid UBSan errors")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 years agoMerge commit 'ce929fe84f9c453263af379f3b255ff8eca01d48'
Olivier Houchard [Fri, 29 Oct 2021 17:18:03 +0000 (19:18 +0200)]
Merge commit 'ce929fe84f9c453263af379f3b255ff8eca01d48'

Import CK as of commit 2265c7846f4ce667f5216456afe2779b23c3e5f7.

2 years agoImport CK as of commit 2265c7846f4ce667f5216456afe2779b23c3e5f7.
Olivier Houchard [Fri, 29 Oct 2021 17:01:15 +0000 (19:01 +0200)]
Import CK as of commit 2265c7846f4ce667f5216456afe2779b23c3e5f7.

2 years agolinux: make PTRACE_GETREGS return correct struct
Edward Tomasz Napierala [Fri, 29 Oct 2021 15:18:13 +0000 (16:18 +0100)]
linux: make PTRACE_GETREGS return correct struct

Previously it returned a shorter struct.  I can't find any
modern software that uses it, but tests/ptrace from strace(1)
repo complained.

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

2 years agolinux: Make PTRACE_GETREGSET return proper buffer size
Edward Tomasz Napierala [Fri, 29 Oct 2021 14:28:56 +0000 (15:28 +0100)]
linux: Make PTRACE_GETREGSET return proper buffer size

This fixes Chrome warning:

[1022/152319.328632:ERROR:ptracer.cc(476)] Unexpected registers size 0 != 216, 68

Reviewed By: emaste
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32616

2 years agolinux: Also translate the signal if the code is CLD_KILLED
Edward Tomasz Napierala [Fri, 29 Oct 2021 13:56:43 +0000 (14:56 +0100)]
linux: Also translate the signal if the code is CLD_KILLED

This fixes ./waitid.gen.test from the strace(1) test suite.

Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32617

2 years agoDo not build libatf-c++ when WITHOUT_CXX
Ed Maste [Fri, 29 Oct 2021 03:01:21 +0000 (23:01 -0400)]
Do not build libatf-c++ when WITHOUT_CXX

libatf-c++ requires C++ support.

From jrtc27: bit slightly odd this isn't gated by MK_TESTS (which itself
depends on MK_CXX), but this makes sense given the current behaviour.

Reported by: Michael Dexter, Build Option Survey
Reviewed by: imp, jrtc27
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32732

2 years agosrc.opts.mk: Add WITHOUT_CXX dependencies
Ed Maste [Fri, 29 Oct 2021 01:43:33 +0000 (21:43 -0400)]
src.opts.mk: Add WITHOUT_CXX dependencies

OFED, OPENMP, and PMC depend on C++ support.  Force them off when
building WITHOUT_CXX.

Reported by: Michael Dexter, Build Option Survey
Reviewed by: imp, jrtc27
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32730

2 years agoDon't build sanitizer runtimes under WITHOUT_CXX
Ed Maste [Fri, 29 Oct 2021 00:49:12 +0000 (20:49 -0400)]
Don't build sanitizer runtimes under WITHOUT_CXX

In the past we built the sanitizer runtimes when building Clang
(and using Clang as the compiler) but 7676b388adbc changed this to
be conditional only on using Clang, to make the runtimes available
for external Clang.

They fail to build when WITHOUT_CXX is set though, so add MK_CXX
as part of the condition.

Reported by: Michael Dexter, Build Option Survey
Reviewed by: imp, jrtc27
Fixes: 7676b388adbc ("Always build the sanitizer runtimes...")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32731

2 years agolinux: Fix ptrace panic with ERESTART
Edward Tomasz Napierala [Fri, 29 Oct 2021 13:21:21 +0000 (14:21 +0100)]
linux: Fix ptrace panic with ERESTART

Translate ERESTART into Linux "internal" errno ERESTARTSYS.
This fixes the erestartsys.gen.test from strace(1).

Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32623

2 years agoRevert "qoriq_gpio: Implement interrupt controller functionality"
Wojciech Macek [Fri, 29 Oct 2021 10:05:55 +0000 (12:05 +0200)]
Revert "qoriq_gpio: Implement interrupt controller functionality"

This reverts commit 027a58aab2cee5589a3a639afb77ecbb607f8fee.

2 years agostress2: Added a regression test
Peter Holm [Fri, 29 Oct 2021 09:04:49 +0000 (09:04 +0000)]
stress2: Added a regression test

2 years agomvneta: fix encap property
Wojciech Macek [Fri, 29 Oct 2021 08:56:57 +0000 (10:56 +0200)]
mvneta: fix encap property

Fix MVNETA encap property.

2 years agoqoriq_gpio: Implement interrupt controller functionality
Kornel Duleba [Tue, 28 Sep 2021 15:09:41 +0000 (17:09 +0200)]
qoriq_gpio: Implement interrupt controller functionality

The pic_* interface was used.
Only edge interrupts are supported by this controller.
Driver mutex had to be converted to a spin lock so that it can
be used in the interrupt filter context.
Two types of intr_map_data are supported - INTR_MAP_DATA_GPIO and
INTR_MAP_DATA_FDT. This way interrupts can be allocated using the
userspace gpio interrupt allocation method, as well as directly from
simplebus. The latter can be used by devices that have its irq routed
to a GPIO pin.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32587