Repository navigation
osbench and latency images run in ACPI mode, as a shipped image does - #1009
Conversation
The T14's periodic whole-machine stall in osbench round 2 (#989) is the firmware's legacy mode, measured as its cause on 2026-10-02 (#681) and recorded in issues/the-t14s-firmware-interrupts-every-cpu-every-2-2-s-under-toyos.md: the kernel enables ACPI mode only for the holder of the `acpi` claim, and benchcase.toml and latencycase.toml started no acpiserver. Their T14 boots stayed in legacy mode, where SMM serves the embedded controller's event every 2.2 s and stops every CPU for about 4.5 ms; shipped images, the testcases image and the bench's Linux all run in ACPI mode. Both images now start acpiserver before test-runner, so the claim's ACPI_ENABLE precedes every job, and the osbench and latency_wake judges refuse a boot that was not in ACPI mode before its first job or left it. On the round-2 readback 588c821's judge passed, this judge refuses it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q
Review of #1009, round 1 (head
|
Review round 1 of #1009: the diary clause names the round-2 boots' tail.diag runs, the restatement of the judges goes, and the T14 boot at e6d6170 is recorded (smi=0 on every CPU across both tail runs, no wake later than 37 us). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q
Round 1 response (head
|
Review of #1009, round 2 (head
|
Review round 2 of #1009: the 1,874 us worst wake of the first latencycase boot with acpiserver, and the second SMI in its run that nothing attributes, recorded as a finding for the latency track. The SMI record names the osbench boot it quotes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q
Round 2 response (head
|
Problem
osbench round 2 (#989) showed a whole-machine stop on the T14 (LENOVO 20W0003AMZ, i5-1135G7, BIOS N34ET71W 1.71). Every CPU stopped for 4.1 to 4.6 ms, every 2.2165 to 2.248 s. Across three boots at
588c821eethe per-CPUMSR_SMI_COUNTrose 27 or 28 times per 60 s, matching the 27 late wakes in each boot.The cause was already measured, with controls, on 2026-10-02 (#681, comment 5966817345) and is recorded in
issues/the-t14s-firmware-interrupts-every-cpu-every-2-2-s-under-toyos.md. The scout booted the same image twice:SCI_ENstayed clear and the count rose by 14 in an idle 30 s and by 13 in a busy 30 s.ACPI_ENABLE: the count stayed at 4818 on every CPU for 61 s.Linux runs with
SCI_ENset and read 0 SMIs in 120 s (perf stat -e msr/smi/, #681). The kernel enables ACPI mode only for the holder of theacpiclaim, which is/system/bin/acpiserver. That is the owner's stage-1 ruling, unchanged here.tests/images/benchcase.tomlandtests/images/latencycase.tomldid not startacpiserver. Every boot of either image stayed in the firmware's legacy mode: every round-2 log saysthe firmware handed over in legacy modeand none has anACPI_ENABLEline. Shipped images (images/system.toml,console.toml) andtestcases.tomlall startacpiserver. So the bench, and cyclictest's latency, were measuring firmware time that no shipped ToyOS or the bench's Linux pays.Supporting detail: in ACPI mode
acpiservertakes embedded-controller query0x4f13 or 14 times per 30 s and 27 times per 60 s on the T14. That is the same rate as the SMIs, which points to the EC event that SMM serves in legacy mode. This is an inference; nothing here reads it inside SMM.Change
benchcase.tomlandlatencycase.tomlstartacpiserverbeforetest-runner, with the same rowimages/system.tomluses. The supervisor spawns[boot] startin order, and the claim is minted at spawn, soACPI_ENABLElands before the first job. On the T14 the write itself held cpu0 2,243,230 ns (benchcase) and 2,186,279 ns (latencycase), andSCI_ENread set 16,980 and 14,550 ns after it. ACPI stage 1: the machine in ACPI mode for a userland server's claim; its SCI, power button and EC events served #713's 14,868 ns is that second figure. The 2026-10-02 scout's 2,129,279 ns ran from its write toSCI_ENreading set, so it includes the write's hold.osbenchandlatency_wakejudges call a newin_acpi_mode_before_any_job. It refuses a boot that was not in ACPI mode before its first===TEST_START, or that loggedlegacy mode again. A firmware that hands over in ACPI mode passes. This keeps a later image edit from quietly bringing the firmware back into the numbers.No kernel, firmware-policy or security change. The AMD bench also hands over in legacy mode (
SMI_CMD 0xb0) and its osbench image now also runsacpiserver. Its SMI cost cannot be read there, because it has no SMI counter.Checks
cargo run -- --ci hostat27acd19a6plus this diff: exit 0, 87 steps green. Rerun at the round-1 heada7e96bfa4(Markdown-only change): exit 0, 87 steps green.osbenchjudge on a copy of round-2 readbackmetal-r2b-t14-1(built from588c821ee, legacy mode). At588c821eeit passed (1 passed). With this change it fails withFAIL osbench: the machine was not in ACPI mode before the first job(exit 1).e6d6170d8(run by the orchestrator; the round-1 commit changes only an issue file):benchcase,osbenchjudge exit 0.ACPI_ENABLEat 12.013 s, the first job at 12.018 s. Every CPU's tail counter readsmi=0over bothtail.wake.periodic.60sandtail.diag.periodic.30s. Both runs hadlate_over_1ms=0, max 37,249 ns and 36,627 ns. Round 2's three boots are the control: same suite, same machine, noacpiserver, 27 late wakes of 4.1 to 4.6 ms per 60 s.latencycase,latency_wakeandtlb_shootdown_costjudges exit 0. cyclictest: p99 16 µs, max 1,874 µs. Its SMI count moved 4819 to 4821 over its 2 s. One of those is theacpiserverfirmware call0xf5logged at 12.151 s (cpu0 held 297,820 ns). The other is not attributed, because later calls of the same byte are not logged one by one.acpiserverall logacpi: ACPI mode: ACPI_ENABLE 0xa0 written to SMI_CMD 0xb0before their first===TEST_STARTand neverlegacy mode again. For example:bench/metal-std-amd/testcases(3a5fc40),crypto-sec/metal-r2/amd/cryptoctcase(9022dcc) andcrypto-perf/readback-probe-amd/cryptocase(fb93764). So the guard passes the AMDosbenchrow.Risks
acpiservernow runs during the bench. It serves an SCI about every 2.2 s and reads the battery every 10 s, as shipped images and Linux do. Its namespace init runs AML that may writeSMI_CMDearly in the boot. Those are SMIs ToyOS asks for and counts as firmware calls.latency.p99_us,tlb.latencycase.p50_nsandtlb.latencycase.p99_nswere recorded from legacy-mode boots.ACPI_ENABLEat 12.075 s in the latencycase boot. So it always measures legacy mode, in every image, and an ACPI-mode guard on its row would pass a reading taken in legacy mode. Its 256 shootdowns take well under a millisecond, so an SMI lands in one with a probability of about 1 in 4,000 (inference). A single hit moves the max, not p99 (one sample in 256).acpiserverinitialises its namespace (12.08 to 12.16 s). Its worst wake (1,874 µs at about 12.10 s) falls in that window; the cause is not identified.tests/images/metalcase.tomlalso starts noacpiserver. None of its rows is a timing row, so it is left as it is.🤖 Generated with Claude Code
https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q