Repository navigation
Commit a93067f
authored
ABI: a deleted syscall, SYS_DEBUG action or inbox op is simply deleted (#651)
A removed number is free (root `CLAUDE.md`, #673). This is the code
half: no source file holds a retirement entry for a deleted syscall,
`SYS_DEBUG` action, inbox op or device class any more, and a deleted one
answers as a number nobody ever assigned. No live number moves. It
closes
`issues/design-debt/the-abi-still-keeps-retired-syscall-numbers.md`.
## What changed, per decision
- **The kernel's retired table is gone**
(`kernel/src/syscall/dispatch.rs`): `retired_syscalls!`, its 19 entries
and its ascending-order assert. A number no arm claims falls to the one
default arm, `_ => SyscallError::InvalidArgument.to_u64()`.
- **The default arm writes no record.** The retired arm logged each
call. Any process can reach the default arm at syscall rate with no
authority, so a record there is a log flood any program can make. What
the kernel keeps of such a call is a count, not a name: the exit-time
`syscalls: pid=…` record gives the main thread's calls per number, and
every number at or past `SYSCALL_PROFILE_OTHER`, 127, shares its last
bin. The T14's call of `u64::MAX` reads `127=1`.
- **Every retirement entry is deleted** from `toyos-abi/src/syscall.rs`
and `toyos-abi/src/inbox.rs`: the "formerly …" and "retired and unused"
notes for syscall numbers, for `SYS_DEBUG` actions 8, 14, 15, 17 and 18,
for device classes 3 and 4 and for inbox ops 2 and 4; the paragraphs on
why 76 and 89 kept their numbers; the 113 and 115 reservations; and the
`"nic"` case of the `DeviceRequest` parse test. The clauses that leaned
on them go from `toyos-abi/src/inventory.rs`, `kernel/src/inbox/mod.rs`
and `toyos/src/census.rs`.
- **`inventory.rs`'s refused-class test** takes one past the highest
declared `DeviceType` and `1 << 40`, not 3 and 4, which the next class
may take.
- **`panic_halts_first` makes its records with `SYS_DEBUG`
`LOG_PATTERNED`.** Its siblings' record was the retired arm's `syscall
26 is retired`. `virt_fatal_halts_the_others_first`'s judge reads
`logstorm t=0 i=0 ` from another CPU as its non-vacuity. What the test
judges is unchanged: QEMU's own account, over QMP, of every other vCPU
halted on AArch64 `virt`, a machine the T14 is not.
- **`syscall_unassigned` pins the default arm's word.** Round 1's
mutation, the arm answering `NotSupported`, left every test green. The
binary calls `u64::MAX` past the wrappers and asserts `InvalidArgument`.
- One number: the one thing computed from the number before the match is
the profile's index, `(num as usize).min(SYSCALL_PROFILE_OTHER)`, and
`u64::MAX` is the number that reaches its clamp.
- Not a once-retired number: a test that names 26 holds 26 against the
next syscall.
- Its tier: no type holds an error word, and the kernel crate builds for
no host. It is a discovered binary, so it rides the T14's shared boot on
the shipping kernel and adds no QEMU test.
- **Issues.** The plans that followed the rule lose it:
`sys-clock-realtime…`, `the-kernel-still-parses…`,
`the-capability-end-state…`, `the-kernel-keeps-nothing-it-enumerates`,
`no-cyclictest`, `mio-deregister…`, `the-kernel-is-small…`,
`the-supervisor-is-host-tested…` and
`sys-debug-actions-and-two-loader-words-that-nothing-calls`. The last
also records that `LOG_PATTERNED` has a caller again and that the
pattern `kernel/src/log/storm.rs` writes into the record has no reader.
Filed:
`issues/design-debt/the-window-protocol-keeps-a-retired-message-type.md`,
the same legacy in the window protocol, which waits on
`issues/isolation/the-compositor-ignores-a-message-it-does-not-know.md`.
- **The AArch64 half of the test binaries' assembly is deleted**
(`tests/toyos-rust-tests/src/arch/aarch64.rs` and the selector's arm).
On main `panic_halts_first` ran it on `virt`; `arch`'s one includer is
now `syscall_unassigned`, and the harness builds that for x86-64 alone.
- **Not touched, and recorded**: six comments that name a deleted
syscall as history and hold no number.
`issues/design-debt/comments-still-name-syscalls-the-abi-deleted.md`
names each site, their owner and the exit. `toyos-i219`'s exit code 82
is no ABI number.
- **Not touched**: four issues that tell history name a deleted number.
`issues/build/mio-deregister-fd-leaves-a-pending-poll-live.md` quotes op
code 2's old comment as the evidence of its defect,
`issues/diagnostics/no-cyclictest.md` names `SYS_SET_RT_PRIORITY` (96)
as the gate it was opened against, and
`issues/build/parallel-tests-red-under-other-suites.md` and
`issues/kernel/deferred-release-outlives-its-syscall.md` name the
commits that deleted `SYS_DEBUG` actions 8, 17 and 18.
Net against `origin/main` 5daab30: `23 files changed, 103
insertions(+), 269 deletions(-)`.
| | Insertions | Deletions |
|---|---|---|
| Production: kernel, `toyos-abi`, `toyos` | 2 | 159 |
| Tests: guest binaries, the judge, `toyos-abi` unit tests | 26 | 39 |
| Issues | 75 | 71 |
## Gates at b20bc9d
b20bc9d is b198b3a, the head the review's named changes were made
at, merged with `origin/main` 5daab30 (#655). The merge had no
conflict: git merged `toyos-abi/src/inbox.rs` and
`kernel/src/inbox/mod.rs` on its own, and in both #655's addition and
this branch's deletion are in the result. `git diff b198b3a b20bc9d`
is #655's diff line for line, and it touches neither
`kernel/src/syscall`, `toyos-abi/src/syscall.rs`, `tests/toyos.rs` nor
either test binary of this change.
#655 brought no retirement entry and no mention of a deleted number:
every search of the tree for one gives the same hits at b198b3a and at
b20bc9d, and none matches a line #655 added. The searches and their
results are in the gates comment linked below.
| Command | EXIT |
|---|---|
| `cargo run -- --ci host` (67 steps, clippy over every kernel shape
among them) | 0 |
| `cargo run -- --build-only` | 0 |
| `cargo test` (the 25 guest tests, `virt_fatal_halts_the_others_first`
among them) | 0 |
| `cargo test --test toyos-build -- --metal --metal-readback <dir>
syscall_unassigned`, staging | 2: staged |
| the same command over the T14's readback of that image | 0: 1 passed,
0 failed, 1 boot |
Their logs, by key line and exit: [the gates at
b20bc9d](#651 (comment)).
`origin/main` has since moved to 8f6abbc (#657), which this head does
not hold: 11 files, none of them one this branch changes, and `git
merge-tree --write-tree b20bc9d 8f6abbc` exits 0. Nothing above was
measured with #657.
The T14 booted b20bc9d's image once, run by the orchestrator ([the
boot](#651 (comment))):
the shared boot with the one job `test_rs_syscall_unassigned`, sha256
`e6471fa75b3d703645e1c617dda6f212dfb8415e3466e794ba3189ee92106a8e`
checked before it was flashed, `toyos-metal` exit 0, `===TEST_END
test_rs_syscall_unassigned exit=0===`, the judge exit 0. The earlier
readings are ea0ee48's ([the
boot](#651 (comment)))
and b198b3a's ([the
boot](#651 (comment))),
both on main without #655. At each: that head's image, its sha256
checked before it was flashed
(`6b031ff614c73a644ceb391eee5cb190db21cb124c03a20ef4724521455527ce` and
`e52fbc8437d1fed1df3db45c26e33a1f68454829f35b548eddef4004533366b6`),
`toyos-metal` exit 0, `===TEST_END test_rs_syscall_unassigned
exit=0===`, and the judge over its readback exit 0, 1 passed, 0 failed,
1 boot. No mutation was booted on the machine, and the red arms below
are QEMU's.
## The checks of a change to the ABI
Each arm is `cargo test --test toyos-build -- <filter>` on ea0ee48,
before the review's named changes and the merge of #655, under a checked
patch, restored afterwards; the patches and the script are in [that
round's
comment](#651 (comment)).
None was run again at b20bc9d. The probe harness, not landed, boots
`tests/testcases` on the shipping kernel under QEMU and runs
`test_rs_syscall_unassigned`.
| Arm | Filter | EXIT |
|---|---|---|
| The probe harness alone | `qemu_syscall_unassigned` | 0 |
| The default arm answers `NotSupported` (round 1's mutation) |
`qemu_syscall_unassigned` | 1: `syscall 18446744073709551615 answered
0xfffffffffffffff7` |
| The whole change reverted but for the new test |
`qemu_syscall_unassigned` | 0 |
| 26 probed beside `u64::MAX` | `qemu_syscall_unassigned` | 0: both
`InvalidArgument` |
| 26 probed, and the whole change reverted but for the new test |
`qemu_syscall_unassigned` | 1: 26 answers `NotSupported` |
| `panic_halts_first.rs` and its judge reverted to main's, on this
kernel | `virt_fatal_halts_the_others_first` | 1: `no other CPU made a
record before the fatal one on cpu3` |
- **Negative control.** The whole change reverted is red only for a
probe of a once-retired number, the fifth arm, and the landed test
probes none, the third: the revert restores an answer for 19 numbers
nothing may name any more. The sixth arm is the control of the test this
change moved: without its new record source it is red, not vacuous.
- **Oracle.** rustc, in every kernel shape of the host gate and in the
image build: nothing still names `retired_syscall`. The declared numbers
are main's: the `const` and device-class lines of
`toyos-abi/src/syscall.rs` (129) and `toyos-abi/src/inbox.rs` (12) at
5daab30 and at b20bc9d `diff` with exit 0. `git grep -E
'retired_syscall|RETIRED_SYSCALLS' b20bc9d` and `git grep -i -E
'formerly|retired and unused|never reused|reserved, not free' b20bc9d
-- toyos-abi toyos kernel/src/syscall kernel/src/inbox` both exit 1. For
`virt_fatal_halts_the_others_first`, QEMU's QMP says which vCPUs halted.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_013UDZQ6fSKw14e4w2TKTRfm23 files changed
Lines changed: 103 additions & 269 deletions
File tree
- issues
- build
- design-debt
- diagnostics
- isolation
- kernel
- kernel/src
- inbox
- syscall
- tests
- toyos-rust-tests/src
- arch
- bin
- toyos-abi/src
- toyos/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 46 | | |
55 | 47 | | |
56 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 21 | + | |
| 22 | + | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | | - | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
300 | | - | |
| 298 | + | |
301 | 299 | | |
302 | 300 | | |
303 | 301 | | |
| |||
0 commit comments