# Strategy: fix the instrument problem, then spend the reliability on observability ## The diagnosis this comes from One session produced roughly ten findings and roughly ten **instrument failures**. Every wrong conclusion in it came from a broken measurement, not from broken reasoning: | failure | shape | | --- | --- | | ring status "flat oracle" | wrong readback address (firmware writes the ALIAS copy) | | three truncated traces | hook range ended exactly at the address that mattered | | `0x2161C` positive control | taken from a **different firmware build** | | MOVW/opcode sweeps | detector could not find a known positive | | VCN LMA window | echoed `byteswap(addr)` and looked like data | | `ifwi_parse_model` "fix" | plausible, measured, made agreement *worse* | | Route C consumer scan | blind to base+offset addressing | | injected-`ldr` control | failed for an unrelated reason and **retracted a correct result** | | `rv=0` reinterpretation | a failed probe re-read until it looked positive | Two things follow. First, ideas are not the bottleneck; **trustworthy measurement is**. Second, controls invented alongside a measurement tend to share its blind spot — several of the controls above were themselves wrong. ## Prong 1 — make controls structural (done) `pspemu/oracle.py` provides `Probe`, which binds a question to the two controls that make its answer meaningful: positive : something that MUST be observed, else the instrument is blind negative : something that MUST NOT be observed, else it is indiscriminate measure : the actual question `Result.get()` **raises** unless both controls held, so a meaningless number cannot be read by accident; `Probe.report()` prints the controls first and exits non-zero, matching the standing rule that a harness says RESULT NOT REPORTABLE rather than reporting a vacuous clean run. The negative control is the half usually skipped, and it is the half that catches "my detector fires on everything" — the byteswap echo and the constant-returning MMIO window. Unit-tested against the exact failure shapes above (`tests/test_oracle.py`) and retrofitted onto `harness/routec_window_watch.py`, which keeps its result. ## Prong 2 — attack observability through the CCP Three open questions are all blocked on the same missing capability: **no read path into PSP-internal space.** * Route C: is its window registers or RAM? (decides the impact rating) * VCN type-49: do the writes land? (decides whether it is a capability) * TMR: where exactly is the protected boundary? The CCP is the lever. It is a DMA engine that firmware drives, and AMD's own `ccp.h` (now in `pspemu/ccp.py` as `CMD_ERROR_NAMES`) shows it reports 0x13 IDMA_PAGE_FAULT 0x14 IDMA_PROTECTION_FAULT 0x23 ODMA_PAGE_FAULT 0x24 ODMA_PROTECTION_FAULT 0x0c ADR_MEM_SEL_CONFLICT 0x0a ILLEGAL_BUFFER_LENGTH So CCP status is a **classification oracle**: aim a descriptor at an address and the status distinguishes *mapped* from *unmapped* from *protected*, without reading a single byte of data. That is weaker than a disclosure primitive and sufficient for all three questions above, because each is a question about memory *properties*, not contents. Why this is more promising than what has been tried: every previous attempt needed a channel that returns **data**, and none exists. This needs only a channel that returns **status**, and that one demonstrably works — CCP statuses already drive `harness/ccp_selftest.py` and the RSA/SHA paths. ### First steps 1. Establish the oracle in the emulator, as a `Probe`: aim a CCP PASSTHRU at a known-mapped address (positive control), a known-unmapped one (must differ), and confirm the two statuses are distinguishable *per address*, not per block. Only then is it an instrument. 2. Replay the same three-way classification against silicon via a firmware-driven CCP path, to confirm the emulator's status semantics match. 3. Apply it: classify Route C's 415 dwords, the VCN window, and the TMR edge. Step 1 is cheap and, if the statuses do not separate, the strategy dies there rather than after another night of probing — which is the point. --- # Step 1 executed: the emulator could not have served as the oracle Ran the falsifiable first step — does CCP status separate reachable from unreachable memory, per address? **First attempt reported a clean "IDENTICAL (no oracle)"** with both controls passing. That answer was wrong, and the reason is instructive: the positive control asked only whether a *status was readable*, not whether any *work happened*. Strengthening it to "the readable case must actually execute a descriptor and copy the bytes" exposed the truth: readable source status=0x00 descriptors executed=1 dst=a5a5a5a5... UNMAPPED source status=0x00 descriptors executed=0 dst=00000000 The unreachable job **executed zero descriptors and still reported success**. `run_queue` aborted mid-drain on the access exception, so the descriptor was never recorded and the status was never set — a job that never ran, reported as status 0. Exactly the silent-lie shape this tree forbids, sitting inside our own device model. Note this was a *weak positive control* producing a confident negative result: the same failure family as the rest of the tally above, caught only because the strategy's first step was designed to be checked. ## Fixed by modelling, not by patching `CCPAccessFault` now carries the AMD-documented codes and `run_queue` reports them in the queue status instead of dropping the job: readable src, writable dst status=0x00 NONE UNMAPPED source status=0x13 IDMA_PAGE_FAULT UNMAPPED destination status=0x23 ODMA_PAGE_FAULT Controls: the reachable case must execute and report 0 (positive); source and destination faults must not be conflated (negative). Both pass, and the suite is green. **Protection faults (0x14/0x24) are deliberately NOT emitted.** Separating "absent" from "present but protected" needs a memory-protection model this emulator does not have, and inventing one would manufacture the very oracle the strategy is trying to obtain. ## What this changes The oracle exists and separates — but only along the axis the emulator actually knows (mapped vs unmapped). The interesting axis for Route C, VCN and TMR is *protected vs unprotected*, and that axis can only come from silicon, where the protection hardware is real. So step 2 is now the load-bearing one, and it is sharper than before: drive a firmware CCP path on the card against (a) plainly readable memory, (b) absent memory, (c) a TMR-protected address, and see whether silicon returns 0x13 and 0x14 as distinct codes. If it does, the classification oracle is real and all three blocked questions become answerable. If protection reads back as a page fault, the axis collapses and the strategy should be abandoned rather than elaborated. --- # Step 2 attempted on silicon: the absent-address arm is DESTRUCTIVE `LOAD_TA` is the host-reachable lever: the host chooses `app_phy_addr`, and the PSP reads and verifies that buffer with the CCP. So the plan was to aim it at a real image (positive control), two different readable-but-invalid buffers (negative control), and an address beyond the end of VRAM. **The absent-address probe wedged the card.** am usb:2-6: IH (...) client=SOC21_IH_CLIENTID_VMC src=(0) ring=153 vmid=0(1) ctx=[0x5fd000, 0x40, 0x0, 0x0] x hundreds A flood of VMC (memory-controller) VM-fault interrupts, then the familiar wedge: `SMU msg 0x2 timeout`, `mode1_reset` failing, `AMD:0 does not exist (0 devices available)`. Recovered with a cold ATX cycle (`atx_power.py cycle 25`); PSP heartbeat confirmed advancing afterwards. No status was returned for any arm, because the interrupt flood swamped both the console and the run. So **step 2 produced no classification data**. ## What was learned anyway * **A new hardware hazard, now recorded in `CONSTRAINTS.md`.** Pointing `LOAD_TA` at an address beyond VRAM is not a clean error: it generates a VM fault storm that takes out the SMU and requires a power cycle. This is the same wedge signature as the earlier broad SMN sweep, reached by a completely different route. * **The fault is observable in principle.** The IH ring reports VMC faults with a context payload, so "the PSP touched something it could not" *does* surface to the host — just not through the ring status, and not survivably in this form. ## Consequence for the strategy The classification oracle cannot be built on absent addresses through this path. Two options remain, and the cheaper one should be tried first: 1. **Readable-but-protected only.** Drop the absent arm entirely and test only `readable-valid` vs `readable-invalid` vs `TMR-protected`. A protected read is answered by protection hardware rather than by an unmapped-page fault, so it may return a status instead of a fault storm. This keeps the interesting axis and discards the destructive one. 2. **Consume the IH fault stream deliberately**, with a single probe and the fault handler drained/masked so one fault does not become a storm. Higher risk, and it should not be attempted without a way to bound the flood. Neither should run until the flood mitigation is understood, because each attempt currently costs a power cycle.