FreeBSD/src 15dfc47crypto/heimdal/lib/asn1 gen.c

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]
DeltaFile
+2-2crypto/heimdal/lib/asn1/gen.c
+2-21 files

FreeBSD/src 689dbdecrypto/heimdal/lib/asn1 gen.c

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]
DeltaFile
+2-2crypto/heimdal/lib/asn1/gen.c
+2-21 files

FreeBSD/src 164f125crypto/heimdal/lib/asn1 check-gen.c der_put.c

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]
DeltaFile
+120-0crypto/heimdal/lib/asn1/check-gen.c
+72-0crypto/heimdal/lib/asn1/der_put.c
+57-0crypto/heimdal/lib/asn1/der_length.c
+50-0crypto/heimdal/lib/asn1/der-protos.h
+42-3crypto/heimdal/lib/asn1/der_get.c
+13-9crypto/heimdal/lib/asn1/gen_template.c
+354-1215 files not shown
+446-5221 files

FreeBSD/src 2efe307crypto/heimdal/lib/asn1 check-gen.c der_put.c

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]
DeltaFile
+120-0crypto/heimdal/lib/asn1/check-gen.c
+72-0crypto/heimdal/lib/asn1/der_put.c
+57-0crypto/heimdal/lib/asn1/der_length.c
+50-0crypto/heimdal/lib/asn1/der-protos.h
+42-3crypto/heimdal/lib/asn1/der_get.c
+13-9crypto/heimdal/lib/asn1/gen_template.c
+354-1215 files not shown
+446-5221 files

FreeBSD/src 8b4cf10. ObsoleteFiles.inc

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)
DeltaFile
+2-0ObsoleteFiles.inc
+2-01 files

FreeBSD/src feb6e27. ObsoleteFiles.inc

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)
DeltaFile
+2-0ObsoleteFiles.inc
+2-01 files

FreeBSD/src 7fdef9csys/kern subr_trap.c, sys/netinet tcp_hpts.c

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)
DeltaFile
+9-1sys/netinet/tcp_hpts.c
+3-1sys/sys/systm.h
+2-0sys/kern/subr_trap.c
+14-23 files

FreeBSD/src 917b543sys/netinet tcp_hpts.h tcp_hpts.c

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)
DeltaFile
+14-1sys/netinet/tcp_hpts.h
+1-1sys/netinet/tcp_hpts.c
+15-22 files

FreeBSD/src d48e7e8sys/netinet/tcp_stacks rack.c

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)
DeltaFile
+6-4sys/netinet/tcp_stacks/rack.c
+6-41 files

FreeBSD/src be4f189. UPDATING, sys/conf newvers.sh

Add UPDATING entries and bump the branch version.

Approved by:    so
DeltaFile
+5-0UPDATING
+1-1sys/conf/newvers.sh
+6-12 files

FreeBSD/src 266b3bdsys/contrib/openzfs/include/os/linux/zfs/sys zpl.h, sys/contrib/openzfs/include/sys arc.h

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]
DeltaFile
+0-62sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c
+52-0sys/contrib/openzfs/module/zfs/arc.c
+0-51sys/contrib/openzfs/module/os/linux/zfs/arc_os.c
+32-0sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
+1-1sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h
+1-1sys/contrib/openzfs/include/sys/arc.h
+86-1152 files not shown
+87-1178 files

FreeBSD/src 78101d4lib/libsys _libsys.h, sys/compat/freebsd32 freebsd32_systrace_args.c

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
DeltaFile
+4-4lib/libsys/_libsys.h
+2-2sys/compat/freebsd32/freebsd32_systrace_args.c
+2-2sys/kern/syscalls.master
+2-2sys/kern/systrace_args.c
+10-104 files

FreeBSD/src 6b0cf2asys/kern vfs_lookup.c

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
DeltaFile
+7-1sys/kern/vfs_lookup.c
+7-11 files

FreeBSD/src 66df810sys/kern vfs_lookup.c, sys/sys namei.h

sys/namei.h: move NI_CAP_VIOLATION() macro from namei.h to vfs_lookup.c

Reviewed by:    emaste, imp, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D44931
DeltaFile
+5-0sys/kern/vfs_lookup.c
+0-5sys/sys/namei.h
+5-52 files

FreeBSD/src 0135101share/mk meta.autodep.mk

meta.autodep.mk do not override start_utc

Update meta.autodep.mk
If included at level 0 it is important not to override start_utc
DeltaFile
+3-1share/mk/meta.autodep.mk
+3-11 files

FreeBSD/src d7ac426sys/sys elf_common.h

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
DeltaFile
+3-0sys/sys/elf_common.h
+3-01 files

FreeBSD/src 2c35c86. Makefile.inc1

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
DeltaFile
+2-1Makefile.inc1
+2-11 files

FreeBSD/src 9d40492sys/arm64/arm64 efirt_machdep.c minidump_machdep.c, sys/arm64/include vmparam.h

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
DeltaFile
+15-3sys/arm64/include/vmparam.h
+2-7sys/arm64/arm64/efirt_machdep.c
+4-3sys/arm64/arm64/minidump_machdep.c
+1-1sys/arm64/arm64/machdep.c
+22-144 files

FreeBSD/src ef80df0sys/arm64/vmm vmm_hyp_exception.S

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
DeltaFile
+3-0sys/arm64/vmm/vmm_hyp_exception.S
+3-01 files

FreeBSD/src a913f3a. .cirrus.yml

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)
DeltaFile
+14-14.cirrus.yml
+14-141 files

FreeBSD/src 1a4e512sys/dev/acpica acpi_battery.c

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)
DeltaFile
+8-1sys/dev/acpica/acpi_battery.c
+8-11 files

FreeBSD/src 71b2ba9usr.sbin/bhyve bhyve.8

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
DeltaFile
+34-6usr.sbin/bhyve/bhyve.8
+34-61 files

FreeBSD/src 63d5f8cshare/examples/bhyve vmrun.sh

vmrun.sh: Stop passing -A to bhyve

It's a no-op now.

Sponsored by:   Innovate UK
DeltaFile
+1-1share/examples/bhyve/vmrun.sh
+1-11 files

FreeBSD/src 1075847usr.sbin/bhyve bhyve.8, usr.sbin/bhyve/amd64 bhyverun_machdep.c

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
DeltaFile
+5-8usr.sbin/bhyve/bhyve.8
+1-2usr.sbin/bhyve/amd64/bhyverun_machdep.c
+6-102 files

FreeBSD/src 4b79491lib/geom/eli geli.8

geli.8: add some notes regarding performance tuning

MFC after:      1 week
Sponsored by:   Axcient
Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D44908
DeltaFile
+41-1lib/geom/eli/geli.8
+41-11 files

FreeBSD/src 8ef2c02sys/kern subr_busdma_bufalloc.c

busdma: uma_zcreate() does not fail

No functional change intended.

MFC after:      1 week
DeltaFile
+0-4sys/kern/subr_busdma_bufalloc.c
+0-41 files

FreeBSD/src 1e607a0sys/kern kern_khelp.c

khelp: uma_zcreate() does not fail

No functional change intended.

MFC after:      1 week
DeltaFile
+0-4sys/kern/kern_khelp.c
+0-41 files

FreeBSD/src 78c51dbsys/fs/udf udf_vfsops.c

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
DeltaFile
+0-11sys/fs/udf/udf_vfsops.c
+0-111 files

FreeBSD/src b6a0ed7sys/dev/wg if_wg.c wg_cookie.c

wg: uma_zcreate() does not fail

No functional change intended.

MFC after:      1 week
DeltaFile
+3-3sys/dev/wg/if_wg.c
+2-3sys/dev/wg/wg_cookie.c
+5-62 files

FreeBSD/src 9640649sys/dev/dpaa if_dtsec_rm.c

dpaa: uma_zcreate() does not fail

No functional change intended.

MFC after:      1 week
DeltaFile
+0-4sys/dev/dpaa/if_dtsec_rm.c
+0-41 files