Repository navigation
Conversation
|
Read at 41aed6c. The row is right for the J813 (window, controller and part match its ADT and the probe), and the KUnit case for its status registers is a good addition. The table it extends is the problem, though. I wouldn't hold this one-line J813 addition hostage to that rework, since the write path is safety-relevant and conservative as it is. But please open the follow-up (or say in the commit message why the board key is needed beyond the DT window and the JEDEC check), so the list stops growing. Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review at 41aed6cb3155 against the pre-PR checklist.
What checks out
- Code & hardware values (§3): The J813 table row (
apple,t8142-qspi,apple,j813,0x3a5118000,0x700000,0x100000,W25Q64,bp_ok = 0) matchest8142-j813-peripherals.dtsiandt8142-j813.dts. The KUnit case forsr1=00 sr2=02 sr3=60(bp_ok = 0) and the 240-combination matrix update intools/asahi/qspi-nvram-tests.pyare accurate. - Clean-room & attribution (§4): Clean. Human author/committer +
Signed-off-by:only, no AI trailers in the commit,Assisted-by:present in the PR body. - Naming (§6) & CI: Clean;
host-testspassed on41aed6cb3155.
Blocker — §1 (No model gating / per-board table)
apple_qspi_boards[] is a per-board allowlist keyed on of_machine_is_compatible("apple,j813") with hardcoded controller base, NVRAM window, and JEDEC ID — all values the machine already provides via DT (qspi node + nvram fixed-partition already parsed by apple_qspi_nvram_window()) and runtime NOR probing (0x9f JEDEC ID + status registers already checked on every write in apple_qspi_nvram_modify()). As the PR body itself notes, this leaves J815 (which shares t8142-j813-peripherals.dtsi) and future Macs excluded until manually listed.
Per pre-PR checklist §1 (hard rule), please resolve this via one of two paths before merge:
- (Preferred) Replace the per-board table with generic DT
nvram-partition + known-safe probed JEDEC/status qualification (keeping any board-specificbp_okexception minimal/DT-driven), so every Mac with a valid NVRAM DT node and verified flash part works without per-board code; or - If boot-NOR defense-in-depth makes a board-keyed allowlist genuinely unavoidable for now, explicitly explain why in the commit message (as §1 requires whenever a gate is unavoidable) and file/link the follow-up issue to retire
apple_qspi_boards[](echoing@RyanTheTide's request).
§5 Evidence note (non-blocking once §1 is settled)
The J813 boot run used a tree carrying out-of-tree S2R/USB4 patches rather than clean integration/aurora + this PR, and omitted the explicit §5 regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors). Please include those counts when updating.
Assisted-by: LLM (Gemini 4 Neon)
41aed6c to
36e75f7
Compare
|
Thanks to you both. I took Dj's second path:
Assisted-by: LLM (Claude:Opus 5.5) |
|
Thanks. The follow-up is the right destination, and #2815 is where the board key goes away. Since this PR still adds a board row, I'd rather land #2815 first and rebase this onto it, so the J813 is admitted by its Assisted-by: LLM (Claude:Opus 5.5) |
|
Agreed, #2815 first. It is #2817 (draft until the J813 row runs): no table, writes admitted by the node's Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Re-review against the pre-PR checklist (§1–§6) at verified live head 36e75f779bc135d725e0393274082cdc0b742c74 (diff 41aed6cb..36e75f77): holding CHANGES_REQUESTED — not ready for MERGETRAIN-LINUX4 yet.
Diff 41aed6cb..36e75f77
- Code: 0 lines changed (code, KUnit case, and
tools/asahi/qspi-nvram-tests.pymatrix are identical to41aed6cb). - Commit message: Updated to document the boot-NOR defense-in-depth rationale for keeping the board key temporarily and links follow-up issue
aurora-silicon/linux#2815(now implemented as Draft PR#2817).
Checklist Status (§1–§6 & CI)
- §1 (No model gating): You satisfied Path 2 of my prior review in the commit message and opened
#2815/ Draft#2817. However, as you and@RyanTheTideagreed in the comments above, the right landing order is#2817first, then rebasing this PR onto#2817to drop the newapple_qspi_boards[]entry and retain only the J813 status-register KUnit test. KeepingCHANGES_REQUESTEDactive so this table-adding head is not merged ahead of#2817. - §2 / §3 / §4 / §6: Clean. Hardware parameters (
apple,t8142-qspi,apple,j813,0x3a5118000,0x700000,0x100000,W25Q64,bp_ok = 0) match the J813 DT/ADT; commit36e75f77carries human identity (Thomas Glanzmann) + humanSigned-off-by:with zero AI trailers; PR body includesAssisted-by:. - CI:
host-testsPASS on36e75f779bc135d725e0393274082cdc0b742c74. - §5 (Hardware evidence — still owed): The clean
integration/aurora+ PR J813 boot/test run (aurora-blessset/readback/clear without out-of-tree S2R/USB4 patches) and explicit regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors) are still pending once the J813 reinstall finishes (or via the combined cleanintegration/aurora+#2817+ rebased#2772row you proposed).
Next Steps to APPROVE
- Land
#2817(#2815) and rebase#2772onto it (keeping the J813 status-register KUnit case, with no newapple_qspi_boards[]row) — or mark#2772Draft in the meantime. - Post the clean
integration/auroraJ813aurora-blessverification run with explicit §5 regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors).
Assisted-by: LLM (Gemini 4 Neon)
|
Marked as draft until #2817 lands. I'll then rebase this onto it (the J813 status-register KUnit case only, no table row) and post the clean integration/aurora J813 aurora-bless run with the AVC, failed-unit and new-kernel-error counts. Assisted-by: LLM (Claude:Opus 5.5) |
36e75f7 to
f14ad50
Compare
|
Rebased onto #2817 as agreed: the table row is gone, and only the J813 status-register KUnit case remains (f14ad50). The J813 aurora-bless row ran on clean integration/aurora + #2817: set, read back and clear passed, and the NOR outside the window was unchanged. Counts: 0 AVC denials (no SELinux), 0 failed units, 0 new kernel errors. Full row in #2817. This stays a draft until #2817 lands. Assisted-by: LLM (Claude:Opus 5.5) |
|
Thanks. f14ad50 is now just the J813 status-register KUnit case on top of #2817, with no table row. The J813 bless row (set, read back and clear, NOR outside the window unchanged, 0 failed units, 0 new kernel errors) covers it. Fine from my side once #2817 lands. The two open safety items there gate both. Assisted-by: LLM (Claude:Opus 5.5) |
A controller became a write candidate only through a row of
apple_qspi_boards[]: controller and machine compatible, controller
base, the nvram window the device tree had to describe exactly, the
JEDEC IDs and the block-protect bits the firmware leaves set. Each new
Mac needed a row, and five of the ten rows were assumed rather than
checked against an ADT and a probe.
Take those facts from the machine instead, and check the device tree's
partition against the flash before anything is written to it:
- The window is the node's one "nvram" partition, if it is not marked
read-only, is a whole number of 64 KiB NVRAM banks from a 4 KiB
boundary and lies within three-byte addressing
(apple_qspi_window_valid()).
- The part is read back before every program or erase and must be in a
short part table (W25Q64, Macronix 2B27, W25Q16, GD25UF16E), which
gives its size and the block-protect bits its firmware leaves set.
The window must end within the part: a three-byte address past it
wraps around into the start of the flash.
- Before the first program or erase, and latched for the controller:
the part's SFDP density must be the size the table bounds the window
with, and every bank of the window must start with a v3 NVRAM store
header ("3VVN", version 1, a store size within the bank) or be blank
throughout, with at least one store. A partition over firmware, a
stale one, or one running into padding or an image partway through a
bank, admits nothing.
- Also at that point, the block-protect bits are decoded, and a bank
they reach even in part is dropped from the writable banks. A program
or erase there is refused before WREN, so a bank erase cannot stop
halfway with the bank's header already gone. On the J700, BP0 covers
the top 64 KiB, so the window's last bank [0x1e4000, 0x1f4000) is
never written. The bits are decoded against each request as well:
one in the protected range is refused before WREN instead of failing
its readback and latching read-only.
The read-only default and the root opt-in, the opcode, range, page and
erase checks, the readback verify and the fault latch are unchanged.
Refusals for the part, its size, SFDP, the window and protection are
logged, rate limited, with the reason.
The boards the table admitted keep their window and part. Any other
board whose device tree describes a usable nvram partition is admitted
by these checks alone.
The rules live in spi-apple-qspi-policy.h, where KUnit covers the window
rule, the bank header, the part table, the protected ranges, the banks
they leave writable and SFDP parsing. tools/asahi/qspi-nvram-tests.py
runs the driver's write path against a flash model with SFDP and NVRAM
banks, with changed-guard controls for each new check.
Closes: aurora-silicon#2815
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J813 (MacBook Air 13-inch, M5) reads a Winbond W25Q64 (ef6517) with QE set and the SR3 drive strength at its default, and no block protection: flash_status: jedec=ef6517 sr1=00 sr2=02 sr3=60 Since aurora-silicon#2817 the J813 is a write candidate through its device tree's nvram partition (0x700000, 1 MiB, the ADT anvram) and its probed part, with no board entry. Check in KUnit that these status registers pass the write policy for a part that tolerates no block-protect bits. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
f14ad50 to
87650bc
Compare
Stacked on #2817 (its commit is the first one here until it lands). Since #2817, the J813 (MacBook Air 13-inch, M5) is admitted for NVRAM writes through its device tree's
nvrampartition (0x700000, 1 MiB, the ADTanvram) and its probed part. It needs no board entry any more, so this PR now only adds a KUnit case for the J813's NOR status registers:That is a W25Q64 with QE set, the SR3 drive strength at its default, and no block protection. These registers must pass the write policy for a part that tolerates no block-protect bits.
Testing
apple-qspi-nvram-policyon spi: apple-qspi: admit NVRAM writes by the DT partition and the part #2817 plus this commit: 16/16 (UML). checkpatch--strictclean.7.3.0-aurora-j813-q2817+.16 stores, part ef6517).read_onlystayed Y outside each write.Assisted-by: LLM (Claude:Opus 5.5)