Doug Moore [Tue, 14 May 2024 04:22:52 +0000 (23:22 -0500)]
arm64_pmap: narrow scope of bti_same test
The pmap_bti_same test in pmap_enter_l3c only happens in the
!ADDR_IS_KERNEL case; in the other case, a KASSERT fails. So move the
test into that case to save a bit of time when ADDR_IS_KERNEL.
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D45160
* VERSION (_MAKE_VERSION): 20240508
Merge with NetBSD make, pick up
o make: ensure variables set on command line get added to
.MAKEOVERRIDES (even if they start with '.') so they are passed to
sub-makes.
Warner Losh [Mon, 13 May 2024 21:58:59 +0000 (15:58 -0600)]
nvme: Add comment about where tr->deadline is set
It's easy to overlook the chain of events that lead to tr->deadline
being updated. Add a comment here to explain what otherwise looks like
an oversight w/o careful study.
tmpfs_destroy_vobject(): clear v_object under the object lock
Which allows tmpfs_pager_writecount_recalc() to reliably detect
reclaimed vnode and make its accesses to object->un_pager.swp.private
(== vp) safe against reclaim. Note that vnode instantiation already
assigns v_object under the object lock.
Reviewed by: markj
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D45119
Kristof Provost [Mon, 13 May 2024 10:06:47 +0000 (12:06 +0200)]
if_ovpn: cope with loops
User misconfiguration may lead to routing loops where we try to send the tunnel
packet into the tunnel. This eventually leads to stack overflows and panics.
Avoid this using if_tunnel_check_nesting(), which will drop the packet if we're
looping or we hit three layers of nested tunnels.
Kyle Evans [Mon, 13 May 2024 05:23:50 +0000 (00:23 -0500)]
Add a build knob for _FORTIFY_SOURCE
In the future, we will Default to _FORTIFY_SOURCE=2 if SSP is enabled,
otherwise default to _FORTIFY_SOURCE=0. For now we default it to 0
unconditionally to ease bisect across older versions without the new
symbols, and we'll put out a call for testing.
include/*.h include their ssp/*.h equivalents as needed based on the
knob. Programs and users are allowed to override FORTIFY_SOURCE in their
Makefiles or src.conf/make.conf to force it off.
Kyle Evans [Mon, 13 May 2024 05:23:50 +0000 (00:23 -0500)]
Prepare the system for _FORTIFY_SOURCE
Notably:
- libc needs to #undef some of the macros from ssp/* for underlying
implementations
- ssp/* wants a __RENAME() macro (snatched more or less from NetBSD)
There's some extra hinkiness included for read(), since libc spells it
as "_read" while the rest of the world spells it "read."
Kyle Evans [Mon, 13 May 2024 05:23:49 +0000 (00:23 -0500)]
Import _FORTIFY_SOURCE implementation from NetBSD
This is a mostly-unmodified copy of the various *_chk implementations
and headers from NetBSD, without yet modifying system headers to start
actually including them. A future commit will also apply the needed
bits to fix ssp/unistd.h.
Warner Losh [Sun, 12 May 2024 04:53:15 +0000 (22:53 -0600)]
linprocfs: Really fix time_t type issue
The cast to (long) is wrong on all the other 32-bit platforms. (long
long) is the correct type on all platforms. Also, use a z modifier for
size_t which also fails on 32-bit platforms.
Warner Losh [Sat, 11 May 2024 22:36:23 +0000 (16:36 -0600)]
linprocfs: Fix i386 time type
Cast the time type to (long). This is correct on all architectures. On
i386, this promotes the int time_t to a long (which is also 32-bit). On
64-bit architectures, this promotes the 64-bit signed time_t to a 64-bit
signed int type.
Ahmad Khalifa [Sat, 20 Apr 2024 00:52:57 +0000 (02:52 +0200)]
usb: Remove uneeded revision verbosity from quirks list
Seperate usb quirks that target specific revisions from those that
dont. Alot of the quirks dont use lo_rev and hi_rev, so we can abstract
the 0x0000, 0xffff into a macro.
[[ This commit is a bit more churn than we like. I carefully reviewed
each one and they are all good. The end product is better -- imp ]]
Ahmad Khalifa [Sat, 20 Apr 2024 00:51:25 +0000 (02:51 +0200)]
usb: Fix quirks list
In some cases, the USB_QUIRK_VP macro was being misused. Instead of
setting quirks to the intended value, the first two supplied quirks
would go into lo_rev and hi_rev. Replace it with USB_QUIRK_VO which only
takes the needed args. This also makes the Dummy products, which where
being used to correctly set vendor only quirks, not necessary.
Warner Losh [Sat, 11 May 2024 19:01:10 +0000 (13:01 -0600)]
nvmecontrol: Appease a meaningless signed error warning thing
Consistently use the weird ssize_t type for things I know are unsigned,
but which none-the-less need to be compared to signed things to prevent
a bogus warning. Sigh, these aren't bugs, can't possibly be bugs and
a waste of time to fix.
Warner Losh [Mon, 8 Apr 2024 16:54:12 +0000 (10:54 -0600)]
nvmecontrol: Implement telemetry-log command.
This produces the same data as the Linux nvme-cli 'nvme telemetry-log'
command. It extracts the telemetry log from drive. This is a variable
length log, so we read the first page and find out how much of the log
to grab. There's 3 levels of details available, and we grab the level of
detail specified on the command line.
Warner Losh [Sun, 7 Apr 2024 23:48:42 +0000 (17:48 -0600)]
nvme: Add telemetry page definitions
Add definition for page types 7 and 8 for host initiated telemetry and
controller initiated telemetry (they differ by one byte, but that byte
that's defined in the host version is reserved in the controller
version).
Michael Tuexen [Sat, 11 May 2024 14:28:45 +0000 (16:28 +0200)]
tcp rack: improve handling of front states
When the RACK stack wants to send a FIN, but still has outstanding
or unsent data, it sends a challenge ack. Don't do this when the
TCP endpoint is still in the front states, since it does not
make sense.
Reviewed by: rrs
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D45122
Warner Losh [Fri, 10 May 2024 21:41:36 +0000 (15:41 -0600)]
intr: Document how to get the interrupt frame
Document that the only way to get the interrupt thread is to use
curthread->td_intr_frame, rather than the old-style of having a NULL
pointer for the interrupt thread. As of 38c35248fe3b, support for that
has been removed. I neglected to update that commit message with these
details.
kern/intr: remove support for passing trap frame as argument
While otherwise a handy potential approach, getting the trap frame via
the argument isn't documented and isn't supposed to be used. With all
uses removed, now remove support to end the mixed calling conventions.
GCC 13 complains that we might be writing too much to an on-stack buffer
when createing a filename.
In practice there is a check that filename isn't too long given the
time format and other static characters so GCC is incorrect, but GCC
isn't wrong that we're potentially trying to put a MAXPATHLEN length
string + some other characters into a MAXPATHLEN buffer (if you ignore
the check GCC can't realistically evaluate at compile time).
Switch to snprintf to populate filename to ensure that future logic
errors don't result in a stack overflow.
Shorten the questionably named yyyymmdd buffer enough to slience the
warning (checking the snprintf return value isn't sufficent) while
preserving maximum flexibility for admins who use the -F option.
MFC after: 3 days
Sponsored by: Klara, Inc.
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D45086
Warner Losh [Fri, 10 May 2024 16:50:46 +0000 (10:50 -0600)]
Revert "grdc: Add copyright"
It turns out this wasn't in 4.4BSD. I had a false positive for gdc.c
(which is in 4.4BSD, but part of gated, not this). gdc.c comes from the
ncurses tests, so it shouldn't have this copyright. This version is
mostly Amos Shapir and John Lupien's code. It comes from ncurses test
directory. ncurses has made dozens of improvements to this file since
we imported it in 1997 (which pre-dates their online history), so it's
not clear if their new copyright applies (which doesn't mention Amos
or John) or if some other copyright applies. In any case, it wasn't
4.4BSD, so revert this.
Ed Maste [Fri, 10 May 2024 18:57:22 +0000 (14:57 -0400)]
madt: print CPU APIC ID as signed int
Instead of printing something like "MADT: Found CPU APIC ID 4294967295
ACPI ID 512: disabled" print the APIC ID as a singed int for a more
user-friendly -1.
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45158
John Baldwin [Fri, 10 May 2024 16:12:03 +0000 (09:12 -0700)]
nvmf_transport: Remove invalid assertion
This is leftover from an earlier iteration of the code where 'nt' was
not dynamically allocated but was the passed in 'ops' pointer so was
always alive.
Warner Losh [Fri, 10 May 2024 15:18:43 +0000 (09:18 -0600)]
posix: POSIX-1.2008 moved SA_* from XSI to base standard
Starting with POSIX-1.2008, "The SA_RESETHAND, SA_RESTART, SA_SIGINFO,
SA_NOCLDWAIT, and SA_NODEFER constants are moved from the XSI option to
the Base." Make them so visible.
Justin Hibbits [Thu, 9 May 2024 19:46:09 +0000 (15:46 -0400)]
conf: Generate fdt_static_dtb.h in OBJDIR
Though the kernel build expects ${.OBJDIR} to be equal to ${.CURDIR}
that may not always be the case. Correctly generate fdt_static_dtb.h in
${.OBJDIR}, which is conceptually more correct anyway.
Justin Hibbits [Thu, 9 May 2024 19:27:35 +0000 (15:27 -0400)]
tpm20: Support partial reads
Summary:
In some cases the TPM utilities may read only a partial block, instead
of a full block. If a new command starts while in the middle of a read
it may cause the TPM to go catatonic and no longer respond to SPI.
Andrew Turner [Tue, 23 Apr 2024 11:27:09 +0000 (12:27 +0100)]
dev/psci: Check all compat strings
When searching for the PSCI FDT node we only check a few compat strings.
Use the existing compat_data array to check all strings the driver may
attach to.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44913
Andrew Turner [Fri, 3 May 2024 16:17:25 +0000 (17:17 +0100)]
arm64: Flush the spintable release address
Ensure the spintable release address is written back from the cache
to memory. The other CPUs reading this may not be reading it with the
cache enabled so ensure it is written to the point of coherency
before issuing the wakeup sev.
As cpu_dcache_wbinv_range includes the needed barrier remove it from
the inline asm before the sev instruction.
Andrew Turner [Mon, 29 Apr 2024 14:23:42 +0000 (15:23 +0100)]
arm64: Support a shared release for spin-table
When releasing multiple CPUs that share a release address we need them
to wait for their turn to boot. Add a mechanism to do this by booting
them until they enable the TLB before waiting their turn to enter
init_secondary.
Alexander Ziaee [Fri, 10 May 2024 02:43:39 +0000 (20:43 -0600)]
sysexits: Tidy deprecated header and manual
<sysexits.h> was deprecated in the base system in a1432b4 for FreeBSD
8.0 and is retained only for backwards compatibility. Make that clear,
since sysexits(3) suggested using it since it was in style(9) prior
to this.
HP van Braam [Fri, 10 May 2024 02:13:03 +0000 (20:13 -0600)]
ahc(4): Default to memory mapped IO
When this driver was written it made sense to make this default to off,
but these days almost all BIOSses will do the right thing. Furthermore
non-mmio communication only works on Intel architectures.
So lets default to allowing mmio, but not change the semantics of the
AHC_ALLOW_MEMIO flag to not break existing installs. Also document the
already existing hint.ahc.<unit>.allow_memio.
Signed-off-by: HP van Braam <hp@tmm.cx>
Reviewed by: imp (small style tweak)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1219