]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 months agomd driver compat32: fix structure padding for arm, powerpc
Mike Karels [Tue, 8 Aug 2023 14:09:03 +0000 (09:09 -0500)]
md driver compat32: fix structure padding for arm, powerpc

Because the 32-bit md_ioctl structure contains 64-bit members, arm
and powerpc add padding to a multiple of 8.  i386 doesn't do this.
The md_ioctl32 definition was correct for amd64/i386 without padding,
but wrong for arm64 and powerpc64.  Make __packed__ conditional on
__amd64__, and test for the expected size on non-amd64.  Note that
mdconfig is used in the ATF test suite.  Note, I verified the
structure size for powerpc, but was unable to test.

Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D41339
Discussed with: jhibbits

(cherry picked from commit 58a46cfd751ac726ddca8544bf73a290b0154a57)

10 months agobhyve: add bootindex option for several devices
Corvin Köhne [Mon, 16 Aug 2021 07:50:15 +0000 (09:50 +0200)]
bhyve: add bootindex option for several devices

The bootindex option creates an entry in the "bootorder" fwcfg file.
This file can be picked up by the guest firmware to determine the
bootorder. Nevertheless, it's not guaranteed that the guest firmware
uses the bootorder. At the moment, our OVMF ignores the bootorder. This
will change in the future.

If guest firmware supports the "bootorder" fwcfg file and no device uses
the bootindex option, the boot order is determined by the firmware
itself. If one or more devices specify a bootindex, the first bootable
device with the lowest bootindex will be booted. It's not garanteed that
devices without a bootindex will be recognized as bootable from the
firmware in that case.

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

(cherry picked from commit 480bef9481f0c44b19ac4b2adb09f6c3191acd41)

10 months agobhyve: add helper to create a bootorder
Corvin Köhne [Mon, 16 Aug 2021 07:47:53 +0000 (09:47 +0200)]
bhyve: add helper to create a bootorder

Qemu's fwcfg allows to define a bootorder. Therefore, the hypervisor has
to create a fwcfg item named bootorder, which has a newline seperated
list of boot entries. Qemu's OVMF will pick up the bootorder and applies
it.

Add the moment, bhyve's OVMF doesn't support a custom bootorder by
qemu's fwcfg. However, in the future bhyve will gain support for qemu's
OVMF. Additonally, we can port relevant parts from qemu's to bhyve's
OVMF implementation.

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

(cherry picked from commit 6632a0a4e3ab68b0e31b612e8aeca14de3fc8159)

10 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

(cherry picked from commit 71fb2dcb0023d49fc048e1f7b610ad05bd2efc32)

10 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

(cherry picked from commit 1115cdcf7af12fd06ca255b981cb579a7bb7a147)

10 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

(cherry picked from commit 6952b9d25e18fd3a4bf0d1bb7d6b44ff6edf6737)

10 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

(cherry picked from commit d9fa7c113df254b237e5a573d0567eb686e5fcde)

10 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

(cherry picked from commit 1bd361eea28ae74b42d49bfc96b109a7eae9f3d3)

10 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

(cherry picked from commit 4a9bf50f408eb9f1acc220dba2b260ec610fd15b)

10 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

(cherry picked from commit 90c3a1b6629c80a7e4c3fa86d6b794596fdf06b4)

10 months agobhyve: import OpRegion definitions
Corvin Köhne [Wed, 10 May 2023 10:25:19 +0000 (12:25 +0200)]
bhyve: import OpRegion definitions

Those definitions are required for the GVT-d emulation to parse the
OpRegion.

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

(cherry picked from commit b67f0d360b87d6e8a71ab5118a8acb350505c20a)

10 months agobhyve: add helper for passthru specific mmio ranges
Corvin Köhne [Wed, 10 May 2023 10:22:33 +0000 (12:22 +0200)]
bhyve: add helper for passthru specific mmio ranges

Intel GPUs have two special memory regions. They are called Graphics
Stolen Memory and OpRegion. bhyve has to emulate both of them. In order
to keep track of those special regions, add generic mmio ranges to the
passthru emulation.

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

(cherry picked from commit 93cf93179c505cebbcdbeef196d523d36890ed4a)

10 months agobhyve: make passthru sel public available
Corvin Köhne [Wed, 10 May 2023 10:19:49 +0000 (12:19 +0200)]
bhyve: make passthru sel public available

The GVT-d emulation requires access to this selector to read from the
device.

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

(cherry picked from commit 60793cee27993048864f60e3c19039386e4a4ab0)

10 months agobhyve: allow adding FwCfg items to ACPI tables
Corvin Köhne [Fri, 22 Jul 2022 08:58:01 +0000 (10:58 +0200)]
bhyve: allow adding FwCfg items to ACPI tables

A TPM has an event log. Therefore, qemu adds a FwCfg item and adds it to
an ACPI table. We like to use the same OVMF driver as qemu, so we should
do the same. This commit adds the ability to basl to do it.

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

(cherry picked from commit 4e46ab0ebe96b56d4fa7ea7df4a81cd533109f07)

10 months agobhyve: add cmdline option for user defined fw_cfg items
Corvin Köhne [Wed, 8 Sep 2021 09:31:21 +0000 (11:31 +0200)]
bhyve: add cmdline option for user defined fw_cfg items

Some guest allow to configure themself by fw_cfg. E.g. Fedora CoreOs can
be provisioned by adding a JSON file as fw_cfg item.

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

(cherry picked from commit ca14781c8170f3517ae79e198c0c880dbc3142dd)

bhyve: error out if fwcfg user file isn't read completely

At the moment, fwcfg reads the file once at startup and passes these
data to the guest. Therefore, we should always read the whole file.
Otherwise we should error out.

Additionally, GCC12 complains that the comparison whether
fwcfg_file->size is lower than 0 is always false due to the limited
range of data type.

Reviewed by: markj
Fixes: ca14781c8170f3517ae79e198c0c880dbc3142dd ("bhyve: add cmdline option for user defined fw_cfg items")
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40076

(cherry picked from commit 26d9f973d8691eccc098ded7326137d6f76ad243)

10 months agobhyvectl: Add '--get-debug-cpus' command
Vitaliy Gusev [Tue, 25 Jul 2023 12:03:54 +0000 (14:03 +0200)]
bhyvectl: Add '--get-debug-cpus' command

vmm and libvmmapi already have handlers for that. When adding debug
cpus, they were only used for the debug stub. Over time, they were
reused by other parts like snapshots or idle APs.

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

(cherry picked from commit 65f8467e3351c38a9d57b538b85cf6c5fab5818e)

10 months agobhyve: rename 'structs' snapshot key with 'kern_structs'
Vitaliy Gusev [Mon, 15 May 2023 14:25:15 +0000 (14:25 +0000)]
bhyve: rename 'structs' snapshot key with 'kern_structs'

Using key 'structs' is ambiguous. This section contains data
related to the kernel. It should use a more informative naming.

Reviewed by: corvink, rew
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D40104

(cherry picked from commit 50aef9f62c1be9e723169ef57920c3fca07bd2fb)

10 months agobhyve: add .pe_snapshot method for PCI 'hostbridge'
Vitaliy Gusev [Mon, 15 May 2023 16:29:56 +0000 (16:29 +0000)]
bhyve: add .pe_snapshot method for PCI 'hostbridge'

There is no error when dump doesn't have it, but to be more
consistent this PCI devices should be saved as well.

Reviewed by: corvink, rew
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D40108

(cherry picked from commit 6f7d2cf8bbb5ce6c4dbe0153d54cdc474b5266f4)

10 months agobhyve: add bus, slot and func to device name
Vitaliy Gusev [Mon, 15 May 2023 14:28:45 +0000 (14:28 +0000)]
bhyve: add bus, slot and func to device name

Each device needs a unique identifier to store and restore snapshots
properly. Adding the pci bsf information to the device name creates a
unique identifier as a bsf can't be occupied twice.

Reviewed by: corvink
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D40107

(cherry picked from commit 14c80457b0f6a5eb6ff9a1db573462410c64a454)

10 months agobhyve: rename 'user_dev' with 'devices'
Vitaliy Gusev [Mon, 15 May 2023 14:28:14 +0000 (14:28 +0000)]
bhyve: rename 'user_dev' with 'devices'

Bhyve don't use 'user' specifier for emulated devices. And
using 'user' adds duality.

Reviewed by: corvink, rew
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D40106

(cherry picked from commit b10d65a420f068bccf6aaf2942157a5347211dc5)

10 months agobhyve: save/restore pir_desc
Vitaliy Gusev [Tue, 9 May 2023 08:27:29 +0000 (10:27 +0200)]
bhyve: save/restore pir_desc

Failing to preserve pir_desc can result in pending interrupts being lost
on resume leading to a hung VM.

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

(cherry picked from commit c543e09f1f8ef98f201f7dd3f34ae023d61dfa83)

10 months agokern: osd: avoid dereferencing freed slots
Kyle Evans [Thu, 10 Aug 2023 17:32:33 +0000 (12:32 -0500)]
kern: osd: avoid dereferencing freed slots

If a slot is freed that isn't the last one, we'll set its destructor to
NULL to indicate that it's been freed and leave a hole in the slot map.
Check osd_destructors in osd_call() to avoid dereferencing a method that
is potentially from a module that's been unloaded.

This scenario would most commonly surface when two modules are loaded
that osd_register(), then the earlier one deregisters and an osd_call()
is made after the fact.  In the specific report that triggered the
investigation, kldload if_wg -> kldload linux* -> kldunload if_wg ->
destroy a jail -> panic.

Noted in the review, but left for follow-up work, is that the realloc
that may happen in osd_deregister() should likely go away and the
assumption that reallocating to a smaller size cannot fail is actually
not correct.

Reported by: dim

(cherry picked from commit 2bd446d7f1a03fbf6d98ace4548f8793599f48fb)

10 months agovlan: Respect IFCAP_LRO mask
Kevin Bowling [Sat, 12 Aug 2023 16:31:22 +0000 (09:31 -0700)]
vlan: Respect IFCAP_LRO mask

vlan_capabilities(), used by the IFCAP ioctl, was not respecting the
IFCAP_LRO bit if it was masked by the requestor.

This prevented if_bridge(4) from automasking LRO with a message like:
bridge0: can't disable some capabilities on em3.11: 0x400

This also prevented manually disabling LRO from any vlan interface.

PR: 254596
Reported by: Paul Vixie <paul@redbarn.org>

(cherry picked from commit b1a39c31a3569bd045a0f40057c3773fc8166f6d)

10 months agoe1000: Some fixes for hardware capabilities
Kevin Bowling [Thu, 3 Aug 2023 20:49:15 +0000 (13:49 -0700)]
e1000: Some fixes for hardware capabilities

This MFC squash retains disabled TSO ultimately, but contains some
capability fixes.

f1b5488f:
e1000: Enable TSO for lem(4) and em(4)

Most em(4) devices now enjoy TSO and TSO6, matching NetBSD and Linux
defaults.

A prior commit automasks TSO on 10/100 Ethernet due to errata and other
bugs for IPv6 were fixed recently allowing this.

Mike Karels identified a performance anomaly on Intel 82574L devices.
These are multiqueue enabled on FreeBSD since the conversion to
iflib.  I am investigating whether this can be fixed, in the mean time
MSI-X with checksum offloads remain default.

i219 SPT devices have an errata that downclocks the DMA engine, which
results in TSO not being able to acheive line rate.  Therefore, it is
disabled on:
* Intel(R) I219-LM and I219-V SPT
* Intel(R) I219-LM and I219-V SPT-H (2)
* Intel(R) I219-LM and I219-V LBG (3)
* Intel(R) I219-LM and I219-V SPT (4)
* Intel(R) I219-LM and I219-V SPT (5)

Many lem(4) devices enjoy TSO, exceptions being 82542, 82543, 82547.
TSO6 may be possible for some chipsets but I am still working through
my testing matrix and that is hidden behind hw.em.unsupported_tso.

If you encounter issues, you may disable TSO with for example:
ifconfig em0 -tso -tso6.
I ask to be informed of any deviations from normal operation requiring
this.

Thanks to cc@ for access to emulab.net.

On a sample I219 system it saves about 16% CPU on IPv4 and 19% on IPv6.

iperf3 -Vc reported numbers:
total% user% system%

IPv4 TSO
21.3 7 14.4
21.4 6 15.4
21.5 6 15.5

IPv4 no TSO
36.8 5.4 31.4
38.5 5.1 33.5
38.2 5.7 32.6

IPv4 no TSO no TXCSUM
45.1 5.8 39.3
46 6.3 39.7
46.2 5.9 40.4

IPv6 TSO6
21.7 5.4 16.3
21.6 5.1 16.5
21.9 5.6 16.3

IPv6 no TSO6
41.2 5.2 36
41 5.1 36
40.8 5.2 35.7

IPv6 no TSO6 no TXCSUM6
49 5.9 43.1
48.8 4.9 43.9
49 5.6 43.4

Tested by: cc (lem(4)), karels (82574L)
Relnotes: yes
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D41170

13da8423:
e1000: Enable TSO on 82574

Further testing indicates something wrong with particular reciever,
enabling TSO 82574 for wider testing.

Tested by: karels

797e480c:
e1000: disable TSO on lem(4) and em(4)

Disable TSO on lem(4) and em(4) until a ring stall can be debugged.

I am not able to reproduce the issue on lem(4) but disabling there in
abundance of caution in case the issue is not specific to em(4).

Reported by: grog

(cherry picked from commit f1b5488f7bba7f25a57750f87cbcbccbd5b9d16b)
(cherry picked from commit 13da84237a37961938e9e237171ac111ddc1897c)
(cherry picked from commit 797e480cba8834e584062092c098e60956d28180)

10 months agoe1000: Fix off by one ipcse
Kevin Bowling [Tue, 15 Aug 2023 21:37:43 +0000 (14:37 -0700)]
e1000: Fix off by one ipcse

This has been off by one in the FreeBSD drivers as far back as I've
looked.  Emperically HW and SW emulations I have available don't seem to
mind.  Noticed while debugging other issues.

(cherry picked from commit eac761e967b34066aa7183474249df87d79a2f32)

10 months agomsi: report error for attempt to use APIC ID > 255
Ed Maste [Tue, 8 Aug 2023 23:42:09 +0000 (19:42 -0400)]
msi: report error for attempt to use APIC ID > 255

The MSI/MSI-X address includes 8 bits to encode the Destination ID.
Previously IDs over 255 overlapped with the fixed portion of the
address, resulting in an invalid value (and a nonfunctional interrupt).

Instead, print an error message and return EINVAL.  The interrupt will
still not work, but the user will have a clue as to why.

PR: 273022
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41395

(cherry picked from commit cbf845052f1c2862a64e66dbaf38e887a7592474)

10 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

(cherry picked from commit 740d76544ad8a59f1be53584a0aa5bbbe00833ee)

10 months agobhyve: Remove vestigial support for setting max vCPUs.
John Baldwin [Mon, 12 Jun 2023 10:47:35 +0000 (12:47 +0200)]
bhyve: Remove vestigial support for setting max vCPUs.

The kernel part of the hypervisor is not going to support per-VM maxcpu
limits. The topology is only used to control the values returned by
CPUID leaves for which max vCPUs is not relevant.

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

(cherry picked from commit bb1770105022e7d65bef0f32988c08ee9676b68e)

10 months agobhyve: fix vCPU single-stepping on VMX
Bojan Novković [Tue, 9 May 2023 07:02:04 +0000 (09:02 +0200)]
bhyve: fix vCPU single-stepping on VMX

This patch fixes virtual machine single stepping on VMX hosts.

Currently, when using bhyve's gdb stub, each attempt at single-stepping
a vCPU lands in a timer interrupt. The current single-stepping mechanism
uses the Monitor Trap Flag feature to cause VMEXIT after a single
instruction is executed. Unfortunately, the SDM states that MTF causes
VMEXITs for the next instruction that gets executed, which is often not
what the person using the debugger expects. [1]

This patch adds a new VM capability that masks interrupts on a vCPU by
blocking interrupt injection and modifies the gdb stub to use the newly
added capability while single-stepping a vCPU.

[1] Intel SDM 26.5.2 Vol. 3C

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

(cherry picked from commit fefac543590db4e1461235b7c936f46026d0f318)

10 months agobhyve: don't panic if e820 finds no available memory
Corvin Köhne [Tue, 9 May 2023 12:32:33 +0000 (14:32 +0200)]
bhyve: don't panic if e820 finds no available memory

The GVT-d emulation tries to allocate some specific memory. It could
happen that this address doesn't exist. In that case, GVT-d will fall
back to allocate any address. Nevertheless, this only works if the e820
fails with an error instead of exiting on an assertion.

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

(cherry picked from commit 99aeb28b2f7e28c516dd6434db63a9bc1c1f3218)

10 months agoixgbe: Check for fw_recovery
Kevin Bowling [Thu, 10 Aug 2023 00:31:49 +0000 (17:31 -0700)]
ixgbe: Check for fw_recovery

The x550 uses an upgradable flash code.  Check for recovery condition
like other flashable intel cards do in case of fw errors.

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

(cherry picked from commit 8b4a3fbdd57215cffde530e2fa3098c272a985fe)

10 months agoigc: sync srrctl buffer sizing with e1000
Kevin Bowling [Thu, 10 Aug 2023 14:41:21 +0000 (07:41 -0700)]
igc: sync srrctl buffer sizing with e1000

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

(cherry picked from commit 0eb8cd1de26849cbaefaf3bc59aa9612fa0dfa52)

10 months agoixgbe: Add support for 82599 LS
Kevin Bowling [Thu, 10 Aug 2023 01:30:15 +0000 (18:30 -0700)]
ixgbe: Add support for 82599 LS

Obtained from: DPDK 549ccd3dc01539e060597b503f2b65b272de3347

(cherry picked from commit 9228ac3a69c4c7401a743e6465e118101a2beeb0)

11 months agoping: use the in6_addr buffer when parsing src address as AF_INET6
R. Christian McDonald [Tue, 8 Aug 2023 18:40:02 +0000 (14:40 -0400)]
ping: use the in6_addr buffer when parsing src address as AF_INET6

Reviewed by: kp
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 9f2cddd261d09b736893454cb8b7aa0651ac5211)

11 months agoroute(8): teach route to attach to jails
Yan Ka, Chiu [Tue, 13 Jun 2023 06:05:17 +0000 (06:05 +0000)]
route(8): teach route to attach to jails

Add -j <jail> flag to route(8) to allow route to perform actions in
a Jail.

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

(cherry picked from commit ab4d1b73cbf8980dbe05cde7d822010042db8344)

11 months agoifconfig(8): Teach ifconfig to attach and run itself in a jail
Yan Ka Chiu [Tue, 23 May 2023 20:39:22 +0000 (16:39 -0400)]
ifconfig(8): Teach ifconfig to attach and run itself in a jail

Add -j <jail> flag to ifconfig to allow ifconfig to attach and run inside a
jail. This allow parent to configure network interfaces of its children
even if ifconfig is not available in child's tree (e.g. Linux Jails)

Reviewed by: emaste, khng, melifaro
Event: Kitchener-Waterloo Hackathon 202305
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40213

(cherry picked from commit 7e49aa86a2824e76e9d9becf61db12066bc0d79d)

11 months agotmpfs: add the "pgread" mount option to the allowed options list for mount
Konstantin Belousov [Fri, 11 Aug 2023 18:00:44 +0000 (21:00 +0300)]
tmpfs: add the "pgread" mount option to the allowed options list for mount

(cherry picked from commit 765ad5b28d3fa272208aedc3047a6a3dff561037)

11 months agotmpfs: add a knob to enable pgcache read for mount
Konstantin Belousov [Sun, 6 Aug 2023 01:35:36 +0000 (04:35 +0300)]
tmpfs: add a knob to enable pgcache read for mount

(cherry picked from commit 0f613ab85e5a5274704d179f39fb15163d46e7c4)

11 months agovnode io: request range-locking when pgcache reads are enabled
Konstantin Belousov [Sun, 6 Aug 2023 01:23:35 +0000 (04:23 +0300)]
vnode io: request range-locking when pgcache reads are enabled

PR: 272678

(cherry picked from commit 821dec4d56a876db56a82cf1dc54a84905b74f5b)

11 months agoRevert "vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()"
Konstantin Belousov [Sun, 6 Aug 2023 01:23:42 +0000 (04:23 +0300)]
Revert "vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()"

(cherry picked from commit 651fdc3d198d066b18823db3b74cf38a0144dfac)

11 months agovnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()
Konstantin Belousov [Sun, 23 Jul 2023 15:55:50 +0000 (18:55 +0300)]
vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()

PR: 272678

(cherry picked from commit 5b353925ff61b9ddb97bb453ba75278b578ed7d9)

11 months agotcp: Handle <RST,ACK> in SYN-RCVD
Richard Scheffenegger [Wed, 26 Jul 2023 22:41:25 +0000 (00:41 +0200)]
tcp: Handle <RST,ACK> in SYN-RCVD

Patch base stack to correctly handle the RST bit independently
of other header flags per TCP RFC.

MFC after: 1 week
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D40982

(cherry picked from commit b352ef58c29b1f2967e358c147e0f7faf8cfbef3)

11 months agoClean up libm use of the __ieee754_ prefix
Steve Kargl [Thu, 3 Aug 2023 19:51:17 +0000 (21:51 +0200)]
Clean up libm use of the __ieee754_ prefix

This removes the __ieee754_ prefix from a number of the math functions.
msun/src/math_private.h contains the statement that

  /*
   * ieee style elementary functions
   *
   * We rename functions here to improve other sources' diffability
   * against fdlibm.
   */
   #define        __ieee754_sqrt  sqrt
   ...

Here, fdlibm refers to https://netlib.org/fdlibm. It is seen from
https://netlib.org/fdlibm/readme that this prefix was used to
differentiate between different standards:

   Wrapper functions will twist the result of the ieee754
   function to comply to the standard specified by the value
   of _LIB_VERSION
      if _LIB_VERSION = _IEEE_, return the ieee754 result;
      if _LIB_VERSION = _SVID_, return SVID result;
      if _LIB_VERSION = _XOPEN_, return XOPEN result;
      if _LIB_VERSION = _POSIX_, return POSIX/ANSI result.
   (These are macros, see fdlibm.h for their definition.)

AFAICT, FreeBSD has never supported these wrappers. In addition, as C99,
principally the long double, functions were added to libm, this
convention was not maintained. Given that only 148 of 324 files under
lib/msun contain a "Copyright (C) 1993 by Sun Microsystems" statement,
the removal of the __ieee754_ prefix provides consistency across all
source files.

The last time someone compared lib/msun to fdlibm appears to be

  commit 3f70824172feb82ea3dcdb3866b54fe0eb7cd890
  Author: David Schultz <das@FreeBSD.org>
  Date:   Fri Feb 4 18:26:06 2005 +0000

  Reduce diffs against vendor source (Sun fdlibm 5.3).

The most recent fdlibm RCS string that appears in a Sun Microsystem
copyrighted file is date "95/01/18". With Oracle Corporation's
acquisition of Sun Microsystems in 2009, it is unlikely that fdlibm will
ever be updated. A search for fdlibm at https://opensource.oracle.com/
yields no hits.

Finally, OpenBSD removed the use of this prefix over 21 years ago. pSee
revision 1.6 of OpenBSD's math_private.h.

Note: this does not drop the __ieee754_ prefix from the trigonometric
argument reduction functions, e.g., __ieee754_rem_pio2. These functions
are internal to the libm and exported through Symbol.map; and thus,
reserved for the implementation.

PR: 272783
MFC after: 1 week

(cherry picked from commit 99843eb89954dac76afe7cf18d962eddfe7a7987)

11 months agolibc dlfcn.c: make dl_iterate_phdr() from libc more useful
Konstantin Belousov [Wed, 9 Aug 2023 05:07:05 +0000 (08:07 +0300)]
libc dlfcn.c: make dl_iterate_phdr() from libc more useful

PR: 272992

(cherry picked from commit 21a52f99440c9bec7679f3b0c5c9d888901c3694)

11 months agosys/cdefs.h: fix for use __restrict in C++
Sebastian Huber [Sun, 6 Aug 2023 13:27:27 +0000 (16:27 +0300)]
sys/cdefs.h: fix for use __restrict in C++

PR: 272723

(cherry picked from commit 15876d9fd83fdfa7d541ea747eb40faeade975d2)

11 months agoUpdate comment describing struct vm_map
Konstantin Belousov [Thu, 10 Aug 2023 05:01:39 +0000 (08:01 +0300)]
Update comment describing struct vm_map

(cherry picked from commit 9da33e8d10736c255bf63d408837c6942bd28e04)

11 months agoImprove dumpfs(8) error messages when a cylinder group read fails.
Kirk McKusick [Sun, 6 Aug 2023 06:09:18 +0000 (23:09 -0700)]
Improve dumpfs(8) error messages when a cylinder group read fails.

Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 02b7bf07c5d2ec578fc044b60229c6e951f26087)

11 months agopf.conf.5: document SCTP support
Kristof Provost [Wed, 21 Jun 2023 08:04:07 +0000 (10:04 +0200)]
pf.conf.5: document SCTP support

Mention SCTP in the pf.conf.5

Reviewed by: tuexen
MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40870

(cherry picked from commit 47d0c1fe7d3279e9d38df75cf0c359b1fbc26d5e)

11 months agopf tests: test SCTP pfsync
Kristof Provost [Wed, 7 Jun 2023 09:55:06 +0000 (11:55 +0200)]
pf tests: test SCTP pfsync

Ensure that SCTP connections survive a failover to the backup pf
instance.

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40869

(cherry picked from commit b7a9a5773a0fdf9b9c7839d79d76dbc6b69a6c4b)

11 months agopf tests: test 'rdr' for SCTP
Kristof Provost [Thu, 1 Jun 2023 16:03:07 +0000 (18:03 +0200)]
pf tests: test 'rdr' for SCTP

Explicitly test that we cannot change the port number with rdr.
That's not a desireable feature on SCTP, because it could break
multihomed connections.

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40868

(cherry picked from commit 4369a57514f227c989d4de87d1ce54470279ba41)

11 months agopf tests: test SCTP NAT
Kristof Provost [Thu, 1 Jun 2023 13:28:58 +0000 (15:28 +0200)]
pf tests: test SCTP NAT

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40867

(cherry picked from commit 1e02b7cb07ce31ad3c9e8c8be806d2825febb5ab)

11 months agopf: add SCTP NAT support
Kristof Provost [Thu, 1 Jun 2023 13:04:48 +0000 (15:04 +0200)]
pf: add SCTP NAT support

Support NAT-ing SCTP connections.

This is mostly similar to UDP and TCP, but we refuse to change ports for
SCTP, to avoid interfering with multihomed connections.

As a result we also never copy the SCTP header back or recalculate
checksums as we'd do for TCP or UDP (because we don't modify the header
for SCTP).

We do use the existing pf_change_ap() function to modify the packet,
because we may still need to update the IPv4 header checksum.

Reviewed by: tuexen
MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40866

(cherry picked from commit 6053adafaa54204f91c43939fa334bde835403cb)

11 months agopf tests: test SCTP 'return'
Kristof Provost [Wed, 31 May 2023 19:45:29 +0000 (21:45 +0200)]
pf tests: test SCTP 'return'

Ensure that we send a correct abort message for 'block return' rules.

Test this by validating that nc doesn't sit around waiting for a
connection. It should give up immediately when it receives the abort.

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40865

(cherry picked from commit 2d42aa9d7ba64fe7166f76234a595637f0c212cf)

11 months agopf: support 'return' for SCTP
Kristof Provost [Wed, 31 May 2023 14:03:39 +0000 (16:03 +0200)]
pf: support 'return' for SCTP

Send an SCTP Abort message if we're refusing a connection, just like we
send a RST for TCP.

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40864

(cherry picked from commit d1bc1e9e1ae04016e16154884914d839566ebaec)

11 months agopf tests: basic SCTP connection test
Kristof Provost [Thu, 27 Apr 2023 09:13:40 +0000 (11:13 +0200)]
pf tests: basic SCTP connection test

pf can now inspect SCTP. Check that we can set up a connection.
IPv4 and IPv6 tests.

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40863

(cherry picked from commit 95363473793986eeecf19f7ed78d05f25cfa7b87)

11 months agopf: initial SCTP support
Kristof Provost [Thu, 27 Apr 2023 08:58:02 +0000 (10:58 +0200)]
pf: initial SCTP support

Basic state tracking for SCTP. This means we scan through the packet to
identify the different chunks (so we can identify state changes).

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40862

(cherry picked from commit 010ee43f5673eea4c86f846893eadc3c5529b2f8)

11 months agopfctl: SCTP can have port numbers
Kristof Provost [Wed, 26 Apr 2023 14:59:40 +0000 (16:59 +0200)]
pfctl: SCTP can have port numbers

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40861

(cherry picked from commit 0bd4a6837c4bc3dd6168c5679c21c58d41a6910e)

11 months agopf: use sctp_calculate_cksum()
Kristof Provost [Fri, 7 Jul 2023 08:04:51 +0000 (10:04 +0200)]
pf: use sctp_calculate_cksum()

This function is always available, even if the SCTP or SCTP_SUPPORT options
are not set.
That lets us remove an ifdef, and also means we improve pf's SCTP handling
when the options are not set.

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D40911

(cherry picked from commit 61e22e9b2905f405170c249a2239f324229b60d1)

11 months agolinux(4): Add elf_hwcap2 to x86
Dmitry Chagin [Fri, 28 Jul 2023 08:56:59 +0000 (11:56 +0300)]
linux(4): Add elf_hwcap2 to x86

On x86 Linux via AT_HWCAP2 the user controlled (by tunables) processor
capabilities are exposed.

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

(cherry picked from commit 4281dab8bc11b3b2f3b58be5e0f67806329bddae)

11 months agolinux: binutils as requires %eflags instead of %flags for CFI.
John Baldwin [Fri, 30 Jun 2023 16:36:16 +0000 (09:36 -0700)]
linux: binutils as requires %eflags instead of %flags for CFI.

This applies the changes to linux32_locore.asm from commit
a35572b16e38 to the i386 copy.

(cherry picked from commit f4de136aa82978107aa98f91ca1928870b7d310a)

11 months agoinet.3: remove mention of VAX endianness
Ed Maste [Tue, 1 Aug 2023 17:20:12 +0000 (13:20 -0400)]
inet.3: remove mention of VAX endianness

Machine endianness is not very important in understanding the inet*
functions; the endianness of the VAX is especially so.

PR: 272728
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 89c762c815dae64a39221956070af549b11ceb80)

11 months agoarm64-iommu: Fix a typo in a kernel message
Gordon Bergling [Fri, 4 Aug 2023 11:52:36 +0000 (13:52 +0200)]
arm64-iommu: Fix a typo in a kernel message

- s/endianess/endianness/

(cherry picked from commit f0ab805200fc304e4255fc68f9fb8d5400de84ce)

11 months agoudf: reject invalid block sizes from lvd
Konstantin Belousov [Fri, 4 Aug 2023 22:47:09 +0000 (01:47 +0300)]
udf: reject invalid block sizes from lvd

PR: 272893

(cherry picked from commit 9e6941a2c7a393aefe6a123952c6eacbc23098a6)

11 months agoopensm libopensm: remove non-existent symbols from the version map
Konstantin Belousov [Thu, 3 Aug 2023 08:52:06 +0000 (11:52 +0300)]
opensm libopensm: remove non-existent symbols from the version map

(cherry picked from commit 21d6c29f344d587a99314f9cd960cc008cb3dec4)

11 months agoopensm libvendor: remove non-existent symbols from the version map
Konstantin Belousov [Thu, 3 Aug 2023 08:44:19 +0000 (11:44 +0300)]
opensm libvendor: remove non-existent symbols from the version map

(cherry picked from commit 6fdf714d5d18f5d6d3f2ae3889a788a3ebead5cc)

11 months agoopensm libosmcomp: remove non-existent symbols from the version map
Konstantin Belousov [Thu, 3 Aug 2023 08:29:31 +0000 (11:29 +0300)]
opensm libosmcomp: remove non-existent symbols from the version map

(cherry picked from commit 67c5de2dcacc7642f4648f9ec25eb10dd7387de1)

11 months agolibrmdacm: rdma_get_local_addr and rdma_get_peer_addr are not exported
Konstantin Belousov [Thu, 3 Aug 2023 08:08:32 +0000 (11:08 +0300)]
librmdacm: rdma_get_local_addr and rdma_get_peer_addr are not exported

(cherry picked from commit e5cf232b3f2484601b2a30f71dcbe9861e22370e)

11 months agolibrdmacm: remove rsocket symbols from the map file
Konstantin Belousov [Thu, 3 Aug 2023 07:54:09 +0000 (10:54 +0300)]
librdmacm: remove rsocket symbols from the map file

(cherry picked from commit 9a7eba89f972e0dac0f53d0d442328248eb949ec)

11 months agolibibverbs: remove nonexistent symbols from the linker map
Konstantin Belousov [Tue, 1 Aug 2023 22:56:40 +0000 (01:56 +0300)]
libibverbs: remove nonexistent symbols from the linker map

(cherry picked from commit dd0f2d02c683c6ee885dda8ed323a1586c409967)

11 months agoFixes for bugs in sinpi/cospi/tanpi
Steve Kargl [Mon, 31 Jul 2023 22:34:48 +0000 (01:34 +0300)]
Fixes for bugs in sinpi/cospi/tanpi

PR: 272742

(cherry picked from commit 2d3b0a687b910c84606e4bc36176945ad5c60406)

11 months agoCleanup debugging code in libm
Steve Kargl [Mon, 31 Jul 2023 22:32:54 +0000 (01:32 +0300)]
Cleanup debugging code in libm

PR: 272765

(cherry picked from commit c66a499e037efd268a744e487e7d0c45a4944a9b)

11 months agoixv: Separate VFTA table for each interface
Yuichiro Naito [Thu, 3 Aug 2023 20:36:21 +0000 (13:36 -0700)]
ixv: Separate VFTA table for each interface

The vlan setting is independent for each interface. Use VFTA table in
'struct ixgbe_softc' that is already defined.

This pull request fixes following bug scenario.

    create ixv0.10
    create ixv1.10
    destroy ixv1.10
    create ixv0.11
    ixv0.10 no longer receives vlan 10 packets.

In this case, destroying ixv1.10 affects to ixv0.

Pull Request: https://github.com/freebsd/freebsd-src/pull/774

(cherry picked from commit 61a8231d152c38ac96b697ea3ca8ff220f3aa536)

11 months agoixgbe: Warn once for unsupported SFPs
Kevin Bowling [Thu, 3 Aug 2023 05:59:37 +0000 (22:59 -0700)]
ixgbe: Warn once for unsupported SFPs

The driver belabors the point about unsupported SFPs, printing multiple
times on link up. Limit it to once.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D39785

(cherry picked from commit a93409fc3cd7b4d4aeb35d7ef27f84c1ae13a42d)

11 months agoe1000: Automask TSO on lem(4)/em(4) 10/100 Ethernet
Kevin Bowling [Thu, 3 Aug 2023 05:47:15 +0000 (22:47 -0700)]
e1000: Automask TSO on lem(4)/em(4) 10/100 Ethernet

This feature masks TSO capability when a link comes up at 10 or 100mbit
due to errata on the chips.  This behavior matches previous versions of
FreeBSD as well as NetBSD and Linux.

A tunable, hw.em.unsupported_tso may be set if the admin desires to
disabling automasking and configure TSO settings manually.

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

(cherry picked from commit 2ddf24f8f52559b08da700ab044c33d0a9ed5601)

11 months agovm_map: Add a macro to fetch a map entry's split boundary index
Mark Johnston [Tue, 9 May 2023 14:07:15 +0000 (10:07 -0400)]
vm_map: Add a macro to fetch a map entry's split boundary index

The resulting code is a bit more concise.  No functional change
intended.

Reviewed by: alc, dougm, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41249

(cherry picked from commit d0e4e53ebd6499d420c19426586eeeafec157150)

11 months agossh: comment deprecated option handling for retired local patches
Ed Maste [Wed, 2 Aug 2023 14:18:33 +0000 (10:18 -0400)]
ssh: comment deprecated option handling for retired local patches

Older versions of FreeBSD included the HPN patch set and provided
client-side VersionAddendum.  Both of these changes have been retired
but we've retained the option parsing for backwards compatibility to
avoid breaking upgrades.  Add comment references to the relevant
commits.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit a93cbba2deed209a30da1ecffa637bf5c61b7641)

11 months agoe1000: Fix lem(4)/em(4) TSO6
Kevin Bowling [Mon, 31 Jul 2023 15:16:24 +0000 (08:16 -0700)]
e1000: Fix lem(4)/em(4) TSO6

* Fix TSO6 by specializing IP checksum insertion and following Intel SDM
  values for IPv6.
* Remove unnecessary 82544 IP-bit handling
* Remove TSO6 from lem(4) capabilitities

Reviewed by: erj (earlier version)
Differential Revision: https://reviews.freebsd.org/D41170

(cherry picked from commit e1353dcb63bbdb33be6a907ed6236c120518129e)

11 months agovfs: Deleting a doubled inclusion of sys/capsicum.h
Dmitry Chagin [Sat, 29 Jul 2023 08:21:58 +0000 (11:21 +0300)]
vfs: Deleting a doubled inclusion of sys/capsicum.h

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

(cherry picked from commit dbac8474fe442a7fdbdcdc3ee4a9fe177b7bf46c)

11 months agolinux(4): Fix control message size calculation
Dmitry Chagin [Sat, 29 Jul 2023 08:21:35 +0000 (11:21 +0300)]
linux(4): Fix control message size calculation

To determine the size in bytes needed to hold a control message
and its contents of length len, CMSG_SPACE should be used.

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

(cherry picked from commit 67116c69052d27dbd6d6c066104850d4d53f0041)

11 months agolinux(4): Use M_LINUX for malloc type of proc emuldata
Dmitry Chagin [Tue, 18 Jul 2023 21:44:17 +0000 (00:44 +0300)]
linux(4): Use M_LINUX for malloc type of proc emuldata

MFC after: 2 weeks

(cherry picked from commit b834497c6d0cccaeebad8d94a32c8dd3ec0d3f9b)

11 months agolinux(4): Use M_LINUX for malloc type in getdents
Dmitry Chagin [Tue, 18 Jul 2023 21:44:16 +0000 (00:44 +0300)]
linux(4): Use M_LINUX for malloc type in getdents

MFC after: 2 weeks

(cherry picked from commit 7729467781670a84059d50c4726dc94cbf4500e9)

11 months agolinux(4): Use M_LINUX for malloc type in getdents64
Dmitry Chagin [Tue, 18 Jul 2023 21:44:16 +0000 (00:44 +0300)]
linux(4): Use M_LINUX for malloc type in getdents64

MFC after: 2 weeks

(cherry picked from commit e27e3fa71c8f31304efa5e065876a34ee603a388)

11 months agolinux(4): Delete a useless variable in getdents64
Dmitry Chagin [Tue, 18 Jul 2023 21:44:16 +0000 (00:44 +0300)]
linux(4): Delete a useless variable in getdents64

MFC after: 2 weeks

(cherry picked from commit b27f3237c82bde866cb24f7299eaa356e8b29eb2)

11 months agolinux(4): Use M_LINUX for malloc type in readdir
Dmitry Chagin [Tue, 18 Jul 2023 21:44:15 +0000 (00:44 +0300)]
linux(4): Use M_LINUX for malloc type in readdir

MFC after: 2 weeks

(cherry picked from commit 13d049ab8dd718d0723229d54062c91b2fc68fda)

11 months agolinux(4): Delete a useless variable in readdir
Dmitry Chagin [Tue, 18 Jul 2023 21:44:15 +0000 (00:44 +0300)]
linux(4): Delete a useless variable in readdir

MFC after: 2 weeks

(cherry picked from commit fffb2e8de691ba6677616f7e0e5c442f4e7e722a)

11 months agolinux(4): Properly allocate buffer for kern_getdirentries in readdir
Dmitry Chagin [Tue, 18 Jul 2023 21:44:15 +0000 (00:44 +0300)]
linux(4): Properly allocate buffer for kern_getdirentries in readdir

Looks like prior to ino64 project the size of the struct linux_dirent
was greater (or equal) to the size of the native struct dirent so the
native dirent fit into the buffer. After ino64 project the size of the
native struct dirent has increased.

Spotted by gcc12.
MFC after: 2 weeks

(cherry picked from commit fc1c787aa0157090e765ebba484e6e290e99f177)

11 months agoObsoleteFiles.inc: Remove leading slash from 20230714 entry
Marius Strobl [Wed, 19 Jul 2023 16:56:35 +0000 (18:56 +0200)]
ObsoleteFiles.inc: Remove leading slash from 20230714 entry

Fixes: c3f58005d92e signal: Remove gsignal references from manuals
(cherry picked from commit 37eec7f68a79d100d8f5d439138acc21cd8b4efa)

11 months agosignal: Remove gsignal references from manuals
Dmitry Chagin [Thu, 13 Jul 2023 21:15:47 +0000 (00:15 +0300)]
signal: Remove gsignal references from manuals

Reported by: Mina Galić, mhorne
Reviewed by: Mina Galić, mhorne
Differential Revision: https://reviews.freebsd.org/D41020
MFC after: 1 week

(cherry picked from commit c3f58005d92e5ac189e7dcb2d6d868ed5a0f27fa)

11 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

(cherry picked from commit 17cb2ac3dfcab3f47727c3c1725c61f6b98f690b)

11 months agoman: Link _Fork(2) man page
Dmitry Chagin [Fri, 28 Jul 2023 08:54:20 +0000 (11:54 +0300)]
man: Link _Fork(2) man page

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

(cherry picked from commit 03eab865aabab1e6737ad0fd1537f7d0a8c3ee02)

11 months agoarm64: Add constants for decoding ISS fields for WF* exceptions
Mark Johnston [Fri, 28 Jul 2023 13:32:45 +0000 (09:32 -0400)]
arm64: Add constants for decoding ISS fields for WF* exceptions

WFI and WFIT trap to EL2 when executed in a vmm guest.  (Currently
WFE/WFET are not configured to trap.)  We only handle WFI at the moment,
so these constants are useful when handling the exception.

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

(cherry picked from commit dd24d475d514bba755111c5eecfef1d362b9d68c)

11 months agopcpu: Remove unused definitions of ALT_STACK_SIZE
Mark Johnston [Mon, 24 Jul 2023 15:26:08 +0000 (11:26 -0400)]
pcpu: Remove unused definitions of ALT_STACK_SIZE

This was added originally for the sparc64 port and apparently copied to
other platforms.  No functional change intended.

MFC after: 1 week

(cherry picked from commit 1083a8cd855b4ec09b62bf9c1df5b06a972a91ea)

11 months agocd9660: do not leak buffers in cd9660_rrip_loop()
Konstantin Belousov [Mon, 31 Jul 2023 22:55:13 +0000 (01:55 +0300)]
cd9660: do not leak buffers in cd9660_rrip_loop()

PR: 272856

(cherry picked from commit fa3cf6cdc68cb6d6f2c440f2653258d68eae1015)

11 months agofork1(): properly track the state of the pg_killsx lock
Konstantin Belousov [Wed, 26 Jul 2023 23:24:30 +0000 (02:24 +0300)]
fork1(): properly track the state of the pg_killsx lock

(cherry picked from commit 474708c334a7d4fb27049e7dabaf5b74542568dd)

11 months agokillpg(): close a race with fork(), part 2
Konstantin Belousov [Thu, 20 Jul 2023 21:19:03 +0000 (00:19 +0300)]
killpg(): close a race with fork(), part 2

(cherry picked from commit 232b922cb363e01ac0dd2a277d93cf74d8485e79)

11 months agosigtd(): prefer non-stopped thread as a target for signal queue
Konstantin Belousov [Fri, 21 Jul 2023 09:41:39 +0000 (12:41 +0300)]
sigtd(): prefer non-stopped thread as a target for signal queue

(cherry picked from commit dfe172484d0e1de0bb32bcab8775eb83e15031c0)

11 months agokillpg(2): close a race with fork(2), part1
Konstantin Belousov [Mon, 12 Jun 2023 07:33:43 +0000 (10:33 +0300)]
killpg(2): close a race with fork(2), part1

(cherry picked from commit 3360b48525fc966894e77b8cd9c124669664472d)

11 months agogitignore: whack dead architectures
Mateusz Guzik [Wed, 23 Nov 2022 01:18:03 +0000 (01:18 +0000)]
gitignore: whack dead architectures

(cherry picked from commit 04af98db59102159682c366cbdaeca2d260d46a8)

11 months agostand: Update testing script for arch retirement
Warner Losh [Sun, 14 Aug 2022 14:41:11 +0000 (08:41 -0600)]
stand: Update testing script for arch retirement

And catch up to changes in booting methods currently supported. Add
riscv.

(cherry picked from commit aff95057bca1dc929996a616b0c39a6ff89a1bbf)

11 months agotests: also remove sparc64 case
Ed Maste [Tue, 8 Nov 2022 18:14:55 +0000 (13:14 -0500)]
tests: also remove sparc64 case

(cherry picked from commit 185efcc376b9dcb3b920d1053a250ac754ad163a)