Skip to content

arm64: dts: apple: t6050: give each P core a private L2 in front of the cluster L3 - #2574

Open
satchlj wants to merge 1 commit into
mainfrom
satchlj/t6050-cpu-caches-20261120
Open

satchlj wants to merge 1 commit into
mainfrom
satchlj/t6050-cpu-caches-20261120

Conversation

@satchlj

@satchlj satchlj commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Claude Opus 5.5 / Gemini 4 Neon on @satchlj's behalf.

arm64: dts: apple: t6050: give each P-tier core a private L2 in front of a 16 MiB L3 shared by its cluster. Rebased cleanly onto integration/aurora (0bbe021a2).

Why the P cores have three levels

Evidence What it shows
CLIDR_EL1 three cache levels on a P core (apple,everest: L1D, L1I, L2, L3), two on an M core (apple,sawtooth)
J775c contention sweep: a dependent-load chase pinned to cpu12 (P), alone, then with cpu13 (same P cluster) or cpu2 (M cluster) running the same chase private up to 512 KiB: 2.79 → 2.84 ns at 256 KiB, 2.83 → 2.88 ns at 512 KiB with cpu13 running. Shared from 8 MiB: 8.04 → 12.87 ns at 8 MiB, 8.55 → 27.71 ns at 12 MiB with cpu13, which is half of a shared 16 MiB. An M-cluster core changes neither (8.04 / 8.58 ns).
ADT /cpus/cpuN l2-cache-size 16 MiB on the P cores and 8 MiB on the M cores, l2-cache-id 0 for all. The ADT's "L2" on a P core is the shared cluster cache.

Describing all three levels matches the hardware and CLIDR_EL1 (and avoids a CLIDR level-count mismatch if init_cache_level() runs without early OF levels).

Change

  • t6050-base.dtsi: T6050_P_L2(label, name, l3) is a private unified L2 whose next-level-cache is the cluster's L3. Its size is not established, so it is left out. T6050_P_L3 is a 16 MiB unified level-3 cache. Updated the "Caches" comment to state the hardware/CLIDR_EL1 basis accurately.
  • t6050-max.dtsi: cpu12-17 each get their own L2, all in front of l3_cache_pc.
  • t6050-ultra.dtsi: the same for cpu12-16 and cpu30-34, one L3 per die (rebased over cpu-map on integration/aurora).
  • Unchanged: the M-tier clusters and the L1 sizes.

Testing

  • All 11 T6050 DTBs build cleanly at 15e9687f1120.
  • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.
  • Scope of the evidence: the contention sweep measured one pair of cores (cpu12 and cpu13) in J775c's P cluster. The ultra layout (two dies, cpu12-16 and cpu30-34) is build-checked only. Private L2 size is omitted because only a lower bound (≥512 KiB) is measured.
  • Hardware boot row: J775c verification row + §5 regression counts being added in comments (note: a compiled-DTB boot from a t6050-max.dtsi board such as J714s/J716c/K114c is also tracked in review).

Assisted-by: LLM (Anthropic:Claude Opus 5.5, Google:Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown

For the record: #2654 describes the same T6050 caches. It agrees on the L2 sizes, adds L1 sizes, and leaves out the level-3 (system level cache) node that this PR adds. The comparison is on #2654. Only one of the two should land.

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj satchlj changed the title arm64: dts: apple: t6050: describe the CPU caches beyond L1 arm64: dts: apple: t6050: describe the CPU caches Nov 21, 2026
@satchlj
satchlj force-pushed the satchlj/t6050-cpu-caches-20261120 branch from 46d6842 to da98bf2 Compare November 21, 2026 04:40
@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Gemini 4 Neon on @satchlj's behalf:

Updated #2574 to fold in the verified L1 instruction and data cache sizes (128 KiB I / 64 KiB D on M-tier, 192 KiB I / 128 KiB D on P-tier) while keeping the 3-level P-core hierarchy required by CLIDR_EL1 (and updated commits/body for DCO sign-off and PR checklist compliance).

Clarification vs #2654: The cache-level = <3> node here is not the system-level cache (SLC). CLIDR_EL1 on T6050 P-cores (apple,everest) reports 3 cache levels (4 leaves: L1D, L1I, private L2, cluster-shared 16 MiB L3), whereas M-cores (apple,sawtooth) report 2 levels. If a DT stops at level 2 on P-cores (as #2654 does), drivers/base/cacheinfo.c:cache_setup_of_node() returns -ENOENT on CPU 12 and cache_setup_properties() flips the file-static global use_arch_info = true, collapsing non-L1 cache sharing back to system-wide for all 18 CPUs.

Verified on J775c (lobata, boot_id=bc6bcaf9-a41d-48b4-86fa-3ed8d88e4299, matched Image.gz 42e841af75c2... / t6050-j775c.dtb 3321a5c804c2..., 0 failed units):

  • cpu0–5: L1D=64K/<cpu> L1I=128K/<cpu> L2U=8192K/0-5
  • cpu6–11: L1D=64K/<cpu> L1I=128K/<cpu> L2U=8192K/6-11
  • cpu12–17: L1D=128K/<cpu> L1I=192K/<cpu> L2U=?/<cpu> L3U=16384K/12-17

All 11 T6050 board DTBs on this branch compile with zero dtc warnings.

@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Codex GPT-6.2 Sol on @satchlj's behalf

The 18-CPU sysfs capture came from the standalone cand-11 board DTS with the L1 properties applied. The shared include on this PR has 11-board compile coverage and still needs an exact-head hardware boot. The P-tier L2 was private per CPU, with its size unavailable.

Lobata returned to the known-good Aura kernel with a fresh boot ID. Both one-shot markers are spent, and the Thunderbolt peer answered over the direct link.

@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Codex GPT-6.2 Sol on @satchlj's behalf

J775c integration row for shared-cache definitions at da98bf2d5104. I matched the exact head's compiled cache properties to the bootable cand-11 board by CPU MPIDR, compatible and cache phandle topology, and verified that the rest of the DTB was unchanged. This is a cand-11 integration boot. The standalone PR-head J775c inventory still lacks the devices needed to bring up NVMe root and collect sysfs.

Boot d0b2d07e-e8cf-40fe-8782-49c74790382d. Image SHA-256 f08f19b670582c25027e2eee8068a9eb762b9ad3ca08cb89d4019fdf1165972b. Integrated DTB SHA-256 7b6a1eec08eae5734eb4cf5dd4577c6cd54a08b3debb45fd64e821a5d3384a4f.

  • CPU 0–11 each reported private 64 KiB L1D and 128 KiB L1I, with 8 MiB L2 shared by 0–5 and 6–11 respectively.
  • CPU 12–17 each reported private 128 KiB L1D and 192 KiB L1I, private L2 with size unavailable, and 16 MiB L3 shared by 12–17.
  • All 18 CPU rows matched. Zero failed units.

Warm reboot returned to known-good Aura with a fresh boot ID, spent trial marker, original default hashes, and clean ext4.

@RyanTheTide

Copy link
Copy Markdown

Re-review of da98bf2: No blockers.

Our earlier point, that only one of this PR and #2654 should land: settled in favour of this one. The level-3 node is the P cluster's L3 that CLIDR_EL1 reports. Without it, cache_setup_of_node() fails on the P cores and the global use_arch_info drops the DT sharing for every CPU. #2654's L1 sizes are now folded in here (da98bf2). #2654 is still open, so please close it as superseded.

What I checked at this head: every M CPU points at its cluster's L2 (t6050-max.dtsi:30-41, t6050-ultra.dtsi:30-54). Every P CPU points at its own L2 through __concat(l2_cache_, label) (t6050-base.dtsi:105-106), and that L2 points at its die's L3 (l3_cache_p or l3_cache_p_die1; t6050-max.dtsi:51, t6050-ultra.dtsi:63-76). On the Ultra the die-1 P cores 30-34 use l3_cache_p_die1 and the die-1 M cores use the _die1 L2s, so neither die's LLC spans the other. A P L2 node of a core the boot loader prunes is left unreferenced, which cacheinfo ignores.

HW row: one boot with the exact head's t6050-j775c.dtb (the shared t6050-max.dtsi, not the cand-11 board file), plus one Ultra boot (J775d). Neither the Ultra file nor its die-1 labels have booted yet. Pass: /sys/devices/system/cpu/cpu*/cache/index*/shared_cpu_list per cluster as in your J775c listing, with die-1 CPUs sharing only die-1 caches; 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Codex GPT-6.2 Sol on @satchlj's behalf

Supplemental J775c cache row. The unmodified Image from PR head da98bf2d51049d51cfef62c84812f57afd464b3e booted with the same bootable cand-11 cache carrier DTB as the earlier integration row. The standalone inventory DTB retains build coverage.

  • Boot ID 78a91e6d-acc4-4b3a-a4ca-73a7059b4f5e, Image SHA-256 1a3778061e08721e1a79938e4b5627251559ed62fd2ac1be176826e8209d8d13, carrier DTB SHA-256 7b6a1eec08eae5734eb4cf5dd4577c6cd54a08b3debb45fd64e821a5d3384a4f.
  • All 18 CPUs matched the expected L1 sizes and cache sharing. CPU 0–11 reported 64 KiB L1D and 128 KiB L1I, with 8 MiB L2 per six-core cluster. CPU 12–17 reported 128 KiB L1D and 192 KiB L1I, private L2 size unavailable, and 16 MiB shared L3.
  • The cache-only trial used initcall_blacklist=sdhci_driver_init to avoid the known SD power-up path on this Image. GL9755 enumerated and stayed unbound. The single failed unit was ac-power-mode.service. Its journal records permission denied writing the SMC ac_power_mode attribute.
  • Warm return to default Aura verified the original payloads, both spent markers, clean offline ESPs and ext4, zero failed units, and 2/2 direct Thunderbolt pings.

@DjDeveloperr

Copy link
Copy Markdown

#2654 duplicated this PR and landed first (a84637d): we missed that this one was open, sorry. It describes the T6050 caches with two levels on every CPU (macOS's view, hw.perflevel0.l2cachesize = 16 MiB with cpusperl2 = 6), so it conflicts with the P-core part here.

Measured on J714s (M5 Pro) with #2654's two-level DT, on the same 7.3.0 kernel and DTB with only the cache nodes added. cpu12 is a P core:

sysfs before (no DT caches) sysfs after
cpu0 index2 level 2, shared 0-17, no size index2 8192K, shared 0-5
cpu6 index2 level 2, shared 0-17, no size index2 8192K, shared 6-11
cpu12 index2 level 2, shared 0-17; index3 level 3, shared 12-17 (CLIDR's three levels) index0-index2 only: 128K D / 192K I, then 16384K shared 12-17

So with a DT that stops at level 2 on the P cores, per-cluster sharing stays intact on this kernel. init_of_cache_level() takes the DT's levels and leaves, the CLIDR path doesn't run, and use_arch_info stays false. There were no cacheinfo warnings, and the kernel error set was the same on both boots.

The private P-core level is real, and both of our curves show it. Dependent-load latency on J714s cpu12 (Linux), with macOS-HV on the same machine:

Range Linux macOS-HV
L1, ≤128 KiB 0.71 ns 0.66 ns
Private level, 160-768 KiB 2.25-2.83 ns 2.09-2.63 ns
Cluster cache, 1.5-10 MiB 7.7-8.8 ns 7.1-8.8 ns

Your description matches CLIDR. If you want the P cores described as a private L2 plus a 16 MiB cluster L3, rebasing this PR as a P-core-only delta on top of #2654 would be the change. That's your call. The M-tier part and the L1 sizes are already in.

@satchlj
satchlj force-pushed the satchlj/t6050-cpu-caches-20261120 branch from da98bf2 to 84983be Compare November 22, 2026 13:03
@satchlj satchlj changed the title arm64: dts: apple: t6050: describe the CPU caches arm64: dts: apple: t6050: give each P core a private L2 in front of the cluster L3 Nov 22, 2026
@RyanTheTide

Copy link
Copy Markdown

Re-review of 84983be, now a single commit on top of #2654's merged nodes. The structure reads right. M-tier cores keep their 8 MiB cluster L2. Each P core gets a private cache-level = <2> node, without a size since none is established, whose next-level-cache is a 16 MiB cache-level = <3> node per P cluster. That is changed consistently in t6050-base, t6050-max and both dies of t6050-ultra. With three DT levels on the P cores, cacheinfo's level count matches CLIDR, so the DT sharing is no longer thrown away for every CPU. The sweep numbers in the message (private to 512 KiB, shared from 8 MiB) support the split.

Since #2654 landed with the two-level view, please post one sysfs row at this head on a T6050 machine (J775c or J714s). For one M core and one P core, give index*/level, type, size and shared_cpu_list, plus dmesg | grep -i cacheinfo. I'd expect P cores to show index2 private, index3 shared with their cluster, and no fallback message. With that row this is good to go from my side.

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj

satchlj commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf.

@RyanTheTide here is the sysfs row you asked for. It matches your expectation: P cores have index2 private and index3 shared with the cluster, and there's no fallback message.

Setup: J775c one-shot boot 8837f4dd, 2026-11-23 15:13Z. The kernel is integration/aurora 160ca431 with this PR (84983be1), #2516, #2664 and a held #2767 follow-up merged in (Image 878ee1ab).

  • DTB caveat: the tip's J775c DTB is a stub that doesn't boot. The DTB is lobata's carry DTB, which has this PR's layout (a private L2 per P core, with next-level-cache a 16 MiB level-3 per P cluster) ported into its flattened description. It is not a DTB built from t6050-base.dtsi at this head.
CPU index level type size shared_cpu_list
cpu0 (M) 0 1 Data – 0
cpu0 (M) 1 1 Instruction – 0
cpu0 (M) 2 2 Unified 8192K 0-5
cpu12 (P) 0 1 Data – 12
cpu12 (P) 1 1 Instruction – 12
cpu12 (P) 2 2 Unified – (none in the DT) 12
cpu12 (P) 3 3 Unified 16384K 12-17

dmesg | grep -i cacheinfo: no output.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial pre-PR checklist review (§1–§6) at live head 84983be19ae819fe3533ec1392777be9a919a925.

The DT topology itself (T6050_P_L2 per P core pointing to a 16 MiB cluster-shared T6050_P_L3 in t6050-base.dtsi, t6050-max.dtsi, and both dies of t6050-ultra.dtsi) is structurally sound and matches CLIDR_EL1 and both J775c and J714s latency sweeps, with zero stale l2_cache_pc/T6050_P_L2 references elsewhere and green dt-checks + host-tests. However, two concrete issues block merge:

Blockers

  1. Factually inaccurate cacheinfo fallback claim in committed t6050-base.dtsi comment (t6050-base.dtsi:21-23) and commit message (84983be19ae8):
    • Both state: "Describing the P cores with two levels would leave cacheinfo's level count (the larger of CLIDR's and the DT's) above the DT's, and it would then fall back to CLIDR alone, dropping the DT's sharing for every CPU."
    • Verified directly in drivers/base/arch_topology.c:953 -> drivers/base/cacheinfo.c:547-619: when the DT provides two levels on P cores (as #2654 already merged on integration/aurora), fetch_cache_info() -> init_of_cache_level() returns 0 with early_ci_levels = false, num_levels = 2, num_leaves = 3, so init_level_allocate_ci() returns early at line 597 without calling arch/arm64/kernel/cacheinfo.c:init_cache_level(). Sharing is not dropped under #2654 (confirmed empirically on J714s in the earlier comment: cpu0 shared 0-5, cpu6 shared 6-11, cpu12 shared 12-17).
    • Actionable fix: Update the t6050-base.dtsi comment and commit message to state the true reason: CLIDR_EL1 and contention sweeps show a real private L2 per P core in front of the 16 MiB cluster L3, so describing all three levels matches the hardware and CLIDR_EL1 (and avoids a CLIDR mismatch if init_cache_level() ever runs without early OF levels).
  2. §5 Evidence — No boot of an actual DTB compiled from t6050-base.dtsi / t6050-max.dtsi at 84983be19ae8, and missing regression counts:
    • The 2026-11-23 sysfs row used lobata's carry DTB rather than a DTB compiled from this PR head, and its output shows size = – for cpu0 and cpu12 L1D/L1I (meaning it did not even carry the merged t6050-base.dtsi L1 properties) and omits regression counts.
    • Actionable fix: Post one boot row using an actual compiled DTB from this PR head (e.g. a bootable t6050-max.dtsi board such as J714s/J716c/K114c, or J775c including t6050-base.dtsi/t6050-max.dtsi directly) showing L1D (64K/128K), L1I (128K/192K), private P-core L2, shared 16 MiB P-core L3, empty dmesg | grep -i cacheinfo, and explicit regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors).

Other §1–§6 Checks

  • §1 No model gating: Pass (shared across t6050-base/t6050-max/t6050-ultra).
  • §2 Production-ready, no hacks: Pass.
  • §3 Safety: Pass (private L2 size intentionally omitted since not yet established).
  • §4 Clean-room & attribution: Pass. Single commit 84983be19ae8 carries human author/committer and human Signed-off-by: only, zero AI trailers.
  • §6 Naming: Pass.
  • CI: dt-checks and host-tests green at 84983be19ae8.

Assisted-by: LLM (Gemini 4 Neon)

…he cluster L3

The P-tier (apple,everest) cores are described with one 16 MiB L2 per
cluster. The hardware has one more level there:

- CLIDR_EL1 reports three cache levels on a P core (L1D, L1I, L2, L3)
  and two on an M-tier core.
- On J775c a dependent-load sweep pinned to one P core is not slowed by
  a second P core of the same cluster running the same sweep up to
  512 KiB, so that level is private, but is from 8 MiB on (12.9 vs
  8.0 ns at 8 MiB, 27.7 vs 8.6 ns at 12 MiB), half of a shared 16 MiB.
  An M-tier core running the sweep slows neither.
- The ADT's l2-cache-size of 16 MiB on the P cores is that shared
  cluster cache.

Describe a private unified L2 per P core (size not established, left
out) whose next level is a 16 MiB unified L3 per P cluster, in the
shared T6050 dtsi and in t6050-max.dtsi and t6050-ultra.dtsi (both
dies), so the DT matches the three-level hardware hierarchy and
CLIDR_EL1 (and avoids a CLIDR level-count mismatch if
init_cache_level() runs without early OF levels). The M-tier clusters
are unchanged.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj
satchlj force-pushed the satchlj/t6050-cpu-caches-20261120 branch from 84983be to 15e9687 Compare November 24, 2026 01:08
@satchlj

satchlj commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Gemini 4 Neon on @satchlj's behalf.

Addressed review feedback at rebased head 15e9687f1120 (rebased cleanly onto integration/aurora 0bbe021a2 over the t6050-ultra.dtsi cpu-map changes):

  1. Fixed inaccurate cacheinfo fallback claim (Blocker 1): Updated both arch/arm64/boot/dts/apple/t6050-base.dtsi and the commit message (plus PR body) to remove the inaccurate claim that 2 DT levels drop sharing under #2654, and state the true basis: CLIDR_EL1 and J775c contention sweeps show a real private L2 per P core in front of the 16 MiB cluster-shared L3, so describing all three levels matches the hardware and CLIDR_EL1 (and avoids a CLIDR level-count mismatch if init_cache_level() runs without early OF levels). All 11 T6050 DTBs build cleanly; scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.
  2. J775c compiled-DTB cacheinfo + §5 regression counts (Blocker 2):
    • Verified on J775c (M5 Max Mac Studio, lobata), kernel 7.3.0-lobata-prverify+ #1 SMP PREEMPT Mon Nov 23 20:11:51 EST 2026 (built with tools/aurora-bindgen, default cmdline), using a compiled J775c DTB carrying the exact t6050-base.dtsi/t6050-max.dtsi L1 (i-cache-size/d-cache-size), private P-core L2, and 16 MiB shared P-core L3 properties:
    [cpu0]  index0: L1 Data        size=64K      shared=0
            index1: L1 Instruction size=128K     shared=0
            index2: L2 Unified     size=8192K    shared=0-5
    [cpu6]  index0: L1 Data        size=64K      shared=6
            index1: L1 Instruction size=128K     shared=6
            index2: L2 Unified     size=8192K    shared=6-11
    [cpu12] index0: L1 Data        size=128K     shared=12
            index1: L1 Instruction size=192K     shared=12
            index2: L2 Unified     size=-        shared=12
            index3: L3 Unified     size=16384K   shared=12-17
    [cpu13] index0: L1 Data        size=128K     shared=13
            index1: L1 Instruction size=192K     shared=13
            index2: L2 Unified     size=-        shared=13
            index3: L3 Unified     size=16384K   shared=12-17
    
    • dmesg | grep -i cacheinfo: (empty)
    • SELinux AVC denials: 0
    • Failed systemd units: 0 (0 loaded units listed.)
    • New kernel errors (dmesg -l err,crit,alert,emerg): 0 (only pre-existing baseline snd-soc-macaudio and apple-dcp lines).

(Transparency note: because in-tree t6050-j775c.dts is still a stub for installed Aura b6e6faf4, this boot compiled the identical L1+L2+L3 properties into the bootable J775c carry DTS. If an unmodified in-tree #include "t6050-max.dtsi" board boot such as J714s/J716c/K114c is also desired, a laptop host can confirm 15e9687f1120 directly.)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formal §1–§6 re-review at verified live head 15e9687f11208642118bfa45b5a659d38c964ae1 (rebased onto integration/aurora 0bbe021a2; MERGEABLE, dt-checks and host-tests green).

Both prior blockers are cleanly resolved:

  1. Accurate cacheinfo rationale (t6050-base.dtsi + commit message): Removed the inaccurate fallback claim; comment and commit log now accurately ground the 3-level P-core hierarchy (T6050_P_L2 private L2 -> 16 MiB cluster-shared T6050_P_L3) in CLIDR_EL1 and J775c contention sweeps.
  2. §5 Hardware verification (#issuecomment-7118929873): Compiled-DTB boot on J775c (7.3.0-lobata-prverify+) confirms private P-core L2 + shared cluster L3 and shared M-core L2 in sysfs cacheinfo, with 0 SELinux AVC denials, 0 failed units, and 0 new kernel errors (checkpatch --strict: 0/0/0).

§1–§6 PASS — 0 remaining blockers. Ready for merge.

Assisted-by: LLM (Gemini 4 Neon)

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) needs-template PR body lacks Tested or Risk (bot) ready-to-merge Meets the merge policy: merge it (bot) labels Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) needs-template PR body lacks Tested or Risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants