Repository navigation
acpiserver: a type-3 SystemIO C-state is handed over on AMD from Family 17h and on Hygon - #1089
Conversation
Review r1: head 7d5c0caArchitectureOwnership is right. acpiserver already owns The CPUID read stays in The rule matches facts.md:
The family decode is correct against APM Vol. 3 Fn0000_0001_EAX: the extended family is added only when the base is Fh. The test vectors are real signatures (17h Renoir 0x860F01, 16h, 1Ah, Hygon 18h). The decode is now the third copy, after "Every deep period is 0x415's" holds by inspection of
A per-state count would not add the missing property either. The count shows what the kernel requested, not what the core entered, and AMD has no counterpart here to the Intel Net size: production about +60 lines ( FindingsB1 (BLOCKER), stale base: the landing tree does not build, and the staged metal is not the landing tree. The images staged for metal are from base de417c2. They lack #1084 and main's scheduler placement change (05da59f), so a run on them would not test the landing tree. osbench figures in particular depend on placement. Main has also rewritten the idle track's exit-cost section. It now reads "a tradeoff to bring to the architect, not accepted". It says "on the AMD the deep state lands a 1 ms sleep 27 µs sooner and moves nothing else", and its audio bullet bounds "the AMD's (400 µs)". After this PR those sentences describe 0x414 alone, and the architect's pending tradeoff is decided on these figures. The handoff compares against the old "AMD deep-idle column", which main has replaced. Fix:
B2 (BLOCKER), BM_RLD is neither handled nor recorded. Fix: add one clause to each. BM_RLD stays as firmware set it, and only PPR 55901 Vol. 5 speaks to it, for 19h M11h. Alternatively, argue why it needs no record. B3 (BLOCKER), With the C3 record deleted, this sentence is the only remaining statement of a permanent policy. The deleted record named Fix: delete the sentence, or state only the real gap. ACPI defines B4 (BLOCKER), evidence for the coherence claim.
Root's research order has a measurement check "every fact above it that a bench can reach", and part of this fact is reachable. The requested run ( Cheapest sufficient check: no new test. Add the AMD bench's existing rows that move device data and check it (for example B5 (BLOCKER), B6 (BLOCKER, PR text, the orchestrator's): the deleted record's exit is misstated. S1 (SUGGESTION), S2 (SUGGESTION), S3 (SUGGESTION), S4 (SUGGESTION), S5 (SUGGESTION), S6 (SUGGESTION). S7 (SUGGESTION, pre-existing scope). A cheap bug fence would be for the kernel to check that an AMD port entry lies within MSRC001_0073 Evidence checked
SEND BACK |
…ly 17h and on Hygon ACPI 6.5 §8.1.4 makes OSPM keep the caches coherent through a type-3 state, on a multiprocessor by flushing them before entry. acpiserver withheld every type-3 SystemIO `_CST` state for want of a statement that the processor makes that unnecessary, so the AMD bench (Family 17h) idled no deeper than port 0x414. AMD's rule, held by its engineers for every part from Family 17h and extended by them to Hygon, is that a type-3 I/O C-state needs no software flush and no ARB_DIS. No AMD document in hand states it; root's research order takes the vendor's engineers' code next after its documents. The provenance is in the clean-room fact sheet the PR's evidence carries, not in the tree. AMD's 15h/16h BKDGs declare their I/O C-state type 2 only and AMD narrowed the rule to Family 17h on, so earlier families and every other vendor keep the old rule. BM_STS is not read: §8.1.4 makes it an optional input to C3 policy, AMD's rule says nothing of it, and PPR 55901 Vol. 5 calls the 19h M11h FCH's "no longer used except for server CPU". Whether any Zen part needs it is recorded as not established in the idle track. The family comes from CPUID the way the kernel's identity does: the vendor string and DisplayFamily. `toyos_abi::processor_is_intel` becomes `processor_id`, the raw vendor string and leaf 1 signature, read through `core::arch::x86_64::__cpuid` rather than a hand-written `rbx` save, which the kernel's `cpuid` notes LLVM can defeat. acpiserver's `cpu` module decodes it; `osc` still keys on Intel. The module header now also records that on Zen `MWAIT` reaches only C1 (CPUID Fn0000_0005_EDX in PPR 55922 and 57896), so no deeper AMD FFH state exists, that Family 1Ah's second C1 sub-state has no documented hint, and that x86 stays on `_CST` because ACPI defines no x86 `_LPI` mechanism beyond Intel's context flags. The `idle_entered` metal row reads each CPU's deep idle periods across an idle second once the server's census is in the log, on the boot `acpi_tables_loaded` rides, and holds every CPU's kept states to the bench's. `acpi_tables_loaded`'s AMD expectation now names 0x415 handed over. `issues/the-amd-benchs-c3-is-withheld-for-want-of-a-coherence-statement.md` goes: its exit, the type-3 state handed over on Family 17h, is met. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed; the CPUID identity is named - Rebased onto main, which dropped `Counter::DeepIdleNanos` (#1084): `idle_entered` prints and its judge reads deep periods alone. - The `idle_entered` judge runs on the AMD bench only, against `AMD_KEPT_STATES`; the T14 has not run it and joins in a later change. Its doc says what the count shows: 0x415 requested by the chooser, not what the core entered. - BM_RLD is recorded beside BM_STS, in `cst.rs`'s header and the idle track: left as firmware set it, and spoken to only by PPR 55901 Vol. 5 for 19h M11h. - The `_LPI` paragraph states the one real gap, that ACPI defines the context-loss flags for Intel alone; the claimed lack of an x86 OS-initiated mechanism was no reason, since platform-coordinated mode needs none. - The Family 1Ah second-C1-sub-state sentence goes: no firmware is known to declare such a hint. - `toyos_abi::ProcessorId { vendor, signature }` names the pair `processor_id` returns. - `acpi_tables_on_metal` reads the census through `acpiserver_api::IDLE_CENSUS`; the osc test's two `intel`s are `on_intel` and `intel`. - The idle track marks its AMD exit-cost figures as 0x414's alone, to be replaced with 0x415's once the AMD's osbench has run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Response to review r1 (head 31db18c, rebased on main)
Checks at 31db18c: |
Review r2: head 31db18cThe branch is rebased onto 5870531. Main has since gained only #1088 (2a24fcf), which touches three issue files and none of this branch's files. No further rebase is needed for correctness. r1 blockers
Suggestions taken
All five are correct as written. I accept the reasons for declining S6 and S7 and do not reopen them. Still openThe track's AMD exit-cost figures must be rewritten from this run's AMD osbench, as the implementer committed. A regression there needs investigating before the architect's pending tradeoff is decided on it. I have no new findings on the 31db18c changes. LAND, on two conditions: the running AMD metal comes back green, and its osbench figures go into the idle track before merge. |
The AMD run at 31db18c read cpu8 at 0 deep periods across the idle second, and twelve CPUs at exactly 1. A period is counted when the CPU is back from it, after the interrupt that ended it was handled, and the read that closed the span is itself that interrupt: a CPU that waited deep through the whole second was counted by no read. The span now ends with a read that wakes every CPU, and the periods are those the next round counts, which the counters' contract issues at least 10 ms later and after its call began. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…il power-off The AMD bench's first run of `stick_survives_a_reset_under_load`, at #1089's 31db18c, lost the stick until an AC power-off. Its retry on the same image passed, and so did main at 5870531: 1 failure in 3, not shown to be #1089's. The recovered log's 7807 load lines are intact and the deadline fired on time, so the record carries the device's state across the reset as the open question, beside the T14's record of the same shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…designated `nvme_leaves_the_benchs_disk_alone` held DATA foreign on every boot, so a bench whose DATA ToyOS has designated reds on every testcases boot: the AMD bench's #1089 testcases boot mounted its volume. Its claim is now that nothing on the bench's disk is touched but its ToyOS DATA partition — every NVMe session on that partition alone — and that DATA is left alone while it is foreign, and formatted or mounted and served as bcachefs once it is designated, never stood in for by memory. `hostdisk::left_alone` answers which of the three DATA was; the QEMU twin, whose disk is never designated and whose every byte is read back, still requires it foreign. Re-judged with it: the AMD's #1089 testcases readback and the T14's #1074 diag3 readback pass. A copy of the AMD's with an NVMe session on the host's root partition reds, as does one whose DATA is said to be in memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… usbd's stop - The scratch-stick issue takes over #1089's record of the 11:48 loss: its evidence, the reset on time, and the T14's row history tallied from the rounds' readbacks (0 confirmed losses in 7; r5 unexplained). - The specification reading is limited to the 12:39 shape, cites tDisabledCount's two resets, and says no xHCI or USB signal recovers that device while a platform power transition is unmeasured. - A loss in a ToyOS cycle is the ToyOS reset's or the loader's warm reset after it; only the deadline arm against the reboot arm isolates the kernel's path. What one session yields is stated. - The scratch stick's model is an inference until the request records it. - The partitions track keeps its rule whole and names write:scratch as its exception. - scratch_written_through_a_reboot requires every usbd's exit code 0, the stop's port and controller resets finished; the first commit's "with the writes going on" was not observed in QEMU and is not claimed. - scratch_load takes a refused answer after the reboot is asked as the stop's; the duplicate-name guard keys on a job's binary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One AMD benchcase boot of #1089 at 31db18c, where every deep period requests 0x415: time.sleep_late.1ms p50 5.5 µs (0x414's 5.4 to 5.6), .10ms 52.4 µs (0x414's 32.6 to 33.3), wake.storm.drain.w4 64.0 µs and .w16 80.3 µs. The storms read below both earlier columns, but main's placement change lies between the boots and no same-base control was read, so they are not attributed to 0x415. Soundserver's worst IRQ lateness in the testcases boot is 0 to 228 µs over 6 windows, with no underrun. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Orchestrator: landing. Review r2 LAND's conditions are met. AMD metal: acpi_tables_loaded and the fixed idle_entered pass (metal-r3 testcases), osbench passes (benchcase), and the device-data rows pass. nvme_leaves_the_benchs_disk_alone's red was #1085's (since fixed on main). The usbload intermittent loss is recorded by #1094, not attributed here. The idle track's AMD exit-cost figures are rewritten with 0x415's. The wake-storm improvement is explicitly not attributed to 0x415 (no same-base control). |
Draft: rebased on main. Metal on the AMD bench is requested from head 31db18c and has not run yet.
Problem
acpiserver withheld every type-3 SystemIO
_CSTstate. ACPI 6.5 §8.1.4 makes OSPM keep the caches coherent in C3, on a multiprocessor by flushing them, and no AMD document says Zen hardware makes that unnecessary. So the AMD bench (Family 17h) idled no deeper than port 0x414, and its 0x415 was withheld (issues/the-amd-benchs-c3-is-withheld-for-want-of-a-coherence-statement.md).What changes
A rule per vendor and family (
system/acpiserver/src/cst.rs,coherent_through_c3):lib/userbound/src/idle.rs) still validates each entry. The kernel is unchanged.Source. The no-flush, no-ARB_DIS property comes from AMD's engineers' own code, not from an AMD document. Root's research order takes the vendor's engineers' code next after its documents. AMD narrowed the rule to Family 17h and later. The clean-room fact sheet is r1/facts.md. The repository cites only the vendor documents.
BM_STS is not read, and BM_RLD stays as firmware set it.
CPU identity.
toyos_abi::processor_is_intel()becomesprocessor_id() -> Option<ProcessorId>.ProcessorIdholds CPUID leaf 0's vendor string and leaf 1's EAX, read throughcore::arch::x86_64::__cpuid. The old hand-writtenrbxsave is gone; the kernel'scpuidnotes that LLVM can defeat that save.cpumodule decodes vendor and DisplayFamily by the SDM/APM rule, as the kernel'sIdentdoes.oscstill keys on Intel. The old function had no other consumer in the tree, the forks or~/.cargo/git/checkouts.Recorded in the module header:
MWAITreaches only C1. CPUID Fn0000_0005_EDX enumerates no deeper sub-state (PPR 55922, 57896), so there is no deeper AMD FFH state to support._LPIstays unread, because ToyOS claims no processor containers. The one x86-specific gap is that ACPI defines_LPI's context-loss flags for Intel alone, so an AMD state's 0 there has no defined meaning. AArch64's_LPIstays inissues/aarch64-cpus-idle-only-in-wfi.md.Records:
issues/the-amd-benchs-c3-is-withheld-for-want-of-a-coherence-statement.mdis deleted. Its exit, an AMD document for Family 17h or_LPIsupport, is not met. It is superseded: root's research order takes the vendor's engineers' code next after its documents, and that source holds the rule.Metal instrument.
idle_enteredrow, for the AMD bench only. The T14 has not run it and can join in a later PR. It rides the sametestcasesboot asacpi_tables_loaded, so it adds no boot.test_rs_idle_enteredwaits for acpiserver's idle census, then reads every CPU's deep-idle count on both sides of an idle second.kernel::sched::idle::choosenever returns 0x414.acpi_tables_loaded's AMD expectation becomesport 0x414 400 µs + port 0x415 350 µs; withheld: none.Checks
Evidence: r2 holds the rebased head. r1 holds the fact sheet and the mutation patches.
cargo run -- --ci hostcargo run -- --build-only>= 0x16The metal request covers three boots:
testcases:acpi_tables_loaded,idle_entered,usbd_serves_the_boot_stick,nvme_leaves_the_benchs_disk_alone,tone_beside_a_stick_writeandamdvi_translates_the_stick_controller.usbload:stick_survives_a_reset_under_load.benchcase:osbench, for the idle-exit cost.The control for the whole change is main, where
acpi_tables_loadedreads 0x415 withheld ×16.Risks
/log,tone_beside_a_stick_write's mebibyte beside HDA DMA, andstick_survives_a_reset_under_load's write under reset.nvme_leaves_the_benchs_disk_alone).--fat32-check.osbench_lanneeds the T14 as its peer, and the T14 is down.HygonGenuine, at any family. The fact sheet covers Hygon without naming a family. The string comes from the tree's existing fixtures, not from the fact sheet.🤖 Generated with Claude Code