diff options
| author | user <user@clank> | 2026-10-01 15:28:42 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-10-01 15:28:42 +0200 |
| commit | 7833f50cffb5a54858fdfb755f95c3d5ccbc66ea (patch) | |
| tree | 4d31c5c3ae51d4516cb2ba7e444ff416aafbd3e0 | |
| parent | type the host request for the remaining components: every module now has one (diff) | |
| download | amd-psp-re-7833f50cffb5a54858fdfb755f95c3d5ccbc66ea.tar.gz amd-psp-re-7833f50cffb5a54858fdfb755f95c3d5ccbc66ea.tar.xz amd-psp-re-7833f50cffb5a54858fdfb755f95c3d5ccbc66ea.zip | |
record all sixteen components in the struct audit, graded by how their size is bounded
The file documented three structures while fifteen existed, which is exactly the kind of stale
reference this tree audits for elsewhere. It now covers every component, grouped by the strength
of the evidence for its size rather than listing them as equally solid: eight close against a
floor the firmware enforces, rap closes on an internal zero-fill, four have only a maximum
observed extent, and tmz needs nothing because its entry is 'return 0'.
Also records the refined ack-word negative (RAP at +0x08 and CSU at +0x04 write the same
'command | 0x80000000' that was first reported as unique to POWERPLAY at +0x04) and the two
inherited prototypes that contradict their call sites.
| -rw-r--r-- | fw/AUDIT-TA-STRUCTS.md | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/fw/AUDIT-TA-STRUCTS.md b/fw/AUDIT-TA-STRUCTS.md index c9b0f0f..fc79f82 100644 --- a/fw/AUDIT-TA-STRUCTS.md +++ b/fw/AUDIT-TA-STRUCTS.md @@ -1,6 +1,9 @@ # Hand-derived TA structures, and the evidence for each -**Status: in progress.** One structure derived and verified (`xgmi_req`). This file records how +**Status: every module covered for its host request; per-function typing still open.** +15 of 16 components have a derived request structure; TMZ needs none (its invoke entry is +`return 0`). See the summary table below for which are closed against an enforced size and +which are not. This file records how each one was obtained so a later reader can check it rather than trust it. Only seven structs existed in this tree before this work (`fw/ta_ida.py`: five GCP, two @@ -218,6 +221,75 @@ The rate is still low and the reason is structural: ASD alone is 6763 of the 100 and has no recorded type information at all, so no amount of work on the small components moves the global percentage much. ASD is where the remaining value is. + +================================================================================ + +## Summary: all 16 components + +A structure is only as good as its bound. These four groups are deliberately distinguished, +because a size that the firmware itself checks is evidence, and a size chosen to cover the +furthest offset seen is a convention. + +### Closed against a size the firmware enforces (8) + +| component | struct | size | the floor, in the firmware's own words | +|---|---|---|---| +| xgmi | `xgmi_req` | `0xC20` | `a4[1] < 0xC20` refused; zero-fill and copy use the same size | +| hdcp | `hdcp_req` | `0x2818` | dispatches only when `params[1] > 0x2817` | +| oc | `oc_req` | `0x1C` | `a4[1] < 0x1C` refused | +| wspe | `wspe_req` | `0x14` | `a4[1] < 0x14` refused | +| csu | `csu_req` | `0x24` | size below `0x24` refused | +| dtm | `dtm_req` | `0x50` | `*(a4 + 4) < 0x50` refused | +| merit | `merit_req` | `0x2024` | `a4[1] >= 0x2024` required | +| opm | `opm_req` | `0x3D54` | `*(a4 + 4) < 0x3D54` refused | + +`opm_req`'s floor independently reproduces the `params_size >= 0x3D54` figure recorded in +`AUDIT-NEW-TAS-RE.md`, derived from the entry rather than taken from that note. + +### Bounded by internal evidence rather than a size check (1) + +| component | struct | size | why it still closes | +|---|---|---|---| +| rap | `rap_req` | `0x34` | the entry zero-fills exactly 24 bytes at `+0x18` and then stores at `+0x30`, so the layout closes without guesswork | + +### Size is a maximum observed, NOT a bound (4) + +| component | struct | size | what is actually known | +|---|---|---|---| +| asd | `asd_req` | `0x18` | smallest 4-aligned size covering every observed access (max is a byte at `+0x14`) | +| powerplay | `powerplay_req` | `0x84` | header hardware-corroborated; params extent is the furthest observed access | +| auc | `auc_req` | `0x3BC` | ctx bounded exactly at `+0x10..+0x298`; params extent only observed | +| fp | `fp_req` | `0x294` | interior pointers scale off a `_DWORD *`: `v4 + 3` is `+0x0C`, `v4 + 68` is `+0x110` | + +### Pre-existing, and needing nothing (3) + +`gcp` (five structures, proven in `AUDIT-NEW-TAS-RE.md`), `merit`'s slot/table pair, and `tmz`, +whose invoke entry is `return 0` -- confirming the "TMZ is a stub" note from the entry itself. + +### The ack-word convention, and a negative that needed refining + +POWERPLAY writes `command | 0x80000000` back at `+0x04`, and the host-page dump in +`AUDIT-NEW-TAS-RE.md` (`dw0-3: 0x4 0x80000004 0x415 0`) corroborates that on hardware. It +looked like a shared TA ABI worth hoisting into one declaration for all sixteen components, and +a scan of twelve entries for an ack at `+4` found none, so it was recorded as POWERPLAY-only. + +That was too strong. RAP writes the same ack at `+0x08` and CSU at `+0x04`. The convention is +real and shared; only its OFFSET is component-specific. Hoisting a single header would still +have been wrong, but for a different reason than first stated. + +### Inherited prototypes that misdescribe their call sites + +Applying a `fw/pseudo` prototype by name can assert a type the call site contradicts. Two +confirmed cases, both left recorded rather than quietly applied: + +* OC: `oc_cmd01(ctx: v5 + 3, params: (struct ta_params *)7)` -- the second argument is the + literal `7`. +* CSU: `csu_cmdNN(ctx: *a4, params: v5)` where `v5` is `a4[1]`, the declared **size**, an + integer rather than a pointer. + +In both the cast in the decompiled output is the tell. A prototype should be checked against +what its call sites pass before being applied; that check is not yet implemented. + ================================================================================ ## Not yet derived |
