Skip to content

basic hv on !apple_sysregs_unlocked#604

Merged
svenpeter42 merged 8 commits into
AsahiLinux:mainfrom
yuyuyureka:m4-hv
Jul 13, 2026
Merged

basic hv on !apple_sysregs_unlocked#604
svenpeter42 merged 8 commits into
AsahiLinux:mainfrom
yuyuyureka:m4-hv

Conversation

@yuyuyureka

@yuyuyureka yuyuyureka commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Depends on #603 for detecting apple_sysregs_unlocked from the proxyclient

This gives working m1n1 in m1n1 hv on T8132, including starting the secondaries in the guest.

@yuyuyureka yuyuyureka force-pushed the m4-hv branch 2 times, most recently from cef2167 to 0843524 Compare June 19, 2026 17:47
Signed-off-by: Yureka <yuka@yuka.dev>
Signed-off-by: Yureka <yuka@yuka.dev>
Signed-off-by: Yureka <yuka@yuka.dev>
Signed-off-by: Yureka <yuka@yuka.dev>
Signed-off-by: Yureka <yuka@yuka.dev>
RVBAR (cpu_impl_reg+0) isn't writable on newer chips, so we can't set it
to the guest entry, and there is no way the guest can choose a different
secondary entry later on.
Instead, return the guest entry on reads to make m1n1 happy, and use the
initial guest entry as secondary entry.

Signed-off-by: Yureka <yuka@yuka.dev>
This fixes use with the new pmgr on A18 Pro / M4 Pro.

Signed-off-by: Yureka <yuka@yuka.dev>
@SuibhneOFoighil

Copy link
Copy Markdown

Tested @ 42b932b (+ #616 cherry-picked, needed for proxyclient on T8132) on a MacBook Pro 14" M4 — Mac16,1 / j604ap / T8132, stub macOS 26.2.

  • Boots to Running proxy... at EL2; proxyclient works over USB from a Debian x86 host (shell.py, memory reads, on-the-fly asm exec).
  • experiments/cpu_id_regs.py output below — may be useful for the features_m4 TODO in chickens.c.

Install note for macOS 26.x testers: kmutil configure-boot -c m1n1.macho fails with Fileset Error: Failed to find __TEXT segment; the raw m1n1.bin method from the README works.

cpu_id_regs.py output (boot P-core, MIDR 0x611f0531)
m1n1 base: 0x100055ac000
Fetching ADT (0x00084000 bytes)...
ID_AA64ISAR0_EL1: 0x221100110212120 (RNDR=0x0, TS=0x2, FHM=0x1, DP=0x1, SM4=0x0, SM3=0x0, SHA3=0x1, RDM=0x1, ATOMICS=0x2, CRC32=0x1, SHA2=0x2, SHA1=0x1, AES=0x2)
ID_AA64PFR0_EL1: 0x1101000010110111 (DIT=0x1, MPAM=0x0, SVE=0x0, GIC=0x0, FP=0x1, EL3=0x0, EL2=0x1, EL1=0x1, EL0=0x1)
ID_AA64PFR1_EL1: 0x202000001 (SME=0x2, MTE=0x0, SSBS=0x0, BT=0x1)
MIDR_EL1: 0x611f0531 (REV_LOW=0x1, PART=0x53, REV_HIGH=0x1)
ID_AA64ISAR1_EL1: 0x110111110211502 (I8MM=0x1, DGH=0x0, BF16=0x1, SB=0x1, FRINTTS=0x1, GPI=0x1, GPA=0x0, LRCPC=0x2, FCMA=0x1, JSCVT=0x1, API=0x5, APA=0x0, DPB=0x2)
ID_AA64MMFR0_EL1: 0x110012120f100023 (ECV=0x1)
ID_AA64MMFR2_EL1: 0x1201011102001011 (AT=0x1)
ID_AA64ZFR0_EL1: 0x100000100001 (F64MM=0x0, F32MM=0x0, I8MM=0x1, SM4=0x0, SHA3=0x0, B16B16=0x0, BF16=0x1, AES=0x0, SVEVer=0x1)
ID_AA64MMFR1_EL1: 0x1112111312100 (AFP=0x1)
ID_AA64ISAR2_EL1: 0x12 (CSSC=0x0, RPRFM=0x0, BC=0x0, MOPS=0x0, APA3=0x0, GPA3=0x0, RPRES=0x1, WFXT=0x2)
ID_AA64AFR0_EL1: 0x0 ()
ID_AA64AFR1_EL1: 0x0 ()
ID_AA64DFR0_EL1: 0x10305f09 (PMSVer=0x0, CTX_CMPs=0x1, WRPs=0x3, PMSS=0x0, BRPs=0x5, PMUVer=0xf, TraceVer=0x0, DebugVer=0x9)
ID_AA64DFR1_EL1: 0x0 ()
ID_AA64FPFR0_EL1: 0x0 ()
ID_AA64ISAR3_EL1: 0x0 ()
ID_AA64MMFR3_EL1: 0x0 ()
ID_AA64MMFR4_EL1: 0x0 ()
ID_AA64PFR2_EL1: 0x0 ()
ID_AA64SMFR0_EL1: 0x1f150ff00000000 (FA64=0, LUTv2=0, SMEver=0x1, I16I64=0xf, F64F64=1, I16I32=0x5, B16B16=0, F16F16=0, F8F16=0, F8F32=0, I8I32=0xf, F16F32=1, B16F32=1, BI32I32=1, F32F32=1, SF8FMA=0, SF8DP4=0, SF8DP2=0, SBitPerm=0, AES=0, SFEXPA=0, STMOP=0, SMOP4=0)

Happy to run more tests on this hardware.

@yuyuyureka

Copy link
Copy Markdown
Contributor Author

Thanks, but none of the things you reported are related to the changes in this PR at all?

@SuibhneOFoighil

Copy link
Copy Markdown

My bad. Better place to put it? On the forum maybe... Just new to contributing—trying to find my way.

@svenpeter42 svenpeter42 merged commit fd20d7f into AsahiLinux:main Jul 13, 2026
7 checks 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