]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
20 months agopvscsi: Advertise maxio of 256k.
Warner Losh [Wed, 21 Apr 2021 18:10:42 +0000 (12:10 -0600)]
pvscsi: Advertise maxio of 256k.

While the PV SCSI SG list can handle 512k of SG entries, it can only do
so for I/O that's aligned to 4k or better. newfs_msdos does unaligned
I/O, so triggers too long for host errors in cam when a 512k I/O is
attempted. Prefer power of 2 256k to the absolute maximum 508k, though
that can be revisited should the latter show to give significant
performance improvement.

MFC After: 3 days
Tested by: darius on discord (508k version of patch)
Sponsored by: Netflix

(cherry picked from commit 9a5a5c1576b4ce308a97e0bce887261701ae3edc)

20 months agortld: fix typo in comment
Konstantin Belousov [Mon, 17 Oct 2022 14:08:36 +0000 (17:08 +0300)]
rtld: fix typo in comment

(cherry picked from commit ca2560bd85ab8d5cb18855cf61f49a7219cb3d8f)

20 months agolibdtrace: Fix some CPU register number definitions to match the kernel
Mark Johnston [Wed, 12 Oct 2022 19:59:09 +0000 (15:59 -0400)]
libdtrace: Fix some CPU register number definitions to match the kernel

(cherry picked from commit 53a31c87df9f0f77d26a5d35cb8322c8e78033ce)

20 months agodtrace: Drop illumos ifdefs for CPU register definitions
Mark Johnston [Wed, 12 Oct 2022 19:59:00 +0000 (15:59 -0400)]
dtrace: Drop illumos ifdefs for CPU register definitions

These are fixed, so having upstream's version is not especially useful,
and the duplicated definitions make for confusing reading.  No
functional change intended.

(cherry picked from commit b34a6e0fed4af33671c79347deb77e3e93930df3)

20 months agomalloc(9): update names and hardlinks
Mitchell Horne [Wed, 12 Oct 2022 16:43:57 +0000 (13:43 -0300)]
malloc(9): update names and hardlinks

Give all documented functions a .Nm entry in the man page, following the
order they are listed in the synopsis. Create MLINKs for each of the
functions as well.

While here, add a missing include directive to the synopsis, and appease
mandoc by wrapping a long line.

Reviewed by: markj, imp (previous version), jhb (previous version)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36940

(cherry picked from commit 30c6a66864821d3b47e25612c0d2e727ec36154e)

20 months agoswi(9): remove BUGS section
Mitchell Horne [Wed, 12 Oct 2022 16:38:08 +0000 (13:38 -0300)]
swi(9): remove BUGS section

Most of these globals have been removed, save for clk_intr_event. This
one is appropriate to keep in sys/interrupt.h, despite the fact that it
has only one consumer.

Bump .Dd for this and previous changes.

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

(cherry picked from commit ed02be352dc973827446436eece4cad5b8c91bf3)

20 months agoDowngrade tty_intr_event from a global
Mitchell Horne [Wed, 12 Oct 2022 16:36:08 +0000 (13:36 -0300)]
Downgrade tty_intr_event from a global

It can be static within uart_tty.c. It is an open question whether there
remains any real benefit to having uart instances share a swi thread.

Reviewed by: imp, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36938

(cherry picked from commit 05b727fee550598bfae5754783f9decfdeeb3c3d)

20 months agoswi(9): clean up description of clk_intr_event
Mitchell Horne [Wed, 12 Oct 2022 16:35:23 +0000 (13:35 -0300)]
swi(9): clean up description of clk_intr_event

From what I can tell, setdelayed() was removed so long ago that its
mention is more likely to be confusing than helpful. We now have a
manpage for hardclock(9), so reference that.

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

(cherry picked from commit 96b76a6a1edd6d0e0d4fa07c37d11d5805e8b8b3)

20 months agoRemove last references of vm_ih
Mitchell Horne [Wed, 12 Oct 2022 16:32:27 +0000 (13:32 -0300)]
Remove last references of vm_ih

The only remaining user was busdma, and so it was simplified.

Reviewed by: markj, jhb
MFC after: 1 week
Fixes: 254e4e5b77d7 ("Simplify swi for bus_dma")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36936

(cherry picked from commit e23c3445f69c945a8d5316b26bd996dbc900b2aa)

20 months agonanobsd: remove unmodified copies of ssh config files
Ed Maste [Wed, 13 Apr 2022 21:04:33 +0000 (17:04 -0400)]
nanobsd: remove unmodified copies of ssh config files

Nanobsd included copies of ssh_config and sshd_config.  The former is
identical to the one provided by the base system, and the latter is
identical except for PermitRootLogin, which is updated by nanobsd's
cust_allow_ssh_root anyhow.  Remove nanobsd's copies and use the
existing base system ones.

Reported by: Jose Luis Duran <jlduran@gmail.com> in D34937
Reviewed by: Jose Luis Duran <jlduran@gmail.com>, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36933

(cherry picked from commit 42942998437d9304110e39b04552853729aa498e)
(cherry picked from commit 6e6c45e66f68e68b451a27430f51a687e00bad15)
(cherry picked from commit a1e39f96d244fe30a3277c9cefbfd23e046cf845)

20 months agoqoriq_dw_pci: Fix typo in link status checking code
Bartlomiej Grzesik [Tue, 31 Aug 2021 04:22:33 +0000 (06:22 +0200)]
qoriq_dw_pci: Fix typo in link status checking code

On some DesignWare PCIe controllers accessing config registers of slots
whose link is down triggers a SError. Because of that we need to check the
link status before any acceses config space.
Due to a typo link was always reported up.
This fixes a SError that occured during boot on LS1028A-RDB.

Obtained from: Semihalf
Reviewed by: wma
Differential revision: https://reviews.freebsd.org/D31509

(cherry picked from commit df9c0e88e1e30cb5d1c81c4c2f295f7d153ed02b)

20 months agosort: deindent file_reader_free and cleanup its usage
Baptiste Daroussin [Thu, 13 Oct 2022 08:51:17 +0000 (10:51 +0200)]
sort: deindent file_reader_free and cleanup its usage

(cherry picked from commit 226e41467ee15c7aba33d59ee7b512b984b182e7)

20 months agosort: simplify file_reader_clean
Baptiste Daroussin [Thu, 13 Oct 2022 08:40:21 +0000 (10:40 +0200)]
sort: simplify file_reader_clean

Deindent the function, remove useless tests:
 - free already test if argument is NULL
 - closefile already test if the input is stdin or null

(cherry picked from commit ffd41d39c660ca1c80b77707238e8e5ef26d7d7a)

20 months agosort: deindent closefile
Baptiste Daroussin [Thu, 13 Oct 2022 08:38:12 +0000 (10:38 +0200)]
sort: deindent closefile

(cherry picked from commit f9d9a7cc4f2ff38795e5056721297e2b8442bf7a)

20 months agosort: use asprintf(3) instead of malloc + snprintf(3)
Baptiste Daroussin [Thu, 13 Oct 2022 08:34:57 +0000 (10:34 +0200)]
sort: use asprintf(3) instead of malloc + snprintf(3)

(cherry picked from commit 48a53cc4849555f1a0b805adddb9f517a305a2ae)

20 months agosort: deindent openfile
Baptiste Daroussin [Thu, 13 Oct 2022 08:31:08 +0000 (10:31 +0200)]
sort: deindent openfile

(cherry picked from commit 958b0d46425395f8f4606ac5d12681d623282e9d)

20 months agosort: use memset to initialize structure when possible
Baptiste Daroussin [Thu, 13 Oct 2022 07:07:46 +0000 (09:07 +0200)]
sort: use memset to initialize structure when possible

(cherry picked from commit f02c783757365340763739e58ef0e68ec13a0f8f)

20 months agosort: unify the code to read from FILE *
Baptiste Daroussin [Thu, 13 Oct 2022 07:36:48 +0000 (09:36 +0200)]
sort: unify the code to read from FILE *

Previously the code to read from a local file or stdin was sperarated
After the change to remove the home made line reader used for stdin
(replaced by getdelim) it apprears that the rest of the code which is
used to read from any FILE * but stdin can benefit from the exact same
change.

(cherry picked from commit 8b9071360a312f2bb2104864af0b9905acac87bc)

20 months agosort: remove unused function
Baptiste Daroussin [Thu, 13 Oct 2022 07:33:12 +0000 (09:33 +0200)]
sort: remove unused function

(cherry picked from commit e8815fb30b340108bc4b36ab46afa31f673948d0)

20 months agosort: simplify the code to handle -z flag
Baptiste Daroussin [Thu, 13 Oct 2022 08:21:48 +0000 (10:21 +0200)]
sort: simplify the code to handle -z flag

(cherry picked from commit f079ef8aa428ebffad28f5c62cce52c2bf70fb49)

20 months agosort: cleanup now unused structutre and prototypes
Baptiste Daroussin [Thu, 13 Oct 2022 08:19:18 +0000 (10:19 +0200)]
sort: cleanup now unused structutre and prototypes

(cherry picked from commit 4d4fcf619efcc02a962d0723a7ccd94fb621c6e6)

20 months agosort: use mkstemp(3) instead of reinventing it
Baptiste Daroussin [Wed, 12 Oct 2022 15:57:37 +0000 (17:57 +0200)]
sort: use mkstemp(3) instead of reinventing it

MFC After: 1 week

(cherry picked from commit 3f9e5e59bda05acea409fa3121c835a74672de1c)

20 months agosort: replace home made line reader by getdelim(3)
Baptiste Daroussin [Wed, 12 Oct 2022 13:31:50 +0000 (15:31 +0200)]
sort: replace home made line reader by getdelim(3)

The previous code had bug when reading lines with an unexpected
encoding, returning without the full line being captured.
This result in sort complaining with "sort: Illegal byte sequence"

Using getdelim(3) instead of the home made code, fixes the situation.

PR: 241679
Reported by: Ronald F. Guilmette <rfg-freebsd@tristatelogic.com>
MFC After: 1 week
Reviewed by: markj, imp
Differential Revision: https://reviews.freebsd.org/D36948

(cherry picked from commit b58094c0d98e5d0ab8abdcdb655ac902ae8ad66e)

20 months agoOptionalObsoleteFiles: grep nls files have been removed 4 years ago
Baptiste Daroussin [Wed, 12 Oct 2022 14:28:36 +0000 (16:28 +0200)]
OptionalObsoleteFiles: grep nls files have been removed 4 years ago

(cherry picked from commit 00ffd6b5e88e9f2cf176379dc185c7f0c0920ba7)

20 months agosort: add wrapper around calloc
Baptiste Daroussin [Wed, 12 Oct 2022 13:52:38 +0000 (15:52 +0200)]
sort: add wrapper around calloc

(cherry picked from commit a312f3e74286c9bccd498198bfd236c49916d891)

20 months agosort: replace malloc+memset with calloc
Baptiste Daroussin [Wed, 12 Oct 2022 13:57:11 +0000 (15:57 +0200)]
sort: replace malloc+memset with calloc

(cherry picked from commit ecc3c2916751a0aef5619ed8f0ba1cc37c0a22ba)

20 months agopw: remove the inaccurate anymore information from the README
Baptiste Daroussin [Wed, 12 Oct 2022 10:11:32 +0000 (12:11 +0200)]
pw: remove the inaccurate anymore information from the README

(cherry picked from commit 88e6c9a674be41bb817573f61c86dec255ca1646)

20 months agopw: exit with an error in case of using an illegal option
Baptiste Daroussin [Wed, 12 Oct 2022 10:06:32 +0000 (12:06 +0200)]
pw: exit with an error in case of using an illegal option

PR: 263188
Reported by: Dennis Clarke <dclarke@blastwave.org>
MFC After: 1 week

(cherry picked from commit c0358afd5bbc2c675941fed2905479ad109770bb)

20 months agopci_vendors: update to 2022.09.09
Baptiste Daroussin [Wed, 12 Oct 2022 09:31:15 +0000 (11:31 +0200)]
pci_vendors: update to 2022.09.09

(cherry picked from commit 0b4886f4543ea8e55313321c92263adf8e0e6ff7)

20 months agoinet6(4): add a missing IPPROTO_ETHERIP entry
Hiroki Sato [Fri, 27 Aug 2021 08:14:35 +0000 (17:14 +0900)]
inet6(4): add a missing IPPROTO_ETHERIP entry

bridge(4) + gif(4) did not work when the outer protocol was IPv6.

Submitted by: Masahiro Kozuka
PR: 256820

Approved by: hps (to cherry-pick)

(cherry picked from commit 9823a0c0acf4fc277a71336ea737e1de7c65742f)

20 months agodma: restore addition of newline when missing from input
Ed Maste [Tue, 27 Sep 2022 19:19:19 +0000 (15:19 -0400)]
dma: restore addition of newline when missing from input

If input mail does not have a newline on the last line dma must add
one.  This was broken by the addition of long-line splitting, with the
switch from strlen(line) to linelen returned by getline().

PR: 266629
Reviewed by: bapt, Mikko Lehto
Tested by: Mikko Lehto
MFC after: 1 week
Fixes: b0b2d05fd060 ("Split body of mails not respecting...")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36763

(cherry picked from commit 169487223143b1232ec4686b720b028af8d6d42b)

20 months agoReapply: "bus.h: rewrite comment describing intr_type"
Mitchell Horne [Fri, 7 Oct 2022 22:21:49 +0000 (19:21 -0300)]
Reapply: "bus.h: rewrite comment describing intr_type"

Describe more clearly the purpose of these flags and where they are
used.

Remove grog's comment about revisiting the flags. At this point it does
not make sense to change this long-standing API, especially in light of
2cf7870864ea ("Collapse interrupt thread priorities").

Give a better example of a bus modifying these flags; I did not find any
existing instance where a bus changes the interrupt's type.

Reviewed by: imp, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36896

Note: 2cf7870864ea is not present in stable/13 and likely will never be.
While reapplying this change, I have modified the comment further to
eliminate any inaccuracy Re: priorities. It should be applicable even if
the change is merged some day.

(cherry picked from commit af390486010e8fc78c4d715e751cd1175d0752c7)

20 months agoRevert "bus.h: rewrite comment describing intr_type"
Mitchell Horne [Tue, 18 Oct 2022 14:13:24 +0000 (11:13 -0300)]
Revert "bus.h: rewrite comment describing intr_type"

This reverts commit fff5fec16b2ec42b0cb357fdbb675353e3126f21.

It needs slight modification for stable/13 which does not have collapsed
interrupt thread priorities.

20 months agosbuf(9): reference the correct function
Mitchell Horne [Thu, 13 Oct 2022 13:01:11 +0000 (10:01 -0300)]
sbuf(9): reference the correct function

This was most likely a copy-paste error.

PR: 262433
MFC after: 3 days
Reported by: Boris Ivanovsky <bivanovsky@gmail.com>
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 204a5f5800a0d025c223a7b0b66537e30777d0c7)

20 months agoofw_graph(9): hook it up to the Makefile
Mitchell Horne [Tue, 11 Oct 2022 19:28:16 +0000 (16:28 -0300)]
ofw_graph(9): hook it up to the Makefile

Otherwise, the man page is not installed. Add appropriate MLINKS.

Reviewed by: manu
MFC after: 3 days
Fixes: 9a4eed0be20c ("ofw_graph: Add functions for graph bindings")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36932

(cherry picked from commit d88131e1e50c9cce5bd089b156661ca3090c10c6)

20 months agoriscv: handle misaligned address exceptions
Mitchell Horne [Tue, 11 Oct 2022 13:39:50 +0000 (10:39 -0300)]
riscv: handle misaligned address exceptions

If this exception is coming from userspace, send the appropriate SIGBUS
to the process. If it's coming from the kernel this is still fatal, but
we can give a better panic message.

Typical misaligned loads/stores are emulated by the SBI firmware, and
require no intervention from our kernel. The notable exception here is
misaligned access with atomic instructions. These can generate the
exception and panic seen in the PR.

With this, we now handle all defined exception types.

PR: 266109
MFC after: 1 week
Found by: syzkaller
Reported by: P1umer <p1umer1337@gmail.com>
Differential Revision: https://reviews.freebsd.org/D36876

(cherry picked from commit 9b4cbaa9c3da233cf06381c3d22e3472ee586585)

20 months agobus.h: rewrite comment describing intr_type
Mitchell Horne [Fri, 7 Oct 2022 22:21:49 +0000 (19:21 -0300)]
bus.h: rewrite comment describing intr_type

Describe more clearly the purpose of these flags and where they are
used.

Remove grog's comment about revisiting the flags. At this point it does
not make sense to change this long-standing API, especially in light of
2cf7870864ea ("Collapse interrupt thread priorities").

Give a better example of a bus modifying these flags; I did not find any
existing instance where a bus changes the interrupt's type.

Reviewed by: imp, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36896

(cherry picked from commit af390486010e8fc78c4d715e751cd1175d0752c7)

20 months agoEVENTHANDLER(9): drop the list of event handlers
Mitchell Horne [Fri, 7 Oct 2022 22:25:12 +0000 (19:25 -0300)]
EVENTHANDLER(9): drop the list of event handlers

Maintaining a comprehensive list of event handlers in this man page is a
futile endeavor. It is entirely detached from the source code, and
therefore requires that anyone adding/removing an event handler have
prior knowledge of the list. Many do not, so it will naturally become
stale (and is).

This is demonstrated by the fact that there are currently 88 instances
of EVENTHANDLER_DECLARE() in the source tree, but the list contains 66
items.

Many of the descriptions do not offer much detail that could not be
gleaned from the handler name alone. It is a more effective strategy to
document the purpose/details of the event handler in a comment alongside
its declaration.

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

(cherry picked from commit 34aac98e3511d90df9209204df6772935a2b7617)

20 months agodtrace: Add a "regs" variable
Mark Johnston [Tue, 4 Oct 2022 16:54:36 +0000 (12:54 -0400)]
dtrace: Add a "regs" variable

This allows invop-based providers (i.e., fbt and kinst) to expose the
register file of the CPU at the point where the probe fired.  It does
not work for SDT providers because their probes are implemented as plain
function calls and so don't save registers.  It's not clear what
semantics "regs" should have for them anyway.

This is akin to "uregs", which nominally provides access to the
userspace registers.  In fact, DIF already had a DIF_VAR_REGS variable
defined, it was simply unimplemented.

Usage example: print the contents of %rdi upon each call to
amd64_syscall():

    fbt::amd64_syscall:entry {printf("%x", regs[R_RDI]);}

Note that the R_* constants are defined in /usr/lib/dtrace/regs_x86.d.
Currently there are no similar definitions for non-x86 platforms.

Reviewed by: christos

(cherry picked from commit bdd101c4d4aeab6c9e76250c310c16f5704b8b8c)

20 months agoatomic: Style
Mark Johnston [Tue, 11 Oct 2022 14:54:36 +0000 (10:54 -0400)]
atomic: Style

Fixes: 30253da1a982 ("atomic: Add some type checking to plain atomic_load/store helpers")

(cherry picked from commit 301a27dc65463fc9a909835863ff5566623f6ef2)

20 months agoixl(4): Fix SR-IOV panics
Yan Ka Chiu [Wed, 13 Jul 2022 01:16:29 +0000 (18:16 -0700)]
ixl(4): Fix SR-IOV panics

The hw and ifp of a vsi will be NULL if such ixl_vsi is allocated
for a VF. When ixl_reconfigure_filters called, it is trying to
access vsi->ifp and hw->mac.addr and therefore is casuing panic.

This commit add checks to determine if vsi is a VF by checking
if vsi->hw is NULL, before adding IXL_VLAN_ANY filter (which
is already in a VF vsi's filter list) and VLAN filters.

(erj's Note: The SR-IOV flows need revisiting; this will help
prevent panics for now)

Reviewed by: krzysztof.galazka@intel.com, erj@
Differential Revision: https://reviews.freebsd.org/D35649

(cherry picked from commit e706512a2b64fa2741144caf056c9fe923b60004)

20 months agoixl(4): Add support for I710 devices and remove non-inclusive language
Krzysztof Galazka [Tue, 24 May 2022 16:08:57 +0000 (09:08 -0700)]
ixl(4): Add support for I710 devices and remove non-inclusive language

Intel introduces a new line of 1G Ethernet adapters
with Device ID 0x0DD2. While at that also remove
non-inclusive language.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: kbowling@
Tested by: gowtham.kumar.ks@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D34924

(cherry picked from commit b7b40e4a38d8521a40494d868d0870dfb9d6d77d)

20 months agoice(4): Add RDMA Client Interface
Eric Joyner [Thu, 2 Dec 2021 00:50:06 +0000 (16:50 -0800)]
ice(4): Add RDMA Client Interface

This allows the "irdma" driver to communicate with the ice(4)
driver to allow it access to the underlying device's hardware
resources as well as synchronize access to shared resources.

This interface already existed in the standalone out-of-tree
1.34.2 driver; this commit adds and enables it in the in-kernel
driver.

Note:

Adds hack to module Makefile to compile interface/.m files

These are required for the RDMA client interface, but they don't
build as-is like the normal .c files. The source directory doesn't
seem to be included by default, so add lines that specifically
add them as libraries so that ice_rdma.h can be found and the
interface files will compile.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D30889

(cherry picked from commit 8a13362d49bf07dfc654e25976d057adbe0ac9c1)
(cherry picked from commit d8cce8145c39812cc31b50070c44d66ca21a5127)

20 months agopci: Disable Electromechanical Interlock.
Alexander Motin [Tue, 4 Oct 2022 14:34:15 +0000 (10:34 -0400)]
pci: Disable Electromechanical Interlock.

Add sysctl/tunable to control Electromechanical Interlock support.
Disable it by default since Linux does not do it either and it seems
the number of systems having it broken is higher than having working.

This fixes NVMe backplane operation on ASUS RS500A-E11-RS12U server
with AMD EPYC 7402 CPU, where attempts to control reported interlock
for some reason end up in PCIe link loss, while interlock status does
not change (it is not really there).

MFC after: 2 weeks

(cherry picked from commit a58536b91ae3931d222c3e4f1a949ff4a4927fb2)

20 months agoclnt_vc.c: Replace msleep() with pause() to avoid assert panic
Rick Macklem [Fri, 14 Oct 2022 22:46:55 +0000 (15:46 -0700)]
clnt_vc.c: Replace msleep() with pause() to avoid assert panic

An msleep() in clnt_vc.c used a global "fake_wchan" wchan argument
along with the mutex in a CLIENT structure.  As such, it was
possible to use different mutexes for the same wchan and
cause a panic assert.  Since this is in a rarely executed code
path, the assert panic was only recently observed.

Since "fake_wchan" never gets a wakeup, this msleep() can
be replaced with a pause() to avoid the panic assert,
which is what this patch does.

(cherry picked from commit 82512c17ea39fcc272483024cb55d567dfd55366)

20 months agoBump __FreeBSD_version to 1301508
Bjoern A. Zeeb [Mon, 17 Oct 2022 20:38:38 +0000 (20:38 +0000)]
Bump __FreeBSD_version to 1301508
after merges of LinuxKPI changes and for de-macrofying pause().

20 months agonet80211: move IEEE80211_F_WME check to vap for consistency
Bjoern A. Zeeb [Mon, 26 Sep 2022 20:57:41 +0000 (20:57 +0000)]
net80211: move IEEE80211_F_WME check to vap for consistency

The IEEE80211_F_WME checks done on the ic were changed to be per-vap
back in the time when multi-bss was introduced or earlier in 2008.
This one was left out but given it is a (re-)accos-req case I see
no reason not to use the vap value here for consistency too.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36733

(cherry picked from commit f82316f67883b53ee0f79bf28be32dfa7d64d5e3)

20 months agoLinuxKPI: add the "dummy" includes directory to builds
Bjoern A. Zeeb [Fri, 23 Sep 2022 21:25:07 +0000 (21:25 +0000)]
LinuxKPI: add the "dummy" includes directory to builds

While we could add the dummy includes directory manually to only the
drivers needing it, it seems a lot easier to simply add it to all
without any expected harm.

This is needed for more drivers (and to remove some #ifdef in current
ones) with empty header files being present not yielding errors.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky, imp
Differential Revision: https://reviews.freebsd.org/D36684

(cherry picked from commit f8bad56164a43aa108498a97bd0021a943c0a02e)

20 months agoLinuxKPI: define LINUXKPI_INCLUDES for module builds as well
Bjoern A. Zeeb [Fri, 23 Sep 2022 21:18:45 +0000 (21:18 +0000)]
LinuxKPI: define LINUXKPI_INCLUDES for module builds as well

While for in-kernel we already have LINUXKPI_INCLUDES in kern.pre.mk
for kmod builds we've not had a common define to use leading to various
spellings of include paths.

In order for the include list to be expanded more easily in the future,
e.g., adding the "dummy" includes (for all) and to harmonize code,
duplicate LINUXKPI_INCLUDES to kmod.mk and use it for all module Makefiles.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36683

(cherry picked from commit 514fb3872166a361faa81d89909f65913e90b1b2)

20 months agoLinuxKPI: add struct dmi_header and unsupported dmi_walk()
Bjoern A. Zeeb [Fri, 23 Sep 2022 22:21:06 +0000 (22:21 +0000)]
LinuxKPI: add struct dmi_header and unsupported dmi_walk()

Add a structure definition as well as a dummy dmi_walk for now
which returns an error as not supported.  Our current dmi implementation
is special but does not give access to all details but rather only
information from kenv which does not suffice all use cases.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36687

(cherry picked from commit f486b352470edc82142766c2f3da2b8220774b7f)

20 months agoLinuxKPI: cache.h add L1_CACHE_ALIGN()
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:46:17 +0000 (19:46 +0000)]
LinuxKPI: cache.h add L1_CACHE_ALIGN()

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36655

(cherry picked from commit f7c0c1590e3e313d7f60da275b1d74dd82b56b04)

20 months agoLinuxKPI: dma-mapping: add dmam_alloc_coherent()
Bjoern A. Zeeb [Wed, 21 Sep 2022 20:58:05 +0000 (20:58 +0000)]
LinuxKPI: dma-mapping: add dmam_alloc_coherent()

Add the devres version dmam_alloc_coherent() of dma_alloc_coherent()
along with the ancillary free function.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36661

(cherry picked from commit 7105f0d967530852b907375687575a8c2ba62fd2)

20 months agoLinuxKPI: device.h add devm_kmemdup()
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:33:30 +0000 (19:33 +0000)]
LinuxKPI: device.h add devm_kmemdup()

Add devm_kmemdup() as needed by a networking driver.

Sponsored by: The FreeBSD Foundation
eviewed by:  hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D36652

(cherry picked from commit e999fbf0776208f9ecbc2926fd088427d766b014)

20 months agoLinuxKPI: pci.h add more defines and functions
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:39:01 +0000 (19:39 +0000)]
LinuxKPI: pci.h add more defines and functions

Add #defines for PCI_DEVICE_ID and repoint the PCI_VENDOR_ID one.
Add dev_is_pci().
Add pcie_capability_clear_word() according to similar implementations.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D36653

(cherry picked from commit c41d83548b6cf18b48af974ad995354f38cf04a4)

20 months agoLinuxKPI: pci_ids.h Add more Vendor IDs.
Bjoern A. Zeeb [Wed, 21 Sep 2022 20:02:00 +0000 (20:02 +0000)]
LinuxKPI: pci_ids.h  Add more Vendor IDs.

Add PCI vendor IDs found in ath and mt76 drivers.  This should make it
easier for me and others not having to re-define them locally.

Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D36659

(cherry picked from commit fdc7ef3c9831bd4c69a431069aaaad0981ceaf17)

20 months agoLinuxKPI: io.h constify arguments and add more functions
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:55:47 +0000 (19:55 +0000)]
LinuxKPI: io.h constify arguments and add more functions

Constify "*from" arguments and add __ioread32_copy() and
__ioread64_copy() based on the already existing implementations.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36657

(cherry picked from commit 046b82842c61c2d5d1648b5024958827e0a85725)

20 months agoLinuxKPI: if_ether.h add more constants
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:51:52 +0000 (19:51 +0000)]
LinuxKPI: if_ether.h add more constants

In addition to the ones added last year add more found in modern
drivers.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36656

(cherry picked from commit 8e30f49256e254b31fc7c25c97e608f19c268b2b)

20 months agoLinuxKPI: lockdep.h add lockdep_{,un}register_key()
Bjoern A. Zeeb [Thu, 22 Sep 2022 15:03:36 +0000 (15:03 +0000)]
LinuxKPI: lockdep.h add lockdep_{,un}register_key()

Add NOPs for lockdep_{,un}register_key().

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D36658

(cherry picked from commit b27c3aa800bb1b3fc6081895df501c367dc3d9cc)

20 months agoLinuxKPI: tracepoint.h add more defines
Bjoern A. Zeeb [Wed, 21 Sep 2022 20:06:44 +0000 (20:06 +0000)]
LinuxKPI: tracepoint.h add more defines

Add some more defines used in drivers to make it easier to compile.

Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D36660

(cherry picked from commit f9f4988dc48db76f764f418c35b2f76045ded279)

20 months agoLinuxKPI: pci.h split up pcim_iomap_regions_request_all()
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:41:37 +0000 (19:41 +0000)]
LinuxKPI: pci.h split up pcim_iomap_regions_request_all()

Factor out parts of pcim_iomap_regions_request_all() into
pcim_iomap_regions() now needed for a driver.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36654

(cherry picked from commit 30048f61423bed87912686a7adfd12be9a4c7c27)

20 months agoiwlwifi: enforce FreeBSD specific (expected) behaviour
Bjoern A. Zeeb [Sun, 25 Sep 2022 21:23:12 +0000 (21:23 +0000)]
iwlwifi: enforce FreeBSD specific (expected) behaviour

iwlwifi can return early from probe (in FreeBSD attach) while a separate
thread is still grinding loading the firmware and setting things up.
For us this means that kldload succeeded but we may not have a physical
wireless interface (com) yet but the rc framework might already try to
configure a vap on one.

Wait until we get a firmware completion event from the other thread
(on success or error) and block returning.  That way we can ensure that
the "hw" (or com in net80211 terms) is there when we return from attach
matching the expected FreeBSD driver behaviour.

Reported by: J.R. Oldroyd (jr opal.com)
Reported by: probably inderectly showing as other problem
Tested by: J.R. Oldroyd (jr opal.com)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit f808c43ad9234670770601ba32a7426b00bbf528)

20 months agoLinuxKPI: device.h remove duplicate #include
Bjoern A. Zeeb [Wed, 21 Sep 2022 17:25:34 +0000 (17:25 +0000)]
LinuxKPI: device.h remove duplicate #include

linux/types.h is included twice; reduce to the first.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 8ea48fc59eaf475aa7d92f07db9b36370c349f3f)

20 months agoLinuxKPI: 802.11: add more header compat bits
Bjoern A. Zeeb [Wed, 21 Sep 2022 17:12:48 +0000 (17:12 +0000)]
LinuxKPI: 802.11: add more header compat bits

First part adding more bits in order to synch up drivers to the same
level and enable a new ones.

(cherry picked from commit f02e21159b2e7ab0d75905742f74ae5798bea122)

20 months agoLinuxKPI: 80211 (+net80211): update and cleanup headers
Bjoern A. Zeeb [Fri, 9 Sep 2022 18:40:23 +0000 (18:40 +0000)]
LinuxKPI: 80211 (+net80211): update and cleanup headers

Fix types for various struct fields (initially added as int).

Move structs and inline functions logically together, e.g., for wowlan.
Add more skeleton functions and #defines needed for iwlwifi d3.c
in the future.

Add struct ieee80211_vht_cap (without "_ie") to net80211 and remove
duplicate definitions in LinuxKPI headers now using net80211 structs.
For now leave ieee80211_ie_vhtcap in net80211.  I am not sure yet if we
actually need it as such.  That'll be cleaned up with more VHT updates
in net80211 in the future.

No functional changes in currently compiled code intended.

Try to implement ieee80211_action_contains_tpc() as I ran into it with
an older iwlwifi chipset.  This depends on c994352a8841eb453.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 800aa9cd3d8050c1d873a1db02d9a546dca8c42e)

20 months agosystm.h: change pause from #define to inline function
Bjoern A. Zeeb [Thu, 8 Sep 2022 00:04:42 +0000 (00:04 +0000)]
systm.h: change pause from #define to inline function

There are drivers are using (*pause)(x, y) function pointers and depending
on how "pause" is used it gets replaced by pause_sbt causing compile time
failures.
Given "pause" is a generic enough name change it from a #define to an
inline function to avoid replacements where it should not.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D36489

(cherry picked from commit 7ea1cac248574ed06c7823ffbfb9a60157240e57)

20 months agobhyve: Make bc_magic unsigned
Mark Johnston [Sat, 8 Oct 2022 15:26:31 +0000 (11:26 -0400)]
bhyve: Make bc_magic unsigned

This addresses a number of compiler warnings about signed/unsigned
comparisons in assertions.

(cherry picked from commit 3dddf73ee1eb1cea3146da2df376be48d4b2a589)

20 months agobhyve: Make pci_bars local to pci_emul.c
Mark Johnston [Sat, 8 Oct 2022 15:26:25 +0000 (11:26 -0400)]
bhyve: Make pci_bars local to pci_emul.c

(cherry picked from commit 07d82562d8740bd53603b4f7e0780403ae835333)

20 months agobhyve: Initialize the return value in blockif_register_resize_callback()
Mark Johnston [Sat, 8 Oct 2022 15:26:38 +0000 (11:26 -0400)]
bhyve: Initialize the return value in blockif_register_resize_callback()

(cherry picked from commit 5b966d7871aa14fd6c7656a9be16af3f23c6e17d)

20 months agoloader: fix elf lookup_symbol type filtering
Kyle Evans [Fri, 14 Oct 2022 03:06:13 +0000 (22:06 -0500)]
loader: fix elf lookup_symbol type filtering

The existing logic doesn't seem to make much sense, as we won't filter
on the type if st_shndx != SHN_UNDEF.  In practice, this breaks booting
12.3 kernels on newer loaders, as they do have a `kernphys` symbol of
the wrong type (NOTYPE, rather than OBJECT) -- we end up deriving the
wrong value for copy_staging.

It's unclear if this version makes any more sense, but it seems to match
what rtld's matched_symbol() does.  Loader doesn't need to care about
STT_FUNC w/ UND shndx, because we won't encounter those; in kmods,
undefined (kernel) functions are NOTYPE.

Reported by: Christian McDonald <cmcdonald netgate com>
Reviewed by: imp, kib, tsoome

(cherry picked from commit 0701dbda94f21de8ddab3113f79262a26cc7b96c)

20 months agoRevert "Avoid using TARGET_ARCH in llvm.build.mk"
Kyle Evans [Fri, 14 Oct 2022 03:04:47 +0000 (22:04 -0500)]
Revert "Avoid using TARGET_ARCH in llvm.build.mk"

This reverts commit 8534e6be8110a8126268a38dc0557a2d15615ce9, and adds
a cautionary note that there are dragons about that should be considered
when changing it.

PR: 267026
Reviewed by: dim, imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D36981

(cherry picked from commit ed7910fbac07ee39d10528994e49ada2d0f2d754)

20 months agopci_host_generic: stop address translation in bus_alloc_resource
Kyle Evans [Mon, 26 Sep 2022 19:24:21 +0000 (14:24 -0500)]
pci_host_generic: stop address translation in bus_alloc_resource

Translating the provided range prior to rman_reserve_resource(9) is
decidedly wrong; the caller may be trying to do a wildcard allocation,
for which the implementation is expected to DTRT and clamp the range to
what's actually feasible.

We don't use the resulting translation here anyways, so just remove it
entirely -- the rman in the default implementation is derived from
sc->ranges, so the translation should trivially succeed every time as
long as the reservation succeeded.  If something has gone awry in a
derived driver, we'll detect it when we translate prior to activation,
so there's likely no diagnostic value in retaining the translation after
reservation either.

Reviewed by: andrew
Noticed by: jhb

(cherry picked from commit bd93b5f79ab489fb0ed6ab25d6be48242eb8c028)

20 months agoUse DEFINE_CLASS_0 in the arm generic timer
Andrew Turner [Tue, 20 Sep 2022 16:07:27 +0000 (17:07 +0100)]
Use DEFINE_CLASS_0 in the arm generic timer

Rather than defining the structure manually use the DEFINE_CLASS_0
macro. As we have both an ACPI and FDT attachment we need to use the
_0 variant of the macro as DEFINE_CLASS would create two structures
with the same name.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 42353d81e3a580442a70404a4fcfcbc16c36ef3f)

20 months agoCreate macros for the Arm timer IRQ indexes
Andrew Turner [Wed, 14 Sep 2022 16:29:29 +0000 (17:29 +0100)]
Create macros for the Arm timer IRQ indexes

Rather than hard coding these values use a macro to document which
interrupt is being used.

Reviewed by: emaste
Obtained from: https://github.com/FreeBSD-UPB/freebsd-src (earlier version)
Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation
Sponsored by: University Politehnica of Bucharest
Differential Revision: https://reviews.freebsd.org/D36600

(cherry picked from commit 9526031cd5606fe590ef69224d0db1af1603dcfe)

20 months agoigc: Fix up hw vlan ops
Kevin Bowling [Mon, 10 Oct 2022 23:09:21 +0000 (16:09 -0700)]
igc: Fix up hw vlan ops

Adapt 2796f7cab10785ef40efbba97ef67ab319c96e9c to igc(4)

* Don't reset the entire adapter for vlan changes, fix up the problems
* Remove the VFTA, this hardware doesn't seem to implement it

Approved by: grehan
Differential Revision: https://reviews.freebsd.org/D31979

(cherry picked from commit 2eaef8ec4af1f7576a1444180020e23d2e142107)

20 months agoigc: remove unnecessary PHY ID checks
Mah Yock Gen [Fri, 2 Sep 2022 00:18:28 +0000 (08:18 +0800)]
igc: remove unnecessary PHY ID checks

I225 devices have only one PHY vendor. There is unnecessary to check
_I_PHY_ID during the link establishment and auto-negotiation process,
the checking also caused devices like i225-IT failed. This patch is to
remove the mentioned unnecessary checking.

Cc: stable@dpdk.org
Signed-off-by: Mah Yock Gen <yock.gen.mah@intel.com>
Signed-off-by: Taripin Samuel <samuel.taripin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Approved by: grehan
Differential Revision: https://reviews.freebsd.org/D36923

(cherry picked from commit 29d7f1ff579579711dd5a3325480728b8ed45f8c)

21 months agocontrib/tzdata: import tzdata 2022e
Philip Paeps [Wed, 12 Oct 2022 01:50:03 +0000 (09:50 +0800)]
contrib/tzdata: import tzdata 2022e

Changes: https://github.com/eggert/tz/blob/2022e/NEWS

(cherry picked from commit 5d56371c70d785c222ff086ba8a83b408111acbf)

21 months agoipfilter: Removed unused ioctl typedef
Cy Schubert [Fri, 7 Oct 2022 10:05:53 +0000 (03:05 -0700)]
ipfilter: Removed unused ioctl typedef

Defunct operating systems no longer pollute the ipfilter sources. Remove
their typedefs.

(cherry picked from commit 1fcc50004cebbe3a578f6761936e5d8cd8ee24cd)

21 months agoldd: ignore unverified files
Simon J. Gerraty [Fri, 7 Oct 2022 00:51:28 +0000 (17:51 -0700)]
ldd: ignore unverified files

When mac_veriexec is enforcing, we won't run unverified binaries,
don't let ldd examine them either.

Reviewed by: stevek emaste
MFC after: 1 week
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D36897

(cherry picked from commit f48114b653a2a3d8f817ad68186235595ce304ed)

21 months agonfs_clvnops.c: Fix access to v_mount when vnode unlocked
Rick Macklem [Sat, 1 Oct 2022 14:43:53 +0000 (07:43 -0700)]
nfs_clvnops.c: Fix access to v_mount when vnode unlocked

Commit ab17854f974b fixed access to v_mount when the
vnode is unlocked for nfs_copy_file_range().

This patch does the same for nfs_ioctl().

(cherry picked from commit bffb3d947b2ee48dc30c4876e0c7a5927375e38f)

21 months agoTrack kern.ipc.somaxconn -> kern.ipc.soacceptqueue rename
Jose Luis Duran [Tue, 11 Oct 2022 16:39:26 +0000 (12:39 -0400)]
Track kern.ipc.somaxconn -> kern.ipc.soacceptqueue rename

Fixes: 2bdf61ca29d0 ("Hide the unfortunate named sysctl...")

(cherry picked from commit 9871ae6aa91f82a6932be7fcfa1023b077be8e2e)
(cherry picked from commit f4f6bc636787e110cbea90ca5822cc5209138125)

21 months agoFix an incorrectly placed parenthesis.
Kirk McKusick [Thu, 29 Sep 2022 08:44:34 +0000 (01:44 -0700)]
Fix an incorrectly placed parenthesis.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 221da3e9212d4cc1e370721493922de232fe3918)

21 months agoWhen taking a snapshot on a UFS/FFS filesystem, it must be mounted.
Kirk McKusick [Tue, 27 Sep 2022 15:57:30 +0000 (08:57 -0700)]
When taking a snapshot on a UFS/FFS filesystem, it must be mounted.

PR:           265362
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 27d673fbbb79b1b829484ec127da59b45f623ebd)

21 months agoriscv: handle kernel PTE edge-case in pmap_enter_l2()
Mitchell Horne [Wed, 5 Oct 2022 16:14:36 +0000 (13:14 -0300)]
riscv: handle kernel PTE edge-case in pmap_enter_l2()

Page table pages are never freed from the kernel pmap, instead they are
zeroed when a range is unmapped. This allows future mappings to be
constructed more quickly. Detect this scenario in pmap_enter_l2(), so we
don't fail to create a superpage mapping when the 2MB range is actually
available.

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

(cherry picked from commit 1f9cc5ffc50523498545b6f7d50406feb18903be)

21 months agoriscv: add an assert to pmap_remove_pages()
Mitchell Horne [Thu, 25 Aug 2022 20:08:20 +0000 (17:08 -0300)]
riscv: add an assert to pmap_remove_pages()

Similar checks exist for both arm64 and amd64, but note that for amd64
it is a bare panic().

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

(cherry picked from commit 99fe523778af8cd0db3a17b253adb77a980176be)

21 months agoriscv: handle superpage in pmap_enter_quick_locked()
Mitchell Horne [Wed, 5 Oct 2022 17:11:02 +0000 (14:11 -0300)]
riscv: handle superpage in pmap_enter_quick_locked()

Previously, if pmap_enter_l2() was asked to re-map an existing superpage
(the result of madvise(MADV_WILLNEED) on a mapped range), it could
'fail' to do so, falling back to trying pmap_enter_quick_locked() for
each 4K virtual page. Because this function does not check if the l2
entry it finds is a superpage, it would proceed, sometimes resulting in
the creation of false PV entries.

If the relevant range was later munmap'ed, the system would panic during
the process' exit in pmap_remove_pages(), while attempting to clean up
the PV entries for mappings which no longer exist.

Instead, we should return early in the presence of an existing
superpage, as is done in other pmaps.

PR:             266108
Reviewed by: markj, alc
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36563

(cherry picked from commit 9d1aef84021f4e99d37f4e9149a8799c3d9e5e03)

21 months agoriscv: optimize MADV_WILLNEED on existing superpages
Mitchell Horne [Wed, 5 Oct 2022 17:10:45 +0000 (14:10 -0300)]
riscv: optimize MADV_WILLNEED on existing superpages

Specifically, avoid pointless calls to pmap_enter_quick_locked() when
madvise(MADV_WILLNEED) is applied to an existing superpage mapping.

1d5ebad06c20 made the change for amd64 and arm64.

Reviewed by: markj, alc
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36563

(cherry picked from commit 95b1c27069775dd969cd045888b4ea5aeb53cb7f)

21 months agodhclient-script: cope with /32 address leases
Kristof Provost [Wed, 5 Oct 2022 10:11:07 +0000 (12:11 +0200)]
dhclient-script: cope with /32 address leases

On certain cloud platforms (Google Cloud, Packet.net and others) the
DHCP server offers a /32 address. This makes adding the default route
fail since it is not reachable via any interface. Linux's
dhclient-script seem to usually have a special case for that and
explicitly adds an interface route to the router's address.

FreeBSD's dhclient-script already has a special case for when the router
address is the same as the leased address. Now also add one for when
it's a different address that doesn't fall in the interface's subnet.

PR: 241792
Event: Aberdeen hackathon 2022
Submitted by: sigsys@gmail.com
Reviewed by: dch, kp, bz (+1 on the idea, not reviewed), thj
MFC after: 1 week

(cherry picked from commit fd6ecc184dbc64b9b3f7866b34812fb93df62925)

21 months agoamd64: remove useless addr2 variables in page range invalidation handlers
Konstantin Belousov [Sat, 8 Oct 2022 08:33:11 +0000 (11:33 +0300)]
amd64: remove useless addr2 variables in page range invalidation handlers

(cherry picked from commit 273d0715f6b168ab7be6e79a768d97fbdea81c8d)

21 months agoamd64 pmap: add comment explaining why INVLPG is functional for PCID config
Konstantin Belousov [Mon, 10 Oct 2022 00:19:45 +0000 (03:19 +0300)]
amd64 pmap: add comment explaining why INVLPG is functional for PCID config

(cherry picked from commit e0612ed490c723174607823378d9e883a4b1c257)

21 months agoldd: use direct exec mode unconditionally
Konstantin Belousov [Wed, 21 Sep 2022 13:55:44 +0000 (16:55 +0300)]
ldd: use direct exec mode unconditionally

PR: 127276, 175339, 231926

(cherry picked from commit 9cabef3d146e9a844813b6bc8952d6cf2e9d45e5)

21 months agobhyve: Address -Wno-unused warnings in atkbd.c
Mark Johnston [Thu, 8 Sep 2022 22:48:03 +0000 (18:48 -0400)]
bhyve: Address -Wno-unused warnings in atkbd.c

(cherry picked from commit 57d96d8df99129080a3950bf3f8806d9ebf01a64)

21 months agobhyve: Make smbios tables local to smbiostbl.c
Mark Johnston [Fri, 9 Sep 2022 03:26:47 +0000 (23:26 -0400)]
bhyve: Make smbios tables local to smbiostbl.c

Also flag them as const.

(cherry picked from commit 889cec66d39d60d0a00cd249614924291759fb82)

21 months agobhyve: Address compiler warnings in audio.c
Mark Johnston [Thu, 8 Sep 2022 22:48:53 +0000 (18:48 -0400)]
bhyve: Address compiler warnings in audio.c

- Avoid arithmetic on void pointers.
- Avoid a signed/unsigned comparison in loops which write or fill audio
  data buffers.

Convert while loops to for loops while here.

(cherry picked from commit ee83710bc492c0b2e7d66dd61f45fa657a14d169)

21 months agocam: Provide compatibility for CAMGETPASSTHRU for periph drivers
Mark Johnston [Thu, 29 Sep 2022 17:07:52 +0000 (13:07 -0400)]
cam: Provide compatibility for CAMGETPASSTHRU for periph drivers

The CAM version bump 0x19 -> 0x1a changed the CAMGETPASSTHRU definition,
so applications using the old ioctl are broken.  However, that version
change did not affect anything relating to the ioctl implementation for
periphs.

Fixes: 8f9be1eed11c ("cam(4): Improve XPT_DEV_MATCH")
PR: 264709
Tested by: andreas.mahling@googlemail.com
Reviewed by: imp

(cherry picked from commit 0cd631ee0693dd7337c38b251044e018aad6fbaf)

21 months agoriscv: Handle invalid L2 entries in pmap_extract()
Mark Johnston [Thu, 29 Sep 2022 17:07:26 +0000 (13:07 -0400)]
riscv: Handle invalid L2 entries in pmap_extract()

While here, eliminate a single-use local variable.

PR: 266103
Reviewed by: mhorne

(cherry picked from commit ec21f85ab5f03a803884cc7bafa88621c613f4ca)

21 months agousb(4): Make the enumeration thread nice time a variable.
Hans Petter Selasky [Fri, 7 Oct 2022 11:28:38 +0000 (13:28 +0200)]
usb(4): Make the enumeration thread nice time a variable.

Depends on "options USB_DEBUG".

Suggested by: koobs@
Sponsored by: NVIDIA Networking

(cherry picked from commit 8758aabb169d98f08c20f2a1fce5184434b1ddf6)

21 months agousb(4): Make sure the enumeration thread doesn't loop too fast.
Hans Petter Selasky [Thu, 9 Jun 2022 13:15:49 +0000 (15:15 +0200)]
usb(4): Make sure the enumeration thread doesn't loop too fast.

Sponsored by: NVIDIA Networking

(cherry picked from commit 55a3bd000d9799f431c207e359466484ac63c137)

21 months agolibusb(3): Implement libusb_interrupt_event_handler() by exposing existing function.
Hans Petter Selasky [Sun, 2 Oct 2022 15:30:40 +0000 (17:30 +0200)]
libusb(3): Implement libusb_interrupt_event_handler() by exposing existing function.

Sponsored by: NVIDIA Networking

(cherry picked from commit aa87aa52326be7b726664dba65e91ec3d8160f48)

21 months agovt(4): Use define instead of numerical value.
Hans Petter Selasky [Wed, 5 Oct 2022 09:50:42 +0000 (11:50 +0200)]
vt(4): Use define instead of numerical value.

No functional change intended.

Sponsored by: NVIDIA Networking

(cherry picked from commit 18a44589fcdc9833b3756854c2db4b68e750d7d7)

21 months agovt(4): Clear paste buffer after pasting.
Ivan Quitschal [Wed, 5 Oct 2022 08:37:08 +0000 (10:37 +0200)]
vt(4): Clear paste buffer after pasting.

Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D36042

(cherry picked from commit d2d30464365ebaa9f4b04371f947fcffcc3975e1)