Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ toyos-metal = { path = "tests/metal" }
toyos-quiesce = { path = "lib/quiesce" }
# The parity table `crypto_parity` prints and the judge reads, under one rule.
toyos-parity = { path = "lib/parity" }
# The package energy counter's decode, so the `counters` judge's reading of
# it is osbench's rule and not a second one.
osbench-rules = { path = "tests/guest/osbench/rules" }

[patch.crates-io]
loom = { git = "https://github.com/ToyOSOrg/loom", branch = "toyos" }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
status: open
kind: tooling
opened: 2026-10-31
---

# No filter word takes the counters metal row without counters_silent

`tests/common/metal.rs`'s `select` takes every row and shared member whose
name contains a filter word. Every substring of `counters`, the row's whole
name, is also part of the shared member `counters_silent`, which rides
`shared-debug`. An offline run (`--metal --metal-readback <dir> counters`)
judges only once every selected boot has a readback. So judging the
`counters` row over a `testcases` readback alone stages `shared-debug`
instead, and nothing is judged.

#1100's review had to drop `counters_silent` from the selection with a
temporary patch to judge round 1's T14 readback (evidence pr-1100 r8,
`judge-select.patch`). Any row whose name is part of another row's or
member's name has the same problem.

**Exit**: a filter word can select one row alone, for example an exact-name
form, and the `counters` row is judged offline over a `testcases` readback
with no patch.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ its groups:
sides' IDs match or either side's changed across it;
- lateness past a 1 ms timer: `time.timer_1ms.late`;
- NVMe reads, read-only: `nvme.read.*`;
- an idle minute's package energy: `energy.idle_60s.package`;
- the package's power, idle and under defined loads, with its C-state
residency where Intel documents it: `energy.*`, run only by name, a ToyOS
boot of its own (`osbench_energy`) and as root under Linux;
- the machine's PCI, USB, NVMe and cpuidle identity: `identity`, with no
serial number or network identifier;
- TCP connect, round trip and throughput between the two benches:
Expand Down Expand Up @@ -68,12 +70,13 @@ comparison until it can:
- **NVMe reads**: a program reaches a disk's blocks only through a grant the
supervisor mints for a file server's role or the idle slot, and the bench's
NVMe holds another system.
- **Package energy and temperature**: no counter carries either
- **Package temperature**: no counter carries it
(`toyos_abi::counters::Counter`), so the ToyOS crunch runs its one-thread
phase alone and reports every all-core row `unmeasured`, with nothing to
stop it at. The kernel's sampler of `IA32_PACKAGE_THERM_STATUS`,
`MSR_TEMPERATURE_TARGET` and `MSR_PKG_ENERGY_STATUS` in
`issues/the-kernel-owns-cpu-performance-state.md` is what closes both. The
stop it at. The sampler's `IA32_PACKAGE_THERM_STATUS` and
`MSR_TEMPERATURE_TARGET` in
`issues/the-kernel-owns-cpu-performance-state.md` is what closes it; the
package's energy is a counter now (`Counter::PackageEnergy`). The
first ToyOS crunch on the T14 held 3,788 MHz all-core where Linux fell to
1.7-1.9 GHz, which
`issues/the-t14s-thermal-modes-do-not-move-its-package-power-limits.md`
Expand Down
35 changes: 35 additions & 0 deletions issues/the-amd-benchs-idle-package-draws-15-percent-over-linuxs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
status: assigned
kind: defect
opened: 2026-10-31
---

# The AMD bench's idle package draws 15 % over Linux's

Held by the power task that follows #1100.

On the AMD bench (Family 17h Model 60h), `osbench_energy` resolves the idle
package against ToyOS. Over four runs a side, every ToyOS run lies above
every Linux run (p = 0.029):

- The median of the runs' per-second p50s is 1688 mW against 1472 mW.
- The median of the runs' means is 1688 mW against 1501 mW.

These runs predate the matched read. In them, Linux read only the package
each second, while ToyOS's read kicked every CPU. That asymmetry adds to
ToyOS's figure in exactly this row, by an amount not yet measured; a run of
the matched read settles it.

The cores are not the consumer. Their own energy counters give ToyOS 0-1 mW
over the idle minute across the four runs, against Linux's 11-20 mW, so the
gap of about 200 mW lies outside the cores: in the SoC, memory, I/O or
devices. Its 10 ms sleeper,
1700-1710 against 1391-1705 mW, is not resolved. Work may not be slowed to
close the gap.

The bench documents no package C-state residency (PPR 55922), so ToyOS's
rows cannot show which state the package reaches.

**Exit**: the AMD bench's `energy.idle.package` row is unresolved against
Linux's in `osbench_energy`, or the remaining gap is a cause named and
recorded at its owner.
15 changes: 10 additions & 5 deletions issues/the-kernel-owns-cpu-performance-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ performance bias, on every CPU that has all of them
writing that register whole. *Exit*: the ruling, and the bit declared or
recorded as firmware's.
- **The sampler**: a program that reads the envelope every 60 s and at a
span's start and end, with package power from `MSR_PKG_ENERGY_STATUS` and
temperature from `IA32_PACKAGE_THERM_STATUS` and `MSR_TEMPERATURE_TARGET`,
the bar's validity conditions. The energy counter is a side channel
(CVE-2020-8694), under `Rights::TRACE` like the rest. *Exit*: one valid
span on the T14.
span's start and end, with package power and temperature from
`IA32_PACKAGE_THERM_STATUS` and `MSR_TEMPERATURE_TARGET`, the bar's
validity conditions. The package's energy is read already, under
`Rights::TRACE` as a side channel (CVE-2020-8694): `Counter::PackageEnergy`
and its unit, its C2 to C7 residency, AMD's core energy, all on the boot
processor for its package but the last (`kernel/pure/cpu.rs`). A machine of
more than one package counts only the boot processor's; Intel's PP0 and PP1
planes, and the T14's PC8 to PC10, which SDM Vol. 4 does not give Tiger
Lake, are unread. Temperature is still to build. *Exit*: one valid span on
the T14.

Not covered: hybrid Intel and AMD CPPC,
`issues/the-perf-state-declaration-refuses-hybrid-intel-and-amd-cppc.md`;
Expand Down
54 changes: 54 additions & 0 deletions issues/the-t14s-idle-package-stays-in-pc2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
status: assigned
kind: defect
opened: 2026-10-31
---

# The T14's idle package stays in PC2

Held by the power task that follows #1100.

On the T14, `osbench_energy` gives an idle package of 7137 mW under ToyOS
against 1648 mW under Linux, 4.3×: the median, over four runs a side, of
each run's per-second p50. The medians of the runs' means are 8272 against
2167 mW, 3.8×. Under a 10 ms sleeper it is 2863 against
1219 mW. ToyOS's package spends 994 ‰ of the idle minute in PC2 and none
deeper, against Linux's 102 ‰ in PC2. Every ToyOS core waits in C7. Power
belongs in the idle states and in device power management: none of this gap
may be closed by slowing work. The AMD bench's smaller gap is
`issues/the-amd-benchs-idle-package-draws-15-percent-over-linuxs.md`.

Intel's datasheet (631121 Vol. 1 §3.2.5, Table 3-5) holds the package in PC2
when its cores are in C6 or deeper and its graphics in RC6, but an LTR, a
near timer or a device memory access refuses any deeper state. Table 3-8
caps the package at PC3 while a processor PCIe link is in L0, and at PC8
until it reaches L1.2.

Ruled out, by measurement:

- **The driverless functions.** Parking all nine in D3hot changed nothing
under ToyOS, and unbinding them under Linux cost Linux nothing.
- **The deepest core state.** Holding every core at an 800 µs wake latency
is inside the idle seconds' scatter.
- **The cores and graphics as consumers.** PP0 is about 0.3 W and PP1 under
0.03 W, so about 6.8 W lies outside both planes. On Linux the equivalent
is about 1.5 W.
- **The I219.** Parking it under ToyOS, or unbinding it under Linux,
changed nothing.

The two causes, each reproduced on Linux by putting ToyOS's state there:

- **The NVMe without APST** (`issues/diskserver-drives-nvme-apst.md`).
- With APST off, Linux's idle rises from 1622 to 5127 mW (per-second p50), and its package goes no deeper than PC3.
- The rise is large when nothing wakes and smaller under a 10 ms sleeper, which is ToyOS's own shape.
- The link's ASPM, L1 substates and LTR are as firmware left them, the same on both systems.
- **The display as the GOP left it.**
- With no graphics driver (`nomodeset`), Linux idles at 2796 mW and stays in PC2 976 ‰. Its 10 ms sleeper draws 2864 mW, against ToyOS's 2831.
- Under ToyOS, stopping the scan-out's plane fetches (Intel's PLANE_CTL Plane Enable) releases PC2 for PC3.
- Linux's driver reaches PC8 with the panel lit. The fix is ToyOS's own display programming, with the panel lit; turning it off is not the fix. Per Intel's Tiger Lake display reference (Vol. 12), that means watermarks, SAGV, DMC firmware for DC5/DC6, and PSR for PC9/PC10. A driver for it is an owner decision.

APST is the larger share and comes first.

**Exit**: the T14's `energy.idle.package` row is unresolved against Linux's
in `osbench_energy`, or the remaining gap is a cause named and recorded at its
owner.
Loading