From 9306f55ec74268e6c7d6d87d1f86a8f518068bd0 Mon Sep 17 00:00:00 2001 From: Naeem Malik Date: Sat, 31 Oct 2026 16:52:26 +0530 Subject: [PATCH 1/2] drm/asahi: g15: admit a third J516C GPU firmware TEXT (125f0497) Two J516C MacBook Pro 16" M3 Max owners (issue #289) load a GPU firmware whose TEXT digest is 125f0497c7904fde... (sha256 125f0497c7904fde87b05a9264a88cf03bdb3572a1715cec91bd0f9b78245544, TEXT 0x64000, DATA 0x140000, marker 0x5cf28). The driver refuses it and the Mac falls back to llvmpipe. Add it as a third FirmwareBuild, written like the two existing J516C entries and still gated to the J516C. The entry name and the comment record where the digest was measured; they do not claim a distinct firmware build. Evidence from #289: with the digest accepted through asahi.g15_accept_text_prefix, glxinfo reports Apple M3 Max (G15C B2), and a GLES compute run shows 0 mismatches and no faults in dmesg. This branch boots on a J516C M3 Max in the Mac lab (job j1031-185713-2fe6, 3 of 3 tests pass, GPU probed). That Mac loads the macOS 14.7 stub firmware, so the new digest itself was not exercised there. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik --- drivers/gpu/drm/asahi/g15/hw/t6031.rs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/asahi/g15/hw/t6031.rs b/drivers/gpu/drm/asahi/g15/hw/t6031.rs index 19f7283ce4ec6a..3fe5742529eadb 100644 --- a/drivers/gpu/drm/asahi/g15/hw/t6031.rs +++ b/drivers/gpu/drm/asahi/g15/hw/t6031.rs @@ -132,10 +132,12 @@ pub(crate) const CONFIG: Config = Config { version: 0x07041100, counts: 0x0021040a, }], - // The stubs the boot chains of this J516C leave loaded (RTKit-2419.140.12): the macOS 14.7 - // chain's and the macOS 14.8 boot volume's. Same segment sizes and marker; the layout, board - // images and initdata below do not depend on which one is loaded. A further build can be - // admitted for one boot with `g15_accept_text_prefix`, which logs its digest. + // The stubs the boot chains of J516Cs leave loaded (RTKit-2419.140.12): the macOS 14.7 + // chain's, the macOS 14.8 boot volume's and a third TEXT seen on two further J516Cs (omacom + // /linux-aurora#289). Same segment sizes and marker; the layout, board images and initdata + // below do not depend on which one is loaded. The names say where a digest was measured, + // not that it identifies one build. A further digest can be admitted for one boot with + // `g15_accept_text_prefix`, which logs it. firmware: &[ FirmwareBuild { name: "macOS 14.7 stub firmware (iBoot-10151.140.19.700.2), J516C", @@ -161,6 +163,21 @@ pub(crate) const CONFIG: Config = Config { 0x9d, 0x6b, 0xcd, 0xa0, 0x26, 0xcf, ], }, + // Two J516Cs (iBoot2 iBoot-10151.140.19.700.2, OS firmware 14.7; iBoot1 mBoot-20457.1.29 + // and mBoot-20457.41.3) load this TEXT. On the second, 10 boots, glxinfo on the M3 Max + // renderer and a GLES compute job with no mismatches, no GPU faults (#289). + FirmwareBuild { + name: "J516C stub firmware, TEXT 125f0497 (seen with iBoot-10151.140.19.700.2)", + machine: Some(kernel::c_str!("apple,j516c")), + text_size: 0x64000, + data_size: 0x140000, + marker: 0x5cf28, + text_sha256: [ + 0x12, 0x5f, 0x04, 0x97, 0xc7, 0x90, 0x4f, 0xde, 0x87, 0xb0, 0x5a, 0x92, 0x64, + 0xa8, 0x8c, 0xf0, 0x3b, 0xdb, 0x35, 0x72, 0xa1, 0x71, 0x5c, 0xec, 0x91, 0xbd, + 0x0f, 0x9b, 0x78, 0x24, 0x55, 0x44, + ], + }, // Measured by the normal driver on J514C's 14.7 boot chain (system // firmware 26.5.2). Short native GL/Vulkan and normal-login checks passed; // power/thermal qualification remains open. Exact board identity is required. From b33057c8536c4c1016cec4e5c73aff81adb7d268 Mon Sep 17 00:00:00 2001 From: Naeem Malik Date: Sat, 14 Nov 2026 01:00:38 +0530 Subject: [PATCH 2/2] drm/asahi: g15: also admit TEXT 125f0497 on J514C Two 14-inch M3 Max J514C owners load the same GPU firmware TEXT that the previous commit admits on J516C: sha256 125f0497c7904fde87b05a9264a88cf03bdb3572a1715cec91bd0f9b78245544, TEXT 0x64000, DATA 0x140000, marker 0x5cf28. Both run OS firmware 14.7. With the digest accepted through asahi.g15_accept_text_prefix the GPU comes up on both (G15C B2; OpenGL 4.6 accelerated on one, render and compute known-answer tests with 0 wrong on the other). Without it the driver refuses the firmware and the Mac falls back to llvmpipe. A row takes one machine, so add a second row for the same digest bound to apple,j514c. The J516C row stays bound to apple,j516c; the digest is not open to any other T6031 board. The board images come from the Config, not from the row, so the row carries only the firmware identity. The J514C host test counted exactly one J514C row and expected another board to be refused a digest; with one digest bound to two boards, count two rows and expect the first row bound to the asking board instead. Not tested on hardware by this change: the new digest itself was not exercised in the Mac lab, whose J514C loads the already admitted build. Power and thermal qualification of J514C remains open. Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Naeem Malik --- drivers/gpu/drm/asahi/g15/hw/t6031.rs | 15 +++++++++++++++ tools/asahi/g15-j514c-firmware-tests.py | 20 ++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/asahi/g15/hw/t6031.rs b/drivers/gpu/drm/asahi/g15/hw/t6031.rs index 3fe5742529eadb..330831ed0b087f 100644 --- a/drivers/gpu/drm/asahi/g15/hw/t6031.rs +++ b/drivers/gpu/drm/asahi/g15/hw/t6031.rs @@ -193,6 +193,21 @@ pub(crate) const CONFIG: Config = Config { 0x70, 0xc6, 0x6d, 0x2b, 0x0a, 0x1e, 0x87, 0x86, ], }, + // The same TEXT as the J516C row above, on J514C: two 14-inch M3 Max owners load it + // with OS firmware 14.7 and bring the GPU up with `g15_accept_text_prefix`. Exact + // board identity is required; power/thermal qualification remains open. + FirmwareBuild { + name: "J514C stub firmware, TEXT 125f0497", + machine: Some(kernel::c_str!("apple,j514c")), + text_size: 0x64000, + data_size: 0x140000, + marker: 0x5cf28, + text_sha256: [ + 0x12, 0x5f, 0x04, 0x97, 0xc7, 0x90, 0x4f, 0xde, 0x87, 0xb0, 0x5a, 0x92, 0x64, + 0xa8, 0x8c, 0xf0, 0x3b, 0xdb, 0x35, 0x72, 0xa1, 0x71, 0x5c, 0xec, 0x91, 0xbd, + 0x0f, 0x9b, 0x78, 0x24, 0x55, 0x44, + ], + }, ], // This is the reference board. The exact J514C/T6031 pair also uses this // configuration through normal admission, with the unmeasured reference diff --git a/tools/asahi/g15-j514c-firmware-tests.py b/tools/asahi/g15-j514c-firmware-tests.py index 13c2969be48765..857d84a5104a88 100755 --- a/tools/asahi/g15-j514c-firmware-tests.py +++ b/tools/asahi/g15-j514c-firmware-tests.py @@ -29,7 +29,7 @@ } machine = re.search(r'machine:\s*Some\(kernel::c_str!\("([^"]+)"\)\)', body) rows.append((fields, digest, machine.group(1) if machine else None)) -assert sum(machine == "apple,j514c" for _, _, machine in rows) == 1 +assert sum(machine == "apple,j514c" for _, _, machine in rows) == 2 assert any(machine == "apple,j516c" for _, _, machine in rows) assert all(machine == "apple,j516c" for _, _, machine in rows if machine != "apple,j514c") measurements = [] @@ -51,13 +51,24 @@ (m, b.map_or(true, |b| b == board)) }).collect() } +// A digest may be bound to more than one board (one row per board); the expected +// verdict on `board` is the first row with that digest bound to it or to no board. +fn expected(sha256: &[u8; 32], board: &str) -> Verdict { + let all = rows(board); + match all.iter().zip(MACHINES).position(|((m, _), b)| { + &m.sha256 == sha256 && b.map_or(true, |b| b == board) + }) { + Some(i) => Verdict::Pinned(i), + None => Verdict::Refused, + } +} #[test] fn j514c_exact_candidate() { - let index = MACHINES.iter().position(|b| *b == Some("apple,j514c")).unwrap(); + for index in (0..MACHINES.len()).filter(|&i| MACHINES[i] == Some("apple,j514c")) { let exact = rows("apple,j514c")[index].0; assert_eq!(lookup::verdict(&exact, rows("apple,j514c"), 0), Verdict::Pinned(index)); for board in ["apple,j516c", "apple,j514m", "apple,j516m"] { - assert_eq!(lookup::verdict(&exact, rows(board), 0), Verdict::Refused); + assert_eq!(lookup::verdict(&exact, rows(board), 0), expected(&exact.sha256, board)); } let mut bad = exact; bad.sha256[31] ^= 1; assert_eq!(lookup::verdict(&bad, rows("apple,j514c"), 0), Verdict::Refused); @@ -67,6 +78,7 @@ assert_eq!(lookup::verdict(&bad, rows("apple,j514c"), 0), Verdict::Refused); let mut bad = exact; bad.marker += 8; assert_eq!(lookup::verdict(&bad, rows("apple,j514c"), 0), Verdict::Refused); + } } #[test] fn existing_rows_unchanged() { @@ -76,7 +88,7 @@ assert_eq!(lookup::verdict(&measured, rows("apple,j516c"), 0), Verdict::Pinned(index)); if board.is_some() { for other in ["apple,j514c", "apple,j514m", "apple,j516m"] { - assert_eq!(lookup::verdict(&measured, rows(other), 0), Verdict::Refused); + assert_eq!(lookup::verdict(&measured, rows(other), 0), expected(&measured.sha256, other)); } } }