]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 months agokboot: Better default boot device
Warner Losh [Thu, 2 Mar 2023 17:55:06 +0000 (10:55 -0700)]
kboot: Better default boot device

Provide a better message when we can't find a boot device.

Sponsored by: Netflix

16 months agokboot: Hack for running on FreeBSD host
Warner Losh [Thu, 2 Mar 2023 17:31:05 +0000 (10:31 -0700)]
kboot: Hack for running on FreeBSD host

When we're running on a FreeBSD host, we can't open /proc/iomem.  So,
for now, just assume that we have 32GB of ram starting at 4GB.

Sponsored by: Netflix

16 months agomoused: Fix typos
Elyes Haouas [Fri, 24 Feb 2023 06:53:51 +0000 (07:53 +0100)]
moused: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
16 months agoftgpio: Fix panic at attach and use better device description
Stéphane Rochoy [Thu, 2 Mar 2023 15:16:35 +0000 (08:16 -0700)]
ftgpio: Fix panic at attach and use better device description

Use ftgpio_group_get_status instead of inlining an imperfect
version of it to get correct register and avoid
panic: ftgpio_group_get_ioreg: invalid register 0 for group 0

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/677

16 months agoyp_mkdb: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:07 +0000 (07:59 -0700)]
yp_mkdb: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agousbconfig: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:07 +0000 (07:59 -0700)]
usbconfig: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agorrenumd: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:07 +0000 (07:59 -0700)]
rrenumd: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agorpcbind: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:07 +0000 (07:59 -0700)]
rpcbind: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agorpc.yppasswdd: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:07 +0000 (07:59 -0700)]
rpc.yppasswdd: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agopmcstat: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:07 +0000 (07:59 -0700)]
pmcstat: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agolpr: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:07 +0000 (07:59 -0700)]
lpr: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agoextattr: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:06 +0000 (07:59 -0700)]
extattr: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agodiskinfo: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:06 +0000 (07:59 -0700)]
diskinfo: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agodconschat: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:06 +0000 (07:59 -0700)]
dconschat: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agobluetooth/hccontrol: Remove useless return at the end of void function
Elyes Haouas [Thu, 2 Mar 2023 14:59:06 +0000 (07:59 -0700)]
bluetooth/hccontrol: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656

16 months agouuidgen(1): back to the past and fix typo
Baptiste Daroussin [Thu, 2 Mar 2023 08:35:30 +0000 (09:35 +0100)]
uuidgen(1): back to the past and fix typo

Reported by: ceri

16 months agodaemon: more human-friendly variable names
Ihor Antonov [Thu, 2 Mar 2023 03:00:43 +0000 (21:00 -0600)]
daemon: more human-friendly variable names

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agodaemon: move syslog facility and syslog tag into log_params
Ihor Antonov [Thu, 2 Mar 2023 03:00:42 +0000 (21:00 -0600)]
daemon: move syslog facility and syslog tag into log_params

Since struct log_params already contains logging-related
varaiables, including syslog-related, move remaining
syslog-related variables into struct log_params as well

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agodaemon: deduplicate log_params varaibles
Ihor Antonov [Thu, 2 Mar 2023 03:00:42 +0000 (21:00 -0600)]
daemon: deduplicate log_params varaibles

While we're here, sort log_params by size.

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agodaemon: make log_reopen variable a bool
Ihor Antonov [Thu, 2 Mar 2023 03:00:42 +0000 (21:00 -0600)]
daemon: make log_reopen variable a bool

Following style(9) and C99 recommendation use bool instead of
int for boolean operations.

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agodaemon: make dosyslog variable a bool and give it a better name
Ihor Antonov [Thu, 2 Mar 2023 03:00:42 +0000 (21:00 -0600)]
daemon: make dosyslog variable a bool and give it a better name

Following style(9) and C99 recommendation use bool instead of
int for boolean operations. Also give the variable a more descriptive
name that follows boolean naming convention.

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agodaemon: add supervision_enabled var
Ihor Antonov [Thu, 2 Mar 2023 03:00:42 +0000 (21:00 -0600)]
daemon: add supervision_enabled var

explicitly name a bunch of boolean checks that enable
supervison mode and improve comments

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agodaemon: initialize struct sigaction at declaration site
Ihor Antonov [Thu, 2 Mar 2023 03:00:42 +0000 (21:00 -0600)]
daemon: initialize struct sigaction at declaration site

This improves readability by uncluttering the code

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agodaemon: fix double init of pid variable
Ihor Antonov [Thu, 2 Mar 2023 03:00:42 +0000 (21:00 -0600)]
daemon: fix double init of pid variable

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agodaemon: initialize mask_orig with sigemptyset()
Ihor Antonov [Thu, 2 Mar 2023 03:00:41 +0000 (21:00 -0600)]
daemon: initialize mask_orig with sigemptyset()

consolidation of variable declarations and initializations in previous
commit allowed me to detect that one of the signal masks is not properly
initialized with sigemptyset (as man 3 sigsetops demands)

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agodaemon: consolidate variable declarations and initializaions
Ihor Antonov [Thu, 2 Mar 2023 03:00:41 +0000 (21:00 -0600)]
daemon: consolidate variable declarations and initializaions

- improve readability by breaking apart single-line multi-variable declarations
- initialize simple variables at declaration site
- move other top-level variable initializations closer declarations
  to avoid potential UB and unclutter the use-site.

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agodaemon: use braces with 'if' consistently
Ihor Antonov [Thu, 2 Mar 2023 03:00:41 +0000 (21:00 -0600)]
daemon: use braces with 'if' consistently

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/669

16 months agofreebsd-update: re-edit files if merge conflict markers remain
Ed Maste [Wed, 14 Dec 2022 17:34:59 +0000 (12:34 -0500)]
freebsd-update: re-edit files if merge conflict markers remain

freebsd-update will open ${EDITOR} if conflicts occur while merging
updates to config files.  Inform the user if they've left conflict
markers behind, and go back to editing the file.

PR: 185546
PR: 229689
Reviewed by: delphij
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37703

16 months agotools/build: Hide spurious errors if sys/stat.h does not exist
Ed Maste [Fri, 24 Feb 2023 14:43:57 +0000 (09:43 -0500)]
tools/build: Hide spurious errors if sys/stat.h does not exist

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38757

16 months agoFix typo: messages missing an 'a'.
Warner Losh [Wed, 1 Mar 2023 23:34:43 +0000 (16:34 -0700)]
Fix typo: messages missing an 'a'.

16 months agosvc_rpcsec_gss.c: Separate out the non-vnet initialization
Rick Macklem [Wed, 1 Mar 2023 23:29:25 +0000 (15:29 -0800)]
svc_rpcsec_gss.c: Separate out the non-vnet initialization

Without this patch, a single initialization function was
used to initialize both the vnet'd and non-vnet'd data.
This patch separates out the non-vnet'd initializations
into a separate function invoked by SYSINIT().
This avoids use of IS_DEFAULT_VNET() in the initialization
functions and also configures the non-vnet'd initialization
function to be called first, although ordering is not
currently needed.

Reviewed by: glebius
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D38749

16 months agonfs_fha_new: Fix nfs_fha_new so that sysctls work in prisons
Rick Macklem [Wed, 1 Mar 2023 23:25:35 +0000 (15:25 -0800)]
nfs_fha_new: Fix nfs_fha_new so that sysctls work in prisons

The sysctls were in "struct fha_params", making it impractical
to vnet them.  This patch moves the sysctls out of "struct fha_params"
and vnet's them, so that they are available in vnet prisons
running nfsd(8).  It also avoids the IS_DEFAULT_VNET() macros
in the VNET_SYSINIT() function.

Reviewed by: glebius
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D38748

16 months agotesting: skip tarfs tests if module is not loadable.
Olivier Cochard [Wed, 1 Mar 2023 20:26:54 +0000 (21:26 +0100)]
testing: skip tarfs tests if module is not loadable.

Approved by: asomers
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D38828

16 months agosysctl: tests: fix a couple issues
Kyle Evans [Wed, 1 Mar 2023 20:35:52 +0000 (14:35 -0600)]
sysctl: tests: fix a couple issues

The function that sets test case metadata is actually named ${tc}_head
rather than ${tc}, so add the suffix.

While we're here, hook the tests up to the infrastructure so that they
do get run.

Sponsored by: Klara, Inc.

16 months agonvram2env: Remove MIPS-specific support.
John Baldwin [Wed, 1 Mar 2023 18:54:08 +0000 (10:54 -0800)]
nvram2env: Remove MIPS-specific support.

16 months agousb: Trim another MIPS reference.
John Baldwin [Wed, 1 Mar 2023 18:51:27 +0000 (10:51 -0800)]
usb: Trim another MIPS reference.

Fix a nearby whitespace nit while here.

16 months agog_part_ebr: always create "compat" aliases
Ed Maste [Mon, 27 Feb 2023 19:13:09 +0000 (14:13 -0500)]
g_part_ebr: always create "compat" aliases

The "canonical" EBR partition names like `ada0s4+00002081` are not
particularly meaningful.  The "compat" aliases share the same namespace
as the parent MBR, resulting in user-friendly names like `ada0s6`.
These names are consistent with the way Linux names EBR partitions.

We previously provided a sysctl kern.features.geom_part_ebr_compat
(enabled by default) to control the "compat" names.  Remove the sysctl
and always create the aliases.

Relnotes: yes
Reviewed by: cem, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38812

16 months agosys/modules: Make use of SRCS.${KERN_OPT}.
John Baldwin [Wed, 1 Mar 2023 18:32:30 +0000 (10:32 -0800)]
sys/modules: Make use of SRCS.${KERN_OPT}.

kmod.mk appends the value of SRCS.${KERN_OPT} for each defined kernel
option to SRCS.  This helper is shorter than appending to SRCS under
explicit checks on KERN_OPTS.

Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38738

16 months agosys/modules: fix bogus OPT_ACPI tests
Nathaniel Wesley Filardo [Wed, 1 Mar 2023 18:32:08 +0000 (10:32 -0800)]
sys/modules: fix bogus OPT_ACPI tests

ACPI is not handled specially by sys/conf/kern.opts.mk (unlike a few
options), so we should fall back on the generic behavior of
sys/conf/config.mk, which pulls from all the generated opt*.h files,
including opt_acpi.h, which will cause DEV_ACPI to be included in
KERN_OPTS.  Then the generic machinery in sys/conf/kmod.mk will cause
SRCS.DEV_ACPI to be included in SRCS when appropriate.

Reviewed by: jhb, imp
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D38737

16 months agohwpmc: Don't wrap entire files in #ifdef DEV_ACPI.
John Baldwin [Wed, 1 Mar 2023 18:31:53 +0000 (10:31 -0800)]
hwpmc: Don't wrap entire files in #ifdef DEV_ACPI.

A subsequent commit will instead use existing infrastructure to
exclude the files from hwpmc.ko for non-ACPI builds.  Note that the
original commit left the files as optional in sys/conf/files.arm64.

This reverts commit 751d88119fdc1dff71d1390c7768942a9b857bc6.

Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38736

16 months agomachine-id: generate a compact version of the uuid
Baptiste Daroussin [Tue, 28 Feb 2023 10:31:06 +0000 (11:31 +0100)]
machine-id: generate a compact version of the uuid

dbus and other actually expect an uuid without hyphens

Reported by: tijl
MFC After: 3 days

16 months agouuidgen: add -c for compact uuid
Baptiste Daroussin [Tue, 28 Feb 2023 10:29:51 +0000 (11:29 +0100)]
uuidgen: add -c for compact uuid

It generates the uuid string but without the hyphen

MFC After: 3 days
Reviews by: tcberner
Differential Revision: https://reviews.freebsd.org/D38820

16 months agobhyve: Remove useless return at the end of void function
Elyes Haouas [Thu, 23 Feb 2023 06:36:13 +0000 (07:36 +0100)]
bhyve: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
16 months agobhyve: remove redundant variable
Vitaliy Gusev [Wed, 1 Mar 2023 07:45:46 +0000 (07:45 +0000)]
bhyve: remove redundant variable

Reviewed by:    corvink,markj
Sponsored by:   vStack
Differential Revision: https://reviews.freebsd.org/D38836

16 months agofreebsd-update: avoid effects of user's environment on grep
Ed Maste [Wed, 14 Dec 2022 17:13:19 +0000 (12:13 -0500)]
freebsd-update: avoid effects of user's environment on grep

A user had GREP_OPTIONS containing --color=always, which broke grep use
in freebsd-update.  Unset this environment variable.

PR: 255990
Reviewed by: kevans
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

16 months agobc: remove MIPS Makefile case
Ed Maste [Mon, 27 Feb 2023 15:05:16 +0000 (10:05 -0500)]
bc: remove MIPS Makefile case

MIPS support has been removed from FreeBSD.

Sponsored by: The FreeBSD Foundation

16 months agonetlink: add userland name mappings to all NETLINK_ROUTE messages.
Alexander V. Chernikov [Wed, 1 Mar 2023 15:22:21 +0000 (15:22 +0000)]
netlink: add userland name mappings to all NETLINK_ROUTE messages.

MFC after: 1 day

16 months agobuf: Make buf_daemon_shutdown() a no-op after a panic
Mark Johnston [Wed, 1 Mar 2023 15:07:56 +0000 (10:07 -0500)]
buf: Make buf_daemon_shutdown() a no-op after a panic

As in commit 9d7cc536e261a7, there is no need to do anything in this
context.

MFC after: 1 week

16 months agopf tests: test pfsync over IPSec
Kristof Provost [Wed, 1 Mar 2023 13:02:15 +0000 (14:02 +0100)]
pf tests: test pfsync over IPSec

Test that we can transport pfsync (unicast) over IPSec.

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

16 months agothunderx: fix potential sign extension issue
Ed Maste [Tue, 28 Feb 2023 19:17:30 +0000 (14:17 -0500)]
thunderx: fix potential sign extension issue

Coverity reported a sign extension issue on rq->caching << 26 in the
Linux ThunderX driver.  (It appears Coverity Scan doesn't build arm64
objects in FreeBSD.)

As done in Linux, add a cast.

Fixes: 3c0086b81391 ("Raw import of ThunderX VNIC networking driver...")
Sponsored by: The FreeBSD Foundation

16 months agoarm64: Shave off two instructions in exceptions
Dapeng Gao [Wed, 1 Mar 2023 14:28:53 +0000 (14:28 +0000)]
arm64: Shave off two instructions in exceptions

This patch shaves off up to two three instructions in
save_registers_head in exception.S for arm64, which would make more
space for instructions that could be added in CheriBSD.

This is done by:
 1. Combining pointer arithmetic with pre-incrementing STP instructions
 2. Removing the instruction that sets the frame pointer (x29) as its
    content is unused

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

16 months agossh: default VerifyHostKeyDNS to no, following upstream
Ed Maste [Fri, 17 Feb 2023 01:26:41 +0000 (20:26 -0500)]
ssh: default VerifyHostKeyDNS to no, following upstream

Revert to upstream's default.  Using VerifyHostKeyDNS may depend on a
trusted nameserver and network path.

This reverts commit 83c6a5242c80160fff76fb85454938761645b0c4.

Reported by: David Leadbeater, G-Research
Reviewed by: gordon
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38648

16 months agou3g(4): Add device ID for the Quectel EM160R
Allan Jude [Wed, 1 Mar 2023 14:01:19 +0000 (14:01 +0000)]
u3g(4): Add device ID for the Quectel EM160R

Also add the EM160R to the man page, noting the work-around
required to make it function properly in PPP mode.

MFC-After: 1 week
Sponsored by: Metify Inc.
Sponsored by: Klara Inc.

16 months agofb: whack __mips__ leftovers
Mateusz Guzik [Wed, 1 Mar 2023 11:40:38 +0000 (11:40 +0000)]
fb: whack __mips__ leftovers

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

16 months agosyscons: whack __mips__ leftovers
Mateusz Guzik [Wed, 1 Mar 2023 11:11:46 +0000 (11:11 +0000)]
syscons: whack __mips__ leftovers

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

16 months agomips: whack __mips__ leftover
Mateusz Guzik [Wed, 1 Mar 2023 11:09:48 +0000 (11:09 +0000)]
mips: whack __mips__ leftover

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

16 months agodtrace: whack __mips__ from dtraceall
Mateusz Guzik [Wed, 1 Mar 2023 11:08:52 +0000 (11:08 +0000)]
dtrace: whack __mips__ from dtraceall

Note contrib code is not modified.

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

16 months agonet: whack __mips__ leftovers
Mateusz Guzik [Wed, 1 Mar 2023 11:07:32 +0000 (11:07 +0000)]
net: whack __mips__ leftovers

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

16 months agokern: whack __mips__ leftover
Mateusz Guzik [Wed, 1 Mar 2023 11:05:12 +0000 (11:05 +0000)]
kern: whack __mips__ leftover

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

16 months agoif_ovpn tests: skip the if_ovpn_c test if if_ovpn.ko isn't loaded
Kristof Provost [Tue, 28 Feb 2023 10:14:24 +0000 (11:14 +0100)]
if_ovpn tests: skip the if_ovpn_c test if if_ovpn.ko isn't loaded

Skip the test (rather than loading it) if if_ovpn.ko isn't loaded. Match
the behaviour of other tests.

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

16 months agoefifb: add a tunable to select the framebuffer cache attribute
Kyle Evans [Wed, 1 Mar 2023 06:04:49 +0000 (00:04 -0600)]
efifb: add a tunable to select the framebuffer cache attribute

Mapping the framebuffer with WC (Write Combined) memory type can, in
practice, cause some memory transactions to be rate-limited at a
fraction of the fb write rate.  WC allows one core to queue up many
globally visible write transactions, and in the process some unrelated
transactions may end up having to wait for all of the queued up PCI
writes to be flushed.

Add an hw.efifb.cache_attr tunable to allow mapping the framebuffer as
uncacheable instead.  We should likely be taking a more careful approach
of checking the memory map to determine which cacheability attributes
are feasible, but the knob lets us use our historically functional
behavior while offering a convenient way to switch on a stock kernel.

The only valid values for hw.efifb.cache_attr at this time are "uc" and
"wc".

Original patch by Marc De La Gueronniere <mdelagueronniere@verisign.com>
along with previous testing.

Reviewed by: imp
MFC after: 1 week
Sponsored by: Verisign, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D17884

16 months agoi18n: csmapper: hook up the top-level .src files to the build
Kyle Evans [Wed, 1 Mar 2023 04:24:54 +0000 (22:24 -0600)]
i18n: csmapper: hook up the top-level .src files to the build

The top-level charset.pivot.src may be empty, but the top-level
mapper.dir.src is not -- it contains some definitions for supplementary
UCS planes.  The SMP/SSP definitions aren't actually used at the moment,
but the inclusion of the SIP definitions fixes conversions involving
JISX0213-1/JISX0213-2 to be possible.

Sponsored by: Klara, Inc.

16 months agousb: dwc3: implement hw.usb.xhci.use_polling
Kyle Evans [Tue, 28 Feb 2023 01:59:43 +0000 (19:59 -0600)]
usb: dwc3: implement hw.usb.xhci.use_polling

Polling is currently only implemented in the xhci pci attachment.
Adding it to dwc3 doesn't make it much uglier, and supporting it can be
useful for confirming that hardware's otherwise functional when
interrupts are apparently not firing.

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

16 months agoarm64: set FPEN if we're stuck with HCR_EL2.E2H
Kyle Evans [Fri, 24 Feb 2023 19:37:20 +0000 (13:37 -0600)]
arm64: set FPEN if we're stuck with HCR_EL2.E2H

On Apple Silicon systems, E2H can't actually be cleared; we're stuck
with it.  Check it again when we're setting up CPTR_EL2 and set FPEN
appropriately to avoid later trapping to EL2 on writes to SIMD
registers.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D38819

16 months agoAdd deprecation notice to the gbde(8) program, scheduled to be removed in FreeBSD...
Poul-Henning Kamp [Tue, 28 Feb 2023 21:39:06 +0000 (21:39 +0000)]
Add deprecation notice to the gbde(8) program, scheduled to be removed in FreeBSD 15.0.

16 months agonetinet: Remove the IP(V6)_RSS_LISTEN_BUCKET socket option
Mark Johnston [Tue, 28 Feb 2023 20:57:21 +0000 (15:57 -0500)]
netinet: Remove the IP(V6)_RSS_LISTEN_BUCKET socket option

It has no effect, and an exp-run revealed that it is not in use.

PR: 261398 (exp-run)
Reviewed by: mjg, glebius
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38822

16 months agolibrss: Remove rss_socket_set_rss_bucket()
Mark Johnston [Tue, 28 Feb 2023 20:57:11 +0000 (15:57 -0500)]
librss: Remove rss_socket_set_rss_bucket()

In preparation for the removal of the IP_RSS_LISTEN_BUCKET socket
option.

PR: 261398 (exp-run)
Reviewed by: glebius
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38821

16 months agotcp: Make TCP PCAP buffer properly configurable.
Richard Scheffenegger [Tue, 28 Feb 2023 18:57:30 +0000 (19:57 +0100)]
tcp: Make TCP PCAP buffer properly configurable.

Reviewed By: tuexen, cc, #transport
MFC after: 3 days
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D38824

16 months agoMAINTAINERS+GitHub: Reflect ipfilter was moved from contrib to netpfil
Cy Schubert [Tue, 28 Feb 2023 15:42:47 +0000 (07:42 -0800)]
MAINTAINERS+GitHub: Reflect ipfilter was moved from contrib to netpfil

Reflect the fact that ipfilter was moved from contrib to netpfil
on December 20, 2021 by 3b9b51fe464e. And that ipfilter userland
was moved from contrib to sbin/ipf by 41edb306f056 that same day.

16 months agogithub: Create pull request template
Warner Losh [Tue, 28 Feb 2023 18:23:53 +0000 (11:23 -0700)]
github: Create pull request template

Just to see how this looks. Will likely need to iterate.

16 months agosuperio,ftgpio: Add support for Fintek F81865 GPIO
Stéphane Rochoy [Tue, 28 Feb 2023 17:16:46 +0000 (10:16 -0700)]
superio,ftgpio: Add support for Fintek F81865 GPIO

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/674
Differential Revision: https://reviews.freebsd.org/D37893

16 months ago310.accounting: Verify process accounting is active before log rotation.
John Grafton [Tue, 28 Feb 2023 16:49:40 +0000 (09:49 -0700)]
310.accounting: Verify process accounting is active before log rotation.

This corrects a bug in which the daily periodic script '310.accounting'
attempts to rotate logs via /etc/rc.d/accounting by calling
onerotate_logs function. The rotate logs function turns accounting back
on regardless of what acccounting_enable is set to in /etc/rc.conf. This
is due to checkyesno always returning YES since rotate logs is called
with the 'one' prefix.

In effect, accounting will always be turned back on once a day even if
it is disabled and stopped by hand. The fix was simple, just check if
accounting is before rotating logs and if it is, don't attempt the
rotate.

PR: 267464
Reviewed by: imp, hps (lgtm, not approval), Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/648
Differential Revision: https://reviews.freebsd.org/D37434

16 months agoiflib: fix regression with new pfil(9) KPI
Gleb Smirnoff [Tue, 28 Feb 2023 16:56:20 +0000 (08:56 -0800)]
iflib: fix regression with new pfil(9) KPI

Do not pass the pointer to our valid mbuf to pfil(9).  Pass an
uninitialized one only.  This was unsafe with the old KPI, too,
but for some reason didn't fail.

Fixes: caf32b260ad46b17a4c1a8ce6383e37ac489f023

16 months agorc.conf(5): Style issues
Warner Losh [Tue, 28 Feb 2023 16:28:30 +0000 (09:28 -0700)]
rc.conf(5): Style issues

Fix mandoc -Tlint style issues
* Use Pa instead of Va for .conf element (mdoc warned the Va was unused, and its the
  wrong markup anyway)
* Drop useless Va and use Va instead of Ar when referring to variables in the jail file
* One sentence, one line
* drop xr to info(1). That makes no sense, and intro(1) seems unhelpful.

This leaves two warnings: gdb(1) xref not found (but we add a
parenthetical about the package) and a false positive about
a trailing period that is being mistaken for a 'full stop'
when it is really just a character in a filename.

Sponsored by: Netflix

16 months agorc.conf(5): document nscd_enable
Tom Hukins [Tue, 28 Feb 2023 16:18:06 +0000 (09:18 -0700)]
rc.conf(5): document nscd_enable

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/650

16 months agorc.conf(5): describe what unbound(8) does
Tom Hukins [Tue, 28 Feb 2023 16:18:06 +0000 (09:18 -0700)]
rc.conf(5): describe what unbound(8) does

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/650

16 months agodtrace_kinst.4: Demonstrate usage of the "regs" variable
Mark Johnston [Tue, 28 Feb 2023 16:09:26 +0000 (11:09 -0500)]
dtrace_kinst.4: Demonstrate usage of the "regs" variable

Suggested by: Mina Galić <freebsd@igalic.co>
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D38823

16 months agogrowfs_fstab startup script: set dumpdev to AUTO
Mike Karels [Tue, 28 Feb 2023 13:55:35 +0000 (07:55 -0600)]
growfs_fstab startup script: set dumpdev to AUTO

The growfs_fstab script has been testing dumpdev, and if it is AUTO,
enables dumps on the newly-added swap device for the initial boot.
However, dumpdev defaults to AUTO on main, but NO on stable/13 and
release branches.  On the other hand, bsdinstall adds dumpdev="AUTO"
by default (controlled by a menu item).  bsdinstall is not used when
booting an SD card or other disk image.  Adopt the default from
bsdinstall, and set dumpdev to AUTO in /etc/rc.conf in the
growfs_fstab script if a swap partition has been added, along with
the explanatory comment added by bsdinstall.

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

16 months agousb: Add HID_IGNORE quirk for APC Smart-UPS1000
Cy Schubert [Wed, 22 Feb 2023 02:38:16 +0000 (18:38 -0800)]
usb: Add HID_IGNORE quirk for APC Smart-UPS1000

Without the HID_IGNORE quirk enabled it will appear to be a uhid device.

PR: 269729
MFC after: 1 week

16 months agousbdevs: Add APC Smart-UPS1000
Cy Schubert [Tue, 21 Feb 2023 21:10:35 +0000 (13:10 -0800)]
usbdevs: Add APC Smart-UPS1000

MFC after: 1 week

16 months agousbdevs: Remove duplicate APC entries
Cy Schubert [Tue, 21 Feb 2023 21:08:08 +0000 (13:08 -0800)]
usbdevs: Remove duplicate APC entries

MFC after: 1 week

16 months agosqlite3: Vendor import of sqlite3 3.41.0
Cy Schubert [Tue, 28 Feb 2023 13:28:07 +0000 (05:28 -0800)]
sqlite3: Vendor import of sqlite3 3.41.0

Release notes at https://www.sqlite.org/releaselog/3_41_0.html.

Obtained from:  https://www.sqlite.org/2023/sqlite-autoconf-3410000.tar.gz
MFC after: 2 weeks

Merge commit '615bd3eb2a2225e83e14d5b2a82649430889483c' into temp_merge

16 months agobhyve: fix resume for vms with guest_ncpus > 1
Vitaliy Gusev [Tue, 28 Feb 2023 10:28:40 +0000 (11:28 +0100)]
bhyve: fix resume for vms with guest_ncpus > 1

This error occurs because vm->vcpu[1] has not been allocated yet when
vm_snapshot_vm() is called.

To fix this, move spinup_vcpu() before restore code.

Reviewed by: corvink, markj
MFC after: 2 weeks
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D38477

16 months agobhyve: fix restore of kernel structs
Vitaliy Gusev [Tue, 28 Feb 2023 10:32:49 +0000 (11:32 +0100)]
bhyve: fix restore of kernel structs

vmx_snapshot() and svm_snapshot() do not save any data and error occurs at
resume:

Restoring kernel structs...
vm_restore_kern_struct: Kernel struct size was 0 for: vmx
Failed to restore kernel structs.

Reviewed by: corvink, markj
Fixes: 39ec056e6dbd89e26ee21d2928dbd37335de0ebc ("vmm: Rework snapshotting of CPU-specific per-vCPU data.")
MFC after: 2 weeks
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D38476

16 months agovmm: fix restore of TSC offset
Vitaliy Gusev [Tue, 28 Feb 2023 11:16:35 +0000 (12:16 +0100)]
vmm: fix restore of TSC offset

After suspend/resume Ubuntu 20.04 and 22.04 installer can hang if
tsc-early clocksource has a big skew.

Reviewed by: corvink, jhb
Fixes: a7db532e3a6f83067b342f569b56076d011f8a1e ("vmm: Simplify saving of absolute TSC values in snapshots.")
MFC after: 2 weeks
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D38474

16 months agobhyve: add common fwcfg items
Corvin Köhne [Wed, 11 Aug 2021 08:02:57 +0000 (10:02 +0200)]
bhyve: add common fwcfg items

Qemu defines some common fwcfg items. We don't need to support all of
them. Only a subset needs to be present for fwcfg to work properly.

- signature
  The signature is used by the guest to check if qemu's fwcfg is
  available or not.
- id
  The id is used by the guest to check which features are supported by
  the fwcfg implementation of the hypervisor.
- file_dir
  The file dir reports all fwcfg items which don't have a fixed index.
  These are mostly user defined fwcfg items.

Reviewed by: <If someone else reviewed your modification.>
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38335

16 months agobhyve: add helper to add fwcfg items
Corvin Köhne [Wed, 11 Aug 2021 08:01:19 +0000 (10:01 +0200)]
bhyve: add helper to add fwcfg items

This helper makes it easier to add multiple fwcfg items. You can pass an
index and some data to the helper. The helper adds these information to
the fwcfg emulation so that the guest reads the given data on the
specified index.

Reviewed by: <If someone else reviewed your modification.>
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38334

16 months agojail: Improve readability
Zhenlei Huang [Tue, 28 Feb 2023 10:14:07 +0000 (18:14 +0800)]
jail: Improve readability

No functional change intended.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D37890

16 months agojail: Use flexible array member within struct prison_ip
Zhenlei Huang [Tue, 28 Feb 2023 10:01:33 +0000 (18:01 +0800)]
jail: Use flexible array member within struct prison_ip

Current implementation utilize off-by-one struct prison_ip to access the
IPv[46] addresses. It is error prone and hence comes the regression fix
21ad3e27fabc and ddbf879d79d4. Use flexible array member so that compiler
will catch such errors and it will also be easier to review.

No functional change intended.

Reviewed by: melifaro, glebius
Differential Revision: https://reviews.freebsd.org/D37874

16 months agoperiodic: switch lockf to silent operation.
Alexander Leidinger [Tue, 28 Feb 2023 08:38:42 +0000 (09:38 +0100)]
periodic: switch lockf to silent operation.

This fixes duplicate mails (one from cron, one from periodic)
when a periodic run is not finished bfore the next one starts.

The man page states that the intended use case is cron, and
the error handling of the lockf invocation handles this case
explicitely, as such no error message for the "interactive"
use was considered.

16 months agoCONTRIBUTING.md: correct developer certificate of origin link markup
Ed Maste [Tue, 28 Feb 2023 02:34:49 +0000 (21:34 -0500)]
CONTRIBUTING.md: correct developer certificate of origin link markup

Sponsored by: The FreeBSD Foundation

16 months agoCONTRIBUTING.md: Suggest PR and Differential Revision lines
Warner Losh [Tue, 28 Feb 2023 00:19:25 +0000 (17:19 -0700)]
CONTRIBUTING.md: Suggest PR and Differential Revision lines

When there's an open PR and/or a Differential Revision, people
evaluating the pull request will want to look at them. Suggest that the
submitter include this information to make it easier to process.

Sponsored by: Netflix

16 months agoCONTRIBUTING.md: Add in for github pull requests
Warner Losh [Sat, 25 Feb 2023 15:24:00 +0000 (08:24 -0700)]
CONTRIBUTING.md: Add in for github pull requests

Create a slightly longer version of the inforamtion available in the
handbook in the file that Github displays for more information about
contributing.

Sponsored by: Netflix

16 months agosqlite3: Vendor import of sqlite3 3.41.0
Cy Schubert [Mon, 27 Feb 2023 23:41:54 +0000 (15:41 -0800)]
sqlite3: Vendor import of sqlite3 3.41.0

Release notes at https://www.sqlite.org/releaselog/3_41_0.html.

Obtained from:  https://www.sqlite.org/2023/sqlite-autoconf-3410000.tar.gz

16 months agostand: Minor cleanup
Alfonso [Mon, 27 Feb 2023 23:19:54 +0000 (16:19 -0700)]
stand: Minor cleanup

Replace a cast '0' for a null pointers with NULL
Replace a 'goto loop' with a do-while loop in ufs and ext2fs.
Cast cp pointer to uintptr_t to test to see if it's aligned rather than long.

[ minor tweaks based on my & hps' review, reworded commit message ]
Reviewed by: imp, hps
Pull Request: https://github.com/freebsd/freebsd-src/pull/547

16 months agoreport full error string on SSL_connect() failure
Vladimir Kotal [Mon, 27 Feb 2023 23:07:27 +0000 (16:07 -0700)]
report full error string on SSL_connect() failure

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/575

16 months agoif_re: Generate an address if there is none in the EEPROM
Evgeni Golov [Mon, 27 Feb 2023 22:50:56 +0000 (15:50 -0700)]
if_re: Generate an address if there is none in the EEPROM

There exists hardware that has no ethernet address burned into
the EEPROM. Loading if_re on such a HW brings the device up
with '00:00:00:00:00:00' as the address, and that doesn't get
you too far in a real network.

PR: 262406
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/670
Signed-off-by: Evgeni Golov <evgeni@debian.org>
Differential Revision: https://reviews.freebsd.org/D34485

16 months agopps: Round to closest integer in pps_event()
Sebastian Huber [Mon, 27 Feb 2023 21:49:10 +0000 (14:49 -0700)]
pps: Round to closest integer in pps_event()

The comment above bintime2timespec() says:

  When converting between timestamps on parallel timescales of differing
  resolutions it is historical and scientific practice to round down.

However, the delta_nsec value is a time difference and not a timestamp.  Also
the rounding errors accumulate in the frequency accumulator, see hardpps().
So, rounding to the closest integer is probably slightly better.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604

16 months agopps: Simplify the nsec calculation in pps_event()
Sebastian Huber [Mon, 27 Feb 2023 21:49:09 +0000 (14:49 -0700)]
pps: Simplify the nsec calculation in pps_event()

Let A be the current calculation of the frequency accumulator (pps_fcount)
update in pps_event()

  scale = (uint64_t)1 << 63;
  scale /= captc->tc_frequency;
  scale *= 2;
  bt.sec = 0;
  bt.frac = 0;
  bintime_addx(&bt, scale * tcount);
  bintime2timespec(&bt, &ts);
  hardpps(tsp, ts.tv_nsec + 1000000000 * ts.tv_sec);

and hardpps(..., delta_nsec):

  u_nsec = delta_nsec;
  if (u_nsec > (NANOSECOND >> 1))
          u_nsec -= NANOSECOND;
  else if (u_nsec < -(NANOSECOND >> 1))
          u_nsec += NANOSECOND;
  pps_fcount += u_nsec;

This change introduces a new calculation which is slightly simpler and more
straight forward.  Name it B.

Consider the following sample values with a tcount of 2000000100 and a
tc_frequency of 2000000000 (2GHz).

For A, the scale is 9223372036.  Then scale * tcount is 18446744994337203600
which is larger than UINT64_MAX (= 18446744073709551615).  The result is
920627651984 == 18446744994337203600 % UINT64_MAX.  Since all operands are
unsigned the result is well defined through modulo arithmetic.  The result of
bintime2timespec(&bt, &ts) is 49.  This is equal to the correct result
1000000049 % NANOSECOND.

In hardpps(), both conditional statements are not executed and pps_fcount is
incremented by 49.

For the new calculation B, we have 1000000000 * tcount is 2000000100000000000
which is less than UINT64_MAX. This yields after the division with tc_frequency
the correct result of 1000000050 for delta_nsec.

In hardpps(), the first conditional statement is executed and pps_fcount is
incremented by 50.

This shows that both methods yield roughly the same results.  However, method B
is easier to understand and requires fewer conditional statements.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604

16 months agopps: Directly assign the timestamps in pps_event()
Sebastian Huber [Mon, 27 Feb 2023 21:49:09 +0000 (14:49 -0700)]
pps: Directly assign the timestamps in pps_event()

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604