]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 months agoMerge commit fde5924dcc69 from llvm-project (by Serge Pavlov):
Dimitry Andric [Thu, 13 Jul 2023 18:57:22 +0000 (20:57 +0200)]
Merge commit fde5924dcc69 from llvm-project (by Serge Pavlov):

  [clang] Reset FP options before template instantiation

  AST nodes that may depend on FP options keep them as a difference
  relative to the options outside the AST node. At the moment of
  instantiation the FP options may be different from the default values,
  defined by command-line option. In such case FP attributes would have
  unexpected values. For example, the code:

      template <class C> void func_01(int last, C) {
        func_01(last, int());
      }
      void func_02() { func_01(0, 1); }
      #pragma STDC FENV_ACCESS ON

  caused compiler crash, because template instantiation takes place at the
  end of translation unit, where pragma STDC FENV_ACCESS is in effect. As
  a result, code in the template instantiation would use constrained
  intrinsics while the function does not have StrictFP attribute.

  To solve this problem, FP attributes in Sema must be set to default
  values, defined by command line options.

  This change resolves https://github.com/llvm/llvm-project/issues/63542.

  Differential Revision: https://reviews.llvm.org/D154359

Requested by: pkubaj
PR: 265755, 265758
MFC after: 1 month

12 months agovfs_bio: initialize pctries
Doug Moore [Thu, 13 Jul 2023 18:28:21 +0000 (13:28 -0500)]
vfs_bio: initialize pctries

bufobj_init depends on fields bo_dirty.bv_root and bo_clean.bv_root
being zeroed on entry and pctrie_init zeroing whatever is passed to
them, and so does not call pctrie_init for either of them. That fails
if pctrie_init ever changes to do something other that zeroing data,
so add explicit calls to them.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D40978

12 months agopfsync: transport over IPv6
Luiz Amaral [Thu, 13 Jul 2023 06:06:24 +0000 (08:06 +0200)]
pfsync: transport over IPv6

Implement pfsync over IPv6.

Submitted by: Luiz Amaral <email@luiz.eng.br>
Submitted by: Naman Sood <naman@freebsdfoundation.org>
Reviewed by: kp
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D40102

12 months agosignal: Get rid of gsignal() as it not used anywhere
Dmitry Chagin [Thu, 13 Jul 2023 07:41:51 +0000 (10:41 +0300)]
signal: Get rid of gsignal() as it not used anywhere

Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D41007
MFC after: 1 week

12 months agopf: Simplify rule actions logic
Kajetan Staszkiewicz [Thu, 13 Jul 2023 05:08:24 +0000 (07:08 +0200)]
pf: Simplify rule actions logic

Actions applied to a processed packet come in case of stateless
firewalling from a rule or in case of statefull firewalling from a
state. The state obtains the actions from a rule when it is created by a
rule or by pfsync. The logic for deciding if actions come from a rule or
a state is spread across many places in pf.

There already is struct pf_rule_actions in struct pf_pdesc and thus it
can be used as a central place for storing actions and their parameters.
OpenBSD does something similar: they also store the actions in struct
pf_pdesc and have no variables in pf_test() but they use separate
variables instead of a structure. By using struct pf_rule_actions we can
simplify the code even further. Applying of actions is done *only* in
pf_rule_to_actions() no matter if for the legacy scrub rules or for the
normal match / pass rules. The logic of choosing if rule or state
actions are used is applied only once in pf_test() by copying the whole
struct.

Reviewed by: kp
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D41009

12 months agorpcgen: Clarify behaviour for idx
Jessica Clarke [Thu, 13 Jul 2023 05:22:52 +0000 (06:22 +0100)]
rpcgen: Clarify behaviour for idx

The re-initialisation of idx in the later else branch is a bit hidden,
and results in deviation from the earlier two paths. Use more consistent
code instead to make it abundantly clear what's going on.

12 months agoDocument fdescfs mount option "rdlnk"
Konstantin Belousov [Tue, 11 Jul 2023 05:09:11 +0000 (08:09 +0300)]
Document fdescfs mount option "rdlnk"

Reviewed by: dchagin
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40969

12 months agofdescfs: add a mount option rdlnk
Konstantin Belousov [Tue, 11 Jul 2023 05:03:49 +0000 (08:03 +0300)]
fdescfs: add a mount option rdlnk

which changes /dev/fd/N files types to symbolic link with the behavior
of symbolic links.

PR: 272127
Reported by: Peter Eriksson <pen@lysator.liu.se>
Reviewed by: dchagin
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40969

12 months agoRevert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount option"
Konstantin Belousov [Tue, 11 Jul 2023 04:58:06 +0000 (07:58 +0300)]
Revert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount option"

This reverts commits 4a402dfe0bc44770c9eac6e58a501e4805e29413 and
3bffa2262328e4ff1737516f176107f607e7bc76.

The fix will be implemented in somewhat different manner.  The semantic
adjustment is incompatible with linuxolator expectations.

Reported and reviewed by: dchagin
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40969

12 months agorelease: remove a stray backslash
Glen Barber [Wed, 12 Jul 2023 20:57:57 +0000 (16:57 -0400)]
release: remove a stray backslash

PR: 272354 (related)
MFC after: 3 days
MFC with: 0ed426276fd52e917506ab87c05a61c6641ae298
MFC with: cd8cad0ef5cd534dc7ae1dd9a470cac2057ed957
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd

12 months agorelease: follow-up to previous commit to install lang/python{,3}
Glen Barber [Wed, 12 Jul 2023 20:49:53 +0000 (16:49 -0400)]
release: follow-up to previous commit to install lang/python{,3}

PR: 272354
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd

12 months agorelease: ensure gce-check-depends installs lang/python{,3}
Glen Barber [Wed, 12 Jul 2023 20:08:40 +0000 (16:08 -0400)]
release: ensure gce-check-depends installs lang/python{,3}

PR: 272354
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd

12 months agopf: Fix duplicate storage of direction
Kajetan Staszkiewicz [Wed, 12 Jul 2023 16:04:56 +0000 (18:04 +0200)]
pf: Fix duplicate storage of direction

The variable storing the direction of a processed packet is passed
around to many functions. Most of those functions already have a pointer
to struct pf_pdesc which also contains the direction. By using the one
in struct pf_pdesc we can reduce the amount of arguments passed around.

Reviewed by: kp
Sponsored by: InnGames GmbH
Differential Revision: https://reviews.freebsd.org/D41008

12 months agoamd64 pmap: Fix compilation when superpage reservations are disabled
Yufeng Zhou [Wed, 12 Jul 2023 07:52:02 +0000 (02:52 -0500)]
amd64 pmap: Fix compilation when superpage reservations are disabled

The function pmap_pde_ept_executable() should not be conditionally
compiled based on VM_NRESERVLEVEL. It is required indirectly by
pmap_enter(..., psind=1) even when reservation-based allocation is
disabled at compile time.

Reviewed by: alc
MFC after: 1 week

12 months agovmm: don't leak locks exiting vmmdev_ioctl()
Gleb Smirnoff [Wed, 12 Jul 2023 16:16:40 +0000 (09:16 -0700)]
vmm: don't leak locks exiting vmmdev_ioctl()

At least an error from vcpu_lock_all() at line 553 would leak
memseg lock.  There might be other cases as well.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D40981

12 months agovmm: don't return random error from vcpu_lock_all() if vcpu is empty
Gleb Smirnoff [Wed, 12 Jul 2023 16:16:40 +0000 (09:16 -0700)]
vmm: don't return random error from vcpu_lock_all() if vcpu is empty

When vcpu array is empty, function would return random value from
stack.  What I observed was -1.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D40980

12 months agodtrace: prevent forked child from running after an error condition
Eric van Gyzen [Tue, 11 Jul 2023 17:58:29 +0000 (12:58 -0500)]
dtrace: prevent forked child from running after an error condition

The pid/killonerror test uses an invalid probe specifier to verify that
the child process is killed.  It occasionally fails because the "date"
command is allowed to run long enough to print the date.  This is harmless
in this case, but is clearly not ideal.

When the dt_proc_control thread is about to exit, and the dtrace command
forked the child, do not make the child runnable.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D40976

12 months agopf: fix error descriptions in the man page
Kristof Provost [Wed, 12 Jul 2023 11:17:14 +0000 (13:17 +0200)]
pf: fix error descriptions in the man page

PR: 272459
Submitted by: alex@inferiorhumanorgans.com
MFC after: 1 week

12 months agopf: fix pfi_kif definition in the man page
Kristof Provost [Wed, 12 Jul 2023 09:43:43 +0000 (11:43 +0200)]
pf: fix pfi_kif definition in the man page

PR: 272455
Submitted by: alex@inferiorhumanorgans.com
MFC after: 1 week

12 months agogetlocalbase: Make default path actually configurable
Jessica Clarke [Tue, 11 Jul 2023 20:49:22 +0000 (21:49 +0100)]
getlocalbase: Make default path actually configurable

We include paths.h in getlocalbase.c, which defines _PATH_LOCALBASE.
This will override a definition on the command line, meaning it is
impossible to override like how the manpage says you can, and it means
the code to provide a fallback default is dead as the macro is always
defined.

Instead, introduce a new LOCALBASE_PATH macro like LOCALBASE_CTL_LEN
that can be set on the command line and will default to the system's
existing _PATH_LOCALBASE to avoid duplicating the default here.

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

12 months agokmod.mk: Use portable printf '%s' over non-portable echo -n
Jessica Clarke [Tue, 11 Jul 2023 20:30:06 +0000 (21:30 +0100)]
kmod.mk: Use portable printf '%s' over non-portable echo -n

Whilst /bin/echo on macOS and Linux implement -n, as do the builtin
echos in bash and zsh, the builtin echo in dash does not, causing the
first line of the output to be -n foo rather than just foo, and there to
be an extra newline in the output and thus blank line, both of which
result in "Symbol ... is not present in *.kld" warnings appearing in the
build output (once for -n foo and once for the empty string for each
module where EXPORT_SYMS is a list of symbols).

MFC after: 1 week

12 months agobhyve: Deduplicate some code in modify_bar_registration()
Mark Johnston [Tue, 11 Jul 2023 19:22:37 +0000 (15:22 -0400)]
bhyve: Deduplicate some code in modify_bar_registration()

No functional change intended.

Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40877

12 months agogetlocalbase.3: Fix AUTHORS formatting
Jessica Clarke [Tue, 11 Jul 2023 17:50:32 +0000 (18:50 +0100)]
getlocalbase.3: Fix AUTHORS formatting

MFC after: 1 week

12 months agolibutil: Delete trailing whitespace
Jessica Clarke [Tue, 11 Jul 2023 17:45:23 +0000 (18:45 +0100)]
libutil: Delete trailing whitespace

12 months agoix, ixv: fix kernel build
Piotr Kubaj [Tue, 11 Jul 2023 17:41:26 +0000 (19:41 +0200)]
ix, ixv: fix kernel build

struct adapter was renamed to struct sc.

Reported by: FreeBSD User <freebsd@walstatt-de.de>

12 months agoix: remove stale comment
Piotr Kubaj [Tue, 11 Jul 2023 16:45:04 +0000 (18:45 +0200)]
ix: remove stale comment

Reported by: Navdeep Parhar

12 months agoix, ixv: Update link status with autonegotiated baudrate value
Piotr Pietruszewski [Tue, 11 Jul 2023 16:14:26 +0000 (18:14 +0200)]
ix, ixv: Update link status with autonegotiated baudrate value

Use autonegotiated link speed value while updating link status
to iflib.

This patch is part of change made in NetBSD kernel
by Masanobu Saitoh, NetBSD maintainer.

Differential Revision: https://reviews.freebsd.org/D19176
Approved by: erj

12 months agoipfw: teach ipfw that pfsync is an upper layer protocol
Kristof Provost [Tue, 11 Jul 2023 10:37:17 +0000 (12:37 +0200)]
ipfw: teach ipfw that pfsync is an upper layer protocol

Explicitly add pfsync as a know upper layer protocol so we don't
automatically discard pfsync packets (carried over IPv6).

net.inet6.ip6.fw.deny_unknown_exthdrs defaults to 1, so even if
net.inet.ip.fw.default_to_accept is set to 1 we'd discard pfsync (over
IPv6).

Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D40973

12 months agocsu: Implement _start using as to satisfy unwinders on i386
Dmitry Chagin [Tue, 11 Jul 2023 12:12:01 +0000 (15:12 +0300)]
csu: Implement _start using as to satisfy unwinders on i386

The right unwinding stop indicator should be CFI-undefined PC.
https://dwarfstd.org/doc/Dwarf3.pdf - page 118:
If a Return Address register is defined in the virtual unwind table,
and its rule is undefined (for example, by DW_CFA_undefined), then
there is no return address and no call address, and the virtual
unwind of stack activations is complete.

The hack localizing _start1 symbol removed.

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

12 months agocsu: Add the prologue and epilogue to the _init and _fini on i386
Dmitry Chagin [Tue, 11 Jul 2023 12:11:22 +0000 (15:11 +0300)]
csu: Add the prologue and epilogue to the _init and _fini on i386

Normally, modern unwinders uses Dwarf information to unwind stack,
however in case when the code is not annotated by Dwarf instructions,
unwinders fallbacks to a frame-pointer based algorithm.

That is allows libunwind to unwind stack from global constructors and
destructors. Also it makes gdb happy as it printed nonexistent frame
before.

Reviewed by: kib, imp
Differential Revision: https://reviews.freebsd.org/D40948

12 months agortld: Annotate .rtld_start on i386
Dmitry Chagin [Tue, 11 Jul 2023 12:10:32 +0000 (15:10 +0300)]
rtld: Annotate .rtld_start on i386

Add a stop indicator to rtld_start to satisfy unwinders:
The right unwinding stop indicator should be CFI-undefined PC.
https://dwarfstd.org/doc/Dwarf3.pdf - page 118:
If a Return Address register is defined in the virtual unwind table,
and its rule is undefined (for example, by DW_CFA_undefined), then
there is no return address and no call address, and the virtual
unwind of stack activations is complete.

That is allows gdb and libunwind successfully stop when unwinding stack
from global constructors and destructors.

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

12 months agortld: Microoptimize rtld_start on i386
Dmitry Chagin [Tue, 11 Jul 2023 12:10:08 +0000 (15:10 +0300)]
rtld: Microoptimize rtld_start on i386

Initial stack pointer is preserved in calle-saved %esi,
use it bellow to pass initial stack pointer to _rtld().

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

12 months agostress2: Added two syzkaller reproducers
Peter Holm [Tue, 11 Jul 2023 08:24:19 +0000 (10:24 +0200)]
stress2: Added two syzkaller reproducers

12 months agolibbe: promote activated BEs all the way
Kyle Evans [Tue, 11 Jul 2023 05:43:51 +0000 (00:43 -0500)]
libbe: promote activated BEs all the way

This matches the beadm behavior; generally, we need to keep promoting
until the BE is no longer a clone from a snapshot.  This fixes scenarios
where the dataset associated with a BE's origin is itself a clone,
activating the BE previously would promote it to a clone of the origin's
origin.

We could keep using be_get_dataset_props here, except for two
annoyances:

1.) I couldn't find a clean way to just clear an nvlist rather than
    having to re-alloc it, and I didn't want to just remove the one prop
    we're inspecting out of it.

2.) That's a lot of overhead when all we want to do is fetch the origin
    anyways.

Note that this is not a complete fix, but it does fix the majority of
cases; deep BE subordinates are still notably broken, pending a patch
from Christian.

Reported by: R. Christian McDonald <rcm@rcm.sh>
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D40903

12 months agoigc: Increase default per-queue interrupt rate to 20000.
Peter Grehan [Fri, 7 Jul 2023 08:23:42 +0000 (18:23 +1000)]
igc: Increase default per-queue interrupt rate to 20000.

The default per-queue packet rate of 8000 will cause packet loss when
forwarding at 2.5G with a single stream, as is common when using e.g.
iperf3 to test a platform.

Bump this to 20000 (the "low latency" value in the Linux driver) which
avoids packet loss for this type of test.

Future work will use adaptive interrupt rate in a similar fashion
to the ixgbe driver.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Reviewed by: erj, kp
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D40904

12 months agodepend-cleanup: Add verbose (-v) and pretend/dry-run (-n) flags
Jessica Clarke [Tue, 11 Jul 2023 00:53:04 +0000 (01:53 +0100)]
depend-cleanup: Add verbose (-v) and pretend/dry-run (-n) flags

These are useful for testing new additions to the script. Whilst here,
harden the script a little and improve error messages.

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

12 months agoMake sure MACHINE(_ARCH) are exported for depend-cleanup.sh
Jessica Clarke [Tue, 11 Jul 2023 00:53:04 +0000 (01:53 +0100)]
Make sure MACHINE(_ARCH) are exported for depend-cleanup.sh

We run depend-cleanup.sh twice during the build. The second time is the
normal run, where we run it under WMAKEENV and thus have CROSSENV's
MACHINE(_ARCH)=${TARGET(_ARCH)} in the environment. However, the first
time is for bootstrap-tools, where it's run under BMAKEENV and we don't
have any assignments to MACHINE(_ARCH) in the environment, meaning the
script sees them as unset. In practice this doesn't matter since the
only use doesn't apply to bootstrap-tools, but it could be a future
issue. Thus, explicitly export them for depend-cleanup.sh and have the
script verify they're set.

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

12 months agosigqueue_delete_set_proc(): initialize sq_proc for worklist
Konstantin Belousov [Mon, 10 Jul 2023 00:29:43 +0000 (03:29 +0300)]
sigqueue_delete_set_proc(): initialize sq_proc for worklist

This should fix leaks for the p_killpg_cnt counter, because
sigqueue_flush() drops ksi's.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

12 months agomsdosfs: zero partially valid extended cluster
Konstantin Belousov [Thu, 6 Jul 2023 01:51:07 +0000 (04:51 +0300)]
msdosfs: zero partially valid extended cluster

It contains arbitrary garbage, which is not cleared by vfs_bio_clrbuf()
which only zeroes invalid portions of the pages.

Reported by: Maxim Suhanov <dfirblog@gmail.com>
Discussed with: so
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

12 months agodepend-cleanup.sh: Fix whitespace
Jessica Clarke [Mon, 10 Jul 2023 23:18:15 +0000 (00:18 +0100)]
depend-cleanup.sh: Fix whitespace

Fixes: 45c4ff15e3eb ("depend-cleanup.sh: Handle libc bcmp.S moving to bcmp.c on amd64.")

12 months agodepend-cleanup.sh: cleanup stale ffs.S dependencies for arm and i386
Dimitry Andric [Mon, 10 Jul 2023 22:50:31 +0000 (00:50 +0200)]
depend-cleanup.sh: cleanup stale ffs.S dependencies for arm and i386

Now that depend-cleanup.sh handles 32-bit dependencies a bit better, get
rid of the stale ffs.S ones, otherwise an incremental build on amd64
will fail with:

  cc: error: no such file or directory: '/usr/src/lib/libc/i386/string/ffs.S'

Fixes: ee8b0c436d72

12 months agodepend-cleanup.sh: handle 32-bit dependencies having no 64-bit equivalent
Dimitry Andric [Mon, 10 Jul 2023 22:50:09 +0000 (00:50 +0200)]
depend-cleanup.sh: handle 32-bit dependencies having no 64-bit equivalent

For example with the recent removal of ffs.S for 32-bit arm and i386,
the egrep in clean_dep() did not find any files to remove, even if you
added a "clean_dep lib/libc ffs S" line. This is because it will never
find the ffs.S filename in the 64-bit .depend files for libc.

Split the searching and removing of 32-bit dependencies and objects into
a separate part to cope with this. This can be used similarly later on,
for other bitnesses.

MFC after: 3 days

12 months agoMultiple fixes to the zfsd test suite
Alan Somers [Mon, 3 Apr 2023 21:43:17 +0000 (15:43 -0600)]
Multiple fixes to the zfsd test suite

* Wait for gnop devices to disappear after "gnop destroy".

  Apparently that process is asynchronous now, or maybe it's just slower
  than it used to be.  Also, after removing a gnop wait for its pool to
  be degraded.  That isn't instant.

* The zfsd tests no longer require camcontrol.

  This was a harmless oversight from
  11ed0a95bfa76791dc6428eb2d47a986c0c6f8a3

* Fix the zfsd_degrade_001_pos test for recent zfs versions.

  ZFS now rate limits checksum errors to about 20 per second.  But
  zfsd's threshold for degrading a disk is 50 per minute.  So we must
  alternately corrupt and scrub the pool to ensure that checksum errors
  are generated in multiple 1-second windows, so that zfsd will see
  enough of them.

* Fix the zfsd_fault_001_pos test in VMs

  And, for that matter, when using NVME or SATA disks.  As originally
  written, the test used the da driver to inject errors.  Rewrite it to
  use gnop vdevs.  gnop can also inject errors.  It works on top of any
  disk device, and it's also faster than using da.

MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D39437

12 months agozfsd: listen for sysevent.fs.zfs instead of misc.fs.zfs
Alan Somers [Mon, 3 Apr 2023 21:45:55 +0000 (15:45 -0600)]
zfsd: listen for sysevent.fs.zfs instead of misc.fs.zfs

At some point the names of these devd events changed.  Probably it
happened when importing OpenZFS.  Before that, FreeBSD's sysevent_alloc
method didn't create a "class" nvpair in the event, which led to
log_sysevent using the event's ev_subclass field as its type.

MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D39437

12 months agorelease: Add code to make FreeBSD/Firecracker
Colin Percival [Mon, 10 Jul 2023 06:16:31 +0000 (23:16 -0700)]
release: Add code to make FreeBSD/Firecracker

This just stages the kernel and builds a stripped-down rootfs for use
with the Firecracker VMM.  At some point in the future the release
engineering team might start publishing these, but initially it's
just here to simplify FreeBSD/Firecracker development and testing.

Note that the rootfs generated:
* Uses an IP address of 10.0.0.2 with a gateway of 10.0.0.1,
* Has sshd enabled,
* Has user "freebsd" with password "freebsd" and a root password
  of "root", and
* Is 1 GB in size (but has growfs enabled).

All of those are subject to change without notice; anyone intending to
use FreeBSD/Firecracker in anything remotely resembling a production
environment should talk to cperciva first.

Reviewed by: gjb
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D40956

12 months agodhclient: fix build on i386
Eric van Gyzen [Mon, 10 Jul 2023 20:03:39 +0000 (15:03 -0500)]
dhclient: fix build on i386

Only i386 still uses a 32-bit time_t.  I knew this, and I still failed
to compile-test on i386.  My bad.

Reported by: cy
Fixes: c210cac00f258 ("dhclient: fix time parsing for leases...")
Sponsored by: Dell EMC Isilon

12 months agoCONTRIBUTING.md: reinsert double spaces
WuerfelDev [Wed, 5 Jul 2023 08:27:16 +0000 (10:27 +0200)]
CONTRIBUTING.md: reinsert double spaces

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

12 months agopmc_events.h: update top-level comment
Mitchell Horne [Mon, 26 Jun 2023 17:08:56 +0000 (14:08 -0300)]
pmc_events.h: update top-level comment

It points to non-existent documentation. The wiki page still contains a
useful overview, so keep this link.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

12 months agopmcstat(8): Drop .Ud
Mitchell Horne [Mon, 10 Jul 2023 17:23:36 +0000 (14:23 -0300)]
pmcstat(8): Drop .Ud

This utility has existed for a long time and should not be advertised as
"currently under development".

While here, fix the one other warning from igor about using a newline
for a new sentence.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

12 months agopmclog(3): Drop .Ud
Mitchell Horne [Mon, 10 Jul 2023 17:20:54 +0000 (14:20 -0300)]
pmclog(3): Drop .Ud

This API is stable and should not be advertised as "currently under
development".

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

12 months agodhclient: fix time parsing for leases expiring after 2038
Alex Bahm [Mon, 10 Jul 2023 15:56:05 +0000 (10:56 -0500)]
dhclient: fix time parsing for leases expiring after 2038

Convert lease parsing to timegm to calculate timestamp. For reference, when
writing the lease, we use gmtime to convert the timestamp to struct tm.

Reviewed By: markj, vangyzen
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D40760

12 months agoDuring F_SETFL, don't change file flags on error
Alan Somers [Sun, 9 Jul 2023 20:48:10 +0000 (14:48 -0600)]
During F_SETFL, don't change file flags on error

Previously, even if the FIONBIO or FIOASYNC ioctl failed, the file's
f_flags variable would still be changed.  Now, kern_fcntl will restore
the original flags if the ioctl fails.

PR: 265736
Reported by: Yuval Pavel Zholkover <paulzhol@gmail.com>
MFC after: 2 weeks
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40955

12 months agoRemove GCC 4.2 include dirs
Mitchell Horne [Mon, 10 Jul 2023 13:16:13 +0000 (10:16 -0300)]
Remove GCC 4.2 include dirs

These are present (and empty) on a system installed post-GCC removal.

Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D40878

12 months agoradix_trie: avoid code duplication in insert
Doug Moore [Sun, 9 Jul 2023 20:06:02 +0000 (15:06 -0500)]
radix_trie: avoid code duplication in insert

Two cases in the insert routine are written differently, when
they're really doing the same thing. Writing that case only once
saves 208 bytes in the compiled vm_radix_insert code and reduces
instructions executed by about 2%.
Reviewed by: alc
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D40807

12 months agohwpmc(4): update DEBUGGING section details
Mitchell Horne [Sun, 9 Jul 2023 19:01:55 +0000 (16:01 -0300)]
hwpmc(4): update DEBUGGING section details

The examples I wrote previously do not work. We parse the flags using
explicit names, not the shortened flag suffix. Fix the list of major
flags, and add a compact list of minor flags. Fix the examples, and
tweak some wording for clarity.

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Fixes: 5fc97cc32553 ("hwpmc(4): document debugging options")
Differential Revision: https://reviews.freebsd.org/D40913

12 months agortld-elf: Remove _PATH_ELF32_HINTS and _COMPAT32_PATH_RTLD
Jessica Clarke [Sun, 9 Jul 2023 17:50:30 +0000 (18:50 +0100)]
rtld-elf: Remove _PATH_ELF32_HINTS and _COMPAT32_PATH_RTLD

These are no longer referenced, with the one user of each now using the
double-underscore version with "32" as an argument instead.

Reviewed by: kib, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40935

12 months agoldd: Use __PATH_RTLD("32") over _COMPAT32_PATH_RTLD
Jessica Clarke [Sun, 9 Jul 2023 17:50:24 +0000 (18:50 +0100)]
ldd: Use __PATH_RTLD("32") over _COMPAT32_PATH_RTLD

This will allow the latter to be removed, reducing the boilerplate
needed for a new libcompat.

Reviewed by: kib, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40934

12 months agoldconfig: Use __PATH_ELF_HINTS("32") over _PATH_ELF32_HINTS
Jessica Clarke [Sun, 9 Jul 2023 17:50:15 +0000 (18:50 +0100)]
ldconfig: Use __PATH_ELF_HINTS("32") over _PATH_ELF32_HINTS

This will allow the latter to be removed, reducing the boilerplate
needed for a new libcompat.

Reviewed by: kib, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40933

12 months agobsd.compat.mk: Remove obsolete COMPAT_32BIT now it's unused
Jessica Clarke [Sun, 9 Jul 2023 17:50:03 +0000 (18:50 +0100)]
bsd.compat.mk: Remove obsolete COMPAT_32BIT now it's unused

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: emaste, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40932

12 months agolib: Migrate from COMPAT_32BIT to generic COMPAT_LIBCOMPAT
Jessica Clarke [Sun, 9 Jul 2023 17:49:53 +0000 (18:49 +0100)]
lib: Migrate from COMPAT_32BIT to generic COMPAT_LIBCOMPAT

In the process, delete a COMPAT_SOFTFP remnant that was missed in
previous sweeps.

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: emaste, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40931

12 months agolibsysdecode: Migrate from COMPAT_32BIT to generic COMPAT_LIBCOMPAT
Jessica Clarke [Sun, 9 Jul 2023 17:49:43 +0000 (18:49 +0100)]
libsysdecode: Migrate from COMPAT_32BIT to generic COMPAT_LIBCOMPAT

The use isn't any more generic, just the variable itself, which will
allow COMPAT_32BIT to be removed. The fact we even have to check
COMPAT_LIBCOMPAT here in order to pass the right flags to CPP points at
our libcompat infrastructure not suitably modifying the CPP variable
(which we barely use for world; this and bsd.symver.mk are the two
uses, and the latter could benefit from the right flags too), but this
change doesn't attempt to fix that.

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: emaste, imp, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40930

12 months agolibiconv_modules: Migrate from COMPAT_32BIT to generic COMPAT_libcompat
Jessica Clarke [Sun, 9 Jul 2023 17:49:35 +0000 (18:49 +0100)]
libiconv_modules: Migrate from COMPAT_32BIT to generic COMPAT_libcompat

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40929

12 months agogeom: Migrate from COMPAT_32BIT to generic COMPAT_libcompat
Jessica Clarke [Sun, 9 Jul 2023 17:49:28 +0000 (18:49 +0100)]
geom: Migrate from COMPAT_32BIT to generic COMPAT_libcompat

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: imp, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40927

12 months agokerberos5: Migrate from COMPAT_32BIT to generic COMPAT_LIBCOMPAT
Jessica Clarke [Sun, 9 Jul 2023 17:49:21 +0000 (18:49 +0100)]
kerberos5: Migrate from COMPAT_32BIT to generic COMPAT_LIBCOMPAT

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: emaste, imp, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40926

12 months agortld-elf: Migrate from COMPAT_32BIT to generic COMPAT_libcompat/LIBCOMPAT
Jessica Clarke [Sun, 9 Jul 2023 17:49:07 +0000 (18:49 +0100)]
rtld-elf: Migrate from COMPAT_32BIT to generic COMPAT_libcompat/LIBCOMPAT

We still have a tiny amount of libcompat-specific code in rtld_paths.h,
but it's been deduplicated as much as possible, and in future we may
wish to just push these variables down to the few consumers of them and
make them use the double-underscore variants with a libcompat argument
rather than give them names here.

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: kib, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40925

12 months agoinclude: Migrate from COMPAT_32BIT to generic COMPAT_libcompat
Jessica Clarke [Sun, 9 Jul 2023 17:48:54 +0000 (18:48 +0100)]
include: Migrate from COMPAT_32BIT to generic COMPAT_libcompat

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: emaste, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40924

12 months agoopenpam: Migrate from COMPAT_32BIT to generic COMPAT_libcompat
Jessica Clarke [Sun, 9 Jul 2023 17:48:17 +0000 (18:48 +0100)]
openpam: Migrate from COMPAT_32BIT to generic COMPAT_libcompat

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40923

12 months agobsd.compat.mk: Provide new CPP and sub-make variables
Jessica Clarke [Sun, 9 Jul 2023 17:47:42 +0000 (18:47 +0100)]
bsd.compat.mk: Provide new CPP and sub-make variables

Currently the only way to detect for a libcompat build is to consult
whether COMPAT_32BIT is defined (or equivalent, for downstreams with
other libcompats or past releases with libsoft as COMPAT_SOFTFP). There
are two issues with this:

1. COMPAT_32BIT is a new naming scheme that doesn't match the libcompat
   name, which is unnecessary deviation.
2. When multiple libcompats exist, everywhere that needs to detect a
   libcompat must check each variable in turn, despite the fact that it
   normally just wants to know if this is a libcompat build and perhaps
   what ${LIBCOMPAT} and/or ${libcompat} are for it.

As a result, far too many places in the tree need to know about the set
of possible libcompats.

Instead, introduce two new CPP and sub-make variables, COMPAT_LIBCOMPAT
and COMPAT_libcompat, which give the values for ${LIBCOMPAT} and
${libcompat} respectively, so that uses can be made parameterised. For
when code really does need to know the specific libcompat, Makefiles can
perform a string comparison, but the C preprocessor cannot, so introduce
an additional CPP-only COMPAT_LIB${LIBCOMPAT} which is intended to
replace the inconsistently-named COMPAT_32BIT (which will be removed in
future). Uses of this new variable should still be kept to a minimum,
however, given the code duplication needed for new libcompats.

Reviewed by: emaste, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40922

12 months agoMakefile.libcompat: Quote CFLAGS and CXXFLAGS for sub-make
Jessica Clarke [Sun, 9 Jul 2023 17:46:12 +0000 (18:46 +0100)]
Makefile.libcompat: Quote CFLAGS and CXXFLAGS for sub-make

Currently none of the words in these require quoting, but a future
commit will add words that do, thus we should make sure to quote each
word so the shell doesn't mangle them before calling the sub-make.

(Note that :@var@expr@ is the bmake syntax for map, replacing each word
with expr's evaluation, with var containing the input word)

Reviewed by: emaste, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40921

12 months agolibc: Build all i386 sources for amd64 lib32
Jessica Clarke [Sun, 9 Jul 2023 17:46:03 +0000 (18:46 +0100)]
libc: Build all i386 sources for amd64 lib32

Having the symbols exported by libc differ between i386 and amd64 lib32
is questionable. Since these files build just fine today, stop guarding
them with !defined(COMPAT_32BIT). Whether or not they work at run time
is a different matter, but an i386 jail would be similarly affected if
not, so that's not a problem with lib32.

Reviewed by: kib, jhb, imp
Differential Revision: https://reviews.freebsd.org/D40937

12 months agolib: Enable libcbor and libfido2 for COMPAT_32BIT
Jessica Clarke [Sun, 9 Jul 2023 17:45:56 +0000 (18:45 +0100)]
lib: Enable libcbor and libfido2 for COMPAT_32BIT

We no longer have COMPAT_32BIT hacks for libusb, instead supporting the
normal 32-bit ioctls for freebsd32 processes, so we can enable these for
the lib32 build.

Reviewed by: emaste, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40920

12 months agortld-elf: Reuse _BASENAME_RTLD for debug.h rather than duplicating logic
Jessica Clarke [Sun, 9 Jul 2023 17:45:49 +0000 (18:45 +0100)]
rtld-elf: Reuse _BASENAME_RTLD for debug.h rather than duplicating logic

Reviewed by: kib, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40919

12 months agoelf-hints.h: Allow rtld_paths.h to be included before it
Jessica Clarke [Sun, 9 Jul 2023 17:45:42 +0000 (18:45 +0100)]
elf-hints.h: Allow rtld_paths.h to be included before it

Currently rtld_paths.h will #undef _PATH_ELF_HINTS in order to override
this to the right value if included afterwards, but the other way round
does not work as elf-hints.h tries to define an already-defined macro to
a potentially different value. Thus, guard the definition here so that
rtld_paths.h's definition continues to take precedence.

Note that, although all in-tree uses of _PATH_ELF_HINTS have included
rtld_paths.h already, pax-utils wants _PATH_ELF_HINTS from elf-hints.h
and so we cannot just drop the define. In-tree uses must just continue
to make sure that they include rtld_paths.h to get the right value for
libcompat builds as is already required.

Reviewed by: kib, brooks, jhb, imp
Differential Revision: https://reviews.freebsd.org/D40918

12 months agoDon't bother to check COMPAT_32BIT when __LP64__ is defined
Jessica Clarke [Sun, 9 Jul 2023 17:45:32 +0000 (18:45 +0100)]
Don't bother to check COMPAT_32BIT when __LP64__ is defined

Under COMPAT_32BIT we are compiling 32-bit code and so __LP64__ is not
defined, __ILP32__ is, and thus the check is completely redundant.

Reviewed by: brooks, jhb, imp
Differential Revision: https://reviews.freebsd.org/D40917

12 months agolibsysdecode: Drop dead __amd64__ && COMPAT_32BIT code
Jessica Clarke [Sun, 9 Jul 2023 17:45:23 +0000 (18:45 +0100)]
libsysdecode: Drop dead __amd64__ && COMPAT_32BIT code

Under COMPAT_32BIT we are compiling 32-bit code and so __amd64__ is not
defined, __i386__ is, and we use the real i386 headers.

Reviewed by: brooks, jhb, imp
Differential Revision: https://reviews.freebsd.org/D40916

12 months agoopenssl: include d2i_KeyParams() and d2i_KeyParams_bio()
Kristof Provost [Fri, 7 Jul 2023 19:25:34 +0000 (21:25 +0200)]
openssl: include d2i_KeyParams() and d2i_KeyParams_bio()

These functions are new, and some ports (e.g.opensc) expect to have them
available. Add the file they're defined in to the build, and add them
to Version.map.

PR: 270076
Reviewed by: markj, emaste, pierre
Fixes: b077aed33b7b ("Merge OpenSSL 3.0.9")
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40914

12 months agosuperio.4: mdoc cleanup
Christian Brueffer [Sun, 9 Jul 2023 10:51:16 +0000 (12:51 +0200)]
superio.4: mdoc cleanup

12 months agoath10k.4: mdoc cleanup
Christian Brueffer [Sun, 9 Jul 2023 10:23:58 +0000 (12:23 +0200)]
ath10k.4: mdoc cleanup

12 months agoxinstall: do not use copy_file_range(2) when BOOTSTRAPPING
Martin Matuska [Sat, 8 Jul 2023 23:24:38 +0000 (01:24 +0200)]
xinstall: do not use copy_file_range(2) when BOOTSTRAPPING

Reported by: arichardson

12 months agocat: fallback on EBADF with copy_file_range(2)
Martin Matuska [Sat, 8 Jul 2023 23:04:25 +0000 (01:04 +0200)]
cat: fallback on EBADF with copy_file_range(2)

When stdout is opened with O_APPEND, copy_file_range(2) fails with EBADF.

12 months agoamd64 pcpu.h: Add missing 'do' from do-while loop around __PCPU_SET.
John Baldwin [Sat, 8 Jul 2023 19:59:26 +0000 (12:59 -0700)]
amd64 pcpu.h: Add missing 'do' from do-while loop around __PCPU_SET.

Reported by: mjg
Diagnosed by: jrtc27

12 months agoxinstall: use copy_file_range(2) with fallback to previous behavior
Martin Matuska [Sat, 8 Jul 2023 19:46:46 +0000 (21:46 +0200)]
xinstall: use copy_file_range(2) with fallback to previous behavior

This allows to use special filesystem features like server-side
copying on NFS 4.2 or block cloning on OpenZFS 2.2.

Note: copy_file_range(2) is not used when a digest calculation is
requested as this would require to read the input file twice.

Reviewed by: asomers, imp, rmacklem
Differential revision: https://reviews.freebsd.org/D40898

12 months agocat: use copy_file_range(2) with fallback to previous behavior
Martin Matuska [Sat, 8 Jul 2023 18:31:38 +0000 (20:31 +0200)]
cat: use copy_file_range(2) with fallback to previous behavior

This allows to use special filesystem features like server-side
copying on NFS 4.2 or block cloning on OpenZFS 2.2.

Reviewed by: imp, rmacklem
Differential revision: https://reviews.freebsd.org/D40882

12 months agovfs: clean up unused NDF_NO* macros
Mateusz Guzik [Sat, 8 Jul 2023 19:45:46 +0000 (19:45 +0000)]
vfs: clean up unused NDF_NO* macros

The manpage is touched up to not mention them, but still desperately
needs help.

12 months agokillpg(): more carefully avoid LoR
Konstantin Belousov [Fri, 7 Jul 2023 17:19:33 +0000 (20:19 +0300)]
killpg(): more carefully avoid LoR

otherwise we could end up with the livelock.  When pg_killsx trylock
failed, ensure that we do wait for lock availability before retry.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

12 months agosys_setpgid(): style, remove extra ()s
Konstantin Belousov [Fri, 7 Jul 2023 16:59:41 +0000 (19:59 +0300)]
sys_setpgid(): style, remove extra ()s

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

12 months agoCorrect grammo. This one has spread. Should be the last.
Jens Schweikhardt [Sat, 8 Jul 2023 12:35:41 +0000 (14:35 +0200)]
Correct grammo. This one has spread. Should be the last.

12 months agoCorrect grammo.
Jens Schweikhardt [Sat, 8 Jul 2023 12:25:44 +0000 (14:25 +0200)]
Correct grammo.

12 months agoCorrect a grammo.
Jens Schweikhardt [Sat, 8 Jul 2023 09:55:54 +0000 (11:55 +0200)]
Correct a grammo.

12 months agohwpmc(4): instead of manual edition, use sysrc(8)
Graham Perrin [Sat, 8 Jul 2023 06:24:18 +0000 (07:24 +0100)]
hwpmc(4): instead of manual edition, use sysrc(8)

Exemplifying safe use of sysrc(8) has become commonplace in
documentation such as the FreeBSD Handbook. Encourage its use.

Consistency: 'the driver' (not 'this driver').

Co-authored-by: Mina Galić <me+github@igalic.co>
Reviewed-by: imp, Mina Galić <me+github@igalic.co>
Approved by:    imp
MFC after:      3 days
Pull-request:   https://github.com/freebsd/freebsd-src/pull/785

12 months agolibthr: Patch to reduce latency to acquire+release a pthread mutex.
Greg Becker [Fri, 7 Jul 2023 22:03:14 +0000 (17:03 -0500)]
libthr: Patch to reduce latency to acquire+release a pthread mutex.

The acquisition and release of an uncontended default/normal pthread
mutex on FreeBSD is suprisingly slow, e.g., pthread wrlocks and binary
semaphores both exhibit roughly 33% lower latency, while default/normal
mutexes on Linux exhibit roughly 67% lower latency than FreeBSD. This is
likely explained by the fact that AFAICT in the best case to acquire an
uncontended mutex on Linux one need touch only 1 page and read+modify
only 1 cacheline, whereas on FreeBSD we need to touch at least 4 pages,
read 6 cachelines, and modify at least 4 cachelines.

This patch does not address the pthread mutex architecture. Instead,
it improves performance by adding the __always_inline attribute to
mutex_lock_common() and mutex_unlock_common() to encourage constant
folding and propagation, thereby lowering the latency to acquire and
release a mutex due to a shorter code path with fewer compares, jumps,
and mispredicts.

With this patch on a stock build I see a reduction in latency of roughly
7% for default/normal mutexes, and 17% for robust mutexes. When built
without PTHREADS_ASSERTIONS enabled I see a reduction in latency of
roughly 15% and 26%, respectively. Suprisingly, I see similar reductions
in latency for heavily contended mutexes.

By default, this patch increases the size of libthr.so.3 by 2448 bytes,
but when built without PTHREAD_ASSERTIONS enabled it only increases by
448 bytes.

Reviewed by: jhb (previous version), kib
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40912

12 months agopam_krb5: Add missing patch
Cy Schubert [Sat, 8 Jul 2023 03:09:18 +0000 (20:09 -0700)]
pam_krb5: Add missing patch

Include a portion of the patch that was missed in 813847e49e35.

Reported by: markj
Fixes: 813847e49e35
MFC after: 1 day

12 months agoqlnxe: Add missing #ifdef INET to fix amd64 LINT-NOINET/NOIP builds
Jessica Clarke [Fri, 7 Jul 2023 23:54:07 +0000 (00:54 +0100)]
qlnxe: Add missing #ifdef INET to fix amd64 LINT-NOINET/NOIP builds

The approach here is copied directly from qlxgb.

Fixes: b0d3d44dfe63 ("qlnxe: add driver to amd64 NOTES")

12 months agoSimplify buffer count calculation
Mark O'Donovan [Fri, 7 Jul 2023 22:31:47 +0000 (16:31 -0600)]
Simplify buffer count calculation

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/778

12 months agoRemove duplicate #include
Mark O'Donovan [Fri, 7 Jul 2023 22:31:47 +0000 (16:31 -0600)]
Remove duplicate #include

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/778

12 months agoetc/rc.d/routing: use find_system_scripts
Brooks Davis [Fri, 7 Jul 2023 22:25:11 +0000 (23:25 +0100)]
etc/rc.d/routing: use find_system_scripts

In 3693d9140e05aba9942232df13468f51a6cde136 /etc/rc switched to using
find_system_scripts rather than directly including /etc/rc.d/* in the
list of scripts to run in order to skip .pkgsave files.  Follow suit
in etc/rc.d/routing.

Sponsored by: DARPA

12 months agogpart(8): slices are out of context for GPT
Graham Perrin [Fri, 7 Jul 2023 22:05:46 +0000 (23:05 +0100)]
gpart(8): slices are out of context for GPT

Correct the GPT example. Creation of a partition leaves free the rest
of the device (not the slice).

Approved-by: imp
Fixes: ae1b731b5df0 Rewrite the GPT and MBR examples. For GPT, ensure that the boot partition is large enough for gptzfsboot, which has doubled in size since 10.
MFC after:    1 week
Pull-request: https://github.com/freebsd/freebsd-src/pull/795

12 months agocat: ensure serrno is always set
Alfonso Gregory [Fri, 7 Jul 2023 21:54:26 +0000 (15:54 -0600)]
cat: ensure serrno is always set

Set serrno to errno before the loop begins for the edge case that res0
is immediately NULL.

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

12 months agoisp(4): Style changes
Joerg Pulz [Fri, 7 Jul 2023 21:43:35 +0000 (15:43 -0600)]
isp(4): Style changes

Please tools/build/checkstyle9.pl as mentioned by imp@

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726

12 months agoisp(4): Remove redundant functions for reading data from FLT and flash
Joerg Pulz [Fri, 7 Jul 2023 21:43:34 +0000 (15:43 -0600)]
isp(4): Remove redundant functions for reading data from FLT and flash

Rename isp_rd_2400_nvram to isp_rd_2xxx_flash.
Cleanup some leftovers.
Hide all output regarding FLT parsing behind ISP_LOGDEBUG0.

Thanks to imp@ and mav@ for reviewing and commenting.

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726