Avoid the creation of a /usr/tests/sys/vm/stack/.debug directory by
placing sys/vm/stack test debug symbols under /usr/lib/debug.
Reviewed by: emaste
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48796
Remove extra slashes that end up in the metalog. These double slashes
can produce an invalid specification file if there are subdirectories
down the hierarchy when sorted.
For example, consider the following metalog excerpt:
./base/aaa type=dir
./base//aaa/bbb type=dir
If sorted, would turn out:
./base//aaa/bbb type=dir
./base/aaa type=dir
Apparently missing the ./base/aaa directory in the specification.
Luckily here are no subdirectories.
Reviewed by: imp, emaste
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48779
Remove an extra slash that ends up in the metalog. This double slash
can produce an invalid specification file if there are subdirectories
down the hierarchy when sorted.
For example, consider the following metalog excerpt:
./base/aaa type=dir
./base//aaa/bbb type=dir
If sorted, would turn out:
./base//aaa/bbb type=dir
./base/aaa type=dir
Apparently missing the ./base/aaa directory in the specification.
Luckily here are no subdirectories.
Reviewed by: imp, emaste
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48778
Print the desired partition index together with the starting LBA and the
size. Otherwise, when only one code partition is desired, the
configuration partition (/cfg) may not end up in the third slice, thus
breaking the scripts that expect it there.
This was the previous approach, changed in 587c054bea ("nanobsd: Use
gpart and create code image before full disk image").
Fix it by printing the index as the last column to reduce the chances of
breaking current overrides, and using it as the gpart index.
PR: 262098
Reviewed by: imp
Approved by: emaste (mentor)
Fixes: 587c054bea ("nanobsd: Use gpart and create code image before full disk image")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47835
Changing the rsc_switch flag using sysctl to turn rsc on or off
could hang. The orignal code sends request to host to get the
mtu setting. Sometimes the host fails to reply, causing
the thread to sleep forever waiting for the host response.
Use existing cached mtu from hn device instead to avoid calling
host.
Reported by: whu
Tested by: whu
MFC after: 1 week
When the IOMMU option is enabled but a device doesn't have an IOMMU
this will return an error. If the device is really behind an IOMMU
then it will fail later, and if not this is needed to allocate MSI and
MSI-X interrupts.
Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D48725
If the ram driver is unable to reserve a memory range it will panic
with no real information why. Move this driver earlier in the boot so
any devices that cause the conflict will fail to attach.
This should make it easier to debug why the conflict exists.
Reviewed by: mhorne, kevans, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D48766
When cleaning arm64 only files we try to clean both the native libc
depends files and the compat32 depends files. Ignore the latter as
only the native files have changed.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D48524
With the addition of the Extended Hypervisor Configuration Register
(HCRX_EL2), this change ensures that it is both set to 0 before entering
a vm, and that it is properly saved/restored.
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D48584
Signed-off-by: Harry Moulton <harry.moulton@arm.com>
pkg used to store copies of upstream repository databases in
/var/db/pkg/repo-*.sqlite. About a year ago this was moved to
/var/db/pkg/repos/*/, resulting in FreeBSD cloud images no longer
having those (unhelpful since they'll be long out of date before
the cloud images are launched) databases removed.
Remove the correct location, and hope that future pkg updates don't
break the base system again.
Sponsored by: Amazon
If SOURCE_DATE_EPOCH is set and MK_REPRODUCIBLE_BUILD is not set, the
kernel contains SOURCE_DATE_EPOCH, converted to a date+time string.
In the interests of easier reproducibility convert it in UTC.
Reviewed by: imp
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D48802
The newvers.sh script is used to generate vers.c for 10 programs (at
latest count on amd64): 4 EFI loaders, 3 x86 loaders, two userboots,
and one kboot. When building without MK_REPRODUCIBLE_BUILD this
resulted in 10 different timestamps being compiled into various files.
If SOURCE_DATE_EPOCH is set, use that value rather than the current
date and time.
Reviewed by: emaste, imp
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D48803
Added ht20 mode, based on if_run from FreeBSD, and if_mtw.c
from OpenBSD.
PR: 247545
Approved by: adrian, wireless
Differential Revision: https://reviews.freebsd.org/D45179
Avoid POLA breakage and preserve output standard that really predates
the FreeBSD project itself. There are scripts in the wild that rely
on the behavior.
Provide option to specify -nn twice to have a completely numeric
output of the routing tables.
Fixes: 9206c79961
This reverts commit e090646d6f.
Reviewed by: zlei, gallatin, melifaro, allanjude, markj, emaste
Differential Revision: https://reviews.freebsd.org/D48729
The uncommented #ifdef _KERNEL originates from 1997 by wollman@ (see
57bf258e3d) with no clear original reason. Since these old times two
abusers of the header leak were created - libprocstat(3) and netstat(1).
These two already have a lot of _WANT_FOO hacks, so satisfy them with
_WANT_PROTOSW.
While here, cleanup and sort forward declaraions.
The file obtains some kernel structures in a dirty way and needs
forward declaration of struct sockopt for that. Make it explicit
instead of getting it via headers that were not designed for that.
Print the quirks in a more human-readable form. When testing a dozen
different removeable devices, the hex numbers quickly blur...
Sponsored by: Netflix
Sort options using the slightly unusual convention used here as well.
MFC after: 3 days
Approved by: carlavilla (mentor), imp (src)
Differential Revision: https://reviews.freebsd.org/D48800
Replaced by arm-optimized-routines in commit 2e8ff4d1d5 ("Switch to
Arm Optimized Routines for mem* & str*").
Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48500
This was a comment in a configuration example.
Reported by: bapt
Reviewed by: bapt, jlduran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48810
There're two possible race conditions,
1. Concurrent bpfattach() and bpf_setif(), i.e., BIOCSETIF ioctl,
2. Concurrent bpfdetach() and bpf_setif().
For the first case, userland may see BPF interface attached but it has
not been in the attached interfaces list `bpf_iflist` yet. Well it
will eventually be so this case does not matter.
For the second one, bpf_setif() may reference `dead_bpf_if` and the
kernel will panic (spotted by change [1], without the change we will
end up silently corrupted memory).
A simple fix could be that, we add additional check for `dead_bpf_if`
in the function `bpf_setif()`. But that requires to extend protection
of global lock (BPF_LOCK), i.e., BPF_LOCK should also protect the
assignment of `ifp->if_bpf`. That simple fix works but is apparently
not a good design. Since the attached interfaces list `bpf_iflist` is
the single source of truth, we look through it rather than check
against the interface's side, aka `ifp->if_bpf`.
This change has performance regression, that the cost of BPF interface
attach operation (BIOCSETIF ioctl) goes back from O(1) to O(N) (where
N is the number of BPF interfaces). Well we normally have sane amounts
of interfaces, an O(N) should be affordable.
[1] 7a974a6498 bpf: Make dead_bpf_if const
Fixes: 16d878cc99 Fix the following bpf(4) race condition ...
MFC after: 4 days
Differential Revision: https://reviews.freebsd.org/D45725
From the spec:
Any SBI function, requiring a hart mask, must take the following
two arguments:
- unsigned long hart_mask is a scalar bit-vector containing hartids
- unsigned long hart_mask_base is the starting hartid from which the
bit-vector must be computed.
hart_mask_base can be set to -1 to indicate that hart_mask shall be
ignored and all available harts must be considered.
Differential Revision: https://reviews.freebsd.org/D48717
From the spec:
The remote fence function acts as a full TLB flush if
• start_addr and size are both 0
• size is equal to 2^XLEN-1
Differential Revision: https://reviews.freebsd.org/D48716
Remove CPU clock-frequency property as incorrectly constructed
and not needed.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D48712
For not yet determined reasons, the Qualcom Snapdragon Elite will
take no other value than RAWAWB, but we're basically OK with that,
because that should be the most performant setting. Investigations
are continuing.
This patch makes the Lenovo T14sGen6 laptop to boot to multiuser,
but very little else works.
Builds now with BCE_DEBUG defined. All bets are of as to whether or not
it works though. This is not the default, and likely quite a rare config
given (a) it's been broken for years and (b) this is an old card people
aren't actively debugging anymore. I don't have the hardware to test it,
though I've not changed anything in the BCE_DEBUG undefined case.
Sponsored by: Netflix
When compiling with debug enabled, this produces an always false
warning. It's clear that this was to skip ranges that aren't used when
dumping the registers, so change the && to || to skip things properly.
PR: 200984
Sponsored by: Netflix
Although this is vendor code, and apparently abandoned vendor code at
that, this is clearly a mistake and always true. It's unclear how to
contribute back to the upstream at this point, alas.
PR: 217745
Reviewed by: imp
RPC calls are filtered by the Netlink system itself, but the RPC replies
are not. With legitimate use the chance of a xid collision is zero, since
global clients use global atomically updated 32-bit counter for that.
However, a malicious jail may blindly inject replies guessing the xid,
where guessing is trivial. Protect against that checking the vnet, too.
A netlink RPC client should be global. The filtering of RPC calls is done
by the nl_send_group() that would distribute the call to all subscribers
in the curvnet of clnt_nl_call() context.
Fixes: a3a6dc24f3
Fixes: 42eec5201a
With all the recent changes we don't need extra argument that specifies
what exactly the syscalls does, neither we need a copyout-able pointer,
just a pointer sized integer.
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D48649
At normal NFS server runtime there is not much RPC traffic from kernel to
rpc.tlsservd. But as Rick rmacklem@ explained, the notion of multiple
workers exists to handle a situation when a server reboots and it has
several hundred or thousands of TLS/TCP connections from clients. Once it
comes back up, all the clients make TCP connections and do TLS handshakes.
So cleanup the remnants of the workers, that left after the conversion of
RPC over netlink(4) transport and restore desired parallelism with help of
pthread(3).
We are processing the TLS handshakes in separate threads, one per
handshake. Number of concurrent threads is capped by hw.ncpu / 2, but this
can be overriden with -N.
Differential Revision: https://reviews.freebsd.org/D48570