git: 358752abdf1c - main - loader/loader.mk: add docs for LOADER_*_SUPPORT variables

2024-10-24 Thread Warner Losh
The branch main has been updated by imp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=358752abdf1c44d15e99bc2709b0256a358fd2a9

commit 358752abdf1c44d15e99bc2709b0256a358fd2a9
Author: Warner Losh 
AuthorDate: 2024-10-25 02:22:51 +
Commit: Warner Losh 
CommitDate: 2024-10-25 02:26:26 +

loader/loader.mk:  add docs for LOADER_*_SUPPORT variables

These are internal to the loader and generally can only be set in a
makefile that's compiling some variation of loader. Add caveats since
these aren't really user-serviceable parts, though some downstreams will
tweak individual makefiles for their own purposes.

Sponsored by:   Netflix
---
 stand/loader.mk | 28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/stand/loader.mk b/stand/loader.mk
index de717ce7b18b..0f2ff31a5343 100644
--- a/stand/loader.mk
+++ b/stand/loader.mk
@@ -1,4 +1,3 @@
-
 .PATH: ${LDRSRC} ${BOOTSRC}/libsa
 
 CFLAGS+=-I${LDRSRC}
@@ -30,6 +29,33 @@ SRCS+=   load_elf64.c reloc_elf64.c
 SRCS+= metadata.c
 .endif
 
+#
+# LOADER_*_SUPPORT variables are used to subset the boot loader in the various
+# configurations each platform supports. These are typically used to omit 
broken
+# options, or to size optimize for space constrained instances. These are set 
in
+# loader Makefiles (which include loader.mk) to control which subset of 
features
+# are enabled. These cannot generally be set in src.conf since that would 
affect
+# all loaders, but also not all loaders are setup for overrides like that and
+# not all combinations of the following have been tested or even work. 
Sometimes
+# non-default values won't work due to buggy support for that component being
+# optional.
+#
+# LOADER_BZIP2_SUPPORT Add support for bzip2 compressed files
+# LOADER_CD9660_SUPPORTAdd support for iso9660 filesystems
+# LOADER_DISK_SUPPORT  Adds support for disks and mounting filesystems on it
+# LOADER_EXT2FS_SUPPORTAdd support for ext2 Linux filesystems
+# LOADER_GPT_SUPPORT   Add support for GPT partitions
+# LOADER_GZIP_SUPPORT  Add support for gzip compressed files
+# LOADER_INSTALL_SUPPORT Add support for booting off of installl ISOs
+# LOADER_MBR_SUPPORT   Add support for MBR partitions
+# LOADER_MSDOS_SUPPORT Add support for FAT filesystems
+# LOADER_NET_SUPPORT   Adds networking support (useless w/o net drivers 
sometimes)
+# LOADER_NFS_SUPPORT   Add NFS support
+# LOADER_TFTP_SUPPORT  Add TFTP support
+# LOADER_UFS_SUPPORT   Add support for UFS filesystems
+# LOADER_ZFS_SUPPORT   Add support for ZFS filesystems
+#
+
 .if ${LOADER_DISK_SUPPORT:Uyes} == "yes"
 CFLAGS.part.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib
 SRCS+= disk.c part.c vdisk.c



git: 23dee252daf2 - main - loader: Change this BIOS tradeoff: Add back zip and use text only

2024-10-24 Thread Warner Losh
The branch main has been updated by imp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=23dee252daf2ff60e521c9c019e64134b63ce90f

commit 23dee252daf2ff60e521c9c019e64134b63ce90f
Author: Warner Losh 
AuthorDate: 2024-10-25 02:22:25 +
Commit: Warner Losh 
CommitDate: 2024-10-25 02:26:25 +

loader: Change this BIOS tradeoff: Add back zip and use text only

After talking with a number of people about the removal of some things
to make the loader fit, readjust things a little.

Add back GZIP and BZIP2 compression support. Many of the downstream MFC
packaging systems depend on this. This adds back 20k to the size of the
loader.

Make the boot loader text-only by default. This saves 40k in size. Net,
we're 20k smaller. The graphics loader for BIOS is less useful than the
zip functionality: You can still boot w/a text only one it and you can
build a custom one if you really want it. It's also the default we use
for dual console.

This should be merged back into stable/14 and stable/13 so it's in the
next release for each of these. That way we have only one release (13.4)
with the other defaults.

MFC After:  3 days
Sponsored by:   Netflix
Reviewed by:olce, rgrimes, emaste
Differential Revision:  https://reviews.freebsd.org/D47203
---
 share/mk/src.opts.mk   | 2 +-
 stand/i386/loader/Makefile | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index 95801cdeecc5..f8877153f17f 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -127,6 +127,7 @@ __DEFAULT_YES_OPTIONS = \
 LLVM_ASSERTIONS \
 LLVM_COV \
 LLVM_CXXFILT \
+LOADER_BIOS_TEXTONLY \
 LOADER_GELI \
 LOADER_KBOOT \
 LOADER_LUA \
@@ -206,7 +207,6 @@ __DEFAULT_NO_OPTIONS = \
 DTRACE_TESTS \
 EXPERIMENTAL \
 HESIOD \
-LOADER_BIOS_TEXTONLY \
 LOADER_VERBOSE \
 LOADER_VERIEXEC_PASS_MANIFEST \
 LLVM_BINUTILS \
diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile
index 8385131a8849..857944dcd010 100644
--- a/stand/i386/loader/Makefile
+++ b/stand/i386/loader/Makefile
@@ -7,8 +7,8 @@ LOADER_CD9660_SUPPORT?= yes
 LOADER_EXT2FS_SUPPORT?=no
 LOADER_MSDOS_SUPPORT?= no
 LOADER_UFS_SUPPORT?=   yes
-LOADER_GZIP_SUPPORT?=  no
-LOADER_BZIP2_SUPPORT?= no
+LOADER_GZIP_SUPPORT?=  yes
+LOADER_BZIP2_SUPPORT?= yes
 
 .include 
 



RE: git: f3dbef108212 - main - Bump __FreeBSD_version for llvm 19.1.2 merge

2024-10-24 Thread Mark Millard
Dimitry Andric  wrote on
Date: Wed, 23 Oct 2024 18:32:46 UTC :

> The branch main has been updated by dim:
> 
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=f3dbef108212460489ae68b4c47e20b73984f433
> 
> commit f3dbef108212460489ae68b4c47e20b73984f433
> Author: Dimitry Andric 
> AuthorDate: 2024-10-23 16:49:02 +
> Commit: Dimitry Andric 
> CommitDate: 2024-10-23 18:27:43 +
> 
> Bump __FreeBSD_version for llvm 19.1.2 merge
> 
> PR: 280562
> MFC after: 1 month
> ---
> sys/sys/param.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sys/sys/param.h b/sys/sys/param.h
> index 8af2f9594bc1..7647c0d6e518 100644
> --- a/sys/sys/param.h
> +++ b/sys/sys/param.h
> @@ -73,7 +73,7 @@
> * cannot include sys/param.h and should only be updated here.
> */
> #undef __FreeBSD_version
> -#define __FreeBSD_version 1500025
> +#define __FreeBSD_version 1500026
> 
> /*
> * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,


I've been getting buildworld failures under META_MODE style builds for
the likes of:

# Meta data file 
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/share/examples/tests/tests/googletest/sample1_unittest.full.meta
CMD c++ -target x86_64-unknown-freebsd15.0 
--sysroot=/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp 
-B/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/bin 
-O2 -pipe -fno-common -DNDEBUG -fPIE -g -gz=zlib -Wno-format-zero-length 
-fstack-protector-strong -Wsystem-headers -Wall -Wno-format-y2k -W 
-Wno-unused-parameter -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wdate-time 
-Wmissing-variable-declarations -Wno-empty-body -Wno-string-plus-int 
-Wno-unused-const-variable -Wno-error=unused-but-set-parameter 
-Wno-error=cast-function-type-mismatch -Qunused-arguments 
-I/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/include/private
 -DGTEST_HAS_POSIX_RE=1 -DGTEST_HAS_PTHREAD=1 -DGTEST_HAS_STREAM_REDIRECTION=1 
-frtti -fPIE -std=c++14 -Wno-c++11-extensions  -Wl,-zrelro -pie   -o 
sample1_unittest.full  sample1_unittest.o sample1.o -lprivategtest_main 
-lprivategtest
CWD 
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/share/examples/tests/tests/googletest
TARGET sample1_unittest.full
OODATE sample1_unittest.o sample1.o
-- command output --
ld: error: undefined symbol: testing::internal::MakeAndRegisterTestInfo(char 
const*, char const*, char const*, char const*, testing::internal::CodeLocation, 
void const*, void (*)(), void (*)(), testin
g::internal::TestFactoryBase*)
>>> referenced by sample1_unittest.cc:76 
>>> (/usr/main-src/contrib/googletest/googletest/samples/sample1_unittest.cc:76)
>>>   sample1_unittest.o:(_GLOBAL__sub_I_sample1_unittest.cc)
>>> referenced by sample1_unittest.cc:100 
>>> (/usr/main-src/contrib/googletest/googletest/samples/sample1_unittest.cc:100)
>>>   sample1_unittest.o:(_GLOBAL__sub_I_sample1_unittest.cc)
>>> referenced by sample1_unittest.cc:103 
>>> (/usr/main-src/contrib/googletest/googletest/samples/sample1_unittest.cc:103)
>>>   sample1_unittest.o:(_GLOBAL__sub_I_sample1_unittest.cc)
>>> referenced 3 more times
c++: error: linker command failed with exit code 1 (use -v to see invocation)

*** Error code 1
. . .

Another example is:

ld: error: undefined symbol: testing::internal::MakeAndRegisterTestInfo(char 
const*, char const*, char const*, char const*, testing::internal::CodeLocation, 
void const*, void (*)(), void (*)(), testin
g::internal::TestFactoryBase*)
>>> referenced by zfsd_unittest.cc:236 
>>> (/usr/main-src/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc:236)
>>>   zfsd_unittest.o:(_GLOBAL__sub_I_zfsd_unittest.cc)
>>> referenced by zfsd_unittest.cc:242 
>>> (/usr/main-src/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc:242)
>>>   zfsd_unittest.o:(_GLOBAL__sub_I_zfsd_unittest.cc)
>>> referenced by zfsd_unittest.cc:248 
>>> (/usr/main-src/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc:248)
>>>   zfsd_unittest.o:(_GLOBAL__sub_I_zfsd_unittest.cc)
>>> referenced 19 more times
c++: error: linker command failed with exit code 1 (use -v to see invocation)


Intersting is the first parameter being "char const *" when the
MakeAndRegisterTestInfo implementation in
contrib/googletest/googletest/src/gtest.cc has std::string instead:

TestInfo* MakeAndRegisterTestInfo(
std::string test_suite_name, const char* name, const char* type_param,
const char* value_param, CodeLocation code_location,
TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc,
TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory) {
. . .

What I'm finding is that various .o files are not being rebuilt in the
META_MODE build. For example,

. . ./cddl/usr.sbin/zfsd/tests/zfsd_unittest.o
. . ./examples/tests/tests/googletest/sample*_unittest.o

have maintained old dates in the file system 

git: b1bb6934bb87 - main - sound: Fix build error in chm_mkname() KASSERT

2024-10-24 Thread Christos Margiolis
The branch main has been updated by christos:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b1bb6934bb8774dd96be76d88e6824e49b613549

commit b1bb6934bb8774dd96be76d88e6824e49b613549
Author: Christos Margiolis 
AuthorDate: 2024-10-24 12:57:19 +
Commit: Christos Margiolis 
CommitDate: 2024-10-24 12:57:19 +

sound: Fix build error in chm_mkname() KASSERT

Sponsored by:   The FreeBSD Foundation
MFC after:  2 days
---
 sys/dev/sound/pcm/channel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index b1d3ebc0d0f7..7bcd841d541f 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1181,7 +1181,7 @@ chn_mkname(char *buf, size_t len, struct pcm_channel *c)
const char *str;
 
KASSERT(buf != NULL && len != 0,
-   ("%s(): bogus buf=%p len=%lu", __func__, buf, len));
+   ("%s(): bogus buf=%p len=%zu", __func__, buf, len));
 
switch (c->type) {
case PCMDIR_PLAY:



git: 9693241188aa - main - sound: Call DSP_REGISTERED before PCM_DETACHING

2024-10-24 Thread Christos Margiolis
The branch main has been updated by christos:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=9693241188aa6882166b091d9006f9d0affeda7e

commit 9693241188aa6882166b091d9006f9d0affeda7e
Author: Christos Margiolis 
AuthorDate: 2024-10-24 11:37:01 +
Commit: Christos Margiolis 
CommitDate: 2024-10-24 11:37:01 +

sound: Call DSP_REGISTERED before PCM_DETACHING

DSP_REGISTERED first checks if the softc is not null, through
PCM_REGISTERED, which in turn calls PCM_ALIVE, whereas PCM_DETACHING
accesses the softc flags directly.

Sponsored by:   The FreeBSD Foundation
MFC after:  2 days
Reviewed by:dev_submerge.ch, markj, emaste
Differential Revision:  https://reviews.freebsd.org/D47195
---
 sys/dev/sound/pcm/dsp.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index d4f7e3d6e63f..6573dfaabf2f 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -196,7 +196,7 @@ dsp_close(void *data)
 
d = priv->sc;
/* At this point pcm_unregister() will destroy all channels anyway. */
-   if (PCM_DETACHING(d))
+   if (!DSP_REGISTERED(d) || PCM_DETACHING(d))
goto skip;
 
PCM_GIANT_ENTER(d);
@@ -301,7 +301,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct 
thread *td)
return (ENODEV);
 
d = i_dev->si_drv1;
-   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
+   if (!DSP_REGISTERED(d) || PCM_DETACHING(d))
return (EBADF);
 
priv = malloc(sizeof(*priv), M_DEVBUF, M_WAITOK | M_ZERO);
@@ -485,7 +485,7 @@ dsp_io_ops(struct dsp_cdevpriv *priv, struct uio *buf)
("%s(): io train wreck!", __func__));
 
d = priv->sc;
-   if (PCM_DETACHING(d) || !DSP_REGISTERED(d))
+   if (!DSP_REGISTERED(d) || PCM_DETACHING(d))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -704,7 +704,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int 
mode,
return (err);
 
d = priv->sc;
-   if (PCM_DETACHING(d) || !DSP_REGISTERED(d))
+   if (!DSP_REGISTERED(d) || PCM_DETACHING(d))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -1823,7 +1823,7 @@ dsp_poll(struct cdev *i_dev, int events, struct thread 
*td)
if ((err = devfs_get_cdevpriv((void **)&priv)) != 0)
return (err);
d = priv->sc;
-   if (PCM_DETACHING(d) || !DSP_REGISTERED(d)) {
+   if (!DSP_REGISTERED(d) || PCM_DETACHING(d)) {
/* XXX many clients don't understand POLLNVAL */
return (events & (POLLHUP | POLLPRI | POLLIN |
POLLRDNORM | POLLOUT | POLLWRNORM));
@@ -1905,7 +1905,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset,
if ((err = devfs_get_cdevpriv((void **)&priv)) != 0)
return (err);
d = priv->sc;
-   if (PCM_DETACHING(d) || !DSP_REGISTERED(d))
+   if (!DSP_REGISTERED(d) || PCM_DETACHING(d))
return (EINVAL);
 
PCM_GIANT_ENTER(d);



git: f3a097d0312c - main - netstat: switch to using the sysctl-exported stats for live stats

2024-10-24 Thread Kyle Evans
The branch main has been updated by kevans:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f3a097d0312cbadefa9bbb00cf3c6af784f9fbb9

commit f3a097d0312cbadefa9bbb00cf3c6af784f9fbb9
Author: Kyle Evans 
AuthorDate: 2024-10-24 16:53:59 +
Commit: Kyle Evans 
CommitDate: 2024-10-24 16:54:21 +

netstat: switch to using the sysctl-exported stats for live stats

Now that we export the relevant stats via the net.route.stats sysctl,
switch to using that to avoid having to dig around in mem(4) for live
kernel statistics.  Based on callers of kresolve_list(), this is the
last live path using mem(4) that could be functional today.

Tested both with `netstat -rs` and `netstat -rs -M`.

Note that this will not be able to extract stats from a running kernel
that predates 3360a15898 / 1500026, but this can be worked around by
specifying `-M /dev/mem` explicitly in the interim to fallback to
libkvm against /dev/mem.

Reviewed by:glebius, markj, zlei
Differential Revision:  https://reviews.freebsd.org/D47231
---
 usr.bin/netstat/main.c  | 7 ++-
 usr.bin/netstat/route.c | 8 +++-
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index eaca38365ed8..97509ea6798b 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -523,12 +523,9 @@ main(int argc, char *argv[])
if (rflag) {
xo_open_container("statistics");
xo_set_version(NETSTAT_XO_VERSION);
-   if (sflag) {
-   if (live) {
-   kresolve_list(nl);
-   }
+   if (sflag)
rt_stats();
-   } else
+   else
routepr(fib, af);
xo_close_container("statistics");
if (xo_finish() < 0)
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index f32ddee8403f..74797e2addb8 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -699,13 +699,11 @@ void
 rt_stats(void)
 {
struct rtstat rtstat;
-   u_long rtsaddr;
 
-   if ((rtsaddr = nl[N_RTSTAT].n_value) == 0) {
-   xo_emit("{W:rtstat: symbol not in namelist}\n");
+   if (fetch_stats("net.route.stats", nl[N_RTSTAT].n_value, &rtstat,
+   sizeof(rtstat), kread_counters) != 0)
return;
-   }
-   kread_counters(rtsaddr, (char *)&rtstat, sizeof (rtstat));
+
xo_emit("{T:routing}:\n");
 
 #definep(f, m) if (rtstat.f || sflag <= 1) \



git: bffebc336f4e - main - tcp: use CALLOUT_TRYLOCK for the TCP callout

2024-10-24 Thread Gleb Smirnoff
The branch main has been updated by glebius:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=bffebc336f4ece4d18774c1ab8f555802cebf961

commit bffebc336f4ece4d18774c1ab8f555802cebf961
Author: Gleb Smirnoff 
AuthorDate: 2024-10-24 16:58:37 +
Commit: Gleb Smirnoff 
CommitDate: 2024-10-24 17:14:03 +

tcp: use CALLOUT_TRYLOCK for the TCP callout

This allows to remove the drop of the lock tcp_timer_enter(), which closes
a sophisticated but possible race that involves three threads.  In case we
got a callout executing and two threads trying to close the connection,
e.g. and interrupt and a syscall, then lock yielding in tcp_timer_enter()
may transfer lock from one closing thread to the other closing thread,
instead of the callout.

Reviewed by:jtl
Differential Revision:  https://reviews.freebsd.org/D45747
---
 sys/netinet/tcp_subr.c  |  3 ++-
 sys/netinet/tcp_timer.c | 39 +++
 2 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 9b5f2651fb35..668d218b34a8 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -2309,7 +2309,8 @@ tcp_newtcpcb(struct inpcb *inp, struct tcpcb 
*listening_tcb)
tp->t_hpts_cpu = HPTS_CPU_NONE;
tp->t_lro_cpu = HPTS_CPU_NONE;
 
-   callout_init_rw(&tp->t_callout, &inp->inp_lock, CALLOUT_RETURNUNLOCKED);
+   callout_init_rw(&tp->t_callout, &inp->inp_lock,
+   CALLOUT_TRYLOCK | CALLOUT_RETURNUNLOCKED);
for (int i = 0; i < TT_N; i++)
tp->t_timers[i] = SBT_MAX;
 
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index ae6b97c09cdf..ae4753b2523f 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -949,35 +949,26 @@ tcp_timer_active(struct tcpcb *tp, tt_which which)
 
 /*
  * Stop all timers associated with tcpcb.
- *
  * Called when tcpcb moves to TCPS_CLOSED.
- *
- * XXXGL: unfortunately our callout(9) is not able to fully stop a locked
- * callout even when only two threads are involved: the callout itself and the
- * thread that does callout_stop().  See where softclock_call_cc() swaps the
- * callwheel lock to callout lock and then checks cc_exec_cancel().  This is
- * the race window.  If it happens, the tcp_timer_enter() won't be executed,
- * however pcb lock will be locked and released, hence we can't free memory.
- * Until callout(9) is improved, just keep retrying.  In my profiling I've seen
- * such event happening less than 1 time per hour with 20-30 Gbit/s of traffic.
  */
 void
 tcp_timer_stop(struct tcpcb *tp)
 {
-   struct inpcb *inp = tptoinpcb(tp);
 
-   INP_WLOCK_ASSERT(inp);
-
-   if (curthread->td_pflags & TDP_INTCPCALLOUT) {
-   int stopped __diagused;
+   INP_WLOCK_ASSERT(tptoinpcb(tp));
 
-   stopped = callout_stop(&tp->t_callout);
-   MPASS(stopped == 0);
-   for (tt_which i = 0; i < TT_N; i++)
-   tp->t_timers[i] = SBT_MAX;
-   } else while(__predict_false(callout_stop(&tp->t_callout) == 0)) {
-   INP_WUNLOCK(inp);
-   kern_yield(PRI_UNCHANGED);
-   INP_WLOCK(inp);
-   }
+   /*
+* We don't check return value from callout_stop().  There are two
+* reasons why it can return 0.  First, a legitimate one: we could have
+* been called from the callout itself.  Second, callout(9) has a bug.
+* It can race internally in softclock_call_cc(), when callout has
+* already completed, but cc_exec_curr still points at the callout.
+*/
+   (void )callout_stop(&tp->t_callout);
+   /*
+* In case of being called from callout itself, we must make sure that
+* we don't reschedule.
+*/
+   for (tt_which i = 0; i < TT_N; i++)
+   tp->t_timers[i] = SBT_MAX;
 }



git: 656991b0c629 - main - locks: augment lock_class with lc_trylock method

2024-10-24 Thread Gleb Smirnoff
The branch main has been updated by glebius:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=656991b0c629038beddf1847a6c20318d3ac4181

commit 656991b0c629038beddf1847a6c20318d3ac4181
Author: Gleb Smirnoff 
AuthorDate: 2024-10-24 16:57:57 +
Commit: Gleb Smirnoff 
CommitDate: 2024-10-24 17:14:03 +

locks: augment lock_class with lc_trylock method

Implement for mutex(9) and rwlock(9).

Reviewed by:jtl
Differential Revision:  https://reviews.freebsd.org/D45745
---
 sys/kern/kern_mutex.c  | 18 ++
 sys/kern/kern_rwlock.c | 14 ++
 sys/sys/lock.h |  1 +
 3 files changed, 33 insertions(+)

diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index 0fa624cc4bb1..fa043fa7e124 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -100,6 +100,8 @@ static void db_show_mtx(const struct lock_object *lock);
 #endif
 static voidlock_mtx(struct lock_object *lock, uintptr_t how);
 static voidlock_spin(struct lock_object *lock, uintptr_t how);
+static int trylock_mtx(struct lock_object *lock, uintptr_t how);
+static int trylock_spin(struct lock_object *lock, uintptr_t how);
 #ifdef KDTRACE_HOOKS
 static int owner_mtx(const struct lock_object *lock,
struct thread **owner);
@@ -118,6 +120,7 @@ struct lock_class lock_class_mtx_sleep = {
.lc_ddb_show = db_show_mtx,
 #endif
.lc_lock = lock_mtx,
+   .lc_trylock = trylock_mtx,
.lc_unlock = unlock_mtx,
 #ifdef KDTRACE_HOOKS
.lc_owner = owner_mtx,
@@ -131,6 +134,7 @@ struct lock_class lock_class_mtx_spin = {
.lc_ddb_show = db_show_mtx,
 #endif
.lc_lock = lock_spin,
+   .lc_trylock = trylock_spin,
.lc_unlock = unlock_spin,
 #ifdef KDTRACE_HOOKS
.lc_owner = owner_mtx,
@@ -216,6 +220,20 @@ lock_spin(struct lock_object *lock, uintptr_t how)
mtx_lock_spin((struct mtx *)lock);
 }
 
+static int
+trylock_mtx(struct lock_object *lock, uintptr_t how)
+{
+
+   return (mtx_trylock((struct mtx *)lock));
+}
+
+static int
+trylock_spin(struct lock_object *lock, uintptr_t how)
+{
+
+   return (mtx_trylock_spin((struct mtx *)lock));
+}
+
 static uintptr_t
 unlock_mtx(struct lock_object *lock)
 {
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
index 31ff8a7213fd..c7e377c8f77a 100644
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -72,6 +72,7 @@ static void   db_show_rwlock(const struct lock_object *lock);
 #endif
 static voidassert_rw(const struct lock_object *lock, int what);
 static voidlock_rw(struct lock_object *lock, uintptr_t how);
+static int trylock_rw(struct lock_object *lock, uintptr_t how);
 #ifdef KDTRACE_HOOKS
 static int owner_rw(const struct lock_object *lock, struct thread **owner);
 #endif
@@ -85,6 +86,7 @@ struct lock_class lock_class_rw = {
.lc_ddb_show = db_show_rwlock,
 #endif
.lc_lock = lock_rw,
+   .lc_trylock = trylock_rw,
.lc_unlock = unlock_rw,
 #ifdef KDTRACE_HOOKS
.lc_owner = owner_rw,
@@ -176,6 +178,18 @@ lock_rw(struct lock_object *lock, uintptr_t how)
rw_wlock(rw);
 }
 
+static int
+trylock_rw(struct lock_object *lock, uintptr_t how)
+{
+   struct rwlock *rw;
+
+   rw = (struct rwlock *)lock;
+   if (how)
+   return (rw_try_rlock(rw));
+   else
+   return (rw_try_wlock(rw));
+}
+
 static uintptr_t
 unlock_rw(struct lock_object *lock)
 {
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index 65064aad5aa8..9d81a49ab52a 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -66,6 +66,7 @@ struct lock_class {
int (*lc_owner)(const struct lock_object *lock,
struct thread **owner);
uintptr_t   (*lc_unlock)(struct lock_object *lock);
+   int (*lc_trylock)(struct lock_object *lock, uintptr_t how);
 };
 
 #defineLC_SLEEPLOCK0x0001  /* Sleep lock. */



git: d021d3b3c675 - main - tcp: get rid of TDP_INTCPCALLOUT

2024-10-24 Thread Gleb Smirnoff
The branch main has been updated by glebius:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d021d3b3c67573822b01d27cb05ca937fc966843

commit d021d3b3c67573822b01d27cb05ca937fc966843
Author: Gleb Smirnoff 
AuthorDate: 2024-10-24 16:58:49 +
Commit: Gleb Smirnoff 
CommitDate: 2024-10-24 17:14:03 +

tcp: get rid of TDP_INTCPCALLOUT

With CALLOUT_TRYLOCK we don't need this special flag.

Reviewed by:jtl
Differential Revision:  https://reviews.freebsd.org/D45748
---
 sys/netinet/tcp_timer.c | 9 +
 sys/sys/proc.h  | 2 +-
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index ae4753b2523f..c5c65dda5b1a 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -874,12 +874,8 @@ tcp_timer_enter(void *xtp)
struct inpcb *inp = tptoinpcb(tp);
sbintime_t precision;
tt_which which;
-   bool tp_valid;
 
INP_WLOCK_ASSERT(inp);
-   MPASS((curthread->td_pflags & TDP_INTCPCALLOUT) == 0);
-
-   curthread->td_pflags |= TDP_INTCPCALLOUT;
 
which = tcp_timer_next(tp, NULL);
MPASS(which < TT_N);
@@ -887,8 +883,7 @@ tcp_timer_enter(void *xtp)
tp->t_precisions[which] = 0;
 
tcp_bblog_timer(tp, which, TT_PROCESSING, 0);
-   tp_valid = tcp_timersw[which](tp);
-   if (tp_valid) {
+   if (tcp_timersw[which](tp)) {
tcp_bblog_timer(tp, which, TT_PROCESSED, 0);
if ((which = tcp_timer_next(tp, &precision)) != TT_N) {
MPASS(tp->t_state > TCPS_CLOSED);
@@ -898,8 +893,6 @@ tcp_timer_enter(void *xtp)
}
INP_WUNLOCK(inp);
}
-
-   curthread->td_pflags &= ~TDP_INTCPCALLOUT;
 }
 
 /*
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 1e98cc84a60a..466fb3c0cd41 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -560,7 +560,7 @@ enum {
 #defineTDP_RESETSPUR   0x0400 /* Reset spurious page fault 
history. */
 #defineTDP_NERRNO  0x0800 /* Last errno is already in td_errno 
*/
 #defineTDP_UIOHELD 0x1000 /* Current uio has pages held in 
td_ma */
-#defineTDP_INTCPCALLOUT 0x2000 /* used by netinet/tcp_timer.c */
+#defineTDP_UNUSED0 0x2000 /* UNUSED */
 #defineTDP_EXECVMSPC   0x4000 /* Execve destroyed old vmspace */
 #defineTDP_SIGFASTPENDING 0x8000 /* Pending signal due to 
sigfastblock */
 



git: 75ff90814aec - main - enic: Remove a stray semicolon

2024-10-24 Thread Zhenlei Huang
The branch main has been updated by zlei:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=75ff90814aec7a68e719d326f8dd0a7e1d0fc66d

commit 75ff90814aec7a68e719d326f8dd0a7e1d0fc66d
Author: Zhenlei Huang 
AuthorDate: 2024-10-24 15:04:49 +
Commit: Zhenlei Huang 
CommitDate: 2024-10-24 15:04:49 +

enic: Remove a stray semicolon

MFC after:  1 week
---
 sys/dev/enic/enic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/enic/enic.h b/sys/dev/enic/enic.h
index 6d0eb8563efd..8c2212726548 100644
--- a/sys/dev/enic/enic.h
+++ b/sys/dev/enic/enic.h
@@ -228,7 +228,7 @@ struct enic {
 
/* interrupt vectors (len = conf_intr_count) */
struct vnic_intr *intr;
-   struct intr_queue *intr_queues;;
+   struct intr_queue *intr_queues;
unsigned int intr_count; /* equals enabled interrupts (lsc + rxqs) */
 
 



git: 56b17de1e836 - main - makefs: Remove a stray semicolon

2024-10-24 Thread Zhenlei Huang
The branch main has been updated by zlei:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=56b17de1e8360fe131d425de20b5e75ff3ea897c

commit 56b17de1e8360fe131d425de20b5e75ff3ea897c
Author: Zhenlei Huang 
AuthorDate: 2024-10-24 15:04:48 +
Commit: Zhenlei Huang 
CommitDate: 2024-10-24 15:04:48 +

makefs: Remove a stray semicolon

MFC after:  1 week
---
 usr.sbin/makefs/msdos/msdosfs_fat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/makefs/msdos/msdosfs_fat.c 
b/usr.sbin/makefs/msdos/msdosfs_fat.c
index e00ce9ef7b97..16e2ce44084d 100644
--- a/usr.sbin/makefs/msdos/msdosfs_fat.c
+++ b/usr.sbin/makefs/msdos/msdosfs_fat.c
@@ -245,7 +245,7 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp, 
u_long *cnp, int *sp)
return (0);
}
 
-hiteof:;
+hiteof:
if (cnp)
*cnp = i;
if (bp)



git: 802c78f5194e - main - sound: Untangle dsp_cdevs[] and dsp_unit2name() confusion

2024-10-24 Thread Christos Margiolis
The branch main has been updated by christos:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=802c78f5194e4524faa30ea57adbf00f28fc72c6

commit 802c78f5194e4524faa30ea57adbf00f28fc72c6
Author: Christos Margiolis 
AuthorDate: 2024-10-24 11:37:23 +
Commit: Christos Margiolis 
CommitDate: 2024-10-24 11:37:23 +

sound: Untangle dsp_cdevs[] and dsp_unit2name() confusion

Before de8c0d15a64fa ("sound: Get rid of snd_clone and use
DEVFS_CDEVPRIV(9)"), sound(4) would create one device for each allocated
channel. The device names would be chosen from dsp_cdevs[], and created
with dsp_unit2name(). Additionally, dsp_cdevs[] was also used to match
these devices names, as well as OSSv4 aliases in dsp_clone().

Since sound(4) does not create separate devices for each channel
anymore, the meaning and use dsp_cdevs[] has changed. Part of it no
longer corresponds to devices at all, but instead is used to create
channel names, and another part is used to match only OSSv4 aliases in
dsp_clone().

To address this confusion, separate dsp_cdevs[] into a dsp_aliases[]
array, and move dsp_unit2name() to pcm/channel.c and rename it to
chn_mkname().

While here, get rid of the SND_DEV_DSPHW_* channel types, and simply use
the existing PCMDIR_* constants as the channel types. There is no need
to duplicate the same meaning twice.

Sponsored by:   The FreeBSD Foundation
MFC after:  2 days
Reviewed by:dev_submerge.ch
Differential Revision:  https://reviews.freebsd.org/D47199
---
 sys/dev/sound/pcm/channel.c |  70 +++
 sys/dev/sound/pcm/channel.h |   1 +
 sys/dev/sound/pcm/dsp.c | 290 +++-
 sys/dev/sound/pcm/dsp.h |   1 -
 sys/dev/sound/pcm/sound.h   |   4 -
 sys/dev/sound/pcm/vchan.c   |  11 +-
 6 files changed, 175 insertions(+), 202 deletions(-)

diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 6b8f00f9aa83..b1d3ebc0d0f7 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1161,13 +1161,13 @@ static struct unrhdr *
 chn_getunr(struct snddev_info *d, int type)
 {
switch (type) {
-   case SND_DEV_DSPHW_PLAY:
+   case PCMDIR_PLAY:
return (d->p_unr);
-   case SND_DEV_DSPHW_VPLAY:
+   case PCMDIR_PLAY_VIRTUAL:
return (d->vp_unr);
-   case SND_DEV_DSPHW_REC:
+   case PCMDIR_REC:
return (d->r_unr);
-   case SND_DEV_DSPHW_VREC:
+   case PCMDIR_REC_VIRTUAL:
return (d->vr_unr);
default:
__assert_unreachable();
@@ -1175,6 +1175,37 @@ chn_getunr(struct snddev_info *d, int type)
 
 }
 
+char *
+chn_mkname(char *buf, size_t len, struct pcm_channel *c)
+{
+   const char *str;
+
+   KASSERT(buf != NULL && len != 0,
+   ("%s(): bogus buf=%p len=%lu", __func__, buf, len));
+
+   switch (c->type) {
+   case PCMDIR_PLAY:
+   str = "play";
+   break;
+   case PCMDIR_PLAY_VIRTUAL:
+   str = "virtual_play";
+   break;
+   case PCMDIR_REC:
+   str = "record";
+   break;
+   case PCMDIR_REC_VIRTUAL:
+   str = "virtual_record";
+   break;
+   default:
+   __assert_unreachable();
+   }
+
+   snprintf(buf, len, "dsp%d.%s.%d",
+   device_get_unit(c->dev), str, c->unit);
+
+   return (buf);
+}
+
 struct pcm_channel *
 chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls,
 int dir, void *devinfo)
@@ -1183,27 +1214,19 @@ chn_init(struct snddev_info *d, struct pcm_channel 
*parent, kobj_class_t cls,
struct feeder_class *fc;
struct snd_dbuf *b, *bs;
char buf[CHN_NAMELEN];
-   int i, direction, type;
+   int i, direction;
 
PCM_BUSYASSERT(d);
PCM_LOCKASSERT(d);
 
switch (dir) {
case PCMDIR_PLAY:
-   direction = PCMDIR_PLAY;
-   type = SND_DEV_DSPHW_PLAY;
-   break;
case PCMDIR_PLAY_VIRTUAL:
direction = PCMDIR_PLAY;
-   type = SND_DEV_DSPHW_VPLAY;
break;
case PCMDIR_REC:
-   direction = PCMDIR_REC;
-   type = SND_DEV_DSPHW_REC;
-   break;
case PCMDIR_REC_VIRTUAL:
direction = PCMDIR_REC;
-   type = SND_DEV_DSPHW_VREC;
break;
default:
device_printf(d->dev,
@@ -1222,7 +1245,7 @@ chn_init(struct snddev_info *d, struct pcm_channel 
*parent, kobj_class_t cls,
CHN_INIT(c, children);
CHN_INIT(c, children.busy);
c->direction = direction;
-   c->type = type;
+   c->type = dir;
c->unit = alloc_unr(chn_getunr(d, c->type));
c->format = SND_FORMAT(AFMT_U8, 1, 0);
c->speed = DSP_DEFAULT_SPEED;
@@ -1234,8 +1257,7 

Re: git: 536c8d948e85 - main - intrng: change multi-interrupt root support type to enum

2024-10-24 Thread Jessica Clarke
On 24 Oct 2024, at 04:58, Kyle Evans  wrote:
> 
> The branch main has been updated by kevans:
> 
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=536c8d948e8563141356fd41fb8bfe65be289385
> 
> commit 536c8d948e8563141356fd41fb8bfe65be289385
> Author: Elliott Mitchell 
> AuthorDate: 2024-10-24 03:55:21 +
> Commit: Kyle Evans 
> CommitDate: 2024-10-24 03:55:21 +
> 
>intrng: change multi-interrupt root support type to enum
> 
>uint32_t is handy for directly interfacing with assembly-language.  For
>the C portion, enum is much handier.  In particular there is no need to
>count the number of roots by hand.  This also works better for being
>able to build kernels with varying numbers of roots.
> 
>Switch to INTR_ROOT_COUNT as this better matches the purpose of the
>value.  Switch to root_type, rather than rootnum for similar reasons.
> 
>Remove the default from the core.  Better to require the architectures
>to declare the type since they will routinely deviate and a default
>chosen now will likely be suboptimal.
> 
>Leave intr_irq_handler() taking a register type as that better matches
>for interfacing with assembly-language.

Hi Kyle,
A few comments, since I didn’t realise we were going ahead with this
change, otherwise I would have left them on a review somewhere.

> ---
> sys/arm/arm/gic.c  |  2 +-
> sys/arm/broadcom/bcm2835/bcm2836.c |  2 +-
> sys/arm/include/intr.h |  6 ++
> sys/arm64/arm64/gic_v3.c   |  4 ++--
> sys/arm64/arm64/gicv3_its.c|  2 +-
> sys/arm64/include/intr.h   | 10 ++---
> sys/kern/pic_if.m  |  4 ++--
> sys/kern/subr_intr.c   | 43 +++---
> sys/riscv/include/intr.h   |  6 ++
> sys/riscv/riscv/intc.c |  2 +-
> sys/sys/intr.h | 10 -
> 11 files changed, 48 insertions(+), 43 deletions(-)
> 
> diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c
> index b1b7aacd63ab..ffce86e62128 100644
> --- a/sys/arm/arm/gic.c
> +++ b/sys/arm/arm/gic.c
> @@ -200,7 +200,7 @@ gic_cpu_mask(struct arm_gic_softc *sc)
> 
> #ifdef SMP
> static void
> -arm_gic_init_secondary(device_t dev, uint32_t rootnum)
> +arm_gic_init_secondary(device_t dev, enum root_type root_type)
> {
> struct arm_gic_softc *sc = device_get_softc(dev);
> u_int irq, cpu;
> diff --git a/sys/arm/broadcom/bcm2835/bcm2836.c 
> b/sys/arm/broadcom/bcm2835/bcm2836.c
> index 7ed9dedaa77e..fd34ff8818ad 100644
> --- a/sys/arm/broadcom/bcm2835/bcm2836.c
> +++ b/sys/arm/broadcom/bcm2835/bcm2836.c
> @@ -538,7 +538,7 @@ bcm_lintc_init_pmu_on_ap(struct bcm_lintc_softc *sc, 
> u_int cpu)
> }
> 
> static void
> -bcm_lintc_init_secondary(device_t dev, uint32_t rootnum)
> +bcm_lintc_init_secondary(device_t dev, enum root_type root_type)
> {
> u_int cpu;
> struct bcm_lintc_softc *sc;
> diff --git a/sys/arm/include/intr.h b/sys/arm/include/intr.h
> index d0d0ff9fc32a..e74be3ac548e 100644
> --- a/sys/arm/include/intr.h
> +++ b/sys/arm/include/intr.h
> @@ -43,6 +43,12 @@
> #include 
> #endif
> 
> +enum root_type {

Should this not have intr in the name? It’s quite generic.

> + INTR_ROOT_IRQ = 0,
> +
> + INTR_ROOT_COUNT /* MUST BE LAST */

These comments don’t seem particularly useful? Anyone who knows what
they’re doing knows that’s clearly true. It definitely doesn’t need to
be shouted at the reader, at least.

Jess


> +};
> +
> #ifndef NIRQ
> #define NIRQ 1024 /* XXX - It should be an option. */
> #endif
> diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c
> index 964a129111e2..750f734a7757 100644
> --- a/sys/arm64/arm64/gic_v3.c
> +++ b/sys/arm64/arm64/gic_v3.c
> @@ -1093,7 +1093,7 @@ gic_v3_bind_intr(device_t dev, struct intr_irqsrc *isrc)
> 
> #ifdef SMP
> static void
> -gic_v3_init_secondary(device_t dev, uint32_t rootnum)
> +gic_v3_init_secondary(device_t dev, enum root_type root_type)
> {
> struct gic_v3_setup_periph_args pargs;
> device_t child;
> @@ -1140,7 +1140,7 @@ gic_v3_init_secondary(device_t dev, uint32_t rootnum)
> 
> for (i = 0; i < sc->gic_nchildren; i++) {
> child = sc->gic_children[i];
> - PIC_INIT_SECONDARY(child, rootnum);
> + PIC_INIT_SECONDARY(child, root_type);
> }
> }
> 
> diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c
> index 5ecd9b8c0e94..31e23fc01224 100644
> --- a/sys/arm64/arm64/gicv3_its.c
> +++ b/sys/arm64/arm64/gicv3_its.c
> @@ -1293,7 +1293,7 @@ gicv3_its_setup_intr(device_t dev, struct intr_irqsrc 
> *isrc,
> 
> #ifdef SMP
> static void
> -gicv3_its_init_secondary(device_t dev, uint32_t rootnum)
> +gicv3_its_init_secondary(device_t dev, enum root_type root_type)
> {
> struct gicv3_its_softc *sc;
> 
> diff --git a/sys/arm64/include/intr.h b/sys/arm64/include/intr.h
> index 99b4d15ccc1c..008c377b7a16 100644
> --- a/sys/arm64/include/intr.h
> +++ b/sys/arm64/include/intr.h
> @@ -31,6 +31,13 @@
> #include 
> #endif
> 
> +enum root_type {
> + INTR_ROOT_IRQ = 0,
> + IN

git: f0bc751d6fb4 - main - csa: Use pci_find_device to simplify clkrun_hack

2024-10-24 Thread John Baldwin
The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f0bc751d6fb4f7fe46fdaa1486b0ae20b04bb544

commit f0bc751d6fb4f7fe46fdaa1486b0ae20b04bb544
Author: John Baldwin 
AuthorDate: 2024-10-24 14:18:53 +
Commit: John Baldwin 
CommitDate: 2024-10-24 14:24:06 +

csa: Use pci_find_device to simplify clkrun_hack

Reviewed by:christos, imp
Differential Revision:  https://reviews.freebsd.org/D47222
---
 sys/dev/sound/pci/csa.c | 47 +--
 1 file changed, 13 insertions(+), 34 deletions(-)

diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c
index b1e513928487..6440b73f6341 100644
--- a/sys/dev/sound/pci/csa.c
+++ b/sys/dev/sound/pci/csa.c
@@ -108,46 +108,25 @@ static int
 clkrun_hack(int run)
 {
 #ifdef __i386__
-   devclass_t  pci_devclass;
-   device_t*pci_devices, *pci_children, *busp, *childp;
-   int pci_count = 0, pci_childcount = 0;
-   int i, j, port;
+   device_tchild;
+   int port;
u_int16_t   control;
bus_space_tag_t btag;
 
-   if ((pci_devclass = devclass_find("pci")) == NULL) {
-   return ENXIO;
-   }
+   child = pci_find_device(0x8086, 0x7113);
+   if (child == NULL)
+   return (ENXIO);
 
-   devclass_get_devices(pci_devclass, &pci_devices, &pci_count);
-
-   for (i = 0, busp = pci_devices; i < pci_count; i++, busp++) {
-   pci_childcount = 0;
-   if (device_get_children(*busp, &pci_children, &pci_childcount))
-   continue;
-   for (j = 0, childp = pci_children; j < pci_childcount; j++, 
childp++) {
-   if (pci_get_vendor(*childp) == 0x8086 && 
pci_get_device(*childp) == 0x7113) {
-   port = (pci_read_config(*childp, 0x41, 1) << 8) 
+ 0x10;
-   /* XXX */
-   btag = X86_BUS_SPACE_IO;
-
-   control = bus_space_read_2(btag, 0x0, port);
-   control &= ~0x2000;
-   control |= run? 0 : 0x2000;
-   bus_space_write_2(btag, 0x0, port, control);
-   free(pci_devices, M_TEMP);
-   free(pci_children, M_TEMP);
-   return 0;
-   }
-   }
-   free(pci_children, M_TEMP);
-   }
+   port = (pci_read_config(child, 0x41, 1) << 8) + 0x10;
+   /* XXX */
+   btag = X86_BUS_SPACE_IO;
 
-   free(pci_devices, M_TEMP);
-   return ENXIO;
-#else
-   return 0;
+   control = bus_space_read_2(btag, 0x0, port);
+   control &= ~0x2000;
+   control |= run? 0 : 0x2000;
+   bus_space_write_2(btag, 0x0, port, control);
 #endif
+   return (0);
 }
 
 static struct csa_card cards_4610[] = {



git: db08b0b04dec - main - tmpfs_vnops: move swap work to swap_pager

2024-10-24 Thread Doug Moore
The branch main has been updated by dougm:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=db08b0b04deced766c3b5f07bcfb82333666226c

commit db08b0b04deced766c3b5f07bcfb82333666226c
Author: Doug Moore 
AuthorDate: 2024-10-24 19:24:49 +
Commit: Doug Moore 
CommitDate: 2024-10-24 19:24:49 +

tmpfs_vnops: move swap work to swap_pager

Two functions in tmpfs_vnops.c use an interface provided by
swap_pager.c. Move most of the implementation of those functions to
swap_pager.c so that they can be implemented more effectively, with
access to implementation details of the swap pager.

Reviewed by:kib
Differential Revision:  https://reviews.freebsd.org/D47212
---
 sys/fs/tmpfs/tmpfs_vnops.c | 60 --
 sys/vm/swap_pager.c| 58 +++-
 sys/vm/swap_pager.h|  3 ++-
 3 files changed, 58 insertions(+), 63 deletions(-)

diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index c2559a61fe37..428c31f3c59a 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -2092,40 +2092,10 @@ tmpfs_setextattr(struct vop_setextattr_args *ap)
 static off_t
 tmpfs_seek_data_locked(vm_object_t obj, off_t noff)
 {
-   vm_page_t m;
-   vm_pindex_t p, p_swp;
+   vm_pindex_t p;
 
-   p = OFF_TO_IDX(noff);
-   m = vm_page_find_least(obj, p);
-
-   /*
-* Microoptimize the most common case for SEEK_DATA, where
-* there is no hole and the page is resident.
-*/
-   if (m != NULL && m->pindex == p && vm_page_any_valid(m))
-   return (noff);
-
-   p_swp = swap_pager_find_least(obj, p);
-   if (p_swp == p)
-   return (noff);
-
-   /*
-* Find the first resident page after p, before p_swp.
-*/
-   while (m != NULL && m->pindex < p_swp) {
-   if (vm_page_any_valid(m))
-   return (IDX_TO_OFF(m->pindex));
-   m = TAILQ_NEXT(m, listq);
-   }
-   if (p_swp == OBJ_MAX_SIZE)
-   p_swp = obj->size;
-   return (IDX_TO_OFF(p_swp));
-}
-
-static off_t
-tmpfs_seek_next(off_t noff)
-{
-   return (noff + PAGE_SIZE - (noff & PAGE_MASK));
+   p = swap_pager_seek_data(obj, OFF_TO_IDX(noff));
+   return (p == OFF_TO_IDX(noff) ? noff : IDX_TO_OFF(p));
 }
 
 static int
@@ -2142,30 +2112,8 @@ tmpfs_seek_clamp(struct tmpfs_node *tn, off_t *noff, 
bool seekdata)
 static off_t
 tmpfs_seek_hole_locked(vm_object_t obj, off_t noff)
 {
-   vm_page_t m;
-   vm_pindex_t p, p_swp;
-
-   for (;; noff = tmpfs_seek_next(noff)) {
-   /*
-* Walk over the largest sequential run of the valid pages.
-*/
-   for (m = vm_page_lookup(obj, OFF_TO_IDX(noff));
-   m != NULL && vm_page_any_valid(m);
-   m = vm_page_next(m), noff = tmpfs_seek_next(noff))
-   ;
 
-   /*
-* Found a hole in the object's page queue.  Check if
-* there is a hole in the swap at the same place.
-*/
-   p = OFF_TO_IDX(noff);
-   p_swp = swap_pager_find_least(obj, p);
-   if (p_swp != p) {
-   noff = IDX_TO_OFF(p);
-   break;
-   }
-   }
-   return (noff);
+   return (IDX_TO_OFF(swap_pager_seek_hole(obj, OFF_TO_IDX(noff;
 }
 
 static int
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 5eccc621bdae..90d44d3e7402 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -111,6 +111,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2476,17 +2477,62 @@ swap_pager_iter_find_least(struct pctrie_iter *blks, 
vm_pindex_t pindex)
 }
 
 /*
- * Returns the least page index which is greater than or equal to the parameter
- * pindex and for which there is a swap block allocated.  Returns OBJ_MAX_SIZE
- * if are no allocated swap blocks for the object after the requested pindex.
+ * Find the first index >= pindex that has either a valid page or a swap
+ * block.
  */
 vm_pindex_t
-swap_pager_find_least(vm_object_t object, vm_pindex_t pindex)
+swap_pager_seek_data(vm_object_t object, vm_pindex_t pindex)
 {
-   struct pctrie_iter blks;
+   struct pctrie_iter blks, pages;
+   vm_page_t m;
+   vm_pindex_t swap_index;
+
+   VM_OBJECT_ASSERT_WLOCKED(object);
+   vm_page_iter_init(&pages, object);
+   m = vm_page_iter_lookup_ge(&pages, pindex);
+   if (m != NULL) {
+   if (!vm_page_any_valid(m))
+   m = NULL;
+   else if (pages.index == pindex)
+   return (pages.index);
+   }
+   swblk_iter_init_only(&blks, object);
+   swap_index = swap_pager_iter_find_least(&blks, pindex);
+   if (swap_index == pindex)
+   return (swap_index)

git: 3b03e1bb8615 - main - intrng: Store the IPI priority

2024-10-24 Thread Andrew Turner
The branch main has been updated by andrew:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=3b03e1bb86157cc235563fc6e86c33b6bd9baea8

commit 3b03e1bb86157cc235563fc6e86c33b6bd9baea8
Author: Andrew Turner 
AuthorDate: 2024-10-23 16:57:53 +
Commit: Andrew Turner 
CommitDate: 2024-10-24 10:20:48 +

intrng: Store the IPI priority

When registering an interrupt controller we take a priority to compare.
We never store the priority so any later calls may act incorrectly.

Store the priority so later calls act as expected.

Reviewed by:jrtc27
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D47235
---
 sys/kern/subr_intr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c
index b8c085367dd6..e88018e58729 100644
--- a/sys/kern/subr_intr.c
+++ b/sys/kern/subr_intr.c
@@ -1854,8 +1854,10 @@ intr_ipi_pic_register(device_t dev, u_int priority)
return (EBUSY);
}
 
-   if (intr_ipi_dev == NULL || priority > intr_ipi_dev_priority)
+   if (intr_ipi_dev == NULL || priority > intr_ipi_dev_priority) {
+   intr_ipi_dev_priority = priority;
intr_ipi_dev = dev;
+   }
 
return (0);
 }



git: d7f930b80e89 - main - arm64: Implement efi_rt_arch_call

2024-10-24 Thread Andrew Turner
The branch main has been updated by andrew:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d7f930b80e8928efd9f0bdc0fd48585f8b0b7061

commit d7f930b80e8928efd9f0bdc0fd48585f8b0b7061
Author: Andrew Turner 
AuthorDate: 2024-10-24 09:52:46 +
Commit: Andrew Turner 
CommitDate: 2024-10-24 10:20:48 +

arm64: Implement efi_rt_arch_call

This is a function that calls into the EFI Runtime Services, but can
handle a fault. To support this add a handler in assembly that can
restore the kernel state on an exception and return a failure to the
caller.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D46817
---
 sys/arm64/arm64/efirt_machdep.c |   9 ++--
 sys/arm64/arm64/efirt_support.S | 101 
 sys/arm64/arm64/genassym.c  |   6 +++
 sys/arm64/include/proc.h|   6 ++-
 sys/conf/files.arm64|   1 +
 5 files changed, 116 insertions(+), 7 deletions(-)

diff --git a/sys/arm64/arm64/efirt_machdep.c b/sys/arm64/arm64/efirt_machdep.c
index 47e0a209d8b1..aad3761844e1 100644
--- a/sys/arm64/arm64/efirt_machdep.c
+++ b/sys/arm64/arm64/efirt_machdep.c
@@ -50,6 +50,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -239,6 +240,7 @@ efi_arch_enter(void)
 {
 
CRITICAL_ASSERT(curthread);
+   curthread->td_md.md_efirt_dis_pf = vm_fault_disable_pagefaults();
 
/*
 * Temporarily switch to EFI's page table.  However, we leave curpmap
@@ -269,11 +271,6 @@ efi_arch_leave(void)
set_ttbr0(pmap_to_ttbr0(PCPU_GET(curpmap)));
if (PCPU_GET(bcast_tlbi_workaround) != 0)
invalidate_local_icache();
+   vm_fault_enable_pagefaults(curthread->td_md.md_efirt_dis_pf);
 }
 
-int
-efi_rt_arch_call(struct efirt_callinfo *ec)
-{
-
-   panic("not implemented");
-}
diff --git a/sys/arm64/arm64/efirt_support.S b/sys/arm64/arm64/efirt_support.S
new file mode 100644
index ..b7bef7500ee4
--- /dev/null
+++ b/sys/arm64/arm64/efirt_support.S
@@ -0,0 +1,101 @@
+/*-
+ * Copyright (c) 2024 Arm Ltd
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+#include 
+
+#include 
+
+#include "assym.inc"
+
+/*
+ * int efi_rt_arch_call(struct efirt_callinfo *);
+ */
+ENTRY(efi_rt_arch_call)
+   sub sp, sp, #(14 * 8)
+   stp x19, x20, [sp, #(2  * 8)]
+   stp x21, x22, [sp, #(4  * 8)]
+   stp x23, x24, [sp, #(6  * 8)]
+   stp x25, x26, [sp, #(8  * 8)]
+   stp x27, x28, [sp, #(10 * 8)]
+   stp x29, x30, [sp, #(12 * 8)]
+   add x29, sp, #(12 * 8)
+
+   /* Save the stack pointer so we can find it later */
+   ldr x23, [x18, #PC_CURTHREAD]
+   mov x24, sp
+   str x24, [x23, #TD_MD_EFIRT_TMP]
+
+   mov x22, x0
+
+   /* Load the function to branch to */
+   ldr x9, [x22, #(EC_FPTR)]
+
+   /* Load the arguments */
+   ldr x4, [x22, #(EC_ARG1 + (4 * 8))]
+   ldr x3, [x22, #(EC_ARG1 + (3 * 8))]
+   ldr x2, [x22, #(EC_ARG1 + (2 * 8))]
+   ldr x1, [x22, #(EC_ARG1 + (1 * 8))]
+   ldr x0, [x22, #(EC_ARG1 + (0 * 8))]
+
+   /* Set the fault handler */
+   adr x10, efi_rt_fault
+   SET_FAULT_HANDLER(x10, x11)
+
+   blr x9
+
+   /* Clear the fault handler */
+   SET_FAULT_HANDLER(xzr, x11)
+
+   /* Store the result */
+   str x0, [x22, #(EC_EFI_STATUS)]
+   mov x0, #0
+
+.Lefi_rt_arch_call_exit:
+   ldp x19, x20, [sp, #(2  * 8)]
+   ldp x21, x22, [sp, #(4  * 8)]
+   ldp x23, x24, [sp, #(6  * 8)]
+   ldp x25, x26, [sp, #(8  * 8)]
+   ldp x27, x28, [sp, #(10 * 8)]
+   

git: b2dd4970c7b5 - main - dev/gpio: Mask all pl011 interrupts

2024-10-24 Thread Andrew Turner
The branch main has been updated by andrew:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b2dd4970c7b5c20bef35a8924cc2a5f54ea4cb30

commit b2dd4970c7b5c20bef35a8924cc2a5f54ea4cb30
Author: Andrew Turner 
AuthorDate: 2024-10-23 16:57:31 +
Commit: Andrew Turner 
CommitDate: 2024-10-24 10:20:48 +

dev/gpio: Mask all pl011 interrupts

The firmware may have unmasked pl011 interrupts. If we don't have a
device to handle one the kernel will print a spurious interrupt
warning. Rather than print the warning mask all interrupts until we
are ready to handle them.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D46863
---
 sys/dev/gpio/pl061.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/dev/gpio/pl061.c b/sys/dev/gpio/pl061.c
index 76754fead635..cc39790322b6 100644
--- a/sys/dev/gpio/pl061.c
+++ b/sys/dev/gpio/pl061.c
@@ -460,6 +460,9 @@ pl061_attach(device_t dev)
goto free_mem;
}
 
+   /* Mask all interrupts. They will be unmasked as needed later */
+   bus_write_1(sc->sc_mem_res, PL061_INTMASK, 0);
+
ret = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
pl061_intr, NULL, sc, &sc->sc_irq_hdlr);
if (ret) {



git: e4ac0183a1a8 - main - sctp: cleanup

2024-10-24 Thread Michael Tuexen
The branch main has been updated by tuexen:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e4ac0183a1a846ef6556c9876dab76c06f5fea9c

commit e4ac0183a1a846ef6556c9876dab76c06f5fea9c
Author: Michael Tuexen 
AuthorDate: 2024-10-24 11:24:49 +
Commit: Michael Tuexen 
CommitDate: 2024-10-24 11:24:49 +

sctp: cleanup

No functional change intended.

MFC after:  3 days
---
 sys/netinet/sctp_pcb.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 92f08717c001..f25668b5756c 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -192,21 +192,17 @@ sctp_find_ifn(void *ifn, uint32_t ifn_index)
struct sctp_ifn *sctp_ifnp;
struct sctp_ifnlist *hash_ifn_head;
 
-   /*
-* We assume the lock is held for the addresses if that's wrong
-* problems could occur :-)
-*/
SCTP_IPI_ADDR_LOCK_ASSERT();
hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & 
SCTP_BASE_INFO(vrf_ifn_hashmark))];
LIST_FOREACH(sctp_ifnp, hash_ifn_head, next_bucket) {
if (sctp_ifnp->ifn_index == ifn_index) {
-   return (sctp_ifnp);
+   break;
}
-   if (sctp_ifnp->ifn_p && ifn && (sctp_ifnp->ifn_p == ifn)) {
-   return (sctp_ifnp);
+   if (ifn != NULL && sctp_ifnp->ifn_p == ifn) {
+   break;
}
}
-   return (NULL);
+   return (sctp_ifnp);
 }
 
 struct sctp_vrf *



git: d96ba5a62365 - main - config: Remove a stray semicolon

2024-10-24 Thread Zhenlei Huang
The branch main has been updated by zlei:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d96ba5a6236566afba05ce542296c589503a8b17

commit d96ba5a6236566afba05ce542296c589503a8b17
Author: Zhenlei Huang 
AuthorDate: 2024-10-24 15:04:48 +
Commit: Zhenlei Huang 
CommitDate: 2024-10-24 15:04:48 +

config: Remove a stray semicolon

MFC after:  1 week
---
 usr.sbin/config/mkmakefile.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/config/mkmakefile.cc b/usr.sbin/config/mkmakefile.cc
index a102b2b59767..6cffb64a5569 100644
--- a/usr.sbin/config/mkmakefile.cc
+++ b/usr.sbin/config/mkmakefile.cc
@@ -577,7 +577,7 @@ next:
goto nextparam;
}
match &= negate;
-nextparam:;
+nextparam:
negate = 0;
}
compile += match;



git: 88b71d1fe054 - main - arm64: rockchip: Remove a stray semicolon

2024-10-24 Thread Zhenlei Huang
The branch main has been updated by zlei:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=88b71d1fe054f9baace237494d22288256a7fca1

commit 88b71d1fe054f9baace237494d22288256a7fca1
Author: Zhenlei Huang 
AuthorDate: 2024-10-24 15:04:48 +
Commit: Zhenlei Huang 
CommitDate: 2024-10-24 15:04:48 +

arm64: rockchip: Remove a stray semicolon

MFC after:  1 week
---
 sys/arm64/rockchip/rk_pinctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arm64/rockchip/rk_pinctrl.c b/sys/arm64/rockchip/rk_pinctrl.c
index 6137f7f0d50a..4cf266df3cbf 100644
--- a/sys/arm64/rockchip/rk_pinctrl.c
+++ b/sys/arm64/rockchip/rk_pinctrl.c
@@ -1191,7 +1191,7 @@ rk_pinctrl_configure_pin(struct rk_pinctrl_softc *sc, 
uint32_t *pindata)
 
drive = ((1 << (value + 1)) - 1) << (pin % 2);
 
-   mask = 0x3f << (pin % 2);;
+   mask = 0x3f << (pin % 2);
 
SYSCON_WRITE_4(syscon, reg, drive | (mask << 16));
}



git: 86a2c910c05c - main - mpi3mr: Remove a stray semicolon

2024-10-24 Thread Zhenlei Huang
The branch main has been updated by zlei:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=86a2c910c05c65d1318aef81ddbde8ac7eab79b9

commit 86a2c910c05c65d1318aef81ddbde8ac7eab79b9
Author: Zhenlei Huang 
AuthorDate: 2024-10-24 15:04:50 +
Commit: Zhenlei Huang 
CommitDate: 2024-10-24 15:04:50 +

mpi3mr: Remove a stray semicolon

MFC after:  1 week
---
 sys/dev/mpi3mr/mpi3mr_app.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/mpi3mr/mpi3mr_app.c b/sys/dev/mpi3mr/mpi3mr_app.c
index 79da04a74218..7cd3f13e4117 100644
--- a/sys/dev/mpi3mr/mpi3mr_app.c
+++ b/sys/dev/mpi3mr/mpi3mr_app.c
@@ -2079,7 +2079,7 @@ mpi3mr_get_adpinfo(struct mpi3mr_softc *sc,
adpinfo.pci_dev_hw_rev = pci_read_config(sc->mpi3mr_dev, PCIR_REVID, 1);
adpinfo.pci_subsys_dev_id = pci_get_subdevice(sc->mpi3mr_dev);
adpinfo.pci_subsys_ven_id = pci_get_subvendor(sc->mpi3mr_dev);
-   adpinfo.pci_bus = pci_get_bus(sc->mpi3mr_dev);;
+   adpinfo.pci_bus = pci_get_bus(sc->mpi3mr_dev);
adpinfo.pci_dev = pci_get_slot(sc->mpi3mr_dev);
adpinfo.pci_func = pci_get_function(sc->mpi3mr_dev);
adpinfo.pci_seg_id = pci_get_domain(sc->mpi3mr_dev);



git: 02e85d1c8a41 - main - swap_pager: fix assert in seek_data

2024-10-24 Thread Doug Moore
The branch main has been updated by dougm:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=02e85d1c8a41cbf6de1899318b25626e62144363

commit 02e85d1c8a41cbf6de1899318b25626e62144363
Author: Doug Moore 
AuthorDate: 2024-10-24 23:00:47 +
Commit: Doug Moore 
CommitDate: 2024-10-24 23:04:19 +

swap_pager: fix assert in seek_data

An assertion that an object was write-locked should be instead an
assertion that the object is read locked.

Reported by:Jenkins
Fixes:   db08b0b04deced tmpfs_vnops: move swap work to swap_pager
Differential Revision:  https://reviews.freebsd.org/D47278
---
 sys/vm/swap_pager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 90d44d3e7402..3d21d42da6c3 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2487,7 +2487,7 @@ swap_pager_seek_data(vm_object_t object, vm_pindex_t 
pindex)
vm_page_t m;
vm_pindex_t swap_index;
 
-   VM_OBJECT_ASSERT_WLOCKED(object);
+   VM_OBJECT_ASSERT_RLOCKED(object);
vm_page_iter_init(&pages, object);
m = vm_page_iter_lookup_ge(&pages, pindex);
if (m != NULL) {



git: faa9356f97d2 - main - swap_pager: fix seek_hole assert

2024-10-24 Thread Doug Moore
The branch main has been updated by dougm:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=faa9356f97d23655b801f77201692e6de9ae7caa

commit faa9356f97d23655b801f77201692e6de9ae7caa
Author: Doug Moore 
AuthorDate: 2024-10-24 23:06:59 +
Commit: Doug Moore 
CommitDate: 2024-10-24 23:08:32 +

swap_pager: fix seek_hole assert

Moving code from tmpfs to swap_pager introduced another WLOCKED object
assert that should have been an RLOCKED object assert.  Fix it.
---
 sys/vm/swap_pager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 3d21d42da6c3..e1795e8fd3ae 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2524,7 +2524,7 @@ swap_pager_seek_hole(vm_object_t object, vm_pindex_t 
pindex)
struct swblk *sb;
vm_page_t m;
 
-   VM_OBJECT_ASSERT_WLOCKED(object);
+   VM_OBJECT_ASSERT_RLOCKED(object);
vm_page_iter_init(&pages, object);
swblk_iter_init_only(&blks, object);
while (((m = vm_page_iter_lookup(&pages, pindex)) != NULL &&



git: a3a88aa13260 - main - Fix buildworld with gcc 13 after llvm-19 import

2024-10-24 Thread Dimitry Andric
The branch main has been updated by dim:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a3a88aa132605c5d42153a419c0e129296dec467

commit a3a88aa132605c5d42153a419c0e129296dec467
Author: Dimitry Andric 
AuthorDate: 2024-10-24 21:42:36 +
Commit: Dimitry Andric 
CommitDate: 2024-10-24 22:09:33 +

Fix buildworld with gcc 13 after llvm-19 import

It turns out the new libc++ 19 headers result in a -Werror warning from
gcc 13:

  In file included from 
/usr/obj/usr/src/freebsd/src/amd64.amd64/tmp/usr/include/c++/v1/__memory/shared_ptr.h:31:
  
/usr/obj/usr/src/freebsd/src/amd64.amd64/tmp/usr/include/c++/v1/__memory/uninitialized_algorithms.h:
 In instantiation of 'constexpr void 
std::__1::__uninitialized_allocator_relocate(_Alloc&, _Tp*, _Tp*, _Tp*) [with 
_Alloc = allocator >; _Tp = basic_string]':
  
/usr/obj/usr/src/freebsd/src/amd64.amd64/tmp/usr/include/c++/v1/vector:1052:42: 
  required from 'void std::__1::vector<_Tp, 
_Alloc>::__swap_out_circular_buffer(std::__1::__split_buffer<_Tp, 
_Allocator&>&) [with _Tp = std::__1::basic_string; _Allocator = 
std::__1::allocator >]'
  
/usr/obj/usr/src/freebsd/src/amd64.amd64/tmp/usr/include/c++/v1/vector:1469:31: 
  required from 'void std::__1::vector<_Tp, _Alloc>::reserve(size_type) [with 
_Tp = std::__1::basic_string; _Allocator = 
std::__1::allocator >; size_type = long unsigned 
int]'
  /usr/src/freebsd/src/contrib/googletest/googletest/src/gtest.cc:795:27:   
required from here
  
/usr/obj/usr/src/freebsd/src/amd64.amd64/tmp/usr/include/c++/v1/__memory/uninitialized_algorithms.h:645:21:
 error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' writing 
to an object of type 'std::__1::__remove_const_t 
>' {aka 'class std::__1::basic_string'} with no trivial copy-assignment; 
use copy-assignment or copy-initialization instead o[-Werror=class-memaccess]
645 | 
__builtin_memcpy(const_cast<__remove_const_t<_Tp>*>(__result), __first, 
sizeof(_Tp) * (__last - __first));
| 
^
  In file included from 
/usr/obj/usr/src/freebsd/src/amd64.amd64/tmp/usr/include/c++/v1/__system_error/error_category.h:15,
   from 
/usr/obj/usr/src/freebsd/src/amd64.amd64/tmp/usr/include/c++/v1/__system_error/error_code.h:18,
   from 
/usr/obj/usr/src/freebsd/src/amd64.amd64/tmp/usr/include/c++/v1/__ostream/basic_ostream.h:16:
  
/usr/obj/usr/src/freebsd/src/amd64.amd64/tmp/usr/include/c++/v1/string:752:7: 
note: 'std::__1::__remove_const_t >' {aka 'class 
std::__1::basic_string'} declared here
752 | class basic_string {
|   ^~~~

Since this is all benign, turn off errors for -Wclass-memaccess.

PR: 280562
MFC after:  3 days
---
 share/mk/bsd.sys.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 1934a79a5427..63774e857167 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -221,6 +221,7 @@ CWARNFLAGS+=
-Wno-error=aggressive-loop-optimizations\
-Wno-error=restrict \
-Wno-error=sizeof-pointer-memaccess \
-Wno-error=stringop-truncation
+CXXWARNFLAGS+= -Wno-error=class-memaccess
 .endif
 
 # GCC 9.2.0



git: 1c83996beda7 - main - Adjust LLVM_ENABLE_ABI_BREAKING_CHECKS depending on NDEBUG

2024-10-24 Thread Dimitry Andric
The branch main has been updated by dim:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=1c83996beda7b6a382857c318f46daefcb6bd84c

commit 1c83996beda7b6a382857c318f46daefcb6bd84c
Author: Dimitry Andric 
AuthorDate: 2024-10-24 09:53:19 +
Commit: Dimitry Andric 
CommitDate: 2024-10-24 09:53:19 +

Adjust LLVM_ENABLE_ABI_BREAKING_CHECKS depending on NDEBUG

When assertions are disabled, the upstream build system disables
LLVM_ENABLE_ABI_BREAKING_CHECKS by default. Though the upstream build
system allows it to be force-enabled, it looks like that is not a
well-tested build-time configuration.

Therefore, always disable LLVM_ENABLE_ABI_BREAKING_CHECKS when
assertions are disabled, which will also save some more runtime cost
when people use WITHOUT_LLVM_ASSERTIONS.

PR: 280562
MFC after:  1 month
---
 lib/clang/include/llvm/Config/abi-breaking.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/lib/clang/include/llvm/Config/abi-breaking.h 
b/lib/clang/include/llvm/Config/abi-breaking.h
index eb90be1fe37b..55e67e2ebad7 100644
--- a/lib/clang/include/llvm/Config/abi-breaking.h
+++ b/lib/clang/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
+#ifdef NDEBUG
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
+#else
 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#endif
 
 /* Define to enable reverse iteration of unordered llvm containers */
 #define LLVM_ENABLE_REVERSE_ITERATION 0



git: a5b1eecbed07 - main - Apply workaround for building llvm-project with WITHOUT_LLVM_ASSERTIONS

2024-10-24 Thread Dimitry Andric
The branch main has been updated by dim:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a5b1eecbed07519c637095e3291b9cbd9748e823

commit a5b1eecbed07519c637095e3291b9cbd9748e823
Author: Dimitry Andric 
AuthorDate: 2024-10-24 07:02:54 +
Commit: Dimitry Andric 
CommitDate: 2024-10-24 07:03:02 +

Apply workaround for building llvm-project with WITHOUT_LLVM_ASSERTIONS

Some internal checking functions should only be declared when both
NDEBUG and LLVM_ENABLE_ABI_BREAKING_CHECKS are undefined, otherwise you
would get compile errors similar to:

  
/usr/src/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:921:13:
 error: no member named 'VerifyDAGDivergence' in 'llvm::SelectionDAG'
   921 | CurDAG->VerifyDAGDivergence();
   | ~~  ^

Adjust the conditions for declaring and using these functions. This has
also been reported upstream.

Reported by:cy
PR: 280562
MFC after:  1 month
---
 .../llvm/include/llvm/CodeGen/SelectionDAG.h   |  2 +-
 .../llvm/include/llvm/CodeGen/SelectionDAGISel.h   |  2 +-
 .../llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp |  2 +-
 .../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 18 +-
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/contrib/llvm-project/llvm/include/llvm/CodeGen/SelectionDAG.h 
b/contrib/llvm-project/llvm/include/llvm/CodeGen/SelectionDAG.h
index 16ec65f2e7da..9c0220055f38 100644
--- a/contrib/llvm-project/llvm/include/llvm/CodeGen/SelectionDAG.h
+++ b/contrib/llvm-project/llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -582,7 +582,7 @@ public:
 return Root;
   }
 
-#ifndef NDEBUG
+#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
   void VerifyDAGDivergence();
 #endif
 
diff --git a/contrib/llvm-project/llvm/include/llvm/CodeGen/SelectionDAGISel.h 
b/contrib/llvm-project/llvm/include/llvm/CodeGen/SelectionDAGISel.h
index aa0efa5d9bf5..0c23e80a0ac5 100644
--- a/contrib/llvm-project/llvm/include/llvm/CodeGen/SelectionDAGISel.h
+++ b/contrib/llvm-project/llvm/include/llvm/CodeGen/SelectionDAGISel.h
@@ -55,7 +55,7 @@ public:
   AssumptionCache *AC = nullptr;
   GCFunctionInfo *GFI = nullptr;
   SSPLayoutInfo *SP = nullptr;
-#if LLVM_ENABLE_ABI_BREAKING_CHECKS
+#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
   TargetTransformInfo *TTI = nullptr;
 #endif
   CodeGenOptLevel OptLevel;
diff --git 
a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp 
b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 02d44cd36ae5..63213e276d22 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -11623,7 +11623,7 @@ void 
SelectionDAG::CreateTopologicalOrder(std::vector &Order) {
   }
 }
 
-#ifndef NDEBUG
+#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
 void SelectionDAG::VerifyDAGDivergence() {
   std::vector TopoOrder;
   CreateTopologicalOrder(TopoOrder);
diff --git 
a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp 
b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index b961d3bb1fec..74bd1fdb887c 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -916,7 +916,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
 CurDAG->dump());
 
-#if LLVM_ENABLE_ABI_BREAKING_CHECKS
+#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
   if (TTI->hasBranchDivergence())
 CurDAG->VerifyDAGDivergence();
 #endif
@@ -936,7 +936,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
 CurDAG->dump());
 
-#if LLVM_ENABLE_ABI_BREAKING_CHECKS
+#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
   if (TTI->hasBranchDivergence())
 CurDAG->VerifyDAGDivergence();
 #endif
@@ -958,7 +958,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
 CurDAG->dump());
 
-#if LLVM_ENABLE_ABI_BREAKING_CHECKS
+#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
   if (TTI->hasBranchDivergence())
 CurDAG->VerifyDAGDivergence();
 #endif
@@ -982,7 +982,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
  << "'\n";
   CurDAG->dump());
 
-#if LLVM_ENABLE_ABI_BREAKING_CHECKS
+#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
 if (TTI->hasBranchDivergence())
   CurDAG->VerifyDAGDivergence();
 #endif
@@ -1000,7 +1000,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
  << "'\n";
   CurDAG->dump());
 
-#if LLVM_ENABLE_ABI_BREAKING_CHECKS
+#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
 if (TTI->hasBranchDivergence())
   CurDAG->VerifyDAGDivergence();
 #endif
@@ -1016,7 +1016,7 @@ void SelectionDAGI

git: 6b9f7133aba4 - main - libc: Add one more check in new fmemopen test

2024-10-24 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6b9f7133aba44189d9625c352bc2c2a59baf18ef

commit 6b9f7133aba44189d9625c352bc2c2a59baf18ef
Author: Ed Maste 
AuthorDate: 2024-10-23 17:28:55 +
Commit: Ed Maste 
CommitDate: 2024-10-23 17:29:34 +

libc: Add one more check in new fmemopen test

Reported by:jrtc27
Fixes: 0953460ce149 ("libc: fix access mode tests in fmemopen(3)")
---
 lib/libc/tests/stdio/fmemopen2_test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/libc/tests/stdio/fmemopen2_test.c 
b/lib/libc/tests/stdio/fmemopen2_test.c
index 4a7242ee6b2f..a558ff3515e9 100644
--- a/lib/libc/tests/stdio/fmemopen2_test.c
+++ b/lib/libc/tests/stdio/fmemopen2_test.c
@@ -296,6 +296,7 @@ ATF_TC_BODY(test_rdonly_wronly, tc)
fclose(fp);
 
fp = fmemopen(buf_orig, sizeof(buf), "w");
+   ATF_REQUIRE(fp != NULL);
sz = fread(buf, sizeof(buf), 1, fp);
ATF_REQUIRE(sz == 0);
ATF_REQUIRE(errno == EBADF);



RE: git: f3dbef108212 - main - Bump __FreeBSD_version for llvm 19.1.2 merge [questions]

2024-10-24 Thread Mark Millard
Dimitry Andric  write
Date: Wed, 23 Oct 2024 18:32:46 UTC :

> The branch main has been updated by dim:
> 
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=f3dbef108212460489ae68b4c47e20b73984f433
> 
> commit f3dbef108212460489ae68b4c47e20b73984f433
> Author: Dimitry Andric 
> AuthorDate: 2024-10-23 16:49:02 +
> Commit: Dimitry Andric 
> CommitDate: 2024-10-23 18:27:43 +
> 
> Bump __FreeBSD_version for llvm 19.1.2 merge
> 
> PR: 280562
> MFC after: 1 month
> ---
> sys/sys/param.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sys/sys/param.h b/sys/sys/param.h
> index 8af2f9594bc1..7647c0d6e518 100644
> --- a/sys/sys/param.h
> +++ b/sys/sys/param.h
> @@ -73,7 +73,7 @@
> * cannot include sys/param.h and should only be updated here.
> */
> #undef __FreeBSD_version
> -#define __FreeBSD_version 1500025
> +#define __FreeBSD_version 1500026
> 
> /*
> * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,


As clang++ 19 (not necessarily how FreeBSD will use it) crosses
into the territory of supporting new libc++ related things that
work differently for how builds work, I wonder about the intent
for import std; and import std.compat; that involve cmake or
the like in the build process but that depend on material
provided by libc++ that cmake (or whatever) uses.

For reference: https://libcxx.llvm.org/Status/Cxx23.html reports
. . .

QUOTE
P2465R3 Standard Library Modules std and std.compat 2022-07 (Virtual) Complete 
19.0
END QUOTE

So, as stands, it is now just up to FreeBSD what it wants
to do in the specific subject area.

The build activity difference is tied to these not being
prebuilt libraries or the like, but instead built to the
compiler options and such in use for the build of the 
individual project build(s). cmake, for example, uses
information provided by llvm19's libc++ as part of
controlling the building tailored material for import
std; or import std.compat; .

I'm not expecting FreeBSD to allow use of import std; or
import std.compat; in the world or kernel builds. I'm more
curious about if FreeBSD expects to allow personal software
activity or, possibly, ports to use import std; or import
std.compat; via use of the system libc++ ( and clang++ )
vs. not supporting such.

This is mostly a question because FreeBSD only supports use of
the system libc++ for devel/llvm* and there is no lang/clang++-19
( analogous to, say, lang/gcc14 having its own libstdc++ that
can be used instead of the system libc++ ). As stands, there is
just one libc++ for a given build of FreeBSD.

[Use of more modern devel/llvm* 's only get one the langauge
updates, not the libc++ library updates. But some things from
the C++23 and later standards involve both before support is
functional.]

===
Mark Millard
marklmi at yahoo.com




git: 52418fc2be8e - main - Merge llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1c

2024-10-24 Thread Dimitry Andric
The branch main has been updated by dim:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=52418fc2be8efa5172b90a3a9e617017173612c4

commit 52418fc2be8efa5172b90a3a9e617017173612c4
Merge: ff6c8447844b 9b9503334fa8
Author: Dimitry Andric 
AuthorDate: 2024-08-06 13:37:26 +
Commit: Dimitry Andric 
CommitDate: 2024-10-23 18:26:53 +

Merge llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1c

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1c.

PR: 280562
MFC after:  1 month

 .../llvm-project/clang/include/clang/AST/DeclCXX.h |   7 +
 .../llvm-project/clang/include/clang/Basic/Attr.td |   9 +
 .../clang/include/clang/Basic/AttrDocs.td  |  10 +
 .../include/clang/Basic/DiagnosticFrontendKinds.td |   3 +
 .../include/clang/Basic/DiagnosticSemaKinds.td |   5 +-
 contrib/llvm-project/clang/lib/AST/DeclCXX.cpp |  36 +++
 .../clang/lib/CodeGen/CodeGenFunction.cpp  |   3 +
 .../clang/lib/CodeGen/Targets/AArch64.cpp  |   6 +-
 .../clang/lib/Driver/ToolChains/Clang.cpp  |   3 +
 .../clang/lib/Format/TokenAnnotator.cpp|  61 ++---
 .../clang/lib/Sema/CheckExprLifetime.cpp   |   9 +
 .../llvm-project/clang/lib/Sema/SemaChecking.cpp   |  74 ++---
 contrib/llvm-project/clang/lib/Sema/SemaDecl.cpp   |  29 +-
 .../llvm-project/clang/lib/Sema/SemaDeclAttr.cpp   |  10 +-
 .../Checkers/BlockInCriticalSectionChecker.cpp |  16 +-
 .../clang/lib/StaticAnalyzer/Core/Store.cpp|  12 +-
 .../compiler-rt/lib/builtins/riscv/feature_bits.c  | 298 -
 .../lib/interception/interception_linux.h  |  16 +-
 .../compiler-rt/lib/nsan/nsan_interceptors.cpp |  10 -
 .../compiler-rt/lib/rtsan/rtsan_interceptors.cpp   |  12 +
 .../lib/sanitizer_common/sanitizer_linux.cpp   |   2 +-
 .../sanitizer_stacktrace_sparc.cpp |  11 +-
 .../libcxx/include/__atomic/atomic_ref.h   |  32 ++-
 contrib/llvm-project/libcxx/include/typeinfo   |   9 +-
 contrib/llvm-project/libcxx/include/version|   4 +-
 .../libcxx/src/include/overridable_function.h  |   6 +-
 .../llvm-project/libunwind/src/UnwindCursor.hpp|   3 +-
 contrib/llvm-project/lld/ELF/Arch/LoongArch.cpp|  10 +
 contrib/llvm-project/lld/ELF/DWARF.cpp |   3 +-
 contrib/llvm-project/lld/ELF/ICF.cpp   |  26 +-
 contrib/llvm-project/lld/ELF/InputFiles.cpp|   1 +
 contrib/llvm-project/lld/ELF/InputFiles.h  |   1 +
 contrib/llvm-project/lld/ELF/InputSection.cpp  |  75 --
 contrib/llvm-project/lld/ELF/InputSection.h|  27 +-
 contrib/llvm-project/lld/ELF/LinkerScript.cpp  |   2 +
 contrib/llvm-project/lld/ELF/MarkLive.cpp  |  12 +-
 contrib/llvm-project/lld/ELF/OutputSections.cpp| 132 -
 contrib/llvm-project/lld/ELF/OutputSections.h  |   6 +
 contrib/llvm-project/lld/ELF/Relocations.cpp   |  57 ++--
 contrib/llvm-project/lld/ELF/Relocations.h | 102 ++-
 contrib/llvm-project/lld/ELF/ScriptLexer.cpp   |   5 -
 contrib/llvm-project/lld/ELF/SyntheticSections.cpp |  18 +-
 contrib/llvm-project/lld/ELF/SyntheticSections.h   |   5 +-
 contrib/llvm-project/lld/ELF/Writer.cpp|  13 +-
 contrib/llvm-project/lld/docs/ReleaseNotes.rst |   8 +-
 .../llvm-project/llvm/include/llvm/ADT/STLExtras.h |   6 +
 .../include/llvm/CodeGen/TargetFrameLowering.h |   7 +
 .../llvm/include/llvm/IR/IntrinsicInst.h   |   4 +
 .../llvm/include/llvm/IR/VectorBuilder.h   |   5 +-
 .../llvm/include/llvm/MC/MCAsmBackend.h|   5 +-
 .../llvm/include/llvm/MC/MCAssembler.h |   4 +-
 .../llvm-project/llvm/include/llvm/MC/MCSection.h  |   5 +
 .../llvm/include/llvm/Transforms/Utils/LoopUtils.h |   4 +
 .../llvm/lib/CodeGen/RegisterCoalescer.cpp |   7 +
 .../lib/CodeGen/StackFrameLayoutAnalysisPass.cpp   |  72 +++--
 .../llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp   |  14 +
 contrib/llvm-project/llvm/lib/IR/IntrinsicInst.cpp |  19 ++
 contrib/llvm-project/llvm/lib/IR/Metadata.cpp  |   5 +-
 contrib/llvm-project/llvm/lib/IR/VectorBuilder.cpp |  57 +---
 contrib/llvm-project/llvm/lib/MC/MCAssembler.cpp   |  77 +++---
 contrib/llvm-project/llvm/lib/MC/MCSection.cpp |   4 +-
 .../llvm/lib/Support/Windows/Process.inc   |   3 +-
 .../llvm/lib/Support/Windows/Signals.inc   |  38 +--
 .../Target/AArch64/AArch64Arm64ECCallLowering.cpp  |   5 +
 .../lib/Target/AArch64/AArch64FrameLowering.cpp|  35 +++
 .../llvm/lib/Target/AArch64/AArch64FrameLowering.h |   2 +
 .../AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h   |   1 +
 .../llvm/lib/Target/ARM/ARMAsmPrinter.cpp  |   6 +-
 .../Hexagon/MCTargetDesc/HexagonAsmBackend.cpp |   4 +-
 .../LoongArch/AsmParser/LoongArchAsmParser.cpp |  24 ++
 .../lib/Target/LoongArch/LoongArchInstrInfo.td |   6 +-
 ...