Skip to content

arm64: errata: treat the T8152 vGIC SEIS as broken (KVM guests on the J873g, M6 Mac mini) - #1794

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j873-kvm-el2
Nov 21, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j873-kvm-el2

Conversation

@sithglan

Copy link
Copy Markdown
Contributor

#1728 made KVM guests boot on the J813 (M5 MacBook Air, T8142) at EL2. This is the one piece the J873g (Mac mini M6, T8152) still needs on top of it.

With a padded Mach-O Stage 1 (CTXR execute window, as aura#77 describes), the J873g under the macOS 27.2 stub runs Linux at EL2 on all twelve CPUs, and CONFIG_ARM64_CTXR_EXECMEM confines its code to the window. I read the relevant ID registers there with a small module:

  • ICH_VTR_EL2 is 0x90580007 on all twelve CPUs, E (part 0x072) and P (0x073) cores alike: eight list registers with SEIS set, the same value as T8142. This PR adds the two T8152 parts to apple_broken_seis_cpus.
  • The sanitised ID_AA64PFR1_EL1 is 0x00000f0002000201 (MTE2, MTE_frac NI), also the same as T8142. arm64, KVM, irqchip/apple-aic: KVM guests on the J813 (M5 MacBook Air) at EL2 #1728's MTE_frac fix-up therefore already covers it.
  • The AIC needs no change. apple,t8152-aic3 has no T8152-specific match here; it binds through the generic apple,t8122-aic3 entry, so the vm_timer_fiq_readonly handling for T8142 doesn't apply. VM_TMR_FIQ_ENA_EL2 takes writes on T8152.

Testing

Run on the J873g. The kernel is integration/aurora 673f618 with aurora-wip 210c8f6 merged in, because integration doesn't have #1197's J873g NVMe and 10GbE yet. It also has #1652 and this commit, with CONFIG_KVM=y and CONFIG_ARM64_CTXR_EXECMEM=y. It was booted through aura's kboot, which places the kernel in the CTXR window.

  • Boot: "CPU: All CPU(s) started at EL2", "CPU features: detected: Known broken GICv3 SEIS implementation", "kvm [1]: VHE mode initialized successfully". The execmem-confine boot verify passes with 520 mappings and 0 violations. All twelve CPUs come up, the root is on the NVMe, and 10GbE and Wi-Fi work.
  • KVM guests: libvirt 12.9.0 and QEMU 11.1.3 (-accel kvm -cpu host -M virt,gic-version=3), Debian 13 arm64 nocloud with UEFI (AAVMF).
    • 4 vCPUs: login prompt in about 21 s, with network and DNS working.
    • 12 vCPUs, alongside the 4-vCPU guest: login prompt in about 21 s.
  • Build: this branch (integration/aurora + the commit) builds Image.gz, modules and dtbs with CONFIG_KVM=y (LLVM 22). checkpatch --strict is clean.

The same entry, together with #1728's MTE_frac fix, also runs on the M6's linux-aurora j873 desktop kernel (7.1, where the list is still broken_seis in vgic-v3.c). There, guests reach a login prompt in 17 s with 4 vCPUs and with 12.

Jens's #1724 adds the T6050 parts to the same list, so whichever lands second needs a trivial rebase.

cc @Acelogic @DjDeveloperr @RyanTheTide @LiamRay10

ICH_VTR_EL2 on the J873g (Mac mini M6, T8152, macOS 27.2 stub) reads
0x90580007 at EL2 on all twelve CPUs, E (part 0x072) and P (0x073) cores
alike: eight list registers and SEIS set, the value of T8142 and the
other Apple cores in apple_broken_seis_cpus. Add the two T8152 parts so
that KVM does not trust the locally generated SError the vGIC claims to
support, as for those cores.

With it the kernel reports "Known broken GICv3 SEIS implementation" and
KVM guests with 4 and 12 vCPUs boot on the J873g.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan
sithglan force-pushed the thomas/j873-kvm-el2 branch from 871cad7 to 46319d8 Compare November 13, 2026 16:54
@sithglan

Copy link
Copy Markdown
Contributor Author

Rebased onto integration/aurora a34d26c. It is now 46319d8 (was 871cad7). The old head no longer merged because #1724 adds the T6050 pair to the same apple_broken_seis_cpus[] list. The T8152 pair now follows the T6050 pair; nothing else changed. arch/arm64/kernel/cpu_errata.o builds with W=1 and no warnings (LLVM 22).

@RyanTheTide

Copy link
Copy Markdown
Contributor

No blockers.

I checked that MIDR_APPLE_T8152_E/_P exist at the head (arch/arm64/include/asm/cputype.h:272-273, parts 0x072/0x073). The new entries at arch/arm64/kernel/cpu_errata.c:323-324 only take effect through has_broken_gic_v3_seis() (cpu_errata.c:328-334), and that still requires VHE and the SEIS bit set in ICH_VTR_EL2. So the change can only stop KVM from trusting an SEIS the hardware advertises, on the two parts where you read 0x90580007. The ICH_VTR_EL2 readings and the 4- and 12-vCPU guest boots on the J873g are the right proof for it.

HW row: for the record, add the regression line from the J873g boot you already have: 0 failed units, 0 SELinux denials, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan

Copy link
Copy Markdown
Contributor Author

@RyanTheTide the regression line, from a J873g boot that carries this commit: the #2178 stack plus #2459, #2139's AVD and 46319d820e9f, kernel 7.3.0-aurora-j873-prs2459+, firmware 27.2.

  • CPU features: detected: Known broken GICv3 SEIS implementation at 0.0029 s.
  • KVM: the 4-vCPU Debian guest (debian-vm, Linux 6.12) boots to its login prompt with 4 CPUs up. 0 host kernel errors or warnings while it runs.
  • SELinux is not enabled on this install, so 0 denials.
  • Failed units: one, j873-gpu.service. This stack's GPU driver has no 26B123 firmware profile ("stage 10 needs /chosen aurora,g18g-gpu-firmware-profile"), which is unrelated to the errata entry.
  • Kernel errors at boot: display handoff (apple-dcp -22/-5), the GPU profile, Bluetooth firmware (btcentauri -16), the speaker safety refusal, ASoC routing, an i2c NACK. None comes from KVM or the GIC.
  • 0 new kernel errors or warnings after boot, across the guest run and the AVD/USB4 rows on pmdomain: apple: T8152 PSD services as power domains #2459.

The M6 is back on its default kernel.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@DjDeveloperr
DjDeveloperr merged commit e6fab91 into aurora-silicon:integration/aurora Nov 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants