Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (4m)  netbsd-8 (6d)  netbsd-10 (6d)  netbsd-9 (12d)  thorpej-ifq (176d)  thorpej-altq-separation (178d) 

2024-05-10 20:41:00 UTC Now

2024-05-10 14:42:21 UTC MAIN commitmail json YAML

arm/fdt/cpu_fdt.c: Use `cpu' iattr to attach cpufreq.

Now that cpu has an explicit interface attribute, cpufeaturebus,
_all_ children of cpu must use an explicit interface attribute to
disambiguate.  For children that weren't previously attached using an
explicit interface attribute, the name of the parent, `cpu', serves
as the iattr.

XXX I think we should either
(a) not use cpufreqbus, since in the aarch64 case it doesn't seem to
    be passing any information through attach args, or
(b) create another iattr like cpufdtbus for use by cpufreq_dt.c,
    which does rely on attach args, if it has to attach differently
    from the rest of fdtbus.
But for now this should get aarch64 on fdt booting again.

(riastradh)

2024-05-10 12:24:08 UTC MAIN commitmail json YAML

xdebug/shl.mi: Delete libXxf86misc.so.2.0.debug.

Loading existing applications that linked against this into a
debugger should continue to work, so it shouldn't be obsoleted, but
the file is no longer installed.

(riastradh)

2024-05-10 12:21:49 UTC MAIN commitmail json YAML

xbase/shl.mi: Delete, rather than obsolete, libXxf86misc.so.M(.N).

Obsolete lines here will lead postinstall to delete the shlib, which
will break any existing applications linked against it.  Deleting the
lines has no effect on postinstall.

(We should maybe have a different way to mark them instead, as
suggested in PR 57581, but we don't, so this is what we do for now.)

However, keep the obsolete line for libXxf86misc.so, since the .so
symlink itself is only used when linking new applications.

(riastradh)

2024-05-10 12:18:16 UTC MAIN commitmail json YAML

xbase/shl.mi: Copy comment about delete vs obsolete from base/shl.mi.

(riastradh)

2024-05-10 03:29:47 UTC MAIN commitmail json YAML

tests/usr.bin/mtree/t_sets: Add base32, base64, debug32, debug64.

(riastradh)

2024-05-09 22:38:29 UTC MAIN commitmail json YAML

tests/lib/libc/stdio/t_printf: Fix another rounding error.

Noted by kre.

This doesn't break a passing test or fix a failed test, at least on
x86 -- our printf produces `0x1.533p+3' for the double case and
`0xa.99ap+0' for the long double case.  But of the hexadecimal number
literals that that start with 0x5 having three hexadigits to the
right of the fractional point, 0x5.4cdp+1 closest to the IEEE 754
binary64, VAX D, x86 extended precision, and IEEE 754 binary128
floating-point numbers closest to 10.6.

The reason is that the number 10.6 (or the nearest floating-point
number in any format with enough precision) is:

101.0100 1100 1100|1100... * 2^1 = 0x5.4cc|c...p+1

If we round at the vertical bar to the _nearest_ output with three
hexadigits of precision, the result is:

101.0100 1100 1101 * 2^1 = 0x5.4cdp+1

(riastradh)

2024-05-09 19:54:38 UTC MAIN commitmail json YAML

libm: No divtc3.c or multc3.c in sparc64's compat sparc library.

compat/sparc64/sparc/bsd.sparc.mk doesn't define LIBC_MACHINE_CPU,
only LIBC_MACHINE_ARCH, so when the compat build gets to this
conditional, LIBC_MACHINE_CPU is just MACHINE_CPU, i.e., sparc64.

Since there's no `sparc64el' or `sparc64hf-el' that we need to
canonicalize by MACHINE_ARCH -> MACHINE_CPU, just use
LIBC_MACHINE_ARCH here.

(riastradh)

2024-05-09 14:44:40 UTC MAIN commitmail json YAML

tests/lib/libc/gen/t_fpclassify: Test fpclassify on non-IEEE754 too.

Just exclude the subnormal parts on non-IEEE754 architectures
according to __FLT/DBL/LDBL_HAS_DENORM__.

(riastradh)

2024-05-09 14:42:10 UTC MAIN commitmail json YAML

libm: Add frexpf and frexpl on VAX.

These are trivial subroutines, not symbol aliases, for separate
reasons:

- frexpf has a different ABI from frexp (float vs double argument)

- frexp is defined in libc, not libm, so although long double is the
  same as double, frexpl can't be an alias in libm of a symbol
  defined in libc

(riastradh)

2024-05-09 14:13:09 UTC MAIN commitmail json YAML

tests/lib/libc/gen/t_fpclassify: Spruce this up a bit.

Provide more useful diagnostics when tests fail.

(riastradh)

2024-05-09 14:00:59 UTC MAIN commitmail json YAML

tests/lib/libm/t_infinity: Remove broken long double conditional.

LDBL_MAX is always defined, so this branch is dead.  (If LDBL_MAX is
not defined, that's a bug in the architecture's float.h, not a reason
to skip a test.)

(riastradh)

2024-05-09 12:24:24 UTC MAIN commitmail json YAML

Revert various broken changes to printf %La (hldtoa).

This reverts:

hdtoa.c 1.12 (PR/56247: Greg A. Woods: printf("%La", LDBL_MIN) dumps core)
hdtoa.c 1.11 (fix tyop)
hdtoa.c 1.10 (Via enh at google dot com in tech-userlevel. Fix handling of
    EXT_FRAC{H,L}BITS (although we don't need to since we don't have them).)

The underlying motivation for this change was that when ld128 is
decomposed into 4x32 words, this hldtoa logic is broken.

But we don't decompose ld128 into 4x32 words; we decompose it into
6x64 words.

And the change, which was supposed to be a noop in our case of 2x64
words (or similar for x87 80-bit floating-point), broke it to the
point of causing buffer overruns (PR 56247) which when worked around
led to just incorrect output output (PR 56937).

If we want to make the #ifdefs for 4x32 words work, that's fine, but
we absolutely must have automatic test cases to detect this kind of
regression because %La formatting is extremely important for
diagnosing details of floating-point data since it doesn't involve
rounding in binary formats.  For now I've added some trivial tests;
there is a more extensive test suite inside gdtoa that we need to
wire up before anyone tries any other shenanigans in this code.

PR lib/56937: printf(3) long double %a formatting is broken

(riastradh)

2024-05-09 12:23:21 UTC MAIN commitmail json YAML

tests/lib/libm/t_ilogb: Expand and tidy.

1. Instead of calling out VAX by name, use #ifdef NAN and
  isinf(INFINITY).  (VAX defines INFINITY even though it's not an
  infinity, not sure if there's a better compile-time test.)

2. Verify ilogbl works on long double on all architectures, not just
  those with __HAVE_LONG_DOUBLE which means long double is _larger_
  than double.

(riastradh)

2024-05-09 12:18:48 UTC MAIN commitmail json YAML

libm: Define ilogbl as alias for ilogb on vax.

PR 57881

(riastradh)

2024-05-09 12:18:28 UTC MAIN commitmail json YAML

tests/lib/libm/t_fe_round.c: Tidy.

nextafter/nexttoward tests didn't make much sense, and are now
supplanted by t_next.

PR misc/58054

(riastradh)

2024-05-09 00:04:23 UTC MAIN commitmail json YAML

libm: Split expected symbols in mips further by 32-bit vs 64-bit.

32-bit has binary64 long double, same as double; 64-bit has binary128
long double, which is implemented with a few more symbols in libm
(which should maybe be hidden internal symbols, but let's get this
diagnostic measure in the build working before we think about
possibly deleting private symbols).

(riastradh)

2024-05-08 23:28:31 UTC MAIN commitmail json YAML

libm: Record expected symbols for sh3.

(riastradh)

2024-05-08 23:28:07 UTC MAIN commitmail json YAML

2024-05-08 22:59:07 UTC MAIN commitmail json YAML

tests/lib/libm/t_fe_round: xfail for modfl uses.

PR lib/58237: modfl returns wrong answers on ld128 architectures

(riastradh)

2024-05-08 22:57:38 UTC MAIN commitmail json YAML

tests/lib/libm/t_modf: Mark modfl xfail on ld128.

PR lib/58237: modfl returns wrong answers on ld128 architectures

(riastradh)

2024-05-08 20:38:55 UTC MAIN commitmail json YAML

bsd.lib.mk: Use LIBC_MACHINE_ARCH/CPU if set for expected symbols.

Otherwise, we get the wrong list of symbols for compat library
builds, where MACHINE_ARCH/CPU is different from
LIBC_MACHINE_ARCH/CPU, e.g. building compat 32-bit sparc libm on
sparc64.

XXX This is kinda kludgey -- `libc' seems wrong here.

(riastradh)

2024-05-08 20:23:15 UTC MAIN commitmail json YAML

tests/lib/libc/stdio/t_printf: Add another %La test.

This one was adapted from the screw case shown in

https://mail-index.netbsd.org/tech-userlevel/2020/04/11/msg012329.html

which wasn't broken in our libc, but which nevertheless prompted us
to commit a wrong and apparently untested patch that has rendered
printf %La broken for the last four years, which is a little
embarrassing.  (The part of that patch that led to a buffer overrun
has been worked around, so now the output is just incorrect.)

PR lib/56937: printf(3) long double %a formatting is broken

(riastradh)

2024-05-08 20:19:37 UTC MAIN commitmail json YAML

tests/lib/libc/stdio/t_printf: Fix %a test the same way.

(riastradh)

2024-05-08 20:04:33 UTC MAIN commitmail json YAML

tests/lib/libc/stdio/t_printf: Fix %La test.

0xa.99ap+0 is closer to (long double)10.6 in x86 ld80 and in
binary128 (and possibly more formats, haven't verified).

(riastradh)

2024-05-08 18:19:57 UTC MAIN commitmail json YAML

tests/lib/libc/stdio/t_printf: Add a couple simple %La tests.

PR lib/56937: printf(3) long double %a formatting is broken

(riastradh)

2024-05-08 17:27:04 UTC MAIN commitmail json YAML

tests/lib/libm/t_next: Expand substantially.

This covers many more potential problem areas -- and includes a new
xfail test for PR lib/58236: nexttoward(3) is broken on subnormals.

(riastradh)

2024-05-08 02:08:11 UTC MAIN commitmail json YAML

libm: Add rintl, rintf to non-IEEE754 architectures.

While here, delete #ifdef to handle ns32k -- I don't think that's
gonna be relevant any time soon; in case you hadn't noticed, the
world has moved on from ns32k to vax by now.

PR 57881

(riastradh)

2024-05-08 01:58:52 UTC MAIN commitmail json YAML

libm: ldbl_dummy.c is no longer needed -- nix it.

(riastradh)

2024-05-08 01:42:23 UTC MAIN commitmail json YAML

libm: Don't export symbol `pio4' from s_cosl.c.

This appears to have been added unintentionally in the recent FreeBSD
long double update, and never went out in a release.

(riastradh)

2024-05-08 01:40:27 UTC MAIN commitmail json YAML

2024-05-08 01:05:25 UTC MAIN commitmail json YAML

libm/arch/m68k: Do the weak alias dance for finite.

This is used internally.

(riastradh)

2024-05-08 01:04:41 UTC MAIN commitmail json YAML

libm/arch/mc68881: Do the weak alias dance for sin, cos, tan.

These are used internally.

(riastradh)

2024-05-08 01:04:24 UTC MAIN commitmail json YAML

libm/arch/vax: Do the weak alias dance for finite, finitef.

These are used internally.

(riastradh)

2024-05-08 01:04:03 UTC MAIN commitmail json YAML

libm/arch/i387: Do the weak alias dance for finite and finitef.

These are used internally by some things.

(riastradh)

2024-05-07 23:13:33 UTC MAIN commitmail json YAML

libm: Add expected symbols for m68k.

Not sure if this'll work for all ports -- we might need to split it
up finer-grained by different m68k flavours -- but let's give it a
try and see what breaks.

(riastradh)

2024-05-07 22:51:20 UTC MAIN commitmail json YAML

2024-05-07 22:30:17 UTC MAIN commitmail json YAML

lib/libm/m68060/makeas.sh: Delimit symbols with END.

This way we get symbol sizes in the ELF output.

(riastradh)

2024-05-07 22:29:53 UTC MAIN commitmail json YAML

lib/libm/arch/m68060/makeas.sh: Create public weak aliases.

Use _foo for internal names, and weak alias foo when it's public like
sin/cos/tan.

(riastradh)

2024-05-07 22:19:42 UTC MAIN commitmail json YAML

lib/libm/m68060/makeas.sh: Use `set -eu' to detect script mistakes.

No functional change intended.

(riastradh)

2024-05-07 22:18:19 UTC MAIN commitmail json YAML

lib/libm/m68060/makeas.sh: Pass arguments to dummy more idiomatically.

No functional change intended.

(riastradh)

2024-05-07 22:17:24 UTC MAIN commitmail json YAML

lib/libm/m68060/makeas.sh: Use local for shell functions.

No functional change intended.

(riastradh)

2024-05-07 22:17:08 UTC MAIN commitmail json YAML

lib/libm/arch/m68060/makeas.sh: Indent sh blocks.

No functional change intended.

(riastradh)

2024-05-07 21:18:47 UTC MAIN commitmail json YAML

2024-05-07 21:14:12 UTC MAIN commitmail json YAML

lib/libm/arch/m68060/makeas.sh: Strip the $ when emitting RCS id.

(riastradh)

2024-05-07 21:11:24 UTC MAIN commitmail json YAML

libm/arch/m68060/Makefile: bsd.sys.mk -> bsd.host.mk

Somewhat belatedly, after bsd.sys.mk was forbidden to use directly
from Makefiles back in 2014.

(riastradh)

2024-05-07 21:05:47 UTC MAIN commitmail json YAML

libm/arch/m68060/makeas.sh: Tag output with makeas.sh RCS id.

No functional change intended to the output -- only changes are to
comments.

(riastradh)

2024-05-07 21:00:00 UTC MAIN commitmail json YAML

tests/lib/libc/gen/t_fpclassify: Enable long double tests.

The necessary long double symbols should all be available now.  If
there are any architectures where they're not, we can fix those
architectures.

(riastradh)

2024-05-07 20:58:34 UTC MAIN commitmail json YAML

libm: Memorialize expected symbols on various architectures.

This will reduce the risk of accidentally adding or deleting the
wrong symbols while fixing the aliases.

(This is all the architectures I have a build tree for handy; can add
other architectures like m68k later.)

(riastradh)

2024-05-07 20:56:25 UTC MAIN commitmail json YAML

bsd.lib.mk: Allow MACHINE_CPU for default expsym file.

(riastradh)

2024-05-07 15:49:33 UTC MAIN commitmail json YAML

libm/arch/vax: Expose atan2l.

PR port-vax/57881: vax libm is missing various symbols

(riastradh)

2024-05-07 15:17:35 UTC MAIN commitmail json YAML

math.h: Move declarations under appropriate namespace tests.

Not sure about _REENTRANT, but if gamma_r and lgamma_r go under that
(even if _NETBSD_SOURCE isn't defined), then lgammal_r probably
should too.

(riastradh)

2024-05-07 15:15:31 UTC MAIN commitmail json YAML

libm/arch/vax: Use STRONG_ALIAS, not ALTENTRY.

STRONG_ALIAS copies the symbol size and type, so it avoids warnings
like this:

/home/riastradh/netbsd/10/obj.vax/tooldir/bin/../lib/gcc/vax--netbsdelf/10.5.0/../../../../vax--netbsdelf/bin/ld: warning: type and size of dynamic symbol `ldexpl' are not defined

(riastradh)

2024-05-07 15:15:10 UTC MAIN commitmail json YAML

2024-05-06 18:41:23 UTC MAIN commitmail json YAML

tests/lib/libm/t_bit: Expand and tidy.

1. Instead of calling out VAX by name, use #ifdef NAN.

2. Verify signbit works on long double on all architectures, not just
  those with __HAVE_LONG_DOUBLE which means long double is _larger_
  than double.

3. Minor formatting tidying.

(riastradh)

2024-05-06 18:39:36 UTC MAIN commitmail json YAML

tests/lib/libc/stdlib/t_strtod: Spruce up and nix needless #ifdefs.

(riastradh)

2024-05-06 18:35:59 UTC MAIN commitmail json YAML

tests/lib/libm/t_modf: Use isinf(INFINITY) to detect inf support.

Apparently VAX defines the INFINITY macro even though it's not
actually an infinity and isinf returns zero for it.

(riastradh)

2024-05-06 17:53:43 UTC MAIN commitmail json YAML

tests/lib/libc/gen/t_floatunditf: Nix __HAVE_LONG_DOUBLE conditional.

Conversion from uint64_t to long double should work on all ports,
including those where long double is the same as double, i.e., where
__HAVE_LONG_DOUBLE is undefined.

Instead, conditionalize the test cases on how many bits of precision
long double has in the significand, according to LDBL_MANT_DIG.  The
conditionals here should handle binary128, powerpc double-dekker
(~106-bit precision), x86 extended precision (80-bit), m68k extended
precision (80-bit), and VAX D (56-bit).

(riastradh)

2024-05-06 15:53:46 UTC MAIN commitmail json YAML

tests/lib/libm/t_sincos: Nix __HAVE_LONG_DOUBLE conditionals.

sincosl is supposed to be there even if long double is double, as is
the case when __HAVE_LONG_DOUBLE is undefined.

(riastradh)

2024-05-06 15:52:53 UTC MAIN commitmail json YAML

2024-05-06 15:49:31 UTC MAIN commitmail json YAML

tests/lib/libm/t_scalbn: Nix __HAVE_LONG_DOUBLE conditionals.

If long double is the same as double, i.e., __HAVE_LONG_DOUBLE is
undefined, these tests should still pass, since they don't rely on
extra precision beyond double.

(riastradh)

2024-05-06 15:46:31 UTC MAIN commitmail json YAML

tests/lib/libm/t_precision: Nix __HAVE_LONG_DOUBLE conditionals.

long double and LDBL_EPSILON work even on architectures where long
double is the same as double, i.e., where the confusingly named
__HAVE_LONG_DOUBLE is not defined.

(riastradh)

2024-05-06 15:45:20 UTC MAIN commitmail json YAML

tests/lib/libm/t_cos: Fix comment about necessity of volatile.

(riastradh)

2024-05-06 15:44:08 UTC MAIN commitmail json YAML

tests/lib/libm/t_cos: Nix __HAVE_LONG_DOUBLE.

cosl should always be defined even on architectures where long double
is the same as double so the confusingly named __HAVE_LONG_DOUBLE is
not defined.

(riastradh)

2024-05-06 15:40:55 UTC MAIN commitmail json YAML

tests/lib/libm/t_cabsl: Nix __HAVE_LONG_DOUBLE conditionals.

__HAVE_LONG_DOUBLE just means long double is different from double.
This test should always pass on all ports, even if long double is the
same as double; it doesn't test any additional precision.

(riastradh)

2024-05-06 15:33:04 UTC MAIN commitmail json YAML

libm: Expose sinl, cosl, tanl on vax.

While here, make sin, cos, and tan be weak aliases for internal
symbols _sin, _cos, and _tan; likewise sinf, cosf, tanf.

PR 57881

(riastradh)

2024-05-06 14:38:29 UTC MAIN commitmail json YAML

tests/usr.bin/mtree/t_sets.sh: atf_fail, not atf_tc_fail

(riastradh)

2024-05-06 12:11:03 UTC MAIN commitmail json YAML

tests/lib/libc/setjmp/t_sigstack: Add missing comment for 1.10.

PR lib/57946

(riastradh)

2024-05-06 02:21:39 UTC MAIN commitmail json YAML

tests/lib/libm/t_modf: Check sign of modf on infinities too.

Normally I don't like CHECK(A && B) and favour CHECK(A); CHECK(B)
instead, so you can see which one failed, but in this case the inputs
are displayed anyway so we don't lose anything unless the
floating-point printer is broken.

(riastradh)

2024-05-06 00:54:02 UTC MAIN commitmail json YAML

tests/lib/libm/t_modf.c: Expand modf/modff/modfl tests.

1. Exercise more edge cases around the largest exponent that can
  represent non-integers.

2. - Verify modf can handle all cases modff can.
  - Veriy modf can handle some cases modff can't.
  - Verify modfl can handle all cases modf or modff can.
  - If long double isn't just double, verify modfl can handle some
    cases modf and modff can't.

3. Check infinities and NaN.

4. Verify oddness, i.e., modf(-x) = -modf(x).

5. Display more useful diagnostics in case any of this goes wrong.

(riastradh)

2024-05-05 23:08:53 UTC MAIN commitmail json YAML

tests/lib/libm/t_fe_round.c: Work around likely ia64 bug in gcc.

(riastradh)

2024-05-05 22:52:19 UTC MAIN commitmail json YAML

libm: long double is just double on hppa, so don't use s_rintl.c.

PR misc/58054

(riastradh)

2024-05-05 22:10:06 UTC MAIN commitmail json YAML

libm: If long double is double, nexttowardl is nextafter.

long double nexttowardl(long double, long double);
double nextafter(double, double);

(riastradh)

2024-05-05 15:26:20 UTC MAIN commitmail json YAML

makeinfo: Avoid ambiguous bracelessness.

/home/source/ab/HEAD-llvm/src/external/gpl2/texinfo/dist/makeinfo/index.c:526:5: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
    else if ((*elt1)->defining_line > (*elt2)->defining_line)
    ^
/home/source/ab/HEAD-llvm/src/external/gpl2/texinfo/dist/makeinfo/index.c:531:5: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
    else if ((*elt1)->entry_number > (*elt2)->entry_number)
    ^

(riastradh)

2024-05-05 15:25:31 UTC MAIN commitmail json YAML

mesa: Build with -Wno-error=typedef-redefinition.

While here, use CWARNFLAGS.clang instead of an explicit conditional.

In file included from 110_blorp_exec.c:33:
In file included from /home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/intel/blorp/blorp_genX_exec.h:27:
In file included from /home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/intel/blorp/blorp_priv.h:30:
/home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/compiler/nir/nir.h:3840:3: error: redefinition of typedef 'nir_shader' is a C11 feature [-Werror,-Wtypedef-redefinition]
} nir_shader;
  ^
/home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/intel/compiler/brw_compiler.h:41:27: note: previous definition is here
typedef struct nir_shader nir_shader;
                          ^

(riastradh)

2024-05-05 15:18:10 UTC MAIN commitmail json YAML

aarch64/sljit_machdep.h: Make this work in compat32 context.

Should fix clang build of compat32 eabi libsljit:

dependall ===> compat/arm/eabi/../../../lib/../external/bsd/sljit/lib
In file included from /home/source/ab/HEAD-llvm/src/sys/external/bsd/sljit/dist/sljit_src/sljitLir.c:1678:
/home/source/ab/HEAD-llvm/src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c:142:54: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
        FAIL_IF(push_inst(compiler, MOVK | RD(dst) | (((imm >> 32) & 0xffff) << 5) | (2 << 21)));
                                                            ^  ~~

(riastradh)

2024-05-05 14:53:22 UTC MAIN commitmail json YAML

libm: No s_rintl.c on mips32.

This is only for machines where long double is not double.

Not 100% sure this is the right criterion, but there's a good chance
it is.

(riastradh)

2024-05-05 14:34:58 UTC MAIN commitmail json YAML

tests/lib/libm/t_next: Fix stub on VAX.

Tested building the wrong tree, oops.

(riastradh)

2024-05-05 14:29:38 UTC MAIN commitmail json YAML

tests/lib/libm/t_next: Disable this test on VAX.

But leave a replacement xfail test that fails unconditionally, to
leave a reminder in the tests of PR 57881: vax libm is missing
various symbols.

(riastradh)

2024-05-05 14:06:47 UTC MAIN commitmail json YAML

libm/s_nexttowardf.c: Handle __HAVE_LONG_DOUBLE, LDBL_IMPLICIT_NBIT.

We should arrange to just have LDBL_NBIT unconditionally defined in the
appropriate MD header file, and make LDBL_IMPLICIT_NBIT an alias for
LDBL_NBIT==0.  But for now this will do.

(riastradh)

2024-05-05 11:38:03 UTC MAIN commitmail json YAML

libm: Make s_nexttowardf.c work when long double is double.

Seems likely that there are other parts of libm which would benefit
from being defined unconditionally in terms of ieee_ext_u, with
ieee_ext_u as an alias for ieee_double_u, in this scenario.  But I
haven't gone looking yet.

(riastradh)

2024-05-05 11:07:49 UTC MAIN commitmail json YAML

libm: long double is just double on arm, so don't use s_rintl.c.

PR misc/58054

(riastradh)

2024-05-05 02:53:02 UTC MAIN commitmail json YAML

tests/lib/libm: Test nextafter/nexttoward and variants.

The tests are fairly trivial but should work without any conditionals
about floating-point formats.

(riastradh)

2024-05-05 02:50:11 UTC MAIN commitmail json YAML

2024-05-04 20:24:37 UTC MAIN commitmail json YAML

tests/usr.bin/mtree: Fail gracefully with unknown sets.

Rather than `bogus test program', make a test fail.

PR misc/57877

(riastradh)

2024-05-04 19:21:51 UTC MAIN commitmail json YAML

s_rintl.c: Reduce FreeBSD diff and fix on ld128 platforms.

EXT_FRACBITS, the number of bits in the _binary encoding_ that stores
the trailing significand field, is never 113.  In IEEE 754 binary128,
it is 112, even though there are 113 bits of precision in the set of
floating-point numbers -- the leading 1 bit is implicit in binary128.
So ld128 platforms like aarch64 and sparc64 were skipping the real
definition and just defining rintl as an alias for rint, which is
wrong.

In contrast, LDBL_MANT_DIG, the number of bits of precision in the set
of floating-point numbers (p, in IEEE 754 parlance), is 113 in IEEE 754
binary128.  This is also the constant used in FreeBSD libm anyway.  So
let's just use that instead of trying to translate it to our private
EXT_FRACBITS (not defined in FreeBSD) with a fencepos terror.  And
delete the buggy rintl=rint alias.

PR lib/58054

(riastradh)

2024-05-03 21:40:52 UTC MAIN commitmail json YAML

tests/lib/libm/t_fe_round.c: Expand nearbyint/rint tests.

PR lib/58054

(riastradh)

2024-05-02 16:52:08 UTC MAIN commitmail json YAML

tests/lib/libm/t_fe_round: Fix a missed cast.

Need long long or intmax_t, not long, on LP32.

PR lib/58054

(riastradh)

2024-05-02 16:51:55 UTC MAIN commitmail json YAML

tests/lib/libm/t_fe_round: Tidy up nearbyintl, sync nearbyint test.

PR lib/58054

(riastradh)

2024-05-02 11:55:49 UTC MAIN commitmail json YAML

tests/lib/libm/t_fe_round.c: Simplify previous.

There is never any need to write casts to type T in integer constant
initializers for type T.

PR lib/58054

(riastradh)

2024-05-02 00:01:48 UTC MAIN commitmail json YAML

tests/lib/libm/t_fe_round: Test nearbyintl.

This uses inputs that can't be distinguished with only 53 bits of
precision, so it should work in essentially all long double formats
to detect when nearbyintl is incorrectly implemented in terms of
nearbyint.

PR lib/58054

(riastradh)

2024-05-02 00:00:47 UTC MAIN commitmail json YAML

tests/lib/libm/t_fe_round: Tidy up nearbyint test.

Prompted by PR lib/58054.

(riastradh)

2024-04-29 00:28:18 UTC MAIN commitmail json YAML

cgdconfig(8): KNF in cgdconfig.c.

No functional change intended.

(riastradh)

2024-04-28 15:35:39 UTC MAIN commitmail json YAML

linux_sync_file: Fix missing init/fini steps.

Noted by rjs@.

PR kern/58210

(riastradh)

2024-04-28 12:49:08 UTC MAIN commitmail json YAML

tests/lib/Makefile: Hook up libstdc++.

(riastradh)

2024-04-28 01:21:27 UTC MAIN commitmail json YAML

2024-04-21 14:11:12 UTC MAIN commitmail json YAML

apei(4), acpihed(4): Enable in x86 GENERIC.

Let's just see how this works out in practice.  Might need to reduce
the overhead of each GHES on machines with thousands of them, but
we'll see.

PR kern/58046

(riastradh)

2024-04-21 03:02:51 UTC MAIN commitmail json YAML

drm: Allow DRM_IOCTL_GET_UNIQUE on render nodes.

On NetBSD, libdrm uses this to discover what kind of bus the device
is on, without which it refuses to expose the render node at all,
rendering it useless.  With this change, libdrm is able to use render
nodes on NetBSD.

Since this is just reading out information about the bus type and
bus/dev/func numbers, I don't think it's problematic to expose to
render nodes.

This requires tweaking the access path to the master.

PR kern/58180

(riastradh)

2024-04-21 03:02:39 UTC MAIN commitmail json YAML

drm(4): Fix st_rdev in stat.

dminor->index already has the 64*type adjustment, as allocated in
drm_minor_alloc.

PR kern/58180

(riastradh)

2024-04-19 00:55:35 UTC MAIN commitmail json YAML

ip6_output: Initialize plen for ip6_hopopts_input.

This funny little block in ip6_process_hopopts assumes it is
initialized as and behaves differently depending on whether it's zero
or not:

https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#976

In the other call site, it is initialized to ip6->ip6_plen:

https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#561

Reported-by: syzbot+587e3b707bdfe533283f@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?extid=587e3b707bdfe533283f

(riastradh)

2024-04-19 00:45:41 UTC MAIN commitmail json YAML

dounmount: Avoid &((struct vnode_impl *)NULL)->vi_vnode.

Member access of a null pointer is undefined, even if the result
should also be null because vi_vnode is at the start of vnode_impl.

Reported-by: syzbot+a4b2d13c0d6d4dac2d07@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?extid=a4b2d13c0d6d4dac2d07

(riastradh)

2024-04-18 23:33:15 UTC MAIN commitmail json YAML

radeon_acpi.c: ifdef out unused function on NetBSD.

Should fix syzkaller build.

(riastradh)

2024-04-17 18:52:54 UTC MAIN commitmail json YAML

tap(4): Just use mutex_enter.

PR kern/58167

(riastradh)

2024-04-17 18:52:39 UTC MAIN commitmail json YAML

tap(4): Use DETACH_FORCE with config_detach.

It doesn't make a difference here, because tap_detach never fails,
but let's make it more obvious at the call site that failure is
forbidden here.

No functional change intended.

PR kern/58166

(riastradh)

2024-04-17 18:52:25 UTC MAIN commitmail json YAML

tap(4): Prune dead branches around tap_dev_destroyer.

No functional change intended.

PR kern/58166

(riastradh)

2024-04-17 18:32:13 UTC MAIN commitmail json YAML

tap(4): Prune dead branches around tap_dev_close.

No functional change intended.

PR kern/58166

(riastradh)

2024-04-17 18:10:27 UTC MAIN commitmail json YAML

modules/examples/fopsmapper: KNF, sprinkle comments

Missing: MP-safety; this is a kind of broken example.

(riastradh)

2024-04-17 18:01:29 UTC MAIN commitmail json YAML

sys/conf.h: Need sys/types.h for dev_t, devmajor_t.

(riastradh)

2024-04-16 14:34:03 UTC MAIN commitmail json YAML

src/sys/external/bsd/drm2/amdgpu/files.amdgpu@1.31 / diff / nxr@1.31
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu.h@1.9 / diff / nxr@1.9
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_acpi.c@1.6 / diff / nxr@1.6
src/sys/external/bsd/drm2/dist/drm/amd/powerplay/hwmgr/amdgpu_hwmgr.c@1.3 / diff / nxr@1.3
src/sys/external/bsd/drm2/dist/drm/amd/powerplay/hwmgr/amdgpu_smu7_hwmgr.c@1.5 / diff / nxr@1.5
src/sys/external/bsd/drm2/dist/drm/i915/display/intel_acpi.h@1.5 / diff / nxr@1.5
src/sys/external/bsd/drm2/dist/drm/i915/display/intel_opregion.h@1.6 / diff / nxr@1.6
src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h@1.49 / diff / nxr@1.49
src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/core/device.h@1.10 / diff / nxr@1.10
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_acpi.c@1.5 / diff / nxr@1.5
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_acpi.h@1.4 / diff / nxr@1.4
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_display.c@1.6 / diff / nxr@1.6
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h@1.5 / diff / nxr@1.5
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_acpi.c@1.4 / diff / nxr@1.4
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c@1.13 / diff / nxr@1.13
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c@1.12 / diff / nxr@1.12
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_tegra.c@1.4 / diff / nxr@1.4
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/priv.h@1.4 / diff / nxr@1.4
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/bios/nouveau_nvkm_subdev_bios_shadowacpi.c@1.4 / diff / nxr@1.4
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mxm/nouveau_nvkm_subdev_mxm_base.c@1.5 / diff / nxr@1.5
      :
(more 12 files)
drm: Set CONFIG_ACPI in linux/acpi.h and make it build.

Leave a little ACPI-related functionality disabled for now, like
getting EDID out of ACPI -- needs a bit more work to make this work,
and I don't have hardware to work on that.

Should help with failures of the forms:

- unable to locate a BIOS ROM
- bios: unable to locate usable image

on various machines.

(riastradh)

2024-04-16 14:29:33 UTC MAIN commitmail json YAML

opensolaris/sys/sys/elf.h: Omit needless __ELF_WORD_SIZE.

(riastradh)

2024-04-16 14:26:53 UTC MAIN commitmail json YAML

nouveau: Rework nouveau2netbsd hack to get ACPI stuff.

(riastradh)

2024-04-11 13:51:36 UTC MAIN commitmail json YAML

sys_futex.c: Fix illustration of futex(2).

In this illustration, we need to _set_ bit 1 to claim ownership, not
_clear_ bit 1 to claim ownership.

No functional change intended -- comment only.

(riastradh)

2024-04-11 02:15:39 UTC MAIN commitmail json YAML

Nix /var/run/named entry from set lists.

Normally we don't do this, but /var/run/named is

(a) used by running daemons, so postinstall should not delete it, and
(b) deleted at boot-time anyway by /etc/rc.d/mountcritlocal, so
there's no sense in having it checked by mtree.

However, this means that update builds need manual intervention to
delete $DESTDIR/var/run/named or else checkflist will fail, so add a
note to UPDATING about this.

Do the same with /var/run/lwresd just in case.

PR misc/57877

(riastradh)

2024-04-11 02:08:17 UTC MAIN commitmail json YAML

doc/3RDPARTY: Tidy up am-utils entry.

Add vendor branch and release branch pattern.

(riastradh)

2024-04-07 22:59:13 UTC MAIN commitmail json YAML

riscv: Schedule next hardclock tick in the future, not the past.

If we have missed hardclock ticks, schedule up to one tick interval
in the future anyway; don't try to play hardclock catchup by
scheduling for when the next hardclock tick _should_ have been, in
the past, leading to ticking as fast as possible until we've caught
up.  as fast as possible until we've caught up.

Playing hardclock catchup triggers heartbeat panics when continuing
from ddb, if you've been in ddb for >15sec.  Other hardclock drivers
like x86 lapic don't play hardclock catchup either.

PR kern/57920

(riastradh)

2024-04-07 22:52:53 UTC MAIN commitmail json YAML

riscv: Make sure cpu0->ci_cpu_freq is initialized by cpu_attach.

Otherwise this stays zero, which screws up cpu_ipi_wait.

(riastradh)

2024-04-05 18:57:10 UTC MAIN commitmail json YAML

usb *hci: Always set ux_status before usbd_xfer_schedule_timeout.

Add an assert to usbd_xfer_schedule_timeout to enforce this.

Since access to ux_status is serialized by the bus lock, and nothing
releases the bus lock in the interim, this doesn't make a functional
change.  But it does reduce confusion by readers, who no longer have
to worry if some callers got the order wrong.  It could also now
potentially be factored out in a subsequent commit.

(riastradh)

2024-04-05 13:05:41 UTC MAIN commitmail json YAML

uvm: Expand v_size <= v_writesize assertions to help diagnostics.

PR kern/58117

(riastradh)

2024-04-05 00:43:42 UTC MAIN commitmail json YAML

config(1): Make sort order deterministic.

Ensure we break ties in every case.  This way, even though we use the
unstable qsort(3) library routine, the output is reproducible, no
matter what algorithm is behind qsort(3).

It would be nice if we could just use a stable sort function here,
but mergesort(3) is nonstandard, so we'd have to add it to
tools/compat, which is a big pain.

Instead, put a tie-breaking rule in every comparison function we use
with qsort, and abort() in the event of ties -- that way, we noisily
refuse to rely on unstable sort order.

While here, dispense with any question of integer overflow, and
sprinkle comments.

PR bin/58115

(riastradh)

2024-04-04 21:19:25 UTC MAIN commitmail json YAML

Temporarily make PR t_sp:sigsafe noisier.

This is an attempt to diagnose why it's flaky in the releng testbeds
but not when I run it.  This change will be backed out once we get
new testbed output.

(riastradh)

2024-04-04 20:33:59 UTC MAIN commitmail json YAML

external/bsd/am-utils: delete outdated amd2netbsd under dist

This was stored as a local change to dist, where it doesn't belong --
it belongs outside dist.  But we already have an amd2netbsd with the
correct path outside of dist.

(riastradh)

2024-04-04 17:27:32 UTC MAIN commitmail json YAML

rumpkern/t_sp: Save stdout and stderr to report on failure.

This is not very tidy at the moment, but it's an experiment using the
approach in PR bin/58112, to diagnose why t_sp:sigsafe keeps failing
intermittently.  If this works, perhaps can tidy it up and apply it
to all the other tests that run rump_servers.

(riastradh)

2024-04-04 17:27:23 UTC MAIN commitmail json YAML

rumpuser(3): New RUMP_STDOUT, RUMP_STDERR environment variables.

If set, then when rump daemonizes, it opens the path in RUMP_STDOUT
and redirects fd 1 to that (which mostly gets the kernel console
output), and opens the path in RUMP_STDERR and redirects fd 2 to that
(no idea what this gets but it's probably good to record if it ever
gets anything).

This will allow tests that rely on rump_server daemons to stash the
output for diagnostics in case, e.g., the rump kernel crashes.

PR bin/58112

(riastradh)

2024-04-04 00:46:42 UTC MAIN commitmail json YAML

i386 longjmp: Restore stack first, then signal mask.

Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:

- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use forward branches for statically predicted not-taken.
  => val==0 is unlikely in longjmp

PR lib/57946

(riastradh)

2024-04-04 00:46:30 UTC MAIN commitmail json YAML

amd64 longjmp: Restore stack first, then signal mask.

Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:

- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use `xorl %eXX,%eXX' instead of `xorq %rXX,%rXX'.
  => Same effect, one byte shorter, breaks dep chain on more uarches.
- Use forward branches for statically predicted not-taken.
  => val==0 is unlikely in longjmp

PR lib/57946

(riastradh)

2024-04-02 22:41:48 UTC MAIN commitmail json YAML

bsd.own.mk: No need for MKSLJIT to be set differently from others.

- Use ?=, not =, so mk.conf setting wins.
- Write out per-architecture tabular settings, not a conditional.
- Add comments for the architectures that look like they should have
  sljit but don't.  (XXX Missing comments about powerpc and mips --
  not sure why, is this because modules don't yet work on those
  architectures, or what?)

Tidying for PR 58103: bpfjit.kmod is not built on aarch64.

(riastradh)

2024-04-02 22:37:34 UTC MAIN commitmail json YAML

bsd.own.mk: Enable MKLSJIT on aarch64.

Make sure there's only one copy of the conditional, in bsd.own.mk;
just make sys/modules/Makefile conditional on MKSLJIT so we don't
have to keep these in sync.

As a workaround for PR 58106, tweak the conditional definition of
SLJIT_CACHE_FLUSH to use cpu_icache_sync_range only in _HARDKERNEL,
and use __builtin___clear_cache in userland and in rump kernels.

PR 58103: bpfjit.kmod is not built on aarch64

(riastradh)

2024-04-02 22:29:57 UTC MAIN commitmail json YAML

sljit: Pacify -Wsign-compare.

If these sizes are negative, we're probably in trouble anyway, so
assert nonnegative here.

Needed to resolve PR 58103.

(riastradh)

2024-04-02 22:29:35 UTC MAIN commitmail json YAML

MAKEDEV: Tidy some entries on x86 and Arm.

While here, reduce some diffs arising from ordering and formatting
between these architectures.

Only difference between evbarm and aarch64 now is /dev/vchiq.  Not
sure offhand if it makes sense on aarch64 or only 32-bit Arm.

PR port-amd64/58093: /dev/efi missing on x86
PR port-arm/58100: /dev/ttyVI* missing on aarch64
PR port-arm/58101: /dev/nvme* missing on aarch64
PR port-arm/58102: /dev/raid* missing on aarch64

(riastradh)

2024-04-01 18:33:24 UTC MAIN commitmail json YAML

elftoolchain: Be consistent about which ELF header files we use.

1. For tools that use elftoolchain: always use elftoolchain's
  elfdefinitions.h.  Don't even think about looking at the host's
  sys/exec_elf.h, which makes no sense and should never happen.

  (ELF tools that don't use elftoolchain, like m68k-elf2coff,
  continue to use nbincludes/sys/exec_elf.h.  But no more nbincludes
  hacks in elftoolchain.)

2. For kernel components (solaris, zfs, dtrace): always use
  sys/exec_elf.h, even in Solaris components via sys/elf.h.
  elfdefinitions.h is not wired up in the kernel build at all.

3. For most userland components that involve libelf: use
  elfdefinitions.h via libelf header files (libelf.h, gelf.h).

  libdtrace in particular requires _all_ R_* reloc type definitions,
  but sys/exec_elf.h brings in only the _current machine's_ R_*
  reloc type definitions.  (While here: Use uintptr_t instead of
  Elf_Addr for pointer-to-integer cast, since Elf_Addr is MD and
  provided only by sys/exec_elf.h, not by elfdefinitions.h.)

  And most userland components using libelf don't rely on any
  properties of the current machine from sys/exec_elf.h, so they can
  use libelf's elfdefinition.h.

  Exceptions:

  - dtrace drti.c relies on link.h -> link_elf.h -> sys/exec_elf.h,
    but it also relies on sys/dtrace.h -> sys/elf.h ->
    elfdefinitions.h like other userland components using sys/elf.h.

  - kdump-ioctl.c uses sys/exec_elf.h directly and sys/dtrace.h ->
    sys/elf.h -> elfdefinitions like other userland components using
    sys/elf.h.

  - t_ptrace_wait.c (via t_ptrace_core_wait.h) uses libelf to parse
    core files, but relies on sys/exec_elf.h for struct
    netbsd_elfcore_procinfo.

  None of these exceptions needs all R_* reloc type definitions, so
  as a workaround, we can just suppress libelf's elfdefinitions.h by
  defining _SYS_ELFDEFINITIONS_H_ and use sys/exec_elf.h in these
  exceptions.

And undo the whole BUILTIN_ELF_HEADERS mistake.  This was:

- half bogus workarounds for missing build_install dependencies in
  tools/Makefile, which are no longer missing now, and
- half futile attempt to use src/sys/sys/exec_elf.h via nbincludes in
  tools involving libelf instead of libelf's elfdefinitions.h, which
  collides.

Longer-term, we may wish to unify sys/exec_elf.h and libelf's
elfdefinitions.h, so we don't have to play these games.

But at least now the games are limited to three .c files (one of
which is generated by Makefile.ioctl-c), rather than haphazardly
applied tree-wide by monstrous kludges in widely used .h files with
broken hackarounds to get the tools build lurching to completion.

(riastradh)

2024-03-31 00:06:24 UTC MAIN commitmail json YAML

docs/3RDPARTY: Record vendor and release tags for elftoolchain.

(riastradh)

2024-03-30 22:39:53 UTC MAIN commitmail json YAML

tools/elftoolchain: Build with BUILTIN_ELF_HEADERS again.

The header file dependency that motivated disabling this should be
resolved now.

(riastradh)

2024-03-30 22:38:03 UTC MAIN commitmail json YAML

tools/elftoolchain: Handle dependencies properly.

This should properly resolve the problem christos was trying to
address by a bogus make includes hack and #ifdefs in elftoolchain.

(riastradh)

2024-03-29 14:15:02 UTC MAIN commitmail json YAML

exports(5): Tiny punctuation fix in man page.

(riastradh)

2024-03-28 18:24:57 UTC MAIN commitmail json YAML

efiboot: Duplicate efi_bootdp before we clobber it in efi_net_probe.

Patch from jakllsch@.  Makes Socionext Synquacer boot considerably
more reliably.

PR kern/58075

(riastradh)

2024-03-28 15:39:42 UTC MAIN commitmail json YAML

fsirand(8): Fix security claims.

PR misc/58063

(riastradh)

2024-03-28 13:40:08 UTC MAIN commitmail json YAML

apei(4): Fix uninitialized stack access in error branch.

PR kern/58046

(riastradh)

2024-03-27 01:43:26 UTC MAIN commitmail json YAML

exports(5): Substantially rewrite for clarity.

Hope this is an improvement over the turgid paragraphs all about
first/second/third cases of everything.

PR misc/58063

(riastradh)

2024-03-27 00:46:17 UTC MAIN commitmail json YAML

exports(5): Revert warning about `-ro' on read/write file systems.

Looks like the nfs server does enforce that after all, in spite of
the rather oblique commentary in the BUGS section about export
options being tied to local mount point options with which they must
be noncontradictory.

And there's no reason in principle it shouldn't enforce this -- it
just need to block various file system _operations_, rather than the
subtree issue where the criteria for evaluating whether operations
are allowed on particular _file handles_ are too painful to
contemplate.

PR misc/58063

(riastradh)

2024-03-26 23:32:43 UTC MAIN commitmail json YAML

exports(5), mountd(8): First pass at clarifying export semantics.

The exports(5) man page is full of walls of turgid prose that should
be itemized lists with syntax templates, and I'm itching to rewrite
it, but let's get the security-relevant warnings out of the way
first.

PR misc/58063

(riastradh)

2024-03-26 18:38:52 UTC MAIN commitmail json YAML

bsd.lib.mk: Avoid symbol check if we're not doing shared libraries.

Otherwise this fails on non-shlib builds like sun2.

(riastradh)

2024-03-26 10:56:34 UTC MAIN commitmail json YAML

conf/std: Update comment over rnd(4) to reflect current reality.

PR kern/46728

(riastradh)

2024-03-26 10:51:16 UTC MAIN commitmail json YAML

mips/conf/files.octeon: octrnm does not depend on rnd

Whether or not we have /dev/random and /dev/urandom baked into the
kernel, configuring `octrnm* at ...' in the kernel config requires
octeon_rnm.c.

Related to PR kern/46728.

(riastradh)

2024-03-23 21:56:47 UTC MAIN commitmail json YAML

bsd.lib.mk: Tidy up expected symbols check a little.

Add some documentation in bsd.README.

(riastradh)

2024-03-23 21:34:07 UTC MAIN commitmail json YAML

wg(4): Fix IPv6 numbering in example diagram.

This way it matches the configuration suggested below (which avoids
host number zero on the subnet).

PR misc/58015

(riastradh)

2024-03-23 03:41:35 UTC MAIN commitmail json YAML

apei(4): Make sure to initialize *fatalp in apei_gesb_report.

PR kern/58046

(riastradh)

2024-03-22 20:48:14 UTC MAIN commitmail json YAML

2024-03-22 20:48:05 UTC MAIN commitmail json YAML

apei(4): Pre-map registers when compiling interpreter.

This way we don't have to worry about mapping them in nasty contexts
where access to uvm_km_alloc may not be allowed.  Paves the way to
use ERST for saving dmesg on crash.

Exception: ACPI_ERST_MOVE_DATA still needs to do AcpiOsMapMemory.
We'll need to reserve a couple pages to avoid that.

PR kern/58046

(riastradh)

2024-03-22 20:47:52 UTC MAIN commitmail json YAML

apei(4): Allow pre-mapping I/O registers too.

PR kern/58046

(riastradh)

2024-03-22 20:47:31 UTC MAIN commitmail json YAML

apei(4): Fix register chunk counting.

Now it will actually read and write the registers!

Have been updating and reloading the wrong module to test this, oops.

PR kern/58046

(riastradh)

2024-03-22 18:19:14 UTC MAIN commitmail json YAML

apei(4): Fix indexing of multi-unit register access.

PR kern/58046

(riastradh)

2024-03-22 18:19:03 UTC MAIN commitmail json YAML

apei(4): Plug memory leak on teardown of instruction interpreter.

PR kern/58046

(riastradh)

2024-03-21 02:36:02 UTC MAIN commitmail json YAML

2024-03-21 02:35:09 UTC MAIN commitmail json YAML

apei(4): Note some TODOs for EINJ and HEST.

No functional change intended, comments only.

PR kern/58046

(riastradh)

2024-03-21 02:35:00 UTC MAIN commitmail json YAML

apei(4): Fix parsing checks for TRIGGER_ERROR action table.

The TableSize is size of the header plus the body, not just the body.

PR kern/58046

(riastradh)

2024-03-20 19:21:05 UTC MAIN commitmail json YAML

apei(4): Tweak some comments about the APEI interpreter language.

No functional change intended.

PR kern/58046

(riastradh)

2024-03-20 18:47:59 UTC MAIN commitmail json YAML

apei(4): Pacify -Wsign-compare.

Assert that the parsing made forward progress too while here.

PR kern/58046

(riastradh)

2024-03-20 17:11:44 UTC MAIN commitmail json YAML

2024-03-20 13:51:35 UTC MAIN commitmail json YAML

2024-03-20 13:50:51 UTC MAIN commitmail json YAML

libcrypto: Add expected symbol list to check at build-time.

(riastradh)

2024-03-20 13:50:37 UTC MAIN commitmail json YAML

bsd.lib.mk: Check expected vs actual symbols at build-time.

If, for LIB=foo, you create a file foo.expsym, bsd.lib.mk will list
the dynamic symbols and their versions with

nm --dynamic --extern-only --defined-only --with-symbol-versions

and compare the names (not addresses or types) to foo.expsym.  If
there are any differences, they will be printed and the build will
fail.

foo.expsym should be sorted with `LANG=C sort -u'.

This way, you can verify changes don't inadvertently add or remove
symbols.  If you do want to add (or, if you're bumping the major,
remove) symbols, you can verify the changes and edit the foo.expsym
file accordingly.  This will also help to enforce rules about symbol
changes on pullups in release branches.

Note that using a version map (-Wl,--version-script=...) doesn't
catch symbol removal -- ld quietly ignores symbols in the version map
that aren't actually defined by any object in the library.  So this
supplements the version map.

Proposed on tech-userlevel:
https://mail-index.NetBSD.org/tech-userlevel/2024/03/16/msg014264.html

(riastradh)

2024-03-20 12:43:13 UTC MAIN commitmail json YAML

acpi(4): Make apeibus actually work as an iattr.

PR kern/58046

(riastradh)

2024-03-20 03:14:45 UTC MAIN commitmail json YAML

acpi(4): New iattr `apeibus' for attaching an APEI driver.

APEI is the ACPI Platform Error Interface, a standard (if very
complicated) interface for reporting hardware errors to the OS.

Firmware support for APEI is presented through the ACPI tables BERT
(Boot Error Record Table), ERST (Error Record Serialization Table),
EINJ (Error Injection Table), and HEST (Hardware Error Source Table),
rather than through nodes in the ACPI device tree, so it can't just
attach through the existing acpinodebus iattr and instead requires a
special pseudo-bus like acpiwdrt(4).

No driver yet -- this is just the hook to attach one in a module.

The new member sc_apei of struct acpi_softc is placed at the end of
the structure so that this change can be safely pulled up to release
branches without risk to ABI compatibility in existing modules such
as acpiverbose.kmod which may rely on the layout (but not size) of
struct acpi_softc.

PR kern/58046

(riastradh)

2024-03-18 16:15:24 UTC MAIN commitmail json YAML

strptime(3): Declare digit d as time_t.

This doesn't make a semantic difference -- d can only take on the ten
values {0,1,2,3,4,5,6,7,8,9}, and the arithmetic with it later all
comes out the same whether the type is unsigned or time_t, even if
time_t were int32_t instead of int64_t.

But it pacifies overzealous compilers used by downstream users of
this code.  And while it's silly to use a much wider type (64-bit
signed) than is needed here to store a single digit, it doesn't
really hurt either (32-bit unsigned is much larger than needed too).

PR lib/58041

(riastradh)

2024-03-16 00:16:21 UTC MAIN commitmail json YAML

strptime(3): Reduce unnecessary indentation.

Post-fix tidying.

No functional change intended.

PR lib/58041

(riastradh)

2024-03-16 00:06:46 UTC MAIN commitmail json YAML

strptime(3): Avoid arithmetic overflow.

PR lib/58041

(riastradh)

2024-03-16 00:06:37 UTC MAIN commitmail json YAML

strptime(3): Exercise some edge cases in the automatic tests.

Unfortunately, we can't quite use strptime as a black box to detect
the cases that triggered undefined behaviour, because strptime just
fails in that case anyway since the number that would go in .tm_year
is far out of the representable range.

PR lib/58041

(riastradh)

2024-03-15 18:10:37 UTC MAIN commitmail json YAML

2024-03-15 15:49:01 UTC MAIN commitmail json YAML

doc/3RDPARTY: Note OpenSSL vendor/release tags.

(riastradh)

2024-03-15 15:32:07 UTC MAIN commitmail json YAML

libcrypto: Add some trivial tests for truncated SHA-512 variants.

These should use more of the test vectors from

https://csrc.nist.gov/Projects/Cryptographic-Algorithm-Validation-Program/Secure-Hashing#Testing

but this will do for now to detect the buffer overrun rake we left
lying around for ourselves.

PR lib/58039

(riastradh)

2024-03-15 02:20:59 UTC MAIN commitmail json YAML

evbarm/instkernel/sshramdisk: Put firmware in the right paths.

Maybe this should also be wired up to `release' to put the ramdisk in
the releasedir so we detect destdir path leakage like this had.

PR port-evbarm/58035

(riastradh)

2024-03-13 12:44:30 UTC MAIN commitmail json YAML

evbmips/interrupt.c: No need for __diagused with KASSERT.

KASSERT already references all the variables even in !DIAGNOSTIC
builds (but evaluates nothing at run-time in that case).

That said: Is the curlwp->l_blcnt assertion correct?  Can't curlwp be
changed in this interrupt handler by preemption?

(riastradh)

2024-03-12 02:28:03 UTC MAIN commitmail json YAML

wg(4): Rework example numbering for clarity and add IPv6.

Let's avoid triggering unease with host number 0.

PR misc/58015

(riastradh)

2024-03-11 21:10:46 UTC MAIN commitmail json YAML

nvme(4): Disestablish admin q interrupt while suspended.

And re-establish on resume.  Fixes nvmectl(8) after a suspend/resume
cycle on some systems.

Adapted from a patch by mrg@.

PR kern/58025

(riastradh)

2024-03-10 04:21:47 UTC MAIN commitmail json YAML

wg(4): Bind to CPU in wg_handle_packet.

Required by use of psref there.

Assert we're bound up front so we catch mistakes early, rather than
later on if we get unlucky in preemption and scheduling.

PR bin/58021

(riastradh)

2024-03-09 13:55:28 UTC MAIN commitmail json YAML

tun(4): Allow IPv6 packets with TUNSLMODE configured.

PR kern/58013

(riastradh)

2024-03-09 12:36:07 UTC MAIN commitmail json YAML

wg(4): Spruce up example a bit.

- Suggest umask so the private keys aren't world readable.
- Suggest use of pre-shared key files.
- Use TEST-NET-1 and TEST-NET-2 addresses for the example instead of
  real publicly routable addresses.

Holding off on adding IPv6 example until the tun(4) issue is fixed
(PR bin/58013).

PR misc/58015

(riastradh)

2024-03-09 05:22:05 UTC MAIN commitmail json YAML

pmf(9): Document the bug in pmf_device_register return type.

PR kern/57575

(riastradh)

2024-03-08 23:34:03 UTC MAIN commitmail json YAML

heartbeat(9): Return early if panicstr is set.

This way we avoid doing unnecessary work -- and print unnecessary
messages -- to _not_ trigger another panic anyway.

PR kern/58011

(riastradh)

2024-03-04 20:37:32 UTC MAIN commitmail json YAML

certctl(8): Pacify formal POSIX sh syntax.

According to POSIX 2018, the syntax between `then' and `elif' and
`fi' must be a _non-empty_ list of commands:

compound_list    : linebreak term
                | linebreak term separator
                ;
...
if_clause        : If compound_list Then compound_list else_part Fi
                | If compound_list Then compound_list          Fi
                ;
else_part        : Elif compound_list Then compound_list
                | Elif compound_list Then compound_list else_part
                | Else compound_list
                ;

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02

NetBSD's sh(1) currently doesn't enforce this and allows an empty
sequence of commands, but let's not rely on that nonstandard quirk.

Noted in PR 57997.

(riastradh)

2024-03-03 15:53:55 UTC MAIN commitmail json YAML

certctl(8): Avoid basename(1).

Saves some time running subprocesses.  Since this is only used for
non-directories (i.e., there's never trailing / on the inputs), it
suffices to delete the longest prefix matching glob `*/' with shell
parameter expansion -- much cheaper than spawning a subprocess.

Shaves off about 1/3 of the time spent in `certctl list' on an
aarch64 VM in qemu.

PR bin/57993

(riastradh)

2024-03-03 04:35:58 UTC MAIN commitmail json YAML

mozilla-certdata: Fix typo: sprintf, not snprintf, in awk.

Only used during import, and only in case something is wrong anyway
requiring manual intervention, so no change to builds.

(riastradh)

2024-03-03 04:35:44 UTC MAIN commitmail json YAML

doc/3RDPARTY: mozilla-certdata is up-to-date.

(riastradh)

2024-03-03 04:35:18 UTC MAIN commitmail json YAML

mozilla-certdata: Update set lists.

(riastradh)

2024-03-03 04:26:19 UTC MAIN commitmail json YAML

src/external/mpl/mozilla-certdata/share/certs/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.1.pem deleted
src/external/mpl/mozilla-certdata/share/certs/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem@1.2 / diff / nxr@1.2
src/external/mpl/mozilla-certdata/share/certs/Chambers_of_Commerce_Root_-_2008.pem deleted
src/external/mpl/mozilla-certdata/share/certs/CommScope_Public_Trust_ECC_Root-01.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/CommScope_Public_Trust_ECC_Root-02.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/CommScope_Public_Trust_RSA_Root-01.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/CommScope_Public_Trust_RSA_Root-02.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/D-Trust_SBR_Root_CA_1_2022.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/D-Trust_SBR_Root_CA_2_2022.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/Global_Chambersign_Root_-_2008.pem deleted
src/external/mpl/mozilla-certdata/share/certs/Security_Communication_Root_CA.pem deleted
src/external/mpl/mozilla-certdata/share/certs/Symantec_Class_1_Public_Primary_Certification_Authority_-_G6.pem deleted
src/external/mpl/mozilla-certdata/share/certs/Symantec_Class_2_Public_Primary_Certification_Authority_-_G6.pem deleted
src/external/mpl/mozilla-certdata/share/certs/Telekom_Security_SMIME_ECC_Root_2021.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/Telekom_Security_SMIME_RSA_Root_2023.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/Telekom_Security_TLS_ECC_Root_2020.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/Telekom_Security_TLS_RSA_Root_2023.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/TrustAsia_Global_Root_CA_G3.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/TrustAsia_Global_Root_CA_G4.pem@1.1 / diff / nxr@1.1
src/external/mpl/mozilla-certdata/share/certs/TrustCor_ECA-1.pem deleted
      :
(more 6 files)
mozilla-certdata: regen

(riastradh)

2024-03-03 04:24:41 UTC MAIN commitmail json YAML

mozilla-certdata: Update reference in Makefile.

(riastradh)

2024-03-01 23:50:28 UTC MAIN commitmail json YAML

netinet6: Avoid NPD on `ifconfig ifN inet6 ... pltime 0 vltime 0'.

PR kern/53922

(riastradh)

2024-02-28 20:18:13 UTC MAIN commitmail json YAML

urtwn(4): Ditch old queued commands on overflow.

Don't increment ring->queued past what the task will decrement.

This is a stop-gap measure; really, we should just have one task for
each operation that is deferred to the task thread.

PR kern/57965

(riastradh)

2024-02-28 04:14:47 UTC MAIN commitmail json YAML

heartbeat(9): Restore still-applicable comment nixed in last commit.

The nesting depth is stored in ci_heartbeat_suspend which is 32-bit.

(riastradh)

2024-02-28 04:13:00 UTC MAIN commitmail json YAML

heartbeat(9): No kpreempt_disable/enable in heartbeat_suspend/resume.

This causes a leak of l_nopreempt in xc_thread when a CPU is offlined
and onlined again, because the offlining heartbeat_suspend and the
onlining heartbeat_resume happen in separate xcalls.

No change to callers because they are already bound to the CPU:

1. cnpollc does kpreempt_disable/enable itself around the calls to
  heartbeat_suspend/resume anyway

2. cpu_xc_offline/online run in the xcall thread, which is always
  bound to the CPU that is being offlined or onlined

(riastradh)

2024-02-20 03:53:49 UTC MAIN commitmail json YAML

fenv(3): Fix fetestexcept to avoid side effects on trap state.

PR port-amd64/57949

(riastradh)

2024-02-19 23:19:11 UTC MAIN commitmail json YAML

2024-02-19 19:43:27 UTC MAIN commitmail json YAML

longjmp(3) t_sigstack: Fix fencepost error.

Extremely unlikely to cause trouble, but let's just turn that into
`never' to keep it easier for readers.

PR lib/57946

(riastradh)

2024-02-19 17:55:46 UTC MAIN commitmail json YAML

ramdisk-zfsroot: Enable build by default on amd64.

XXX Should maybe copy this to other ports like evbarm64 too.

PR port-amd64/57948

(riastradh)

2024-02-19 13:34:48 UTC MAIN commitmail json YAML

longjmp(3) t_sigstack: Use a sigaltstack per handler entry.

longjmp evidently doesn't reset the state of whether the process is
executing on the alternate signal stack.  So when we re-enter the
signal handler, the alternate stack appears to be still in use, and
the system chooses the original stack for the second call to the
signal handler -- which trips our assertion asking to verify that the
signal handler is always using an alternate stack.

Not strictly necessary for the signal handler to use an alternate
stack on re-entry, but this makes it clearer that the signal handler
itself is always using the alternate stack so we can verify that the
interrupted code is _not_ in the signal handler.

With this change, the test now passes on aarch64.

PR lib/57946

(riastradh)

2024-02-19 12:41:27 UTC MAIN commitmail json YAML

longjmp(3) t_sigstack: Note aarch64 seems to DTRT.

But only by code inspection; it appears to have another problem: on
re-entry, the signal handler is called on the normal stack, not on
the alternate signal stack.

PR lib/57946

(riastradh)

2024-02-19 12:41:19 UTC MAIN commitmail json YAML

longjmp(3) t_sigstack: Print which entry failed.

PR lib/57946

(riastradh)

2024-02-19 12:29:48 UTC MAIN commitmail json YAML

longjmp(3): Test signal mask vs stack restore with siglongjmp too.

PR lib/57946

(riastradh)

2024-02-19 04:33:21 UTC MAIN commitmail json YAML

longjmp(3): Paranoia: more error checking in PR lib/57946 test.

(riastradh)

2024-02-19 04:30:39 UTC MAIN commitmail json YAML

2024-01-29 18:58:54 UTC MAIN commitmail json YAML

hdaudio(4): KNF, no functional change intended

(riastradh)