Commit Graph

305584 Commits

Author SHA1 Message Date
riastradh 40cfbdd6f3 acpihed(4): New driver for PNP0C33 to notify apei(4).
PNP0C33 denotes the ACPI Hardware Error Device, which exists only to
be a vector for event notifications.

PR kern/58046
2024-03-21 02:36:01 +00:00
riastradh a969c7d272 apei(4): Note some TODOs for EINJ and HEST.
No functional change intended, comments only.

PR kern/58046
2024-03-21 02:35:09 +00:00
riastradh 11e3467368 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
2024-03-21 02:34:59 +00:00
nia b2466d56c6 sysinst: Clarify that usernames are maximum 8 characters
At least one user reported thinking that the previous wording implied
that usernames required padding to 8 characters.

This syncs the english translation with the german.
2024-03-21 02:24:35 +00:00
msaitoh c7dff6922c Process all queued messages without delay immediately. From OpenBSD.
Apply the remaining part of OpenBSD sys/dev/vmt.c rev. 1.22.

 > The VM host might send multiple messages at once but vmt(4) only
 > processed one of time per second.  Change the code to process all
 > queued messages without delay immediately.  This fixes two things: a)
 > the vmt time sensor is available on boot when ntpd -s is loaded and b)
 > the random seeding on resume (OS_Resume message) is executed almost
 > immediately and not delayed by about 20 seconds.

 Apply OpenBSD sys/dev/pv/vmt.c rev. 1.4.

 >  Merge two return branches in vmt_tclo_tick().  No functional changes.
2024-03-20 23:34:24 +00:00
msaitoh ce13a26bba On error, give time to recover and wait a second.
Part of OpenBSD sys/dev/vmt.c rev. 1.22.
2024-03-20 23:33:22 +00:00
msaitoh 41309a54f0 Use a table like OpenBSD vmt.c rev. 1.27. No functional change.
Add new vmt_tclo_rpc[] table and use it. In this change, all of
vmt_tclo_xxx()'s functionality are not changed from previous.

 Now we can understand what's the difference between OpenBSD's
sys/dev/pv/vmt.c and NetBSD's sys/dev/vmt/vmt_subr.c.
2024-03-20 23:33:02 +00:00
msaitoh 6b3bcb1f8b Move a prototype definition. No functional change. 2024-03-20 23:32:17 +00:00
msaitoh 9e0e41677e KNF. No functional change. 2024-03-20 23:31:54 +00:00
mrg 707adea339 match message & conversion function name properly.
probably should make this into an array with two members.
2024-03-20 20:19:31 +00:00
mrg eb1fa7eb4a audio_wav_parse_hdr: handle zero-length data files again
the previous clean up turns zero-length data into no data and thus
an error, instead of simply doing nothing.  noted by gson.
2024-03-20 20:18:39 +00:00
riastradh 4966f204b1 apei(4): Tweak some comments about the APEI interpreter language.
No functional change intended.

PR kern/58046
2024-03-20 19:21:04 +00:00
riastradh d302773e0e apei(4): Pacify -Wsign-compare.
Assert that the parsing made forward progress too while here.

PR kern/58046
2024-03-20 18:47:59 +00:00
riastradh 4b159fe528 apei(4): New driver for ACPI Platform Error Interfaces.
For now it is wired up only in x86 ALL kernels, and built as a module
for x86 and Arm.  Once it gets a little more testing on machines with
APEI, I would like to flip it on by default.

PR kern/58046
2024-03-20 17:11:42 +00:00
riastradh 9a55048f5c x86: Release the ramdisks too.
This way we will get cgdroot.fs (and zfsroot.fs too) in the release.

PR misc/57534
2024-03-20 13:51:35 +00:00
riastradh 3cdf638023 libcrypto: Add expected symbol list to check at build-time. 2024-03-20 13:50:51 +00:00
riastradh 837a54d9ce 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
2024-03-20 13:50:37 +00:00
riastradh 864e67f08d acpi(4): Make apeibus actually work as an iattr.
PR kern/58046
2024-03-20 12:43:13 +00:00
rillig aabd8f68ba sparc64/fpsetround: avoid shifting into the sign bit
Lint had warned about the constant expression '0x03 << 30' but not about
the structurally equal nonconstant expression '(rnd_dir & 0x03) << 30'.

No binary change.
2024-03-20 06:15:39 +00:00
riastradh 062c0d7e32 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
2024-03-20 03:14:45 +00:00
christos b81d0cd3ca Fix reproducible builds (Jan-Benedict Glaw) 2024-03-20 00:35:21 +00:00
christos 0cec432304 remove extra stat (Jan-Benedict Glaw) 2024-03-20 00:34:32 +00:00
christos a47d0a4f5e Fix reproducible builds (Jan-Benedict Glaw) 2024-03-20 00:31:54 +00:00
rillig d7b3b04319 lint: keep invalid arguments in function calls
Previously, arguments of incomplete type or 'void' cleared all arguments
of the function call expression, requiring extra checks in later checks.

Invalid function calls are now exported to the .ln files, but that's
irrelevant in practice as these invalid function calls make lint1 fail,
after which xlint removes the .ln file.
2024-03-19 23:19:03 +00:00
gutteridge eac9df6f33 cpuctl.8: fix grammar in a sentence 2024-03-19 01:19:11 +00:00
gutteridge 9e0c61f79f ipsec.4: minor grammatical improvements 2024-03-18 22:47:19 +00:00
martin 56e0726f28 The fetestexcept_trap test case only makes sense on FPUs that implement
exceptions.
2024-03-18 16:33:54 +00:00
riastradh eea7d4e0e0 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
2024-03-18 16:15:24 +00:00
jakllsch 010a79541e Use HUD_PEN instead of 0x0002 as appropriate 2024-03-18 15:15:27 +00:00
wiz 03dff19df5 hier(7): remove reference to /var/db/pkg
The pkg database lives in ${PREFIX}/pkgdb instead now.

Bump date.
2024-03-17 22:05:23 +00:00
andvar a5c0af2445 Add missing "e" in few words, in comments and one log message. 2024-03-17 21:48:01 +00:00
andvar bb2336b065 s/argumment/argument/ in documentation. 2024-03-17 21:37:53 +00:00
jakllsch 0cb28d4d87 Prevent errant ucycom-presenting device from causing up to 225
bytes of kernel memory following input buffer to leak to tty
application.

Probably not practically expolitable, but you never know.
2024-03-17 20:10:52 +00:00
ryoon 5970d5082c Remove debug print 2024-03-16 23:40:25 +00:00
christos c75928623b make all QUAD constants look the same. 2024-03-16 21:50:47 +00:00
andvar ea87150b65 s/Broardcast/Broadcast/ in comment. 2024-03-16 18:17:39 +00:00
riastradh 7b531fef3d strptime(3): Reduce unnecessary indentation.
Post-fix tidying.

No functional change intended.

PR lib/58041
2024-03-16 00:16:21 +00:00
riastradh 5f253fa591 strptime(3): Avoid arithmetic overflow.
PR lib/58041
2024-03-16 00:06:45 +00:00
riastradh 086a7f840a 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
2024-03-16 00:06:37 +00:00
andvar 78ec8e42b9 "retval = 0" should be "*retval = 0", should fix the broken build. 2024-03-15 22:15:21 +00:00
andvar 86c524b4ca Rewrite !VMSWAP uvm_swap_stats() macro as a static function. NFCI.
From riastradh
2024-03-15 20:09:31 +00:00
riastradh f1f68b211d libcrypto: Fix buffer overrun in truncated SHA-512 functions.
Further fallout from the libc/openssl sha2 symbol collision.

PR lib/58039
2024-03-15 18:10:37 +00:00
nia c58d8f331b doc: changes from the last 2 weeks 2024-03-15 17:47:02 +00:00
riastradh 4cf835aac8 doc/3RDPARTY: Note OpenSSL vendor/release tags. 2024-03-15 15:49:01 +00:00
riastradh 1e152b590b 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
2024-03-15 15:32:07 +00:00
andvar 6b7b0b2ad4 Fix !VMSWAP build:
Added __unused for few local variables, which are used in VMSWAP block only.
Adjust !VMSWAP uvm_swap_stats() definition to make it build with compat code.
Copied "int (*uvm_swap_stats50)(...)" definition from uvm_swap to uvm_swapstub
to avoid missing uvm_swap_stats50 reference on linking.

Fixes INSTALL_CPMBR1400, INSTALL_ZYXELKX evbmips kernel configs as a result.

Reviewed by simon and phone in IRC (thanks).
2024-03-15 07:09:37 +00:00
riastradh 9c98722158 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
2024-03-15 02:20:58 +00:00
rillig 083828859c stat: don't allow numeric formatting flags on strings
Calling snprintf with "%+s" invokes undefined behavior.
2024-03-14 21:17:54 +00:00
rillig 897cdf26ba tests/stat: test the left-aligned and right-aligned 'S' format 2024-03-14 21:00:32 +00:00
kre cdaa157c5b While the change in 1.51 certainly retained binary compat with
what was in 1.50 (while silencing LINT) - it was clearly not the
correct change to make.   The code used !FLAG_POUND where it
clearly meant ~FLAG_POUND ... the former is 0, so &= 0 could
be replaced by =0 changing nothing.   But that's not what it
should have been doing, other flags should not have been
removed here, just FLAG_POUND.

This problem seems to have existed since support for %#s
was first added in 2011, which kind of suggests how rarely
that format, particularly with other flags (like %#-s)
has ever been used (with no other flags, the bug would not
be noticed).
2024-03-14 19:38:56 +00:00