]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 months agoarm64/disassem.c: Add shifted register definitions with ror
Mykola Hohsadze [Sat, 17 Jun 2023 15:31:25 +0000 (12:31 -0300)]
arm64/disassem.c: Add shifted register definitions with ror

Add disassembly support for the following shifted register instructions:
* mvn
* orn
* orr
* and
* ands
* bic
* bics
* eon
* eor
* tst

According to Arm64 documenation, operational pseuducode of shifted
register instruction must return `UNDEFINED` if shift type is `RESERVED`
('11'). Hence, removed "rsv" from `shift_2` array and add "ror". In case
of shift type is 3 and this type is `RESERVED`, we will return
`undefined`.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40386

12 months agotcpdump: Reconnect pfsync printer
Joseph Mingrone [Fri, 16 Jun 2023 13:40:00 +0000 (10:40 -0300)]
tcpdump: Reconnect pfsync printer

Fixes: ee67461e (tpcdump: Update to 4.99.4)

Reported by: glebius
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40578

12 months agohifn(4): Fix a typo in a source code comment
Gordon Bergling [Sat, 17 Jun 2023 08:51:23 +0000 (10:51 +0200)]
hifn(4): Fix a typo in a source code comment

- s/regesters/registers/

MFC after: 3 days

12 months agoxdr(3): Fix a typo in a source code comment
Gordon Bergling [Sat, 17 Jun 2023 08:49:40 +0000 (10:49 +0200)]
xdr(3): Fix a typo in a source code comment

- s/curren/current/

MFC after: 3 days

12 months agozfs: merge openzfs/zfs@10e36e176
Martin Matuska [Fri, 16 Jun 2023 21:12:27 +0000 (23:12 +0200)]
zfs: merge openzfs/zfs@10e36e176

Notable upstream pull request merges:
  #14948 Remove ARC/ZIO physdone callbacks
  #14963 Store the L2ARC device ashift in the vdev label
  #14970 Switch refcount tracking from lists to AVL-trees
  #14981 Shorten arcstat_quiescence sleep time

Obtained from: OpenZFS
OpenZFS commit: 10e36e17612ba9c634b140ae76847bb62b5be68f

12 months agoshare/mk/bsd.cpu.mk: handle the default case when CPUTYPE is not specified on powerpc*
Piotr Kubaj [Fri, 16 Jun 2023 09:43:42 +0000 (11:43 +0200)]
share/mk/bsd.cpu.mk: handle the default case when CPUTYPE is not specified on powerpc*

Approved by: imp
Differential Revision: https://reviews.freebsd.org/D40576

12 months agorc.suspend: update man pages for new keyword
Johannes Totz [Fri, 16 Jun 2023 16:48:17 +0000 (13:48 -0300)]
rc.suspend: update man pages for new keyword

rc.suspend has gained an rcorder keyword recently. Document it alongside
the existing resume keyword.

Reviewed By: mhorne, Pau Amma <pauamma@gundo.com>
Differential Revision: https://reviews.freebsd.org/D40484

12 months agohwpmc(4): document debugging options
Mitchell Horne [Fri, 16 Jun 2023 16:38:43 +0000 (13:38 -0300)]
hwpmc(4): document debugging options

The debug options for hwpmc are not documented in detail anywhere, and
setting it up was error-prone the first time I had to figure it out (and
each time I've had to remember it). Add some explanation of the required
options and describe the kern.hwpmc.debugflags sysctl format.

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

12 months agohwpmc: add error for HWPMC_DEBUG without KTR
Mitchell Horne [Fri, 16 Jun 2023 16:38:26 +0000 (13:38 -0300)]
hwpmc: add error for HWPMC_DEBUG without KTR

The option is a no-op otherwise, but this is not necessarily obvious.
Failing the compile gives the user a hint.

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40544

12 months agopmc: clarify and strengthen statements about API/ABI
Mitchell Horne [Fri, 16 Jun 2023 16:38:19 +0000 (13:38 -0300)]
pmc: clarify and strengthen statements about API/ABI

- Make it clear that applications are not only encouraged to use the
  pmc(3) library, but use of the hwpmc(4) interface directly is a
  use-case we do not support
- Move the COMPATIBILITY section above PROGRAMMING API in hwpmc(4)
- Drop statements about the driver and library being "under development"

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40543

12 months agohwpmc(4): more detailed SYNOPSYS
Mitchell Horne [Fri, 16 Jun 2023 16:38:03 +0000 (13:38 -0300)]
hwpmc(4): more detailed SYNOPSYS

Include some boilerplate similar to other section 4 man pages,
describing how to load the module at boot-time or include it in the
kernel.

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40542

12 months agohwpmc(4): remove paragraph about Pentium Pro handling
Mitchell Horne [Fri, 16 Jun 2023 16:34:02 +0000 (13:34 -0300)]
hwpmc(4): remove paragraph about Pentium Pro handling

Support for these CPUs was removed in 2018 (e92a1350b50e).

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40541

12 months agonetlink: convert to IfAPI.
Alexander V. Chernikov [Fri, 16 Jun 2023 15:58:57 +0000 (15:58 +0000)]
netlink: convert to IfAPI.

Convert to IfAPI everything except `IF_AFDATA_WLOCK` usage in neigh.c.

Reviewed By: jhibbits
Differential Revision: https://reviews.freebsd.org/D40577

12 months agoifnet: fix if_strings.h build check
Alexander V. Chernikov [Fri, 16 Jun 2023 15:54:29 +0000 (15:54 +0000)]
ifnet: fix if_strings.h build check

12 months agonetlink: dump interface capabilities with other interface data.
Alexander V. Chernikov [Fri, 16 Jun 2023 14:56:39 +0000 (14:56 +0000)]
netlink: dump interface capabilities with other interface data.

This change exports interface capabilities using the standard
Netlink attribute type, bitset, and switches `ifconfig(8)` to use
it when displaying interface data.
Bitset comes in two representations. The first one is "compact",
where the bits are exported via two arrays - "mask" listing the
"valid" bits and "values, providing the values for those bits.
The second one is more verbose, listing each bit as a separate item,
with its name, id and value. The latter option is handy when submitting
update requests.

The support for setting capabilities will be added in the upcoming diffs.

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

12 months agoperiodic: Honor kern.localbase
Juraj Lutter [Tue, 6 Jun 2023 11:40:49 +0000 (13:40 +0200)]
periodic: Honor kern.localbase

Take kern.localbase into account with fallback to /usr/local and
also allow for LOCALBASE/etc/periodic.conf (similarly to what
many other utilities do).

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40435
MFC after: 2 weeks

12 months agoifconfig: fix armv6 build
Alexander V. Chernikov [Fri, 16 Jun 2023 08:23:14 +0000 (08:23 +0000)]
ifconfig: fix armv6 build

12 months agovm_phys: Fix typo in 9e8174289236
Alan Cox [Fri, 16 Jun 2023 08:12:42 +0000 (03:12 -0500)]
vm_phys: Fix typo in 9e8174289236

12 months agoipfw: add state/comment tests
Alexander V. Chernikov [Fri, 16 Jun 2023 07:24:19 +0000 (07:24 +0000)]
ipfw: add state/comment tests

12 months agoifconfig: use default (more rigid) WARNS level.
Alexander V. Chernikov [Wed, 14 Jun 2023 13:21:17 +0000 (13:21 +0000)]
ifconfig: use default (more rigid) WARNS level.

It helps catch more errors at compile time.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40536
MFC after: 2 weeks

12 months agoifconfig: remove global 'ifr' usage from ifmedia.c & remove 'ifr'.
Alexander V. Chernikov [Wed, 14 Jun 2023 13:04:10 +0000 (13:04 +0000)]
ifconfig: remove global 'ifr' usage from ifmedia.c & remove 'ifr'.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40535
MFC after: 2 weeks

12 months agoifconfig: remove (most of) the usages of global 'struct ifreq ifr'.
Alexander V. Chernikov [Wed, 14 Jun 2023 13:00:49 +0000 (13:00 +0000)]
ifconfig: remove (most of) the usages of global 'struct ifreq ifr'.

It is hard to reason about the contents of 'ifr' at any given time
as nearly every function sets random fields or pointers in this
structure.
Use local on-stack clean 'struct ifreq' for each function instead.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40534
MFC after: 2 weeks

12 months agovm_phys: add binary segment search
Doug Moore [Fri, 16 Jun 2023 06:43:45 +0000 (01:43 -0500)]
vm_phys: add binary segment search

Replace several sequential searches for a segment that contains a
phyiscal address with a call to a function that does it by binary
search.  In vm_page_reclaim_contig_domain_ext, find the first segment
to reclaim from, and reclaim from each subsequent appropriate segment.
Eliminate vm_phys_scan_contig.

Reviewed by: alc, markj
Differential Revision: https://reviews.freebsd.org/D40058

12 months agobhyve: add basic CRB interface for TPM devices
Corvin Köhne [Mon, 29 Aug 2022 10:10:43 +0000 (12:10 +0200)]
bhyve: add basic CRB interface for TPM devices

Add a basic emulation for the command and response buffer interface of
TPM devices. This commit only implements some CRB register and resets
them.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40456

12 months agobhyve: add basic TPM passthrough emulation
Corvin Köhne [Mon, 15 May 2023 12:04:15 +0000 (14:04 +0200)]
bhyve: add basic TPM passthrough emulation

At the moment, the emulation only opens a file descriptor to the TPM
device. Some subsequent commits will read and write from it.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40455

12 months agobhyve: add basic TPM emulation struct
Corvin Köhne [Mon, 15 May 2023 11:49:42 +0000 (13:49 +0200)]
bhyve: add basic TPM emulation struct

This struct will be used to implement various TPM emulations like a TPM
passthrough or a virtual TPM.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40454

12 months agobhyve: use assert for missing TPM version
Corvin Köhne [Thu, 15 Jun 2023 08:36:37 +0000 (10:36 +0200)]
bhyve: use assert for missing TPM version

The TPM version config node should always be set. If it's not set,
there's a bug in our code. An assertion is the correct way to check for
this.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40558

12 months agobhyve: pass address of OpRegion to the guest
Corvin Köhne [Wed, 10 May 2023 11:44:28 +0000 (13:44 +0200)]
bhyve: pass address of OpRegion to the guest

Don't allow access to the physical ASLS register. It contains a host
address which is meaningless for the guest. Additionally, it allows the
guest to safely rewrite this register.

This is the last commit required for GVT-d. Nevertheless, it might not
work due to missing firmware support.

MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D26209

12 months agobhyve: copy OpRegion into guest memory
Corvin Köhne [Wed, 10 May 2023 11:39:56 +0000 (13:39 +0200)]
bhyve: copy OpRegion into guest memory

This makes the OpRegion accessible by the guest. However, the guest
doesn't know the address of the OpRegion. This will be fixed by an
upcoming commit.

The range of the OpRegion is added to the e820 table. This allows the
guest firmware to easily pick up this range and to reserve it properly.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40041

12 months agobhyve: read OpRegion address and size for GVT-d
Corvin Köhne [Wed, 10 May 2023 11:38:02 +0000 (13:38 +0200)]
bhyve: read OpRegion address and size for GVT-d

The OpRegion provides some configuration bits and ACPI methods used by
some Intel drivers. The guest needs access to it. In the first step,
we're reading it's address and size.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40040

12 months agobhyve: emulate graphics stolen memory register
Corvin Köhne [Thu, 11 May 2023 09:18:56 +0000 (11:18 +0200)]
bhyve: emulate graphics stolen memory register

This register contains a host physical address. This address is
meaningless for the guest. We have to emulate it and set it to a valid
guest physical address.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40060

12 months agobhyve: allocate guest memory for graphics stolen memory
Corvin Köhne [Thu, 11 May 2023 09:10:07 +0000 (11:10 +0200)]
bhyve: allocate guest memory for graphics stolen memory

The graphics stolen memory is only GPU accessible. So, we don't have to
copy any data to it as the guest will be unable to access it anyway. We
just have to allocate and reserve some memory. That's done by adding an
E820 entry for the graphics stolen memory. The guest firmware will pick
up the E820 and reserve this range.

Note that we try to reuse the host address as Intel states that newer
Tiger Lake platforms need this [1].

[1]
https://github.com/projectacrn/acrn-hypervisor/blob/e28d6fbfdfd556ff1bc3ff330e41d4ddbaa0f897/devicemodel/hw/pci/passthrough.c#L626-L629

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40059

12 months agobhyve: read out graphics stolen memory address and size
Corvin Köhne [Thu, 11 May 2023 08:53:15 +0000 (10:53 +0200)]
bhyve: read out graphics stolen memory address and size

This is the first step to emulate the graphics stolen memory register.

Note that the graphics stolen memory is somehow confusing. On the one
hand the Intel Open Source HD Graphics Programmers' Reference Manual
states that it's only GPU accessible. As the CPU can't access the area,
the guest shouldn't need it. On the other hand, the Intel GOP driver
refuses to work properly, if it's not set to a proper address.

Intel itself maps it into the guest by EPT [1]. At the moment, we're not
aware of any situation where this EPT mapping is required, so we don't
do it yet.

Intel also states that the Windows driver for Tiger Lake reads the
address of the graphics stolen memory [2]. As the GVT-d code doesn't
support Tiger Lake in its first implementation, we can't check how it
behaves. We should keep an eye on it.

[1]
https://github.com/projectacrn/acrn-hypervisor/blob/e28d6fbfdfd556ff1bc3ff330e41d4ddbaa0f897/devicemodel/hw/pci/passthrough.c#L655-L657
[2]
https://github.com/projectacrn/acrn-hypervisor/blob/e28d6fbfdfd556ff1bc3ff330e41d4ddbaa0f897/devicemodel/hw/pci/passthrough.c#L626-L629

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40039

12 months agobhyve: add empty GVT-d emulation
Corvin Köhne [Wed, 10 May 2023 10:31:50 +0000 (12:31 +0200)]
bhyve: add empty GVT-d emulation

Don't emulate anything yet. Just check if the user would like to pass an
Intel GPU to the guest.

Reviewed by: jhb, markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40038

12 months agoShorten arcstat_quiescence sleep time
George Amanakis [Thu, 15 Jun 2023 19:45:36 +0000 (21:45 +0200)]
Shorten arcstat_quiescence sleep time

With the latest L2ARC fixes, 2 seconds is too long to wait for
quiescence of arcstats like l2_size. Shorten this interval to avoid
having the persistent L2ARC tests in ZTS prematurely terminated.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14981

12 months agoSYSCALL_MODULE(9): fix references to modfind(2) and modstat(2)
Ka Ho Ng [Thu, 15 Jun 2023 19:37:53 +0000 (15:37 -0400)]
SYSCALL_MODULE(9): fix references to modfind(2) and modstat(2)

Sponsored by: Juniper Networks, Inc.
Reviewed by: delphij
MFC after: 1 week

12 months agoasa: Add some unit tests.
Dag-Erling Smørgrav [Thu, 15 Jun 2023 19:23:26 +0000 (19:23 +0000)]
asa: Add some unit tests.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D40564

12 months agoasa: Read from stdin if *argv is "-".
Dag-Erling Smørgrav [Thu, 15 Jun 2023 19:23:22 +0000 (19:23 +0000)]
asa: Read from stdin if *argv is "-".

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D40563

12 months agoasa: Error out if writing to stdout failed.
Dag-Erling Smørgrav [Thu, 15 Jun 2023 19:23:19 +0000 (19:23 +0000)]
asa: Error out if writing to stdout failed.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D40562

12 months agoRemove ARC/ZIO physdone callbacks.
Alexander Motin [Thu, 15 Jun 2023 17:49:03 +0000 (13:49 -0400)]
Remove ARC/ZIO physdone callbacks.

Those callbacks were introduced many years ago as part of a bigger
patch to smoothen the write throttling within a txg. They allow to
account completion of individual physical writes within a logical
one, improving cases when some of physical writes complete much
sooner than others, gradually opening the write throttle.

Few years after that ZFS got allocation throttling, working on a
level of logical writes and limiting number of writes queued to
vdevs at any point, and so limiting latency distribution between
the physical writes and especially writes of multiple copies.
The addition of scheduling deadline I proposed in #14925 should
further reduce the latency distribution.  Grown memory sizes over
the past 10 years should also reduce importance of the smoothing.

While the use of physdone callback may still in theory provide
some smoother throttling, there are cases where we simply can not
afford it.  Since dirty data accounting is protected by pool-wide
lock, in case of 6-wide RAIDZ, for example, it requires us to take
it 8 times per logical block write, creating huge lock contention.

My tests of this patch show radical reduction of the lock spinning
time on workloads when smaller blocks are written to RAIDZ pools,
when each of the disks receives 8-16KB chunks, but the total rate
reaching 100K+ blocks per second.  Same time attempts to measure
any write time fluctuations didn't show anything noticeable.

While there, remove also io_child_count/io_parent_count counters.
They are used only for couple assertions that can be avoided.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #14948

12 months agobhyve: Sort SRCS
Mark Johnston [Thu, 15 Jun 2023 16:21:54 +0000 (12:21 -0400)]
bhyve: Sort SRCS

No functional change intended.

Reviewed by: corvink, jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40553

12 months agoarm64: Make a debug print conditional on bootverbose
Mark Johnston [Thu, 15 Jun 2023 16:13:05 +0000 (12:13 -0400)]
arm64: Make a debug print conditional on bootverbose

It doesn't seem particularly useful to have it enabled by default, and
it spits several dozen lines into the dmesg on a test system.

Reviewed by: andrew
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40499

12 months agobhyve: Remove special no-op handling for I/O port 0x488
Mark Johnston [Thu, 15 Jun 2023 16:12:25 +0000 (12:12 -0400)]
bhyve: Remove special no-op handling for I/O port 0x488

This appears to have been reserved for some kind of debug hook, but it's
not implemented and appears never to have been used.

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

12 months agodtrace/arm64: Fix user memory access routines
Mark Johnston [Thu, 15 Jun 2023 16:39:21 +0000 (12:39 -0400)]
dtrace/arm64: Fix user memory access routines

Use unprivileged loads to access user memory.  Without this, the
accesses trap and various dtrace actions such as ustack() fail.

Reviewed by: andrew
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40540

12 months agodtrace/arm64: Store the fault address when suppressing a page fault
Mark Johnston [Thu, 15 Jun 2023 16:11:11 +0000 (12:11 -0400)]
dtrace/arm64: Store the fault address when suppressing a page fault

Reviewed by: andrew
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40539

12 months agoarm64: Remove struct arm64_frame
Mark Johnston [Thu, 15 Jun 2023 16:10:44 +0000 (12:10 -0400)]
arm64: Remove struct arm64_frame

It was used in one place and was added specifically to support dtrace
stack unwinding code.  Write an equivalent expression using struct
unwind_state instead.  No functional change intended.

Reviewed by: andrew
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40538

12 months agoarmv8crypto: Avoid overriding -march when compiling some source files
Mark Johnston [Thu, 15 Jun 2023 16:10:19 +0000 (12:10 -0400)]
armv8crypto: Avoid overriding -march when compiling some source files

At least one downstream (CheriBSD) overrides -march here.  Instead of
hard-coding the target, simply append the crypto extension to whatever's
already there.

No functional change intended.

Reviewed by: imp, andrew
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40537

12 months agooce(4): deprecate
Brooks Davis [Wed, 14 Jun 2023 17:55:54 +0000 (18:55 +0100)]
oce(4): deprecate

The Emulex OneConnect NIC driver hasn't seen any commits other than ioctl
bug fixes (some severe) and sweeping commits since 2016.  There is no
indication of new parts since 2014 or earlier.  As such, deprecate the
driver with the aim of removing it prior to FreeBSD 15.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40531

12 months agooce(4): Don't directly access usespace
Brooks Davis [Wed, 14 Jun 2023 17:55:41 +0000 (18:55 +0100)]
oce(4): Don't directly access usespace

Replace direct stores to userspace addresses (never safe and broken on
modern CPUs) with a copyout.  Use a static assert on the size to ensure
we don't overflow the field.

Reviewed by: markj, jhb
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D40519

12 months agompi3mr: Add bare-bones manual
Warner Losh [Wed, 14 Jun 2023 22:12:28 +0000 (16:12 -0600)]
mpi3mr: Add bare-bones manual

The mpi3mr driver is written by Broadcom for the 9600 Series 24G PCIe
4.0 Tri-Mode RAID Adapters and eHBAs boards. This is 3rd-Generation
Tri-Mode x8 and x16 NVMe/SAS/SATA (although Broadcom/Avago did muddy the
waters by having multiple 2nd generations cards and referring to them
inconsistently).

Sponsored by: Netflix

12 months agompi3mr: 3rd Generation Tri-Mode NVMe/SAS/SATA MegaRaid / eHBA
Sumit Saxena [Wed, 14 Jun 2023 22:22:30 +0000 (16:22 -0600)]
mpi3mr: 3rd Generation Tri-Mode NVMe/SAS/SATA MegaRaid / eHBA

This is Broadcom's mpi3mr driver for FreeBSD version 8.6.0.2.0.
The mpi3mr driver supports Broadcom SAS4116-based cards in the 9600
series: 9670W-16i, 9670-24i, 9660-16i, 9620-16i, 9600-24i, 9600-16i,
9600W-16e, 9600-16e, 9600-8i8e.

Initially only available as a module and on amd64/arm64, since that's
how it has been tested to date. Future commits will add it to the kernel
build and may expand the architectures it is supported on.

Co-authored-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Feedback-by: ken (prior versions)
Reviewed-by: imp
RelNotes: yes
Differential-Revision: https://reviews.freebsd.org/D36771
Differential-Revision: https://reviews.freebsd.org/D36772

12 months agoipfw: use function return value to fetch insn argument.
Alexander V. Chernikov [Thu, 15 Jun 2023 06:46:42 +0000 (06:46 +0000)]
ipfw: use function return value to fetch insn argument.

This is a prerequsite for splitting compile_rule() into smaller
chunks.

MFC after: 2 weeks

12 months agoipfw: add eaction tests
Alexander V. Chernikov [Thu, 15 Jun 2023 06:36:16 +0000 (06:36 +0000)]
ipfw: add eaction tests

MFC after: 2 weeks

12 months agoroute.8: mention DXR in FIB_ALGO section
Marko Zec [Thu, 15 Jun 2023 05:21:51 +0000 (07:21 +0200)]
route.8: mention DXR in FIB_ALGO section

While here, add a sentence describing DPDK DIR24-8 principle of
operation.

MFC after: 2 weeks.

12 months agocaroot: update the root bundle
Kyle Evans [Thu, 15 Jun 2023 04:26:23 +0000 (23:26 -0500)]
caroot: update the root bundle

Summary:
- Zero (0) newly trusted
- Five (5) modified
- Nine (9) distrusted

MFC after: 3 days

12 months agoresizewin: Stop printing bogus NUL to TTY
Jessica Clarke [Wed, 14 Jun 2023 22:58:36 +0000 (23:58 +0100)]
resizewin: Stop printing bogus NUL to TTY

A char array has an implicit NUL terminating it, which sizeof will
include, so we need to subtract 1 here. Printing a NUL can cause issues
for things like CI environments that aren't expecting it, especially
with recent Jenkins being stricter about not putting NUL in XML files.

Fixes: 3d222369acbe ("Add a small tool, resizewin(1), to query terminal for window size")
MFC after: 1 week

12 months agotcp: add missing static keywords
Gleb Smirnoff [Wed, 14 Jun 2023 21:21:28 +0000 (14:21 -0700)]
tcp: add missing static keywords

Without them compilation with -O0 would produce kernel modules
that depend on symbol that doesn't exist.

12 months agoEC2: Default to "uefi-preferred" boot mode
Colin Percival [Wed, 7 Jun 2023 22:17:12 +0000 (15:17 -0700)]
EC2: Default to "uefi-preferred" boot mode

In EC2, UEFI boots faster than BIOS, but not all amd64 instance types
support UEFI.  AMIs need to have their boot mode designated, which
created a dilemma: Faster boots, or wider compatibility?

The recently added "uefi-preferred" option solves this: AMIs can be
marked to use UEFI where it's available, but fall back to BIOS on
instance types which do not support UEFI.

This uses bsdec2-image-upload 1.4.6, which recently landed in the
ports tree.

PR: 265697
Reviewed by: delphij, imp
MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D40470

12 months agohwpmc: flatten conditional in pmc_process_exit()
Mitchell Horne [Wed, 14 Jun 2023 16:33:46 +0000 (13:33 -0300)]
hwpmc: flatten conditional in pmc_process_exit()

Use a goto to clarify the control flow when there is no process
descriptor. This wins back a level of indentation.

No functional change intended.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40518

12 months agohwpmc: split out PMC_OP_PMCRW
Mitchell Horne [Wed, 14 Jun 2023 16:33:41 +0000 (13:33 -0300)]
hwpmc: split out PMC_OP_PMCRW

Split out the functional logic from the syscall handler into a helper
function. This keeps it separate from the syscall control-flow logic,
resulting in better readability overall. It also wins back a level of
indentation.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40294

12 months agohwpmc: split out PMC_OP_PMCRELEASE
Mitchell Horne [Wed, 14 Jun 2023 16:33:35 +0000 (13:33 -0300)]
hwpmc: split out PMC_OP_PMCRELEASE

Split out the functional logic from the syscall handler into a helper
function. This keeps it separate from the syscall control-flow logic,
resulting in better readability overall. It also wins back a level of
indentation.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40293

12 months agohwpmc: split out PMC_OP_PMCALLOCATE
Mitchell Horne [Wed, 14 Jun 2023 16:33:27 +0000 (13:33 -0300)]
hwpmc: split out PMC_OP_PMCALLOCATE

Split out the large chunk of functional logic from the syscall handler
into a helper function. This keeps it separate from the syscall
control-flow logic, resulting in better readability overall. It also
wins back a level of indentation.

Flip the return values of the pmc_can_allocate_row() and
pmc_can_allocate_rowindex() functions to boolean types, like their
naming implies. We weren't actually using the error codes they were
returning.

While here, make some small style cleanups. No functional change
intended.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40292

12 months agohwpmc: split out PMC_OP_PMCATTACH/PMC_OP_PMCDETACH
Mitchell Horne [Wed, 14 Jun 2023 16:32:11 +0000 (13:32 -0300)]
hwpmc: split out PMC_OP_PMCATTACH/PMC_OP_PMCDETACH

Begin splitting out the large chunks of functional logic from the
syscall handler into separate helper functions. This keeps it separate
from the syscall control-flow logic, resulting in better readability
overall. It also wins back a level of indentation.

For this and the similar changes to follow, try to keep copyin() and
copyout() calls outside of the helper functions. The changes are
intended to have no functional impact, but do address style issues.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40291

12 months agohwpmc: split out PMC_FN_PROCESS_EXEC
Mitchell Horne [Wed, 14 Jun 2023 16:32:01 +0000 (13:32 -0300)]
hwpmc: split out PMC_FN_PROCESS_EXEC

Move the functionality into a separate helper function. All other
actions in pmc_hook_handler() already have this.

While here make some small style improvements. Restructure one for loop.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40333

12 months agohwpmc_mod.c: misc style cleanup
Mitchell Horne [Wed, 14 Jun 2023 16:31:36 +0000 (13:31 -0300)]
hwpmc_mod.c: misc style cleanup

Everything else I found worthy of adjustment.

 - Order local variable declarations per style(9)
 - Make use of __unused annotations rather than cast to void
 - Remove unnecessary casts
 - Add (void) casts to PMC class methods where the return value is
   ignored
 - A couple instances of reordering statements for clarity
 - Prefer bool type where applicable
 - unsigned int -> u_int
 - Use uintmax_t/%j in printf calls
 - Formatting of comments

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40517

12 months agohwpmc_mod.c: prototype style
Mitchell Horne [Wed, 14 Jun 2023 16:31:30 +0000 (13:31 -0300)]
hwpmc_mod.c: prototype style

Improve alphabetical organization, grouping, and whitespace.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40516

12 months agohwpmc_mod.c: conditional and loop style
Mitchell Horne [Wed, 14 Jun 2023 16:31:24 +0000 (13:31 -0300)]
hwpmc_mod.c: conditional and loop style

 - Explicitly check the value in conditional statements, per style(9)
 - Add braces around more loops and conditionals, wherever it appears
   (to me) to aid legibility
 - Expand some assignments within if statements
 - Fix formatting around list-type FOREACH macros

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40515

12 months agohwpmc_mod.c: whitespace style cleanup
Mitchell Horne [Wed, 14 Jun 2023 16:31:15 +0000 (13:31 -0300)]
hwpmc_mod.c: whitespace style cleanup

Handle a few things related to spacing:
 - Remove redundant/superfluous blank lines (and add a couple where
   helpful)
 - Add spacing around binary operators
 - Remove spacing after casts and before goto labels
 - Adjustments for line width of 80 chars
 - Tab/space character issues

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40514

12 months agohwpmc_mod.c: return statement style
Mitchell Horne [Wed, 14 Jun 2023 16:31:06 +0000 (13:31 -0300)]
hwpmc_mod.c: return statement style

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40513

12 months agohpwmc: add __pmcdbg_used annotation
Mitchell Horne [Wed, 14 Jun 2023 16:30:32 +0000 (13:30 -0300)]
hpwmc: add __pmcdbg_used annotation

For variables which are only used in PMCDBG* macros.

Reviewed by: jkoshy, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40288

12 months agoZTS: Skip send_raw_ashift on FreeBSD
Brian Behlendorf [Wed, 14 Jun 2023 15:04:05 +0000 (10:04 -0500)]
ZTS: Skip send_raw_ashift on FreeBSD

On FreeBSD 14 this test runs slowly in the CI environment
and is killed by the 10 minute timeout.  Skip the test on
FreeBSD until the slow down is resolved.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #14961

12 months agoSwitch refcount tracking from lists to AVL-trees.
Alexander Motin [Wed, 14 Jun 2023 15:02:27 +0000 (11:02 -0400)]
Switch refcount tracking from lists to AVL-trees.

With large number of tracked references list searches under the lock
become too expensive, creating enormous lock contention.

On my tests with ZFS_DEBUG enabled this increases write throughput
with 32KB blocks from ~1.2GB/s to ~7.5GB/s.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #14970

12 months agoStore the L2ARC device ashift in the vdev label
George Amanakis [Wed, 14 Jun 2023 15:01:17 +0000 (17:01 +0200)]
Store the L2ARC device ashift in the vdev label

If this is not done, and the pool has an ashift other than the default
(at the moment 9) then the following happens:

1) vdev_alloc() assigns the ashift of the pool to L2ARC device, but
   upon export it is not stored anywhere
2) at the first import, vdev_open() sees an vdev_ashift() of 0 and
   assigns the logical_ashift, which is 9
3) reading the contents of L2ARC, including the header fails
4) L2ARC buffers are not restored in ARC.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14313
Closes #14963

13 months agoifconfig: fix ifconfig crash when compiled w/WITHOUT_NETLINK.
Alexander V. Chernikov [Wed, 14 Jun 2023 10:37:07 +0000 (10:37 +0000)]
ifconfig: fix ifconfig crash when compiled w/WITHOUT_NETLINK.

Properly update the recently-introduced `ctx->ifname` when iterating
over interfaces.

Reported by: Gary Jennejohn <garyj@gmx.de>
MFC after: 2 weeks

13 months agoifconfig: fix -Wunused warnings
Alexander V. Chernikov [Wed, 14 Jun 2023 07:59:01 +0000 (07:59 +0000)]
ifconfig: fix -Wunused warnings

MFC after: 2 weeks

13 months agoifconfig: remove 'newaddr' global variable
Alexander V. Chernikov [Wed, 14 Jun 2023 07:51:27 +0000 (07:51 +0000)]
ifconfig: remove 'newaddr' global variable

Differential Revision: https://reviews.freebsd.org/D40441
MFC after: 2 weeks

13 months agoifconfig: start ifconfig context from main()
Alexander V. Chernikov [Wed, 14 Jun 2023 07:40:12 +0000 (07:40 +0000)]
ifconfig: start ifconfig context from main()

Differential Revision: https://reviews.freebsd.org/D40440
MFC after: 2 weeks

13 months agoifconfig: fix comparison in printmimo().
Alexander V. Chernikov [Wed, 14 Jun 2023 07:38:53 +0000 (07:38 +0000)]
ifconfig: fix comparison in printmimo().

Differential Revision: https://reviews.freebsd.org/D40301
MFC after: 2 weeks

13 months agofwget: Always install packages
Emmanuel Vadot [Wed, 14 Jun 2023 07:17:55 +0000 (09:17 +0200)]
fwget: Always install packages

This wasn't done before as -y wasn't added to the pkg install line.

Sponsored by: Beckhoff Automation GmbH & Co. KG

13 months agotcpdump: fix build with WITHOUT_PF=1
Gleb Smirnoff [Wed, 14 Jun 2023 03:58:36 +0000 (20:58 -0700)]
tcpdump: fix build with WITHOUT_PF=1

Fixes: ee67461e56828dd1f8de165947ba83f6d9148a87

13 months agoFix build with gcc12.
Xin LI [Wed, 14 Jun 2023 03:24:07 +0000 (20:24 -0700)]
Fix build with gcc12.

13 months agonss_tacplus: Support setting the login class.
Dag-Erling Smørgrav [Tue, 13 Jun 2023 16:06:27 +0000 (16:06 +0000)]
nss_tacplus: Support setting the login class.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: thj
Differential Revision: https://reviews.freebsd.org/D40376

13 months agolibtacplus: Allow additional AV pairs to be configured.
Dag-Erling Smørgrav [Tue, 13 Jun 2023 16:04:22 +0000 (16:04 +0000)]
libtacplus: Allow additional AV pairs to be configured.

* Replace hand-rolled input tokenizer with openpam_readlinev() which supports line continuations and has better quoting and escaping.
* Simplify string handling by merging struct clnt_str and struct srvr_str into just struct tac_str.
* Each server entry in the configuration file can now have up to 255 AV pairs which will be appended to the ones returned by the server in response to a successful authorization request.

This allows nss_tacplus(8) to be used with servers which do not provide identity information beyond confirming the existence of the user.

This adds a dependency on libpam, however libtacplus is currently only used by pam_tacplus(8) (which is already always used with libpam) and the very recently added nss_tacplus(8) (which is extremely niche).  In the longer term it might be a good idea to split this out into a separate library.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: pauamma_gundo.com, markj
Differential Revision: https://reviews.freebsd.org/D40285
Relnotes: yes

13 months agonetlink: fix failing TestRtNlAddIfaddrLo::test_add_6 tests.
Alexander V. Chernikov [Tue, 13 Jun 2023 15:24:24 +0000 (15:24 +0000)]
netlink: fix failing TestRtNlAddIfaddrLo::test_add_6 tests.

Recent netlink commit added hook for calling IPv6 code upon implicit
inteface bring-up on adding first interface address. This hook handles
link-local ifa addition for the loopback interface, resulting in
failed assertion in the loopback tests.

Fix the tests by fixing the assert.

13 months agoUPDATING: Add note about nvd aliases
Warner Losh [Tue, 13 Jun 2023 15:23:58 +0000 (09:23 -0600)]
UPDATING: Add note about nvd aliases

Add note about nvd alias disabling to UPDATING so it's easily at hand.

Sponsored by: Netflix

13 months agonvd/nda: Add release notes info.
Warner Losh [Tue, 13 Jun 2023 15:17:57 +0000 (09:17 -0600)]
nvd/nda: Add release notes info.

Sponsored by: Netflix

13 months agodummynet tests: attempt to provoke wf2q+ use-after-free
Kristof Provost [Mon, 12 Jun 2023 13:12:37 +0000 (15:12 +0200)]
dummynet tests: attempt to provoke wf2q+ use-after-free

Attempt to provoke known use-after-free issues with WF2Q+.

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

13 months agodummynet: fix wf2q use-after-free
Kristof Provost [Mon, 12 Jun 2023 13:05:41 +0000 (15:05 +0200)]
dummynet: fix wf2q use-after-free

When we clean up a wf2q+ queue we need to ensure that we remove it from
the correct heap. If we leave a queue pointer behind in an unexpected
heap we'll later write to it, causing a use-after-free and unpredictable
panics.

Teach the dummynet heap code to verify that we're removing the correct
object so we can safely attempt to remove objects not contained in the
heap.

Remove a to-be-removed queue from all heaps.

Also don't continue the enqueue function if we're not finding the queue
on the idle heap as we'd expect.

While here also remove the empty heap warning, because this is now
expected to happen.

See also: https://redmine.pfsense.org/issues/14433
Sponsored by: Rubicon Communications, LLC ("Netgate")

13 months agodummynet: remove unused field from dn_pkt_tag
Kristof Provost [Thu, 8 Jun 2023 13:53:02 +0000 (15:53 +0200)]
dummynet: remove unused field from dn_pkt_tag

ip6opt is never used, so remove it, slightly reducing memory use for
each packet tag.

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

13 months agokinst: rename t_kinst to t_kinst_tramp
Christos Margiolis [Tue, 13 Jun 2023 12:46:45 +0000 (15:46 +0300)]
kinst: rename t_kinst to t_kinst_tramp

The forthcoming RISC-V and ARM64 ports of kinst introduce a new field
named "t_kinst_curprobe", so "t_kinst" (which points to a trampoline)
becomes a misleading name.

No functional change intended.

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40507

13 months agokinst: hide KINST_TRAMPCHUNK_SIZE from ISA-specific headers
Christos Margiolis [Tue, 13 Jun 2023 12:46:33 +0000 (15:46 +0300)]
kinst: hide KINST_TRAMPCHUNK_SIZE from ISA-specific headers

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40505

13 months agoproc.h: capitalize letter in TD_LOCKS_DEC
Christos Margiolis [Tue, 13 Jun 2023 12:46:20 +0000 (15:46 +0300)]
proc.h: capitalize letter in TD_LOCKS_DEC

The other related macros capitalize "thread" as well, so use the same
style. No functional change intended.

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40506

13 months agonamei: Reset the lookup to start from the real root for abs symlink target
Dmitry Chagin [Tue, 13 Jun 2023 12:24:25 +0000 (15:24 +0300)]
namei: Reset the lookup to start from the real root for abs symlink target

Since fd745e1d Linux ABI specifies alternative root directory to reroot
lookups. First, an attempt is made to lookup the file in /ABI/original-path.
If that fails, the lookup is done in /original-path. In case of lookup
symbolic link with leading / in target namei() fails due to reroot reloads
original file name.
To avoid this handle restart in a special maner, without origin path name
reloading.

Reported by: Goran Mekić, Vincent Milum Jr
Tested by: Goran Mekić
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40479

13 months agonamei: Add a comment explaining ISRESTARTED flag
Dmitry Chagin [Tue, 13 Jun 2023 12:22:09 +0000 (15:22 +0300)]
namei: Add a comment explaining ISRESTARTED flag

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

13 months agoipfw: simplify action case parser
Alexander V. Chernikov [Wed, 7 Jun 2023 08:31:52 +0000 (08:31 +0000)]
ipfw: simplify action case parser

Remove "goto charg" from the action parser.
This is a prerequisite for the further split of the gigantic
compile_rule().

Differential Revision: https://reviews.freebsd.org/D40490
MFC after: 2 weeks

13 months agoipfw(8): add ioctl/instruction generation tests
Alexander V. Chernikov [Sun, 11 Jun 2023 08:12:04 +0000 (08:12 +0000)]
ipfw(8): add ioctl/instruction generation tests

Differential Revision: https://reviews.freebsd.org/D40488
MFC after: 2 weeks

13 months agostress2: Added a regression test for mksnap_ffs(8)
Peter Holm [Tue, 13 Jun 2023 09:01:43 +0000 (11:01 +0200)]
stress2: Added a regression test for mksnap_ffs(8)

13 months agolinuxkpi: advance platform_device
Corvin Köhne [Tue, 31 Jan 2023 08:18:38 +0000 (09:18 +0100)]
linuxkpi: advance platform_device

These are required by some linux driver like:
https://github.com/beckhoff/bbapi

Reviewed by: manu
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39554

13 months agoWrite out corrected superblock when creating a UFS/FFS snapshot.
Kirk McKusick [Tue, 13 Jun 2023 07:21:43 +0000 (00:21 -0700)]
Write out corrected superblock when creating a UFS/FFS snapshot.

When taking a snapshot on a UFS version 1 filesystem we need to
call ffs_oldfscompat_write() to unwind any in-memory changes that
were made to the superblock before writing it. The cause of this bug
was that the trimmed down maximum file size was not being reverted.

PR:           271352
Tested-by: Peter Holm
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
13 months agoifconfig(8): add the dotted format for MAC addresses.
Trond Endrestol [Tue, 13 Jun 2023 06:36:16 +0000 (06:36 +0000)]
ifconfig(8): add the dotted format for MAC addresses.

MFC after: 2 weeks
PR: 261572