heimdal: asn1: Use unsigned bitfields for named bitsets
Import upstream 6747e1628:
asn1: Use unsigned bitfields for named bitsets
Signed 1-bit bitfields are undefined in C.
This should fix the following warnings, which for unknown reasons are
errors in CI:
/usr/src/crypto/heimdal/lib/hx509/ca.c:1020:22: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
1020 | ku.digitalSignature = 1;
| ^ ~
/usr/src/crypto/heimdal/lib/hx509/ca.c:1021:21: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
1021 | ku.keyEncipherment = 1;
| ^ ~
/usr/src/crypto/heimdal/lib/hx509/ca.c:1028:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
1028 | ku.keyCertSign = 1;
[10 lines not shown]
heimdal: asn1: Use unsigned bitfields for named bitsets
Import upstream 6747e1628:
asn1: Use unsigned bitfields for named bitsets
Signed 1-bit bitfields are undefined in C.
This should fix the following warnings, which for unknown reasons are
errors in CI:
/usr/src/crypto/heimdal/lib/hx509/ca.c:1020:22: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
1020 | ku.digitalSignature = 1;
| ^ ~
/usr/src/crypto/heimdal/lib/hx509/ca.c:1021:21: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
1021 | ku.keyEncipherment = 1;
| ^ ~
/usr/src/crypto/heimdal/lib/hx509/ca.c:1028:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
1028 | ku.keyCertSign = 1;
[10 lines not shown]
heimdal: Add 64-bit integer support to ASN.1 compiler
Import upstream 19d378f44:
ASN.1 INTEGERs will now compile to C int64_t or uint64_t, depending
on whether the constraint ranges include numbers that cannot be
represented in 32-bit ints and whether they include negative
numbers.
Template backend support included. check-template is now built with
--template, so we know we're testing it.
Tests included.
Also adjusts the generated files:
* asn1parse.c, asn1parse.h (not strictly necessary, but nice to have)
* der-protos.h, which needs a bunch of new prototypes. I copied these
from a der-protos.h generated by the upstream build system, which
uses a perl script for this.
[33 lines not shown]
heimdal: Add 64-bit integer support to ASN.1 compiler
Import upstream 19d378f44:
ASN.1 INTEGERs will now compile to C int64_t or uint64_t, depending
on whether the constraint ranges include numbers that cannot be
represented in 32-bit ints and whether they include negative
numbers.
Template backend support included. check-template is now built with
--template, so we know we're testing it.
Tests included.
Also adjusts the generated files:
* asn1parse.c, asn1parse.h (not strictly necessary, but nice to have)
* der-protos.h, which needs a bunch of new prototypes. I copied these
from a der-protos.h generated by the upstream build system, which
uses a perl script for this.
[33 lines not shown]
Add a few missed libclang_rt files to ObsoleteFiles.inc
PR: 276104
Reported by: Mark Millard <marklmi at yahoo.com>
MFC after: 3 days
(cherry picked from commit 0ab121e9f9a33dde06b292df02ec2eee03033e1f)
Add a few missed libclang_rt files to ObsoleteFiles.inc
PR: 276104
Reported by: Mark Millard <marklmi at yahoo.com>
MFC after: 3 days
(cherry picked from commit 0ab121e9f9a33dde06b292df02ec2eee03033e1f)
Optimize HPTS so that little work is done until we have a hpts thread that is over the connection threshold
HPTS inserts a softclock for system call return that optimizes performance. However when
no HPTS threads need the help (i.e. when they have less than 100 or so connections) then
there should be little work done i.e. check the counter and return instead of running through
all the threads getting locks etc.ptimize HPTS so that little work is done until we have a hpts
thread that is over the connection threshold.
Reported by: eduardo
Reviewed by: gallatin, glebius, tuexen
Tested by: gallatin
Differential Revision: https://reviews.freebsd.org/D44420
(cherry picked from commit b7b78c1c169dd2213b4cb3e14e19c045b2c5e5af)
HTPS has actually three states not two so the macro needs to account for that.
Ok lets fix up the tcp_in_hpts() so that it also says yes if you
are in the race state moving and you are scheduled to be put in.
This also requires changing the MPASS to be the old version non
inline function of tcp_in_hpts().
This change also adds a new inline macro so that a uint64_t timestamp can be
obtained by a transport (aka Rack will use this).
Reviewed by: glebius, tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D44157
(cherry picked from commit 638b5ae1c7858373344bc7b9dcb5a1e7fab80bd9)
TCP: Fix a rack bug that skyzall found which results in a crash.
So when we call the fast_rsm retransmit path, we should always move
snd_nxt back up to snd_max. In fact during ack-processing if snd_nxt
falls behind it should be moved up there as well. Otherwise what
can happen is we have an incorrect mark on snd_nxt and incorrectly
calculate the offset when we go through the front path (which is
what skzyall was able to do) then when we go to clean up the
send the offset is all wrong and we crash.
Special thanks to Gleb for pointing out the problem and the email
that had the reproducer so I could find the issue.
Reported-by: syzbot+f5061a372f74f021ec02 at syzkaller.appspotmail.com
Sponsored by: Netflix Inc
(cherry picked from commit 8818f0f1124ea3d0e8028f85d667237536eba10c)
Unify arc_prune_async() code, fix excessive ARC pruning
There is no sense to have separate implementations for FreeBSD and Linux. Make
Linux code shared as more functional and just register FreeBSD-specific prune
callback with arc_add_prune_callback() API.
Aside of code cleanup this fixes excessive pruning on FreeBSD.
[olce: This code comes from the OpenZFS pull request:
https://github.com/openzfs/zfs/pull/16083, vendor-merged into our tree. Its
commit message has been slightly adapted to the present context. The upstream
pull request has been reviewed and merged into 'zfs-2.1.16-staging' as
5b81b1bf5e6d6aeb8a87175dcb12b529185cac2f, which should come into our tree at the
next vendor import. This is the same code that was merged into stable/14 and
main as part of vendor merges, and released as an EN (FreeBSD-EN-23:18.openzfs)
over releng/14.0 by markj@.]
PR: 275594, 274698
Reported by: Seigo Tanimura <seigo.tanimura at gmail.com>, markj, and others
[9 lines not shown]
syscalls.master: correct return type of {read,write}v
This was missed when read/write, etc were updated to return ssize_t.
Fixes: 2e83b2816183 Fix a few syscall arguments to use size_t instead of u_int.
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D44930
vfs_lookup.c: only call ktrcapfail() if KTRACE is enabled
Reviewed by: emaste, imp, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44931
elf_common.h: Add STO_AARCH64_VARIANT_PCS
This is used to mark symbols that use a variant procedure call with
a different calling convention to the main ABI.
Reviewed by: kib, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44868
showconfig: Set MACHINE for src.opts.mk
Also set MACHINE and MACHINE_ARCH when reading config options from
src.opts.mk. This ensures any machine-dependent options are reported
correctly.
Reviewed by: emaste, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44838
arm64: Check DMAP address is valid in PHYS_IN_DMAP
When checking if a physical address is in the DMAP region we assume
all physical addresses between DMAP_MIN_PHYSADDR and DMAP_MAX_PHYSADDR
are able to be accesses through the DMAP. It may be the case that
there is device memory in this range that shouldn't be accessed through
the DMAP mappings.
Add a check to PHYS_IN_DMAP that the translated virtual address is a
valid kernel address. To support code that already checks the address
is valid add PHYS_IN_DMAP_RANGE.
PR: 278233
Reviewed by: alc, markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44677
arm64/vmm: Ensure the tlbi has completed
Ensure the TLB is invalidated before enabling the EL2 MMU. Without
this the TLB may be in an inconsistant state leading to a possible
exception when enabling the MMU.
PR: 277559
Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44799
Cirrus-CI: bump Clang versions to 16 and 17
Clang/LLVM 17 is currently the in-tree default compiler, so use it as
the default Cirrus-CI toolchain. Clang/LLVM 18 is coming soon and needs
to be added here, but I ran into trouble with llvm18-lite package
availability so will look at that later.
Reviewed by: dim (earlier), Jose Luis Duran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44162
(cherry picked from commit 51c6bf0478bd331225121eb4a0a60510cc3920b1)
(cherry picked from commit adc61137fdf7b31b5f32354b970a8d824347b0de)
acpi_battery: avoid divide-by-zero when no devices have capacity info
On laptops with builtin batteries, disconnecting the battery may show up
as a battery without any capacity information. (The theory is that one
is disconnecting the cells but the electronics identifying the battery
are still connected.) As a result, the loop over all batteries in
acpi_battery_get_battinfo results in total_lfcap == 0.
So, just check that total_lfcap is non-zero to avoid a division by zero
(triggerable by sysctl hw.acpi.battery).
Reported by: Stefano Marinelli
Tested by: Stefano Marinelli
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D44818
(cherry picked from commit 2e850b832f5d2adb9b230d191277d67c00caaab9)
(cherry picked from commit 788987e034b1c73d779a3aa179f79f672bbdb366)
bhyve.8: Document arm64 support
- Mention the options that are amd64-only.
- Provide a minimal example for booting an arm64 guest.
Reviewed by: corvink
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D44738
bhyve.8: Remove mention of the -A flag
It is a no-op on amd64 now and is not implemented on arm64, so let's
remove mention of it altogether so as to reduce confusion for arm64
users.
Reviewed by: corvink, jhb
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D44737
udf: uma_zcreate() does not fail
While here remove an old comment regarding preallocation; it appears to
refer to an optimization that is almost certainly irrelevant at this
point.
No functional change intended.
MFC after: 1 week