Commit Graph

285177 Commits

Author SHA1 Message Date
Warner Losh
9db2db6bf6 cam/ata: Migrate to modern uintXX_t from u_intXX_t
As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html
move to the modern uintXX_t.

MFC After:	3 days
Sponsored by:	Netflix
2023-07-24 21:32:56 -06:00
Warner Losh
7af2f2c801 cam: Migrate to modern uintXX_t from u_intXX_t
As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html
move to the modern uintXX_t.

MFC After:	3 days
Sponsored by:	Netflix
2023-07-24 21:32:56 -06:00
Mark Johnston
789df254cc amd64: Use a larger boot stack
With sanitizers enabled, it becomes possible to overflow the stack when
only a single page is used.  Follow arm64's example and use the default
kernel stack size instead.  This is a bit wasteful, but without a guard
page, overflow merely corrupts adjacent .bss entries and is thus
difficult to debug.

Note, with a GENERIC kernel we already consume over half of the
available boot stack space, see the review for an example.

Reviewed by:	kib
Reported by:	Jenkins
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41166
2023-07-24 18:49:36 -04:00
Konstantin Belousov
5b353925ff vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()
To ensure atomicity of reads against parallel writes and truncates,
vnode lock was not enough at least since introduction of vn_io_fault().
That code only take rangelock when it was possible that vn_read() and
vn_write() could drop the vnode lock.

At least since the introduction of VOP_READ_PGCACHE() which generally
does not lock the vnode at all, rangelocks become required even
for filesystems that do not need vn_io_fault() workaround.  For
instance, tmpfs.

PR:	272678
Analyzed and reviewed by:	Andrew Gierth  <andrew@tao11.riddles.org.uk>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41158
2023-07-25 01:02:59 +03:00
Mykola Hohsadze
4a07c77863 arm64/disassem.c: add extended register instruction definitions
Add disassembly support for the following extended register
instructions: add, adds, sub, subs, cmp, cmn.

Reviewed by:	mhorne
MFC after:	1 week
Pull Request:	https://reviews.freebsd.org/D40967
2023-07-24 17:51:11 -03:00
Mykola Hohsadze
e57b86266b arm64/disassem.c: remove redundant OP_RN_SP for TYPE_02
Removed redundant OP_RN_SP for TYPE_02, since these addressing modes
always use the SP register, never XZR.

Reviewed by:	mhorne
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D40588
2023-07-24 17:51:08 -03:00
John Baldwin
92103adbeb nvme: Use a memdesc for the request buffer instead of a bespoke union.
This avoids encoding CAM-specific knowledge in nvme_qpair.c.

Reviewed by:	chuck, imp, markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D41119
2023-07-24 10:32:58 -07:00
Marius Strobl
0b416346e1 bus_dma: Trim CAM includes from subr_bus_dma.c
These are no longer needed after commit c5312bd79e.  This did
require adding an include of <sys/limits.h> instead for SIZE_T_MAX
which previously was dragged in via header pollution.
2023-07-24 10:26:06 -07:00
Andrew Turner
7a16546025 arm: Only include sysreg.h when needed in asm.h
We only need sysreg.h for armv6 barriers

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41141
2023-07-24 17:58:16 +01:00
Andrew Turner
379c736c5a Add old arm headers to ObsoleteFiles.inc
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41140
2023-07-24 17:58:15 +01:00
Andrew Turner
29629d9e76 arm: Rename pte-v6.h to pte.h
There is no need for this to be versioned after the removal of armv4/v5

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41139
2023-07-24 17:58:15 +01:00
Andrew Turner
1e7dfc94cc arm: Move contents of pmap-v6.h into pmap.h
Previously we had an armv4/v5 and armv6/v7 copy of the pmap header. As
we have removed armv4/v5 support we can now merge the armv6/v7 code
into pmap.h

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41138
2023-07-24 17:58:15 +01:00
Andrew Turner
67d39872e2 arm: Move contents of cpu-v6.h into cpu.h
Previously we had an armv4/v5 and armv6/v7 copy of the cpu.h header. As
we have removed armv4/v5 support we can now merge the armv6/v7 code
into cpu.h

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41137
2023-07-24 17:58:14 +01:00
Andrew Turner
835927fd8e arm: Remove swi.h
It has been unneeded since moving to the Arm EABI

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41136
2023-07-24 17:58:14 +01:00
Andrew Turner
04b1532935 arm: Move contents of atomic-v6.h into atomic.h
Previously we had an armv4/v5 and armv6/v7 implementation of the atomic
operations. As we have removed armv4/v5 support we can now merge the
armv6/v7 code into atomic.h

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41135
2023-07-24 17:58:13 +01:00
Andrew Turner
554cdf8f57 arm: Explain why _atomic_subword.h is needed
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41134
2023-07-24 17:58:13 +01:00
Andrew Turner
e0e5127ff4 Remove left over includes from armv4/v5
These includes were added for armv4 and armv5 support. Remove them as
this has been removed from the tree.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41133
2023-07-24 17:58:13 +01:00
Kristof Provost
b03012d0b6 netinet6 tests: test for loss of Solicited-node multicast groups
The multicast code has an issue where it can lose the Solicited-node
multicast group subscription if the same address is added twice.

Test for this.

PR:		233683
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D41123
2023-07-24 16:47:50 +02:00
Kristof Provost
9c9a76dc68 mld: always commit state changes on leaving
Resolve a race condition where we'd lose the Solicited-node multicast
group subscription if we assigned the same IPv6 address twice.

PR:		233683
Reviewed by:	ae
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41124
2023-07-24 16:47:34 +02:00
Mitchell Horne
a4e4ea738b sys_getrandom: fix a function reference in a comment
MFC after:	3 days
Sponsored by:	FreeBSD Foundation
2023-07-24 10:50:04 -03:00
Mitchell Horne
09e5d91069 puc: fix man page reference
The reference to puc(9) is wrong; the page does not exist, and drivers
belong to section 4. Change the reference to puc(4), which does exist.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-07-24 09:54:42 -03:00
Martin Matuska
e64fe029e9 libarchive: merge from vendor branch
Libarchive 3.7.0

Important changes (relevant to FreeBSD):
  #1814 Do not account for NULL terminator when comparing with "TRAILER!!!"
  #1818 Add ability to produce multi-frame zstd archives
  #1840 year 2038 fix for pax archives on platforms with 64-bit time_t
  #1860 Make single bit bitfields unsigned to avoid clang 16 warning
  #1869 Fix FreeBSD builds with WARNS=6
  #1873 bsdunzip ported to libarchive from FreeBSD
  #1894 read support for zstd compression in 7zip archives
  #1918 ARM64 filter support in 7zip archives

MFC after:	2 weeks
PR:		272567 (exp-run)
2023-07-24 07:42:43 +02:00
Jessica Clarke
7f9318a022 bsd.linker.mk: Use :C not :S for regex
Whilst ^ and $ are supported with C, those are special cases, and
general regex syntax like groups and alternations are not. Use the
correct modifier so we get a version number out that's not 0 (which is
what happens when it can't be parsed by the later code).

Fixes:		c4177f5b41 ("bsd.linker.mk: Handle Xcode 15 linker identification")
MFC after:	1 week
2023-07-24 01:50:55 +01:00
Jessica Clarke
c4177f5b41 bsd.linker.mk: Handle Xcode 15 linker identification
The upcoming Xcode 15 introduces a new linker (called ld-prime or ld-new
in some documentation) to replace the classic ld64, which we need to
handle.

Previously, the linker would identify itself as:

  @(#)PROGRAM:ld  PROJECT:ld64-<version>

Now, there are two cases. When the classic ld64 is in use, it identifies
itself as:

  @(#)PROGRAM:ld-classic  PROJECT:ld64-<version>

When the new linker is in use, it identifies itself as:

  @(#)PROGRAM:ld  PROJECT:dyld-<version>

Thus, tweak the detection to allow a -classic suffix in the PROGRAM
string and to allow a dyld- prefix instead of an ld64- prefix on the
version number in the PROJECT string.

MFC after:	1 week
2023-07-24 01:34:17 +01:00
Dimitry Andric
80e4ac2964 Work around VNET and DPCPU related panics on aarch64
lld >= 14 and recent GNU ld can relax adrp+add and adrp+ldr
instructions, which breaks VNET and DPCPU when used in modules.

Until VNET and DPCPU can be fixed to deal with these relaxed
instructions, disable linker relaxation for now.

PR:		264094
Reviewed by:	markj
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D41156
2023-07-24 00:35:04 +02:00
Michael Tuexen
058d1722b0 sctp: include sctp_module.c in kernel builds
Allow kldload to detect that SCTP has been build into the kernel.

MFC after:	3 days
2023-07-23 14:34:10 +02:00
Dimitry Andric
f576172682 Move LIBADD lines from usr.bin/clang/*/Makefile one level up
Some utilities under usr.bin/clang were only linked to libz, while most
others were linked to libz and libzstd. Make this consistent, and remove
repetition, by moving these LIBADD lines to usr.bin/clang/clang.prog.mk
and usr.bin/clang/clang.prog.mk.

MFC after:	3 days
2023-07-23 22:04:55 +02:00
Xin LI
9df529b8a1 login_getclassbyname(3): use calloc. 2023-07-23 11:18:24 -07:00
Mateusz Guzik
176d83eafc vfs: fix up NDFREE_PNBUF usage in vfs_mountroot_shuffle
Noted by:	karels
2023-07-23 13:44:15 +00:00
Mateusz Guzik
4d9b2ed34b ufs: stop using LK_SLEEPFAIL in ffs_sync
It provides nothing as either locking succeeds or fails with ENOENT as
is.
2023-07-23 13:44:15 +00:00
Michael Tuexen
52640d6174 sctp: update zero checksum support
Implement support for the error detection method identifier.
MFC after:	2 weeks
2023-07-23 06:41:32 +02:00
Dimitry Andric
b8f1c9dd9b Merge commit 2b0f5df7b4e0 from llvm-project (by Jessica Clarke):
[builtins][Mips] Un-break FreeBSD build of __clear_cache

  Commit 674a17e9bbe8 ("MIPS/compiler_rt: use synci to flush icache on
  r6") completely removed the OS-specific guards under the guise of "For
  pre-r6, we can use cacheflush libc function, which is same on Linux and
  FreeBSD." However, the code in question had guards for Linux and
  OpenBSD, not Linux and FreeBSD, and FreeBSD does not have a cacheflush
  libc function as claimed, so this was neither the statement they
  intended to make nor was it sufficient justification for making the code
  completely unconditional. Whilst the upcoming FreeBSD 14 release has
  dropped support for MIPS, FreeBSD 13 has support for it.

  Fix this by only calling cacheflush on the OSes where it was previously
  called, and not on other OSes where it either definitely isn't available
  (FreeBSD) or is unknown (any other OS than the three mentioned in this
  commit).

This is only needed for MFC'ing, as mips has been removed from
14-CURRENT.

PR:		271047
MFC after:	immediately
2023-07-23 13:01:42 +02:00
Marius Strobl
83e67a9d14 xhci(4): Describe AMD 400 Series USB 3.1 controllers
While at it, correct the string for 300 series ones, these also are
already xHCI 3.1.

Fixes:	d171d2f2 Add AHCI/XHCI device IDs found on AMD Ryzen+B350 system
2023-07-23 09:21:46 +02:00
Alan Cox
7b1e606c72 arm64 pmap: Retire PMAP_INLINE
Neither of the remaining callers to pmap_kremove() warrant inlining.
Those calls rarely occur.  In other words, we were optimizing for the
uncommon case.

MFC after:	1 week
2023-07-23 00:34:17 -05:00
Alan Cox
0aebcfc9f4 arm64 pmap: Eliminate some duplication of code
pmap_unmapbios() can simply call pmap_kremove_device() rather than
duplicating its code.

While I'm here, add a comment to pmap_kremove_device() explaining its
proper use, and fix a whitespace issue.

MFC after:	1 week
2023-07-23 00:34:17 -05:00
Kevin Bowling
92fd2f39e5 e1000: add missing parens in csum setup
Reported by:	rscheff
Fixes:	4f9a44a215 e1000: Fix/enable IPv6 transmit checksum offload
MFC after:	2 weeks
2023-07-22 17:05:55 -07:00
Kevin Bowling
4f9a44a215 e1000: Fix/enable IPv6 transmit checksum offload
Fixes and enables txcsum6 offload for lem(4) and em(4).

MFC after:	2 weeks
2023-07-22 15:58:34 -07:00
Kevin Bowling
918c25677d e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes
* em(4) obey administrative ifcaps for using hwcsum offload
* em(4) obey administrative ifcaps for hw vlan receive tagging
* em(4) add additional TSO6 ifcap, but disabled by default as is TSO4
* lem(4) obey administrative ifcaps for using hwcsum offload
* lem(4) add support for hw vlan receive tagging
* lem(4) Add ifcaps for TSO offload experimentation, but disabled by
  default due to errata and possibly missing txrx code.
* lem(4) disable HWCSUM ifcaps by default on 82547 due to errata around
  full duplex links.  It may still be administratively enabled.

Reviewed by:	markj (previous version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30072
2023-07-22 12:13:43 -07:00
Dmitry Chagin
22dca7acf7 linux(4): Implement xattr syscalls
Reviewed by:
Differential revision:	https://reviews.freebsd.org/D35544
MFC after:		1 month
2023-07-22 14:03:33 +03:00
Dmitry Chagin
6453d4240f vfs: Export exattr methods to reuse by Linuxulator
Reviewed by:
Differential revision:	https://reviews.freebsd.org/D35543
MFC after:		1 month
2023-07-22 14:03:33 +03:00
Dmitry Chagin
d9c2dc6bf1 linux(4): Regen for xattr syscalls
MFC after:		1 month
2023-07-22 14:03:32 +03:00
Dmitry Chagin
41f2c69ee3 linux(4): Modify xattr syscalls to match Linux
MFC after:		1 month
2023-07-22 14:03:31 +03:00
Dmitry Chagin
241a55b461 libc/csu: Do not compile the finalizer() for PIC build
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D41148
2023-07-22 11:56:06 +03:00
Alan Cox
29edff0dea arm64/riscv pmap: Initialize the pmap's pm_pvchunk field
I believe that there are two reasons that the missing TAILQ
initialization operations haven't caused a problem.  First, the TAILQ
head's first field is being initialized to zeroes elsewhere.  Second,
the first access to the TAILQ head's last field is by
TAILQ_INSERT_HEAD(), which assigns to the last field without reading
it when the first field is NULL.

Reviewed by:	kib, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41118
2023-07-21 23:58:18 -05:00
Kevin Bowling
5d3c982549 Revert "e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes"
Seems to cause a panic when booting under VitrualBox.

Reported by:	yasu

This reverts commit 95f7b36e8f.
2023-07-21 21:42:23 -07:00
Konstantin Belousov
bc310a95c5 ip output: ensure that mbufs are mapped if ipsec is enabled
Ipsec needs access to packet headers to determine if a policy is
applicable. It seems that typically IP headers are mapped, but the code
is arguably needs to check this before blindly accessing them. Then,
operations like m_unshare() and m_makespace() are not yet ready for
unmapped mbufs.

Ensure that the packet is mapped before calling into IPSEC_OUTPUT().

PR:	272616
Reviewed by:	jhb, markj
Sponsored by:	NVidia networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41112
2023-07-21 21:51:13 +03:00
Warner Losh
ff4633d9f8 cam_periph: Comment about why we need to reset cbfcnp
Just spent a few minutes puzzling out why we do this. Add a comment to
remind my future self (and other intersted folk) why we do the reset
here when we'd set it a few lines above.

Sponsored by:		Netflix
2023-07-21 10:11:37 -06:00
Warner Losh
b4993704d6 cam_periph: Fix a comment
Add a couple of words so that this sentence makes sense.

Sponsored by:		Netflix
2023-07-21 10:07:13 -06:00
Ed Maste
8f8da1bcc7 seq: style(9) cleanup
This is in part for diff reduction with OpenBSD.

Sponsored by:	The FreeBSD Foundation
2023-07-21 10:17:24 -04:00
Kristof Provost
47d0c1fe7d 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
2023-07-21 12:32:19 +02:00