Commit graph

149013 commits

Author SHA1 Message Date
R. Christian McDonald
ae2ca32781 netlink: fix potential llentry lock leak in newneigh handler
The netlink newneigh handler has the potential to leak the lock on
llentry objects in the kernel. This patch reconciles several paths
through the newneigh handler that could result in a lock leak.

MFC after:	1 week
Reviewed by:	markj, kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42307
2023-10-23 16:24:51 +02:00
Andrew Turner
271e669ed5 arm64: Teach bus_dma on arm64 about NUMA
When allocating memory we should try to allocate from the NUMA node
closest to the device to reduce cross domain memory traffic. Teach the
arm64 bus_dma code to do this.

While here use mallocarray to guard against an unlikely integer
overflow.

Reviewed by:	markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42187
2023-10-23 11:45:22 +01:00
Andrew Turner
26ac295c05 arm64: Fix long lines in vm_machdep.c
Reviewed by:	emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41828
2023-10-23 11:43:25 +01:00
Mateusz Guzik
7530de77f5 thread: add td_wantedlock
This enables obtaining lock information threads are actively waiting for
while sampling. Without the change one would only see a bunch of calls
to lock_delay(), where the stacktrace often does not reveal what the
lock might be.

Note this is not the same as lock profiling, which only produces data
for cases which wait for locks.

struct thread already has a td_lockname field, but I did not use it
because it has different semantics -- denotes when the thread is off
cpu. At the same time it could not be converted to hold a lock_object
pointer because non-curthread access would no longer be guaranteed to be
safe -- by the time it reads the pointer the lock might have been taken,
released and the object containing it freed.

Sample usage with dtrace:
rm /tmp/out.kern_stacks ; dtrace -x stackframes=100 -n 'profile-997 { @[curthread->td_wantedlock != NULL ? stringof(curthread->td_wantedlock->lo_name) : stringof("\n"), stack()] = count(); }' -o /tmp/out.kern_stacks

This also facilitates addition of lock information to traces produced by
hwpmc.

Note: spinlocks are not supported at the moment.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-10-22 17:09:45 +00:00
Mateusz Guzik
5d29ead2e2 thread: reorder td_no_sleeping to plug two 4-byte holes on LP64
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-10-22 17:09:44 +00:00
Martin Matuska
22b267e823 zfs: merge openzfs/zfs@797f55ef1
Notable upstream pull request merges:
 #14378 c0e58995e Large sync writes perform worse with slog
 #14721 797f55ef1 Do not persist user/group/project quota zap objects
                  when unneeded
 #15356 380c25f64 FreeBSD: Improve taskq wrapper
 #15390 4fbc52495 Remove lock from dsl_pool_need_dirty_delay()
 #15397 57b409856 Trust ARC_BUF_SHARED() more
 #15402 b29e98fa8 Properly pad struct tx_cpu to cache line
 #15405 ea30b5a9e Set spa_ccw_fail_time=0 when expanding a vdev
 #15416 b9384b949 FreeBSD: taskq: Remove unused declaration

Obtained from:	OpenZFS
OpenZFS commit:	797f55ef12
2023-10-22 18:26:16 +02:00
Rick Macklem
14bbf4fe5a nfscl: Handle a Getattr failure with NFSERR_DELAY following Open
During testing at a recent IETF NFSv4 Bakeathon, a non-FreeBSD
server was rebooted.  After the reboot, the FreeBSD client sent
an Open/Claim_previous with a Getattr after the Open in the same
compound.  The Open/Claim_previous was done to recover the Open
and a Delegation for for a file.  The Open succeeded, but the
Getattr after the Open failed with NFSERR_DELAY.  This resulted
in the FreeBSD client retrying the entire RPC over and over again,
until the server's recovery grace period ended.  Since the Open
succeeded, there was no need to retry the entire RPC.

This patch modifies the NFSv4 client side recovery Open/Claim_previous
RPC reply handling to deal with this case.  With this patch, the
Getattr reply of NFSERR_DELAY is ignored and the successful Open
reply is processed.

This bug will not normally affect users, since this non-FreeBSD
server is not widely used (it may not even have shipped to any
customers).

MFC after:	1 month
2023-10-21 18:33:33 -07:00
Mikel Lechner
2fee397460 ufs quotas: fix configuring soft quota grace time
The QTF_CLOSING flag needs to be cleared earlier to allow dqget() to
work.

PR:	274552
MFC after:	1 week
2023-10-21 09:08:38 +03:00
Zhenlei Huang
7a974a6498 bpf: Make dead_bpf_if const
The dead_bpf_if is not subjected to be written. Make it const so that
on destructive writing to it the kernel will panic instead of silent
memory corruption.

No functional change intended.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42189
2023-10-21 12:52:27 +08:00
Zhenlei Huang
12cce5994b x86: Prefer consistent naming for loader tunables
The following loader tunables do have corresponding sysctl MIBs but
with inconsistent naming. That may be historical reason. Let's prefer
consistent naming for them so that it will be easier to maintain.

 1. hw.dmar.timeout -> hw.iommu.dmar.timeout
 2. hw.lapic_eoi_suppression -> hw.apic.eoi_suppression
 3. hw.lapic_tsc_deadline -> hw.apic.timer_tsc_deadline
 4. hw.x2apic_enable -> hw.apic.x2apic_mode

Those tunables are for field debugging, no need to keep old names for
compatibility.

Reviewed by:	kib
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42248
2023-10-21 09:31:58 +08:00
Zhenlei Huang
9e7f349ff1 amd64 pmap: Prefer consistent naming for loader tunable
The sysctl knob 'vm.pmap.allow_2m_x_ept' is loader tunable and have
public document entry in security(7) but is fetched from kernel
environment 'hw.allow_2m_x_ept'. That is inconsistent and obscure.

As there is public security advisory FreeBSD-SA-19:25.mcepsc [1],
people may refer to it and use 'hw.allow_2m_x_ept', let's keep old
name for compatibility.

[1] https://www.freebsd.org/security/advisories/FreeBSD-SA-19:25.mcepsc.asc

Reviewed by:	kib
Fixes:		c08973d09c Workaround for Intel SKL002/SKL012S errata
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42311
2023-10-21 09:31:58 +08:00
Rick Macklem
196787f79e nfscl: Use Claim_Null_FH and Claim_Deleg_Cur_FH
For NFSv4.1/4.2, there are two new options for the Open operation.
These two options use the file handle for the file instead of the
file handle for the directory plus a file name.  By doing so, the
client code is simplified (it no longer needs the "nfsv4node" structure
attached to the NFS vnode).  It also avoids problems caused by another
NFS client (or process running locally in the NFS server) doing a
rename or remove of the file name between the Lookup and Open.

Unfortunately, there was a bug (fixed recently by commit X)
in the NFS server which mis-parsed the Claim_Deleg_Cur_FH
arguments.  To allow this patch to work with the broken FreeBSD
NFSv4.1/4.2 server, NFSMNTP_BUGGYFBSDSRV is defined and is set
when a correctly formatted Claim_Deleg_Cur_FH fails with NFSERR_EXPIRED.
(This is what the old, broken NFS server does, since it erroneously
uses the Getattr arguments as a stateID.)  Once this flag is set,
the client fills in a stateID, to make the broken NFS server happy.

Tested at a recent IETF NFSv4 Bakeathon.

MFC after:	1 month
2023-10-20 16:10:25 -07:00
Kirk McKusick
3943698c6d Minor sysctl description cleanup.
No functional change.

Agreed-by: Mateusz Guzik
2023-10-20 15:32:05 -07:00
Warner Losh
a113f9dd98 uart: Support EARLY_PRINTF on x86 for port-mapped COM ports
Support early printf for the ns8250 uart driver. Adding
	options UART_NS8250_EARLY_PORT=0xYYY
	options EARLY_PRINTF
to your kernel config will enable it. The code is rather simple minded,
so caveat emptor. This will enable printf before cninit. cninit
automatically disables this and switches to the real routine. It only
works for port-mapped COM ports, and only if you know the port's address
at compile time. It's intended for be a debugging aide, not a general
purpose thing.

Sponsored by:		Netflix
Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D42306
2023-10-20 16:07:24 -06:00
John Baldwin
f6c2774fe4 acpi_pcib: Rename decoded_bus_range to get_decoded_bus_range
While here, change the return value to bool.

Discussed by:	gibbs
2023-10-20 14:53:49 -07:00
John Baldwin
bfccb4a429 x86: Cosmetic cleanups to struct msi_intsrc
- Sort members by size.

- Change msi_msix from a u_int to a bool.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D42305
2023-10-20 14:53:05 -07:00
John Baldwin
2d49248921 x86 msi: Enable/disable IDT vectors for MSI groups all at once
Unlike MSI-X, when a device uses multiple MSI interrupts, the entire
group of interrupts are enabled/disabled at once in the relevant PCI
config register.  Currently, the interrupt code enables the IDT vector
for each MSI interrupt when a handler is first registered.  If the PCI
device triggers an MSI interrupt which doesn't yet have a handler,
this can trigger a panic when the Xrsvd ISR executes rather than
treating it as a stray device interrupt.

To fix, enable all the IDT vectors for an MSI group when the first
interrupt handler is configured, and don't disable the IDT vectors
until the last interrupt handler for the group is torn down.

When migrating an MSI group between CPUs, enable/disable the entire
group of IDT vectors if at least one interrupt handler is configured
for the group.

Reported by:	jhay
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D42232
2023-10-20 14:52:38 -07:00
Andrew Turner
2b39a6f68c arm64: Add PAC instruction macros
To support Pointer Authentication (PAC) in assembly files add a pair of
macros that sign the link register. When used before storing to the
stack it will allow hardware to detect if it has changed before using
it in the return instruction.

Reviewed by:	markj, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42226
2023-10-20 17:01:05 +01:00
Andrew Turner
82597d2102 arm64: Support creating a BTI & PAC note
To detect when an object file is build with the Branch Target
Identification (BTI) and Pointer Authentication Code (PAC) extensions
there is an elf note the compiler will insert. It will only do so from
a high level language, e.g. C or C++.

To get the not in assembly add the GNU_PROPERTY_AARCH64_FEATURE_1_NOTE
macro that can be used to create it, and the
GNU_PROPERTY_AARCH64_FEATURE_1_VAL macro to insert the correct value
based on which combination of BTI and PAC are enabled.

Reviewed by:	markj (earlier version), emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42225
2023-10-20 16:59:25 +01:00
Andrew Turner
f39010b139 sys/sys: Check for __ASSEMBLER__ in elf_common.h
When preprocessing assembly files with clang or gcc the __ASSEMBLER__
macro is defined. Check for this as an alternative to LOCORE in
elf_common.h so it can be included by .S files.

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42224
2023-10-20 16:36:28 +01:00
Doug Rabson
da4b0d6eb0 netfront: fix the support for disabling LRO at boot time
The driver has a tunable hw.xn.enable_lro which is intended to control
whether LRO is enabled. This is currently non-functional - even if its
set to zero, the driver still requests LRO support from the backend.
This change fixes the feature so that if enable_lro is set to zero, LRO
no longer appears in the interface capabilities and LRO is not requested
from the backend.

PR:		273046
MFC after:	1 week
Reviewed by:	royger
Differential Revision: https://reviews.freebsd.org/D41439
2023-10-20 11:50:20 +01:00
Wei Hu
49fa9a6437 Hyper-V: vmbus: check if signaling host is needed in vmbus_rxbr_read
It is observed that netvsc's send rings could stall on the latest
Azure Boost platforms. This is due to vmbus_rxbr_read() routine
doesn't check if host is waiting for more room to put data, which
leads to host side sleeping forever on this vmbus channel. The
problem was only observed on the latest platform because the host
requests larger buffer ring room to be available, which causes
the issue to happen much more easily.

Fix this by adding check in the vmbus_rxbr_read call and signaling
the host in the callers if check returns positively.

Reported by:	NetApp
Tested by:	whu
MFC after:	3 days
Sponsored by:	Microsoft
2023-10-20 09:15:21 +00:00
Kristof Provost
c1146e6ad6 pf: use an enum for packet direction in divert tag
The benefit is that in the debugger you will see PF_DIVERT_MTAG_DIR_IN
instead of 1 when looking at a structure. And compilation time failure
if anybody sets it to a wrong value. Using "port" instead of "ndir" when
assigning a port improves readability of code.

Suggested by:	glebius
MFC after:	3 weeks
X-MFC-With:	fabf705f4b
2023-10-20 09:16:08 +02:00
Sumit Saxena
7e02c7074c mpi3mr: Move creation of watchdog to interupt config hook
Move creation of watchdog process from just before we configure the
interrupt config hook to into the config hook itself. This prevents it
from racing the config intr hook and doing an extra reset of the
card. This extra reset is usually harmless, but sometimes it can prevent
discovery of devices if done at just the wrong time. This can lead to no
disks being registered in a box full of disks, for example. Starting it
later eliminates this race, making discovery reliable.

Reviewed by: imp
2023-10-19 15:09:38 -06:00
Rick Macklem
f300335d9a nfsd: Fix NFSv4.1/4.2 Claim_Deleg_Cur_FH
When I implemented a test patch using Open Claim_Deleg_Cur_FH
I discovered that the NFSv4.1/4.2 server was broken for this
Open option.  Fortunately it is never used by the FreeBSD
client and never used by other clients unless delegations
are enabled. (The FreeBSD NFSv4 server does not have delegations
enabled by default.)

Claim_Deleg_Cur_FH was broken because the code mistakenly
assumed a stateID argument, which is not the case.
This patch fixes the bug by changing the XDR parser to not
expect a stateID and to fill most of the stateID in from the
clientID. The clientID is the first two elements of the "other"
array for the stateID and is sufficient to identify which
client the delegation is issued to.  Since there is only one
delegation issued to a client per file, this is sufficient to
locate the correct delegation.

If you are running non-FreeBSD NFSv4.1/4.2 mounts against the
FreeBSD server, you need this patch if you have delegations enabled.

PR:	274574
MFC after:	2 weeks
2023-10-19 12:35:35 -07:00
Zhenlei Huang
f3ff0918ff vmx: Prefer consistent naming for loader tunables
The following loader tunables do have corresponding sysctl MIBs but
with different names. That may be historical reason. Let's prefer
consistent naming for them so that it will be easier to read and
maintain.

 1. hw.vmm.l1d_flush -> hw.vmm.vmx.l1d_flush
 2. hw.vmm.l1d_flush_sw -> hw.vmm.vmx.l1d_flush_sw
 3. hw.vmm.vmx.use_apic_pir -> hw.vmm.vmx.cap.posted_interrupts
 4. hw.vmm.vmx.use_apic_vid -> hw.vmm.vmx.cap.virtual_interrupt_delivery
 5. hw.vmm.vmx.use_tpr_shadowing -> hw.vmm.vmx.cap.tpr_shadowing

Old names are kept for compatibility.

Meanwhile, add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will
report them correctly.

Reviewed by:	corvink, jhb, kib, #bhyve
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D42251
2023-10-20 01:18:25 +08:00
Zhenlei Huang
02320f6420 pmap: Prefer consistent naming for loader tunable
The sysctl knob 'vm.pmap.pv_entry_max' becomes a loader tunable since
7ff48af704 (Allow a specific setting for pv entries) but is fetched
from system environment 'vm.pmap.pv_entries'. That is inconsistent and
obscure.

This reverts 36e1b9702e (Correct the tunable name in the message).

PR:		231577
Reviewed by:	jhibbits, alc, kib
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42274
2023-10-20 01:00:31 +08:00
Zhenlei Huang
afbb8041a0 amd64: Fix two typos of loader tunables
To match the sysctl MIBs and document entries in security(7).

Fixes:	2dec2b4a34 amd64: flush L1 data cache on syscall return with an error
Fixes:	17edf152e5 Control for Special Register Buffer Data Sampling mitigation

Reviewed by:	kib
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D42249
2023-10-19 23:23:33 +08:00
Kristof Provost
9eff639071 pf: remove COMPAT_FREEBSD14 #ifdef from pfvar.h
When userspace includes pfvar.h it doesn't get the kernel's COMPAT_*
defines, so we end up not having required symbols in userspace. This
caused the libpfctl port to fail to build.

libpfctl will be updated to use the new netlink-based state export code
soon, which will also fix thix build issue.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-10-19 16:19:39 +02:00
Mitchell Horne
b5437d6c65 hwpmc_amd: remove an unused variable
This should fix the LINT builds.

Reported by:	Jenkins
Sponsored by:	The FreeBSD Foundation
Fixes:	2c6f474ee8 ("hwpmc_amd: kill of k7 support bits")
2023-10-19 11:00:31 -03:00
Igor Ostapenko
fabf705f4b pf: fix pf divert-to loop
Resolved conflict between ipfw and pf if both are used and pf wants to
do divert(4) by having separate mtags for pf and ipfw.

Also fix the incorrect 'rulenum' check, which caused the reported loop.

While here add a few test cases to ensure that divert-to works as
expected, even if ipfw is loaded.

divert(4)
PR:		272770
MFC after:	3 weeks
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D42142
2023-10-19 12:12:15 +02:00
Dmitry Chagin
bb8ecf259f vfs cache: Fallback to namei to resolve symlinks with leading / in target for non-native ABI
This is a temporary solution to fix PR before release.
During 15.0 it's necessary to refactor symlinks handling
between vfs & namecache.

PR:			273414
Reported by:		Vincent Milum Jr, Dan Kotowski, glebius
Tested by:		Dan Kotowski, glebius
Reviewed by:
Differential Revision:	https://reviews.freebsd.org/D41806
MFC after:		3 days
2023-10-19 13:33:58 +03:00
Gleb Smirnoff
28f6910714 net/route: properly brace the RT_LOG() macro 2023-10-18 22:21:53 -07:00
John Hall
f07b267d8c smartpqi: Change alignment for dma tags
Problem: Under certain I/O conditions, a program doing large block disk
reads can cause a controller to crash.

Root Cause: The SCSI read request and destination address in the BDMA
descriptor is incorrect, causing the BDMA engine in the controller to
assert.

Fix: Change the alignment for creating bus_dma_tags in the driver from
PAGE_SIZE (4k) to 1, which allows the controller to manage it's own
address range for BDMA transactions.

Risk: Medium

Exposure: This reverts a change first made to support NVMe drives on
Excalibur. At that time a 4k alignment was necessary. This no longer
seems to be the case.

PR: 259541
Reported by: Ka Ho Ng <khng@freebsd.org>
Reviewed by: imp
Differential Revision:	https://reviews.freebsd.org/D41619
2023-10-18 21:12:27 -06:00
John F. Carr
b064a4c9ee smartpqi: Drop spinlock before freeing memory
pqisrc_free_device frees the device softc with the os spinlock
held. This causes crashes when devices are removed because the memory
free might sleep (which is prohibited with spin locks held). Drop the
spinlock before releasing the memory.

MFC After: 2 days
PR: 273289
Reviewed by: imp
2023-10-18 21:06:40 -06:00
Rick Macklem
17f5e2b904 param.h: Bump __FreeBSD_version for commit 57ce37f9dc
Commit 57ce37f9dcc0 changed the internal KAPI between the
nfscommon and nfscl modules.  Both must be rebuilt from sources.
2023-10-18 13:12:26 -07:00
Rick Macklem
57ce37f9dc nfscl: Make NFSv4.2 Copy set atime on infd
RFC7862 does not specify infile atime behaviour when a NFSv4.2 Copy
operation is performed.  Since the collective opinion of a mailing
list discussion (on freebsd-hackers@) seemed to indicate that
copy_file_range(2) should update atime on the infd,
even if there is no data copied, this
patch attempts to ensure that behaviour.

For Copy, it preceeds the Copy operation with a Setattr of
TimeAccess_Set(NFSv4. speak for atime) for the invp.  For the case
where no data will be copied, it does a Setattr RPC to set
TimeAccess_Set for the invp.

A __FreeBSD_version bump will be done as a separate commit, since
this patch changes the internal interface between the nfscommon and
nfscl modules.

MFC after:	1 month
2023-10-18 13:07:39 -07:00
Rick Macklem
c4e298251a nfscl: Handle the NFSERR_RETRYUNCACHEDREP error from a NFSv4 server
In a recent email list discussion related to NFSv4 mount problems
against a non-FreeBSD NFSv4 server, the reporter of the issue noted
that the server had replied 10068 (NFSERR_RETRYUNCACHEDREP).  This
did not seem related to the mount problem, but I had never seen this
error before.  It indicates that an RPC retry after a new TCP
connection has been established failed because the server did not
cache the reply.  Since this should only happen for idempotent
operations, redoing the RPC should be safe.

This patch modifies the NFSv4.1/4.2 client to redo the RPC instead
of considering the server error fatal.  It should only affect the
unusual case where TCP connections to NFSv4 servers are breaking
without the NFSv4 server rebooting.

Reported by:	J David <j.devid.lists@gmail.com>
MFC after:	2 weeks
2023-10-18 12:42:12 -07:00
Mitchell Horne
82d6d46d0d pmc: remove last bits of AMD K7 CPU support
This includes event definitions from sys/pmc_events.h, definitions from
sys/pmc.h, and the man pages.

Reviewed by:	jkoshy
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41275
2023-10-18 15:05:45 -03:00
Mitchell Horne
2c6f474ee8 hwpmc_amd: kill off k7 support bits
This is i386-only, and has been effectively disabled since 2018 when the
companion support was removed from libpmc (e92a1350b5). Remove the
kernel support to simplify the AMD class.

Reviewed by:	jkoshy
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41274
2023-10-18 15:05:45 -03:00
Mitchell Horne
75780146d6 hwpmc_amd: simplify counter descriptor definitions
No functional change intended.

Reviewed by:	jkoshy
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41273
2023-10-18 15:05:44 -03:00
Mitchell Horne
d9e3fe3226 hpwmc_amd.c: style improvements
- Return style
 - Explicit value checks
 - Whitespace formatting
 - Comment formatting
 - Local variable declaration order
 - __unused annotations

Reviewed by:	jkoshy
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41272
2023-10-18 15:05:44 -03:00
Mitchell Horne
440e7cb4ac hwpmc_core: remove two non-existent function prototypes
Reviewed by:	jkoshy
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41271
2023-10-18 15:05:44 -03:00
Mitchell Horne
90a6ea5ca0 hwpmc: tidy pcd_finalize methods
Make them a little bit more consistent with one another in terms of what
is done:
 - Add/reduce assertions to what is most useful: a loop to ensure
   pcpu_fini freed everything
 - Add PMCDBG trace entries

The exception is the dmc620/cmn600 classes, which behave a little
differently, so leave them untouched.

Reviewed by:	jkoshy
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41270
2023-10-18 15:05:44 -03:00
Dag-Erling Smørgrav
3a338c5341 Add the BBR and RACK stacks to the LINT kernel.
While here, drop the EXTRA_TCP_STACKS option, which serves no purpose and
should never have been added.  Instead, build bbr and rack as long as
either or both of INET and INET6 is enabled.  There is no risk to anyone
who doesn't load one or both and then twiddle the relevant sysctls.

Differential Revision:	https://reviews.freebsd.org/D42088
2023-10-18 16:13:12 +02:00
Mark Johnston
f88bd1174a linuxkpi: Fix an assertion in linux_free_kmem()
In the LinuxKPI, PAGE_MASK is the logical negation of FreeBSD's
PAGE_MASK, so the original assertion was simply incorrect.

Reported by:	trasz
Tested by:	trasz
Fixes:		6223d0b67a ("linuxkpi: Handle direct-mapped addresses in linux_free_kmem()")
2023-10-18 09:43:02 -04:00
Rick Macklem
db7257ef97 nfsd: Fix a server crash
PR#274346 reports a crash which appears to be caused by a NULL default session
being destroyed.  This patch should avoid the crash.

Tested by:	Joshua Kinard <freebsd@kumba.dev>
PR:	274346
MFC after:	2 weeks
2023-10-17 19:43:25 -07:00
Rick Macklem
cd5edc7db2 nfsd: Avoid acquiring a vnode for some NFSv4 Readdir operations
Without this patch, a NFSv4 Readdir operation acquires the vnode for
each entry in the directory.  If only the Type, Fileid, Mounted_on_fileid
and ReaddirError attributes are requested by a client, acquiring the vnode
is not necessary for non-directories.  Directory vnodes must be acquired
to check for server file system mount points.

This patch avoids acquiring the vnode, as above, resulting in a 3-8%
improvement in Readdir RPC RTT for some simple tests I did.

Note that only non-rdirplus NFSv4 mounts will benefit from this change.

Tested during a recent IETF NFSv4 Bakeathon testing event.

MFC after:	1 month
2023-10-17 13:55:48 -07:00
R. Christian McDonald
6e281255ea lltable: fix ddb show llentry l3_addr pretty printer
The ddb commands for lltable do not produce useful l3_addr information.

This fixes the llentry pretty printer to correctly display the l3_addr

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42253
2023-10-17 19:03:49 +02:00
Warner Losh
9b42d3e12f mkimg: Ensure GPT Entry Array is at least 16k
UEFI v2.10 Section 5.3 documentes that the minimum reserved space after
the GPT header be at least 16kB. Enforce this minimum. Before, we'd only
set the number of entries to be the unpadded size. gpart's selective
enforcement of aspects of the GPT standard meant that these images would
work, but couldn't be changed (to add a partition or grow the size of a
partition). This ensures that gpart's overly picky standards don't cause
problems for people wishing to, for example, resize release images.

MFC after:		1 day (we want this in 14.0)
PR:			274312
Sponsored by:		Netflix
Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D42245
2023-10-17 11:14:23 -06:00