Commit Graph

301880 Commits

Author SHA1 Message Date
rillig 1d389f0fa4 lint: warn about conversion from 128-bit to smaller integer types 2023-07-08 12:45:43 +00:00
rillig 5bb571bbdc tests/lint: demonstrate missing warning for converting int128_t 2023-07-08 12:42:11 +00:00
rillig a59a6f2f5a lint: clean up
PUSH nodes are not marked as binary, yet they have a left and a right
operand.

If none of the queries is enabled, omit the query from the debug log.
2023-07-08 12:07:21 +00:00
riastradh 2b6c2cf453 kern_resource.c: Fix brace placement.
No functional change intended.
2023-07-08 11:42:03 +00:00
rillig 8668fe51f9 lint: enable more lint warnings for its own source code 2023-07-08 11:18:16 +00:00
rillig 1d1794a80f tests/lint: fix a few ilp32 tests 2023-07-08 11:03:00 +00:00
rillig 97fd604444 lint: fix handling of 'long double' in cross-compiled mode
When lint is compiled on x86-64 (where 'long double' has a 64-bit
mantissa) and targets arm (where 'long double' has a 53-bit mantissa),
warn if a constant cannot fit in the 'long double' of the target
platform, not of the host platform.
2023-07-08 10:59:38 +00:00
rillig 223ac6e8ac tests/lint: automate accepting changed test results 2023-07-08 10:01:17 +00:00
rillig 4aa90eba13 lint: clarify the meaning of 'portable size in bits' of a type
No functional change.
2023-07-08 09:35:35 +00:00
rillig bb39095abb lint: use consistent conditional compilation guards 2023-07-08 09:08:20 +00:00
rillig afb87394f6 tests/lint: only overwrite .exp files if the output actually changes 2023-07-08 08:02:45 +00:00
simonb 2a7583869f Make mstats() decl match prototype so this compiles with -DMSTATS. 2023-07-08 04:09:26 +00:00
rillig 18c22a77cd lint: only warn about traditional/C90 differences in migration mode
In C99 mode, there is no point warning about traditional C.

No change in the tests, as a complete test suite would require several
new test files, and migration mode is not used intensively.
2023-07-07 20:19:08 +00:00
rillig e6298b924c lint: warn about function definitions without header declaration
The existing warning was only issued for function declarations, not for
function definitions.

The interesting change in the tests is in msg_351.c.  Many other tests
use non-static functions due to their syntactic brevity.  In these
tests, the warning is disabled individually, to allow new functions to
be added without generating warning 351.
2023-07-07 19:45:22 +00:00
riastradh e4c8179fca Revert unintentional changes to kern_lock.c in previous commit. 2023-07-07 18:02:52 +00:00
riastradh 9401f7d8e0 heartbeat(9): Test whether curcpu is stable, not kpreempt_disabled.
kpreempt_disabled worked for my testing because I tested on aarch64,
which doesn't have kpreemption.

XXX Should move curcpu_stable() to somewhere that other things can
use it.
2023-07-07 17:05:13 +00:00
riastradh 7af195686c xcall(9): If !mp_online, raise spl or set LP_BOUND to call func.
High-priority xcalls may reasonably assume that the spl is raised to
splsoftserial, so make sure to do that in xc_broadcast.

Low-priority xcalls may reasonably enter paths that assume the lwp is
bound to a CPU, so let's make it assertable even if it doesn't have
any other consequences when !mp_online.

XXX pullup-8
XXX pullup-9
XXX pullup-10
2023-07-07 17:04:49 +00:00
uwe 92446808ba heartbeat(9): markup fixes
Use .Cd for options.  Don't use the usual <space><tab>, which is
superfluous in the man page.  Paragraph break after the config section
of synopsis, before the C API section.
2023-07-07 15:56:31 +00:00
bouyer 7202cc92d3 Unmask event after VCPUOP_stop_periodic_timer and
initializing ci->ci_xen_hardclock_systime_ns, to avoid a possible race with
xen_timer_handler()
2023-07-07 15:13:41 +00:00
riastradh 6e4d02a8ee sys/param.h: Welcome to 10.99.5, courtesy of heartbeat(9). 2023-07-07 14:05:37 +00:00
riastradh 10acd8549e heartbeat(9): Fix grammaro in man page. 2023-07-07 13:19:30 +00:00
wiz 04c9d4b262 Replace main(9) reference with code location 2023-07-07 13:15:00 +00:00
wiz 7057286892 Sort SEE ALSO 2023-07-07 12:59:45 +00:00
riastradh acf51d137d amd64/ALL: Turn on heartbeat checks. 2023-07-07 12:46:50 +00:00
riastradh 12861a663c heartbeat(9): New mechanism to check progress of kernel.
This uses hard interrupts to check progress of low-priority soft
interrupts, and one CPU to check progress of another CPU.

If no progress has been made after a configurable number of seconds
(kern.heartbeat.max_period, default 15), then the system panics --
preferably on the CPU that is stuck so we get a stack trace in dmesg
of where it was stuck, but if the stuckness was detected by another
CPU and the stuck CPU doesn't acknowledge the request to panic within
one second, the detecting CPU panics instead.

This doesn't supplant hardware watchdog timers.  It is possible for
hard interrupts to be stuck on all CPUs for some reason too; in that
case heartbeat(9) has no opportunity to complete.

Downside: heartbeat(9) relies on hardclock to run at a reasonably
consistent rate, which might cause trouble for the glorious tickless
future.  However, it could be adapted to take a parameter for an
approximate number of units that have elapsed since the last call on
the current CPU, rather than treating that as a constant 1.

XXX kernel revbump -- changes struct cpu_info layout
2023-07-07 12:34:49 +00:00
riastradh 6c8524389b crashme(9): New crash methods with raised ipl or kpreempt disabled. 2023-07-07 12:34:26 +00:00
rin 2bd1369fb8 doc/HACKS: Document PR port-alpha/57511 2023-07-07 08:39:23 +00:00
rin 4516a07eeb PR port-alpha/57511 Temporally disable secure PLT for alpha
until support is added to ld.elf_so(1).
2023-07-07 08:33:25 +00:00
martin dbf4e096ae Fix locking error when setting the multicast filter to accept all
multicast frames, pointed out by Lwazi Dube.
2023-07-07 07:22:18 +00:00
rin 9c0183255f virtio(4): Fix byte order of DMA data for armeb in the same manner as
aarch64eb.

Fix comments to explain what is going on for {arm,aarch64}eb on QEMU.
This is not due to QEMU bugs; it correctly configures everything for
little-endian environment, and we forcibly change byte order only for
CPU cores during kernel bootstrap.
2023-07-07 07:19:36 +00:00
rin b2eb12c7ba Remove extra whitespace inserted during merge. No binary changes. 2023-07-07 07:04:17 +00:00
rin 1267710ee7 Remove duplicate OpenBSD RCSID. 2023-07-07 07:02:59 +00:00
rillig 06b8093259 lint: only skip 'unused' warnings after errors, not other warnings
Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that.  This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
2023-07-07 06:03:31 +00:00
msaitoh db06c1e0c0 tprof(8): Add support for Skylake-X and Cascade Lake. 2023-07-07 04:43:15 +00:00
msaitoh 068060949b Modify comment. No functional change. 2023-07-07 04:37:03 +00:00
riastradh 67e5e79509 select(2), poll(2): Clarify return values. 2023-07-07 01:31:25 +00:00
rillig 62962fdef2 tests/lint: test all combinations of {func,obj}_{decl,def}
For a non-static function definition that is not declared in a header,
lint doesn't currently warn.  The previous test didn't notice this.
2023-07-07 00:25:23 +00:00
rillig a9b749ce7a tests/lint: merge duplicate tests for C11 _Atomic 2023-07-07 00:20:39 +00:00
jschauma becf7fe907 +CAC - cryptographic access control 2023-07-06 21:10:15 +00:00
riastradh 7d87cccbb2 t_sig_backtrace: Flush stdout before writing to STDOUT_FILENO.
Avoids confusing ordering of output.
2023-07-06 20:44:55 +00:00
rillig f7ab48a605 lint: add type safety for accessing properties of basic types
No functional change.
2023-07-06 07:59:00 +00:00
rillig bff65bdad9 tests/lint: ensure consistent preprocessor filenames in tests
The deviations often happen when copying or renaming tests.
2023-07-06 07:33:36 +00:00
msaitoh 7c95744288 Add Alder Lake-N. 2023-07-06 02:43:44 +00:00
uwe 5c44d8113a bsdmalloc(3): fix malloc() signature 2023-07-06 01:32:52 +00:00
riastradh d2876e0fc7 tests/libexec/ld.elf_so: Fix helper library makefiles.
1. Consolidate logic into a single helper.mk to reduce duplication.
2. Set NO* variables, not MK* variables which are reserved for user.
3. Avoid eager X!= in favour of lazy ${X:sh}.
4. Mark _g.a set list entries obsolete.  Never should've been built!

PR misc/57462
2023-07-05 22:42:46 +00:00
riastradh d5888fcbdb libbsdmalloc: Use a multiply-overflow that clang supports too.
XXX pullup-10
2023-07-05 22:13:20 +00:00
lukem 2b1fd0414c BUILDING: wording tweaks 2023-07-05 16:41:12 +00:00
lukem 0ae90b729a mk.conf(5): document rump variables
Update mk.conf(5) with the rump variables from
- lib/librumpuser/README.compileopts
- sys/rump/README.compileopts

Add cross-references back to mk.conf(5) in those files.

Ensure that the Default: is listed last in a description,
for consistency with the convention in this file.
2023-07-05 16:40:33 +00:00
palle fcbcc39cb9 Update build instruction for Solaris 11.4 hosts 2023-07-05 16:26:29 +00:00
riastradh bf2cc18785 t_posix_memalign: Simplify.
No functional change intended.
2023-07-05 12:09:39 +00:00