Repository navigation
tests: cover the CTRR L3 split, SPTM-virt cpu-ids past 31 and the T6050 handoff bounds - #473
Conversation
…50 handoff bounds Three merged changes had no test in the tree. Each gets a host test that builds the code unchanged, with the registers, the ADT and the device tree as stand-ins: - test_mmu_ctrr_l3.py (#411): the page-table builder of memory.c and ctxr_range() run on host memory with 16K pages. An L2 block whose output range holds an armed CTRR_C or CTRR_D is built from L3 pages, in every alias of the RAM, and no other block is. The ranges are read once, and not at all with unlocked Apple system registers, off EL2 or for an unmapping; a register that faults under the guard changes nothing. Seeded layouts are compared with a model of the mapping rule. - test_sptm_virt_cpu_ids.py (#407): the S2R trace's walk of /cpus, the stop-mode and go-mode core masks and the DCC transport's per-core cookie and errno, each driven with cpu-ids on both sides of 32, up to MAX_CPUS - 1. - test_t6050_handoff_bounds.py (#408): a panel-less board through dt_set_display_handoff(), and the panel path's ADT checks. A boot framebuffer that starts at or past the end of /vram, and a bandwidth scratch in a PMC metadata block of under 4 bytes, are refused and the device tree is left as it was; the edges on the allowed side are still handed off. Seeded cases are compared with the rule in whole numbers, which cannot wrap. Each test takes another source through an environment variable (AURA_MMU_SOURCE, AURA_SPTM_SOURCE, AURA_T6050_SOURCE), so the same file can be run against a changed copy as a negative control. No production code changes. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Review at 1b414c5. Test-only change, no production code touched. All 188 new cases pass locally with gcc and clang, and
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR review at 1b414c58c6787531a7b8350de3d3e98b263e8b66 (base main).
Assessment
- 0 blockers across §1–§6. Test-only PR (zero production code changes) adding 188 host cases across three pytest suites:
tests/python/test_mmu_ctrr_l3.py(#411): compilessrc/memory.candsrc/ctxr_exec.cunchanged under ASan+UBSan, verifying CTRR_C/CTRR_D L3 splitting by output address across aliases, guard-fault handling, table-leak accounting (lost == 0), and 24 seeded layouts against an independent Python model.tests/python/test_sptm_virt_cpu_ids.py(#407): compilessptm_virt_s2r_soc.c,sptm_virt_s2r.c, andsptm_virt_ctl.cunchanged, exercisingcpu-idvalues across the 32-bit boundary (0..63, 30-core Ultra layout up to 34), 64-bit stop/go core masks, PMU crumbs, and per-core DCC cookie/errno isolation.tests/python/test_t6050_handoff_bounds.py(#408):#include "kboot_display_handoff.c"unchanged (with Mach-O section adaptation on macOS, already green onmacos-15andmacos-26), covering headless and panel/vramframebuffer bounds (including top-of-u64-space wrap cases) and< 4-byte PMC metadata scratch bounds across explicit edges and 216 seeded cases.
- Negative controls: 104/105 single-edit mutants killed (1 verified equivalent), plus verified compatibility against open T6050 PRs (
#471,#439,#282).
CI Status (Withholding APPROVE)
- 14/16 checks are
SUCCESS(includingPytest (ubuntu-latest + gcc),Pytest (macos-15 + llvm-brew),Pytest (macos-26 + llvm-brew),Pytest (ubuntu-24.04-arm, native start.S),format-check,build,policy,selftest) + 1 skipped duplicateselftest. - 2 checks still running:
stage1-size / fedora(IN_PROGRESS) andtest / Pytest (ubuntu-latest + llvm)(IN_PROGRESS). - Posting
COMMENT(withholdingAPPROVE) solely until those 2 remaining CI checks finish green.
Non-blocking Note
- Echoing the optional note already raised in comments: adding a
disp0reg[4]size< 4case int6050_check_adt()would also cover the pre-existingt6050.pmc_size < 4guard in a follow-up (or here if convenient).
Checklist Summary
- §1 No model gating: Pass (test-only).
- §2 Production-ready, no hacks: Pass (test-only;
AURA_*_SOURCEenv vars are test-harness mutation hooks only). - §3 Safety: Pass (test-only, synthetic fixtures).
- §4 Clean-room & attribution: Pass (single commit
1b414c58c678, human author/committerRyan Murray <ryan@aurorasilicon.org>, humanSigned-off-by:, zero AI commit trailers;Assisted-by:in PR body; no Apple code/tuning values). - §5 Evidence: Pass (test-only; 188 new cases + 104/105 mutants killed across gcc/clang; waiting on final 2 CI jobs).
- §6 Naming: Pass.
Assisted-by: LLM (Gemini 4 Neon)
DjDeveloperr
left a comment
There was a problem hiding this comment.
All remaining CI checks (fedora, Pytest (ubuntu-latest + llvm)) have now passed (17/17 green) at 1b414c58c6787531a7b8350de3d3e98b263e8b66 with 0 checklist blockers. Approving and merging.
Assisted-by: LLM (Gemini 4 Neon)
Problem
Three merged changes have no test in the tree, so a later edit can undo them without CI noticing:
/vram, where the bounds checks wrapped.#471, #439 and #282 are open and rework the same T6050 checks, so #408's guards are the ones most likely to move soon.
Change
Three host tests, no production code. Each builds the source unchanged and replaces only what it touches (registers, ADT, device tree, tables):
tests/python/test_mmu_ctrr_l3.py: the page-table builder ofmemory.cwithctxr_range(), on host memory with 16K pages. The program prints the finished tables; the tests check which blocks became L3 pages, in every alias of the RAM, and that the registers are read once and only when they can be.tests/python/test_sptm_virt_cpu_ids.py: the S2R trace's/cpuswalk, the stop-mode and go-mode core masks, and the DCC cookie and errno, with cpu-ids on both sides of 32.tests/python/test_t6050_handoff_bounds.py: a panel-less board throughdt_set_display_handoff()and the panel path'st6050_check_adt(). The edges of each check are explicit cases; the device tree afterwards says whether anything was handed off.Each file takes another source through an environment variable, which is how the negative controls below were run.
Testing
All local on x86 Linux, with gcc 16 and clang 22, pytest 9.1.1 and
requirements.txt:USE_CLANG=1) 1075 passed, 28 skipped; no failures. The three new files are 188 cases.make format-checkwith clang-format 20.1.8: clean (no C file changes).kboot_display_handoff.cof kboot: t6050: check external engine placement before handing it over #471 and kboot: T6050: hand off a prewired internal panel and the combo PHY ports the tree takes #282, and in a checkout of kboot: T6050: 27.3 beta 1 display handoff, and external engines beside a kernel-adopted panel #439.Still to run
u64types, the Mach-O section name for.init.t6050).What each test checks
test_mmu_ctrr_l3.py (#411), 67 cases
test_sptm_virt_cpu_ids.py (#407), 23 cases
s2r_trace_cpus()takes 30 cores whose cpu-ids reach 34, and any single cpu-id from 0 to 63; it refuses 64 and above, a repeated cpu-id on either side of 32, a core with no cpu-id and a tree with no core.test_t6050_handoff_bounds.py (#408), 98 cases
/vram, its first page, last page, last byte and an inside range are taken; a start at the end of/vramor past it (any size, up to the top of the address space), a start below it, and an end past it are refused. Also with/vramending at the top of the address space.size - 4are taken;size - 3and above are refused; a block of 4 bytes takes offset 0 only; blocks of 0 to 3 bytes take nothing, for any offset; a device tree PMC node of another size than the ADT's block is refused./chosensays refused, and no framebuffer reservation is added. A handoff enables the engine, its mailbox, both DARTs, the PMC node and the subsystem, and reserves/vram.Negative controls
A changed copy is "killed" when the test file fails against it. Every row was run with gcc and clang, with the same result.
memory.cfrom before #411, and 36 one-edit mutants ofmmu_holds_ctrr(),mmu_ctrr_ranges()and the split inmmu_map()BIT(cpu & 31), 32 slots, clamps, limits)The equivalent one drops
split_ctrr &&in front ofmmu_holds_ctrr()in the loop. There,split_ctrrfalse meanssplit_rois true, so the target is valid andmmu_ctrr_ranges()already ran and found nothing:mmu_holds_ctrr()is false either way.Assisted-by: LLM (Claude:Opus 5.5), LLM (Claude:Fable 5.2)