]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agokeymap: Add extra Alt Gr mapping for Brazillian Portuguese ABNT2 keyboards
Alfredo Dal'Ava Junior [Wed, 23 Feb 2022 00:35:09 +0000 (21:35 -0300)]
keymap: Add extra Alt Gr mapping for Brazillian Portuguese ABNT2 keyboards

This adds missing Alt Gr mappings for the keys "q", "w", "e" an "c" to
conform with ABNT2 standard.

PR: 256416
Submitted by: Neebz <vpguyrhpjltta@logicstreak.com>
Reviewed by: emaste
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D33801

2 years agocamcontrol fwdownload minor improvements
Warner Losh [Tue, 22 Feb 2022 21:25:32 +0000 (14:25 -0700)]
camcontrol fwdownload minor improvements

Minor improvements to the fwdownload code suggested by chs@:
o Print the path_id/target we're rescanning so it's not invisible
o No need for XPT_GDEVLIST, all the info is filled in. Remove sending it
  as well as a comment related to it from a mistaken observation. libcam
  always fills these in properly, so use those for the ccb path/target.
o Don't leak /dev/xpt fd in success cases.
o Rename fw_rescan_lun to fw_rescan_target and pass sim_mode to
  only print path_id and target_id info.

Reviewed by: chs@
Fixes: 9835900cb95bcd068774934961fb1419719d595b
Sponsored by: Netflix
MFC After: 1 week
Differential Revision: https://reviews.freebsd.org/D34348

2 years agovt: whitespace and style(9) updates
Ed Maste [Tue, 22 Feb 2022 21:30:27 +0000 (16:30 -0500)]
vt: whitespace and style(9) updates

2 years agosrc.libnames.mk: add a comment explaining libssp_nonshared
Ed Maste [Tue, 22 Feb 2022 21:22:03 +0000 (16:22 -0500)]
src.libnames.mk: add a comment explaining libssp_nonshared

libssp_nonshared is a special case for (only) i386 and power*.  Add a
comment explaining why, based on the original commit message that added
it.

MFC after: 1 week
Fixes: 0f61170882cb ("libssp_nonshared: use only on i386 and ppc")
Sponsored by: The FreeBSD Foundation

2 years agomps/mpr: Add missing newlines in error messages.
Alexander Motin [Tue, 22 Feb 2022 20:06:48 +0000 (15:06 -0500)]
mps/mpr: Add missing newlines in error messages.

MFC after: 1 week

2 years agoreadelf: add Arm address mask note type NT_ARM_ADDR_MASK
Ed Maste [Tue, 22 Feb 2022 17:40:39 +0000 (12:40 -0500)]
readelf: add Arm address mask note type NT_ARM_ADDR_MASK

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

2 years agofd: rename fget*_locked to fget*_noref
Mateusz Guzik [Tue, 22 Feb 2022 15:54:17 +0000 (16:54 +0100)]
fd: rename fget*_locked to fget*_noref

This gets rid of the error prone naming where fget_unlocked returns with
a ref held, while fget_locked requires a lock but provides nothing in
terms of making sure the file lives past unlock.

No functional changes.

2 years agotty: fix a panic with INVARIANTS
Robert Wing [Tue, 22 Feb 2022 18:22:18 +0000 (09:22 -0900)]
tty: fix a panic with INVARIANTS

watch'ing a tty triggers a refcount wraparound panic, take a reference
on fp after fget_cap_locked() to fix.

Reported by:    Michael Jung <mikej_at_paymentallianceintl.com>
Reviewed by: hselasky, mjg
Fixes: f40dd6c8034b ("tty: switch ttyhook_register to use fget_cap_locked")
Differential Revision: https://reviews.freebsd.org/D34335

2 years agopowerpc: enable initial-exec TLS
Piotr Kubaj [Fri, 18 Feb 2022 13:22:14 +0000 (14:22 +0100)]
powerpc: enable initial-exec TLS

Summary:
Use initial-exec, like other architectures.

While here, switch MACHINE_ARCH in lib/libc/Makefile to LIBC_ARCH and consistently use powerpc.

Subscribers: imp, #contributor_reviews_base

Differential Revision: https://reviews.freebsd.org/D34315
Reviewed by: luporl
MFC after: 2 weeks

2 years agocamcontrol: Force a rescan of the lun after firmware download.
Warner Losh [Tue, 22 Feb 2022 17:34:36 +0000 (10:34 -0700)]
camcontrol: Force a rescan of the lun after firmware download.

After downloading the firmware to a device, it's inquiry data likely
will change. Force a rescan of the target with the CAM_EXPECT_INQ_CHANGE
flag to get it to record the new inqury data as being expected. This
avoids the need for a 'camcontrol rescan' on the device which detaches
and re-attaches the disk (da, ada) device. This brings fwdownload up to
nvmecontrol's ability to do the same thing w/o changing the exposed
nvme/nvd/nda device. We scan the target and not the LUN because dual
actuator drives have multiple LUNs, but the firmware is global across
many vendors' drives (and the so far theoretical ones that aren't won't
be harmed by the rescan).

Since the underlying struct disk is now preserved accross this
operation, it's now possible to upgrade firmware of a root device w/o
crashing the system.  On systems that are quite busy, the worst that
happens is that certain operaions are reported cancelled when the new
firmware is activated. These operations are retried with the normal CAM
recovery mechanisms and will work on the retry. The only visible hiccup
is the time that new firmware is flashing / initializing. One should not
consider this operation completely risk free, however, since not all
drives are well behaved after a firmware download.

MFC After: 1 week
Relnotes: yes
Sponsored by: Netflix
Feedback by: mav
Differential Revision: https://reviews.freebsd.org/D34325

2 years agoAdd NT_ARM_ADDR_MASK
Andrew Turner [Mon, 30 Aug 2021 16:43:22 +0000 (17:43 +0100)]
Add NT_ARM_ADDR_MASK

This can be used by debuggers to find which bits in a virtual address
should be masked off to get a canonical address. This is currently used
by the Pointer Authentication Code support to get its mask. It could also
be used if we support Top Byte Ignore for the same purpose.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34302

2 years agoriscv: Fix another race in pmap_pinit()
Mark Johnston [Tue, 22 Feb 2022 14:26:33 +0000 (09:26 -0500)]
riscv: Fix another race in pmap_pinit()

Commit c862d5f2a789 ("riscv: Fix a race in pmap_pinit()") did not really
fix the race.  Alan writes,

 Suppose that N entries in the L1 tables are in use, and we are in the
 middle of the memcpy().  Specifically, we have read the zero-filled
 (N+1)st entry from the kernel L1 table.  Then, we are preempted.  Now,
 another core/thread does pmap_growkernel(), which fills the (N+1)st
 entry.  Finally, we return to the original core/thread, and overwrite
 the valid entry with the zero that we earlier read.

Try to fix the race properly, by copying kernel L1 entries while holding
the allpmaps lock.  To avoid doing unnecessary work while holding this
global lock, copy only the entries that we expect to be valid.

Fixes: c862d5f2a789 ("riscv: Fix a race in pmap_pinit()")
Reported by: alc, jrtc27
Reviewed by: alc
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34267

2 years agovt: fix double-click word selection for first word on line
Ed Maste [Mon, 21 Feb 2022 04:09:36 +0000 (23:09 -0500)]
vt: fix double-click word selection for first word on line

Previously when double-clicking on the first word on a line we would
select from the cursor position to the end of the word, not from the
beginning of the line.  This is because we searched backward for a
space to mark the beginning of a word.

Now, use the beginning of the line if we do not find a space.

PR: 261553
Reported by: Stefan B.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agostress2: Added cleanup on error
Peter Holm [Tue, 22 Feb 2022 11:07:45 +0000 (12:07 +0100)]
stress2: Added cleanup on error

2 years agofiles: Make mmc_pwrseq depends on regulator and clk
Emmanuel Vadot [Tue, 22 Feb 2022 10:22:23 +0000 (11:22 +0100)]
files: Make mmc_pwrseq depends on regulator and clk

It uses those two frameworks too.

2 years agodwc: Support phy mode MII
Emmanuel Vadot [Tue, 22 Feb 2022 08:58:36 +0000 (09:58 +0100)]
dwc: Support phy mode MII

Some board use dwc phy in MII mode, so do not fail to attach if this is
the case.
Only rockchip code uses the phy mode to program some custom syscon register.

PR: 260848
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agodwc: Release resources when attach fails
Emmanuel Vadot [Tue, 22 Feb 2022 08:53:11 +0000 (09:53 +0100)]
dwc: Release resources when attach fails

PR: 259282
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agofiles: Make mmc_helpers depends on regulator and clk
Emmanuel Vadot [Tue, 22 Feb 2022 09:01:22 +0000 (10:01 +0100)]
files: Make mmc_helpers depends on regulator and clk

It also needs those two framework.

2 years agosdhci_fsl_fdt: Add voltage switching through syscon
Hubert Mazur [Thu, 20 Jan 2022 09:56:10 +0000 (10:56 +0100)]
sdhci_fsl_fdt: Add voltage switching through syscon

Some SoCs does not have a fixed regulator to handle voltage
switching automatically. Add support for voltage switching
through syscon register when necessary. Add new errata flag
indicating missing regulator. Apply errata to SoCs, which are
known to be affected, i.e. LS1046 and LS1012.

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

2 years agosdhci_fsl_fdt: Apply errata for LX2160A
Hubert Mazur [Tue, 21 Dec 2021 14:52:56 +0000 (15:52 +0100)]
sdhci_fsl_fdt: Apply errata for LX2160A

LX2160A is affected by two erratum regarding SDHCI. However this board
has generic compat string in DTS for SDHCI which means erratum cannot
be simply applied. Compare compat string from "/" path with LX2160A
compat string when attaching device and apply erratum.

Reviewed by: mmel, imp
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D34028

2 years agosdhci_fsl_fdt: Fix tuning code
Kornel Duleba [Wed, 22 Dec 2021 08:17:28 +0000 (09:17 +0100)]
sdhci_fsl_fdt: Fix tuning code

- Some of the register writes were already done in the generic tuning code.
  Remove them.
- Increase the polling timeout. The previous value is probably fine, but since
  timeouts are treated as fatal errors increasing it to 200ms won't hurt.
- Rework the HS400 switching code. Make sure that the switch happens at the
  right time. Reset the DLL0 block. We need to do that if u-boot has previously
  configured the controller in HS400 mode.
- Check current timing before tuning. The tuning devmethod is always called,
  even for timings that don't require the tuning procedure.
- Rework software tuning routine code. Use inner formula for clock
  divider calculation, as previous one was incorrect.
- Implement custom re-tune procedure.

Co-authored-by: Hubert Mazur <hum@semihalf.com>
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D34027

2 years agosdhci_fsl_fdt: Fix pulse width errata application
Kornel Duleba [Fri, 14 Jan 2022 11:21:51 +0000 (12:21 +0100)]
sdhci_fsl_fdt: Fix pulse width errata application

The errata has to be applied every time after SDHCI_RESET_ALL is done.
Move it from attach to the custom reset routine.

Reviewed by: wma, mmel
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D33981

2 years agoinit(8): use proper boolean type for globals
Mitchell Horne [Mon, 21 Feb 2022 16:54:49 +0000 (12:54 -0400)]
init(8): use proper boolean type for globals

Now that stdbool.h is included, prefer this. No functional change
intended.

2 years agorc.subr: boottrace annotations
Mitchell Horne [Sun, 17 Jan 2021 22:56:59 +0000 (18:56 -0400)]
rc.subr: boottrace annotations

When enabled, have the framework use the boottrace(8) utility to execute
each rc script, generating trace entries for the entire suite of
scripts.

Reviewed by: 0mp (slightly earlier version)
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31930

2 years agoboottrace(8): small wrapper utility
Mitchell Horne [Fri, 5 Feb 2021 20:07:39 +0000 (16:07 -0400)]
boottrace(8): small wrapper utility

This is a small program that when invoked will create start and stop
boottrace entries via sysctl, and execute the desired command. Having
this as an executable -- as opposed to some shell script invoking
sysctl(8) -- allows the total resource usage recorded by the trace
entries to include the child process.

Reviewed by: 0mp, trasz (older version)
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31929

2 years agoboottrace: annotate init and shutdown utilities
Mitchell Horne [Tue, 22 Feb 2022 00:16:07 +0000 (20:16 -0400)]
boottrace: annotate init and shutdown utilities

Add boottrace annotations to record events in init(8), shutdown(8), and
reboot(8).

Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #23
Differential Revision: https://reviews.freebsd.org/D31928

2 years agoboottrace: trace annotations for startup and shutdown
Mitchell Horne [Tue, 22 Feb 2022 00:15:57 +0000 (20:15 -0400)]
boottrace: trace annotations for startup and shutdown

Add trace events for execution of SYSINITs (both static and dynamically
loaded), and to the various steps in the shutdown/panic/reboot paths.

Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #23
Differential Revision: https://reviews.freebsd.org/D30187

2 years agoinit_main.c: sort includes
Mitchell Horne [Mon, 10 May 2021 14:37:41 +0000 (11:37 -0300)]
init_main.c: sort includes

This is preferred by style(9). Do this ahead of adding another include.

Reviewed by: imp, kevans, allanjude
MFC after: 3 days
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D30186

2 years agokern_linker.c: sort includes
Mitchell Horne [Sun, 20 Feb 2022 16:59:57 +0000 (12:59 -0400)]
kern_linker.c: sort includes

This is preferred by style(9). Do this ahead of adding another include.

Reviewed by: imp, kevans
MFC after: 3 days
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D30185

2 years agoboottrace: a simple boot and shutdown-time tracing facility
Mitchell Horne [Tue, 22 Feb 2022 00:15:45 +0000 (20:15 -0400)]
boottrace: a simple boot and shutdown-time tracing facility

Boottrace is a facility for capturing trace events during boot and
shutdown. This includes kernel initialization, as well as rc. It has
been used by NetApp internally for several years, for catching and
diagnosing slow devices or subsystems. It is driven from userspace by
sysctl interface, and the output is a human-readable log of events
(kern.boottrace.log).

This commit adds the core boottrace functionality implementing these
interfaces. Adding the trace annotations themselves to kernel and
userland will happen in follow-up commits. A future commit will also add
a boottrace(4) man page.

For now, boottrace is unconditionally compiled into the kernel but
disabled by default. It can be enabled by setting the
kern.boottrace.enabled tunable to 1 in loader.conf(5).

There is an existing boot-time event tracing facility, which can be
compiled into the kernel with 'options TSLOG'. While there is some
functional overlap between this and boottrace, they are distinct. TSLOG
is suitable for generating detailed timing information and flamegraphs,
and has been used to great success by cperciva@ to diagnose and reduce
the overall system boot time. Boottrace aims to more quickly provide an
overview of timing and resource usage of the boot (and shutdown) process
to a sysadmin who requires this knowledge.

Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #23
Differential Revision: https://reviews.freebsd.org/D30184

2 years agobridge: Don't share broadcast packets
Kristof Provost [Sat, 19 Feb 2022 15:34:31 +0000 (16:34 +0100)]
bridge: Don't share broadcast packets

if_bridge duplicates broadcast packets with m_copypacket(), which
creates shared packets. In certain circumstances these packets can be
processed by udp_usrreq.c:udp_input() first, which modifies the mbuf as
part of the checksum verification. That may lead to incorrect packets
being transmitted.

Use m_dup() to create independent mbufs instead.

Reported by: Richard Russo <toast@ruka.org>
Reviewed by: donner, afedorov
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D34319

2 years agonvme: fix spelling of Namespace
Chuck Tuffli [Mon, 21 Feb 2022 18:34:46 +0000 (10:34 -0800)]
nvme: fix spelling of Namespace

Fix spelling of a macro definition.

Reviewed by: mav, imp
Differential Revision: https://reviews.freebsd.org/D34330

2 years agonvme: Add OAES bit-field definitions
Chuck Tuffli [Mon, 21 Feb 2022 18:34:14 +0000 (10:34 -0800)]
nvme: Add OAES bit-field definitions

Create definitions for the Optional Asynchronous Events Supported (OAES)
values. Also adds a helper macro for the common use case of "mask and
shift". E.g.
    value = NVME_CTRLR_DATA_OAES_NS_ATTR_MASK << NVME_CTRLR_DATA_OAES_NS_ATTR_SHIFT;
becomes
    value = NVMEB(NVME_CTRLR_DATA_OAES_NS_ATTR);

Reviewed by: mav, imp
Differential Revision: https://reviews.freebsd.org/D34300

2 years agofiles: Make mmc_helper depend on gpio
Emmanuel Vadot [Mon, 21 Feb 2022 17:31:00 +0000 (18:31 +0100)]
files: Make mmc_helper depend on gpio

mmc_helper have an hard dependency on gpio_if.h
gpio(4) isn't in the default x86 kernel and none of the x86
sd/mmc drivers uses mmc_helper so just add a dependency on gpio.

Fixes: 85b3794ceef ("files: Make ext_resources non-optional")
2 years agoman: Remove mention of EXT_RESOURCES
Emmanuel Vadot [Tue, 11 Jan 2022 10:31:15 +0000 (11:31 +0100)]
man: Remove mention of EXT_RESOURCES

It doesn't exists anymore.

Reviewed by: debdrup (manpages)
Differential Revision: https://reviews.freebsd.org/D33840

2 years agooptions: Remove EXT_RESOURCES
Emmanuel Vadot [Tue, 11 Jan 2022 10:13:05 +0000 (11:13 +0100)]
options: Remove EXT_RESOURCES

It is now unused in kernel code.

MFC after: Never
Differential Revision: https://reviews.freebsd.org/D33839

2 years agoriscv: conf: Remove options EXT_RESOURCES
Emmanuel Vadot [Tue, 11 Jan 2022 10:12:40 +0000 (11:12 +0100)]
riscv: conf: Remove options EXT_RESOURCES

It is now unused in kernel code.

Reviewed by: mhorne
MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33838

2 years agoarm: conf: Remove options EXT_RESOURCES
Emmanuel Vadot [Tue, 11 Jan 2022 10:12:01 +0000 (11:12 +0100)]
arm: conf: Remove options EXT_RESOURCES

It is now unused in kernel code.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33837

2 years agoarm64: conf: Remove options EXT_RESOURCES
Emmanuel Vadot [Tue, 11 Jan 2022 10:10:07 +0000 (11:10 +0100)]
arm64: conf: Remove options EXT_RESOURCES

It is now unused in kernel code.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33836

2 years agoofw_cpu: Make ext_resources non-optional for arm* and riscv
Emmanuel Vadot [Tue, 11 Jan 2022 10:08:18 +0000 (11:08 +0100)]
ofw_cpu: Make ext_resources non-optional for arm* and riscv

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.
For RISC-V it was always enabled.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33835

2 years agofiles: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 10:03:05 +0000 (11:03 +0100)]
files: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33834

2 years agoarmv7: allwinner: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:51:52 +0000 (10:51 +0100)]
armv7: allwinner: Make ext_resources non-optional

The only valid condition for if_awg and aw_syscon is syscon.
EXT_RESOURCES is enabled in GENERIC since 12-CURRENT.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33833

2 years agovf_i2c: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:51:06 +0000 (10:51 +0100)]
vf_i2c: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33832

2 years agoimx_gpio: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:50:05 +0000 (10:50 +0100)]
imx_gpio: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33831

2 years agoimx_i2c: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:49:32 +0000 (10:49 +0100)]
imx_i2c: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33830

2 years agobcm2835_sdhci: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:48:15 +0000 (10:48 +0100)]
bcm2835_sdhci: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

Reviewed by: kevans
MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33829

2 years agouart_dev_snps: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:46:50 +0000 (10:46 +0100)]
uart_dev_snps: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33828

2 years agousb: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:45:42 +0000 (10:45 +0100)]
usb: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33827

2 years agouart_dev_imx: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:43:40 +0000 (10:43 +0100)]
uart_dev_imx: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33826

2 years agoif_cgem: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:42:34 +0000 (10:42 +0100)]
if_cgem: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33825

2 years agosdhci: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:41:23 +0000 (10:41 +0100)]
sdhci: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33824

2 years agotwsi: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:39:47 +0000 (10:39 +0100)]
twsi: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33823

2 years agodwmmc: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:38:24 +0000 (10:38 +0100)]
dwmmc: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33822

2 years agommc: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:37:02 +0000 (10:37 +0100)]
mmc: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33821

2 years agodwc: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:34:36 +0000 (10:34 +0100)]
dwc: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33820

2 years agommap map_at_zero test: handle W^X
Arka Sharma [Fri, 18 Feb 2022 15:34:15 +0000 (09:34 -0600)]
mmap map_at_zero test: handle W^X

Use kern.elfXX.allow_wx to decide whether to map W+X or W-only memory.

Future work could expand this test to add an "allow_wx" axis to the
test matrix, but I would argue that a separate test should be written,
since that's orthogonal to map_at_zero.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

2 years agotcp: Congestion control move to using reference counting.
Randall Stewart [Mon, 21 Feb 2022 11:30:17 +0000 (06:30 -0500)]
tcp: Congestion control move to using reference counting.

In the transport call on 12/3 Gleb asked to move the CC modules towards
using reference counting to prevent folks from unloading a module in use.
It was also agreed that Michael would do a user space utility like tcp_drop
that could be used to move all connections that are using a specific CC
to some other CC.

This is the half I committed to doing, making it so that we maintain a refcount
on a cc module every time a pcb refers to it and decrementing that every
time a pcb no longer uses a cc module. This also helps us simplify the
whole unloading process by getting rid of tcp_ccunload() which munged
through all the tcb's. Instead we mark a module as being removed and
prevent further references to it. We also make sure that if a module is
marked as being removed it cannot be made as the default and also
the opposite of that, if its a default it fails and does not mark it as being
removed.

Reviewed by: Michael Tuexen, Gleb Smirnoff
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D33249

2 years agolibarchive: merge vendor bugfix
Martin Matuska [Mon, 21 Feb 2022 11:06:54 +0000 (12:06 +0100)]
libarchive: merge vendor bugfix

OSS-Fuzz #44843 (security):
RAR reader: fix null-dereference in RAR (v4) filter code

X-MFC-with: 833a452e9d

2 years agoUpdate vendor/libarchive to libarchive/libarchive@1271f775d
Martin Matuska [Mon, 21 Feb 2022 11:04:05 +0000 (12:04 +0100)]
Update vendor/libarchive to libarchive/libarchive@1271f775d

Bugfixes:
OSS-Fuzz #44843 (security):
  RAR reader: fix null-dereference in RAR (v4) filter code

Obtained from: libarchive
Libarchive commit: 1271f775dc917798ad7d03c3b3bd66bacad03603

2 years agocpufreq: dt: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:04:09 +0000 (11:04 +0100)]
cpufreq: dt: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agotwsi: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:03:57 +0000 (11:03 +0100)]
twsi: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoaudio_soc: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:03:38 +0000 (11:03 +0100)]
audio_soc: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoif_dwc: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:03:25 +0000 (11:03 +0100)]
if_dwc: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm: allwinner: a33_codec: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:03:09 +0000 (11:03 +0100)]
arm: allwinner: a33_codec: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm: allwinner: a10_timer: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:02:53 +0000 (11:02 +0100)]
arm: allwinner: a10_timer: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agopmic: rockchip: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:55:43 +0000 (10:55 +0100)]
pmic: rockchip: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm: allwinner: clk: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:55:07 +0000 (10:55 +0100)]
arm: allwinner: clk: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm64: allwinner: aw_usb3phy: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:54:47 +0000 (10:54 +0100)]
arm64: allwinner: aw_usb3phy: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm64: allwinner: aw_i2s: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:54:17 +0000 (10:54 +0100)]
arm64: allwinner: aw_i2s: Plug set but not used variable
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm: allwinner: aw_gpio: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:53:58 +0000 (10:53 +0100)]
arm: allwinner: aw_gpio: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm64: allwinner: axp81x: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:39:05 +0000 (10:39 +0100)]
arm64: allwinner: axp81x: Plug set but not used variable
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm64: allwinner: aw_sid: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:38:06 +0000 (10:38 +0100)]
arm64: allwinner: aw_sid: Plug set but not used variable
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agomlx5core: Add PCI IDs for ConnectX-8.
Hans Petter Selasky [Mon, 21 Feb 2022 08:25:45 +0000 (09:25 +0100)]
mlx5core: Add PCI IDs for ConnectX-8.

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agomlx5ib: Add support for NDR link speed.
Hans Petter Selasky [Mon, 21 Feb 2022 08:25:29 +0000 (09:25 +0100)]
mlx5ib: Add support for NDR link speed.

The IBTA specification has new speed - NDR. That speed supports signaling
rate of 100Gb. mlx5 IB driver translates link modes reported by ConnectX
device to IB speed and width. Added translation of new 100Gb, 200Gb and
400Gb link modes to NDR IB type and width of x1, x2 or x4 respectively.

Linux commits:
f946e45f59ef01ff54ffb3b1eba3a8e7915e7326

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agomlx5core: Add PCI IDs for ConnectX-7.
Hans Petter Selasky [Mon, 21 Feb 2022 08:25:23 +0000 (09:25 +0100)]
mlx5core: Add PCI IDs for ConnectX-7.

Linux commits:
505a7f5478062c6cd11e22022d9f1bf64cd8eab3
dd8595eabeb486d41ad9994e6cece36e0e25e313

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agoibcore: Add support for NDR link speed.
Hans Petter Selasky [Mon, 21 Feb 2022 08:25:10 +0000 (09:25 +0100)]
ibcore: Add support for NDR link speed.

Add new IBTA speed NDR, supporting signaling rate of 100Gb.

Linux commit:
c7adf7717301558e8852949d8e3dc3748d1a4a97

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agoTemporarily skip usr.bin.diff.diff_test.functionname in CI
Li-Wen Hsu [Mon, 21 Feb 2022 08:31:43 +0000 (16:31 +0800)]
Temporarily skip usr.bin.diff.diff_test.functionname in CI

PR: 262086
Sponsored by: The FreeBSD Foundation

2 years agoRevert "Enable -Wdate-time warning"
Ed Maste [Mon, 21 Feb 2022 00:01:40 +0000 (19:01 -0500)]
Revert "Enable -Wdate-time warning"

This reverts commit 489d7a8528cae1adb7192c2563028e2d028c354b.

The flag leaks into some port builds, causing them to fail.  I will
recommit it with some sort of opt-out later on.

Reported by: mi

2 years agodev/pci: fix potential panic due to bogus VPD data
Stefan Eßer [Sun, 20 Feb 2022 21:07:35 +0000 (22:07 +0100)]
dev/pci: fix potential panic due to bogus VPD data

A panic has been observed on a system with a Intel X520 dual LAN
device. The panic is caused by a KASSERT() noticing that the amount
of VPD data copied out to the pciconf command does not match the
amount of data read from the device.

The cause of the size mismatch was VPD data that started with 0x82,
the VPD tag that indicates that a VPD ident follows, but with a length
of more than 255 characters, which happens to be the maximum ident
size supported by the API between kernel and the pciconf program.
The data provided did not resemble an actual VPD identifier, and it
can be assumed that the initial tag value 0x82 happens to be there
by accident.

An ident size of 255 far exceeds the sensible length of that data
element, which is in the order of at most 30 to 40 bytes.

This patch adds several consitstency checks to the VPD parser, the
most critical being that ident lengths of more than 255 bytes are
rejected. Other checks reject VPD with more than one ident tag or
with an empty (zero length) ident string.

This patch prevents the panic that occured when "pciconf -lV" was
executed on the affected system.

During the anaylsis of the issue and the VPD code it has been
found that the VPD parser uses a state machine that accepts tags
in any order and combination. This is a bad match for the actual
VPD data, which has a very simple structure that can be parsed
with a non-recursive direct descent parser (which always knows
exactly which token to expect next).

A review fpr a much simpler VPD parser that performs many more
consistency checks and rejects invalid VPD has been proposed in
review https://reviews.freebsd.org/D34268.

Reported by: mikej at paymentallianceintl.com (Michael Jung)
Approved by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34255

2 years agoAvoid unaligned writes by fsck_ffs(8).
Kirk McKusick [Sun, 20 Feb 2022 21:18:05 +0000 (13:18 -0800)]
Avoid unaligned writes by fsck_ffs(8).

Normally fsck_ffs never does reads or writes that are not aligned
to the size of one of the checked filesystems fragments. The one
exception is when it finds that it needs to write the superblock
recovery information. Here it will write with the alignment reported
by the underlying disk as its sector size as reported by an
ioctl(diskfd, DIOCGSECTORSIZE, &secsize).

Modern disks have a sector size of 4096, but for backward compatibility
with older disks will report that they have a sector size of 512.
When presented with a 512 byte write, they have to read the associated
4096 byte sector, replace the 512 bytes to be written, and write
the updated 4096 byte sector back to the disk. Unfortunately, some
disks report that they have 512 sectors, but fail writes that are not
aligned to 4096 boundaries and are a multiple of 4096 bytes in size.

This commit updates fsck_ffs(8) so that it uses the filesystem fragment
size as the smallest size and alignment for doing writes rather than
the disk's reported sector size.

Reported by:  Andriy Gapon
MFC after:    1 week

2 years agoshare/mk: Fix obvious typo in README (TAREGT -> TARGET)
Joerg Wunsch [Sun, 20 Feb 2022 16:26:04 +0000 (17:26 +0100)]
share/mk: Fix obvious typo in README (TAREGT -> TARGET)

MFC after: 1 week

2 years agosctp: remove KASSERT() which not always holds
Michael Tuexen [Sun, 20 Feb 2022 14:59:21 +0000 (15:59 +0100)]
sctp: remove KASSERT() which not always holds

Reported by: syzbot+c907045aed2043011f3c@syzkaller.appspotmail.com
MFC after: 3 days

2 years agosctp: make sure new locking requirements are satisfied.
Michael Tuexen [Sun, 20 Feb 2022 14:31:53 +0000 (15:31 +0100)]
sctp: make sure new locking requirements are satisfied.

Reported by: syzbot+cd3c1dd64861b8c200bd@syzkaller.appspotmail.com
MFC after: 3 days

2 years agofetch: make -S argument accept values > 2GB
Stefan Eßer [Sun, 20 Feb 2022 14:24:43 +0000 (15:24 +0100)]
fetch: make -S argument accept values > 2GB

Use strtoll() to parse the argument of the -S option.

FreeBSD has supported 64 bit file offsets for more than 25 years on
all architectures and off_t is a 64 bit integer type for that reason.

While strtol() returns a 64 bit value on 64 LP64 architectures, it
is limit to 32 bit on e.g. i386. The strtoll() function returns a 64
but result on all supported architectures and therefore supports the
possible file lengths and file offsets on 32 bit archtectures.

Reported by: antoine
MFC after: 3 days

2 years agosctp: don't hold the assoc create lock longer than needed
Michael Tuexen [Sun, 20 Feb 2022 13:55:41 +0000 (14:55 +0100)]
sctp: don't hold the assoc create lock longer than needed

Reported by: syzbot+c738e3df67cf425c49a2@syzkaller.appspotmail.com
MFC after: 3 days

2 years agoofw_iicbus: Use uint32_t for iic bus address argument, not int.
Michal Meloun [Sun, 20 Feb 2022 11:24:15 +0000 (12:24 +0100)]
ofw_iicbus: Use uint32_t for iic bus address argument, not int.

The iicbus devinfo uses uint32_t for storing iic bus address and new method
should comply with this fact.

MFC with: 1bd3e8ba696633ccd7525030d951b58ade167814#

2 years agoFix a534b50e245d on powerpc.
Michal Meloun [Sun, 20 Feb 2022 13:02:13 +0000 (14:02 +0100)]
Fix a534b50e245d on powerpc.

MFC with: 1bd3e8ba696633ccd7525030d951b58ade167814

2 years agotegra: Improve the detection of the secondary function (RTC) of the MAX77620.
Michal Meloun [Sun, 20 Feb 2022 10:18:42 +0000 (11:18 +0100)]
tegra: Improve the detection of the secondary function (RTC) of the MAX77620.

Use the new ofw_iicbus_set_devinfo() method to implant an OFW compatibility
string for a manually created RTC sub-device.

MFC after: 4 weeks
Reported by: archimedes.gaviola_at_gmail.com
bscott_at_bunyatech.com.au

2 years agoofw_iicbus: Add method for manual setting of basic OFW parameters.
Michal Meloun [Sun, 20 Feb 2022 09:45:14 +0000 (10:45 +0100)]
ofw_iicbus: Add method for manual setting of basic OFW parameters.

Some IIC multifunction devices may have multiple I2C addresses per chip, but
only the primary address is listed in the DT (e.g. MAX776200). In this case,
the sub-devices for the secondary addresses must be created manually with
fixed OFW parameters (node, name, compatibility string, IIC address).
Add a bus method to the ofw_iicbus interface that does this.

MFC after: 4 weeks

2 years agoProvide an interface that allows GEOM modules to return multiple messages.
Kirk McKusick [Sun, 20 Feb 2022 05:30:37 +0000 (21:30 -0800)]
Provide an interface that allows GEOM modules to return multiple messages.

The gctl_error() function provides GEOM modules with the ability
to report only a single message. When running with the verbose
flag, commands that handle multiple devices may want to report a
message for each of the devices on which it operates. This commit
adds the gctl_msg() function that can be called multiple times
to post messages. When finished issuing messages, the application
must either call gctl_post_messages() or call gctl_error() to cause
the messages to be reported to the calling process.

Tested by:    Peter Holm

2 years agosctp: cleanup sctp_lower_sosend
Michael Tuexen [Sun, 20 Feb 2022 00:09:30 +0000 (01:09 +0100)]
sctp: cleanup sctp_lower_sosend

This is a preparation for retiring the tcp send lock in the
next step.

MFC after: 3 days

2 years agosnd_uaudio(4): Set hardware buffering to the minimum by default.
Hans Petter Selasky [Sat, 19 Feb 2022 23:10:53 +0000 (00:10 +0100)]
snd_uaudio(4): Set hardware buffering to the minimum by default.

Improves the audio experience when using applications like
audio/jamulus and audio/hpsjam .

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agovnet: add CURVNET_ASSERT_SET for !VIMAGE
Mateusz Guzik [Sat, 19 Feb 2022 21:00:00 +0000 (21:00 +0000)]
vnet: add CURVNET_ASSERT_SET for !VIMAGE

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

2 years agortsx: Add RTS5260 support and replace bootverbose with sysctl.
Henri Hennebert [Sat, 19 Feb 2022 16:41:53 +0000 (11:41 -0500)]
rtsx: Add RTS5260 support and replace bootverbose with sysctl.

Tested by: mav
MFC after: 4 days
Differential Revision: https://reviews.freebsd.org/D34246

2 years agoipsec: sprinkle CURVNET_ASSERT_SET
Mateusz Guzik [Thu, 17 Feb 2022 16:53:15 +0000 (16:53 +0000)]
ipsec: sprinkle CURVNET_ASSERT_SET

Reviewed by: ae
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34314

2 years agoipsec: extend vnet coverage in esp_input/output_cb
Mateusz Guzik [Thu, 17 Feb 2022 16:50:13 +0000 (16:50 +0000)]
ipsec: extend vnet coverage in esp_input/output_cb

key_delsav used to conditionally dereference vnet, leading to panics as
it was getting unset too early.

While the particular condition was removed, it makes sense to handle all
operations of the sort with correct vnet set so change it.

Reviewed by: ae
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34313

2 years agovnet: add CURVNET_ASSERT_SET
Mateusz Guzik [Thu, 17 Feb 2022 16:48:45 +0000 (16:48 +0000)]
vnet: add CURVNET_ASSERT_SET

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34312

2 years agolibarchive: merge vendor bugfixes
Martin Matuska [Fri, 18 Feb 2022 23:57:56 +0000 (00:57 +0100)]
libarchive: merge vendor bugfixes

Bugfixes:
OSS-Fuzz #44547: fix heap-use-after-free in RAR (v4) filter code
PR #1671: Fix 7z PPMD reading beyond boundary

X-MFC-with: 833a452e9d

2 years agoUpdate vendor/libarchive to libarchive/libarchive@72ce1ff7c
Martin Matuska [Fri, 18 Feb 2022 23:45:12 +0000 (00:45 +0100)]
Update vendor/libarchive to libarchive/libarchive@72ce1ff7c

Bugfixes:
  OSS-Fuzz #44547 (security):
    fix heap-use-after-free in RAR (v4) filter code
  PR #1671:
    Fix 7z PPMD reading beyond boundary

Obtained from: libarchive
Libarchive commit: 72ce1ff7c6857a7334baa05884e69b9264a2199c

2 years agoctl ramdisk: Free compare buffer after a compare I/O request.
John Baldwin [Fri, 18 Feb 2022 23:20:14 +0000 (15:20 -0800)]
ctl ramdisk: Free compare buffer after a compare I/O request.

For a compare request, the ramdisk backend allocates a temporary
buffer to hold the I/O data and then compares it against the LUN's
pages in ctl_backend_ramdisk_cmp after the data has been filled.
However, the tempory buffer was leaked when after the comparison was
complete.  Fix this by freeing the buffer after the comparison.

Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D34316