#
#asahi-dev · 2026-10-29 21:07
snooze6214[m]sven: okay... idk what happend last time but now, i ran run_guest again and this time there was no exception lol. no panics either :) seems like xnu is running, but the screen is still stuck at the loading screen. https... (full message at <https://matrix.org/oftc/media/v1/media/download/AaLMXmnvi6rC-rNp1n1p-H1EdHLL0hoOoz7GDsp-tWT32x2HnjEnTfY6C5Y16LJ203kOPOUh0HKLEdenkl0o0HZCeh0ZZvZgAG1hdHJpeC5vcmcvdXNYR3VVeXRWbUNzeU5ja2VjVFFUSkls>)
#asahi-dev · 2026-10-29 20:34
svenespecially because I change the way _EL12 is handled for secure kernel anyway
#asahi-dev · 2026-10-29 20:34
sventhe proper fix would be to make the EL2 index the actual storage and make the EL1 ones alias to that but I think that's quite a big change. I'd just keep the hack
#asahi-dev · 2026-10-29 20:33
svennice!
#asahi-dev · 2026-10-29 20:32
snooze6214[m]we no longer panic \o/ now i have a sync exception when another cpu starts, ill take a look
#asahi-dev · 2026-10-29 20:29
snooze6214[m]oops that my bad. i added alias for both, but i used HV_VREG_CTRR_D_LWR_EL1 for shadow for both :')
#asahi-dev · 2026-10-29 20:28
svenit looks like the size is still 0xfff which seems wrong
#asahi-dev · 2026-10-29 20:28
svendid you add the alias for both upper and lower?
#asahi-dev · 2026-10-29 20:27
snooze6214[m]TTY> panic(cpu 5 caller 0xfffffe003d97b624): zalloc_ro_mut failed: source (0xfffffe0038ca5290, phys 0x1001b40d290) not from RO zone map (0xfffffe16dc000000 - 0xfffffe1976000000), current stack (0xfffffecdf39a8000 - 0xfffffecdf39ac000) or const memory (phys 0x10017dec000 - 0x10017decfff) @zalloc.c:6733
#asahi-dev · 2026-10-29 20:27
snooze6214[m]eyyyy! progress!!! still a panic, but progress xD i think that totally worked :)
#asahi-dev · 2026-10-29 20:22
sventhen when XNU tries to read them it'll see the _EL1 stuff SPTM wrote (which again is not what happens on real HW and will maybe bite us in the future, but getting this correct is more annoying I think when we don't even know if this is the problem)
#asahi-dev · 2026-10-29 20:21
svener, *replace the _EL2 CTRR sysregs with
#asahi-dev · 2026-10-29 20:21
snooze6214[m]makes sense, cool :)
#asahi-dev · 2026-10-29 20:21
svenyes
#asahi-dev · 2026-10-29 20:21
sventhat's not correct either but that entire file is a big hack
#asahi-dev · 2026-10-29 20:21
snooze6214[m]ah so when HCR_EL2.E2H and you want to access the actual EL1 registerm you use the _EL12 registers?
#asahi-dev · 2026-10-29 20:20
sveni think the easiest hack is to just replaced the separate _EL1 CTRR_D sysregs with VREG_MASK_ALIAS(.._EL2, ..._EL1, ~0xfff)
#asahi-dev · 2026-10-29 20:19
svenand well... sprr.c doesn't emulate that correctly :D
#asahi-dev · 2026-10-29 20:19
svenHCR_EL2.E2H
#asahi-dev · 2026-10-29 20:18
sventhat's also the reason the _EL12 regs exist: they're used to actually access the EL1 reg when you're running in EL2
#asahi-dev · 2026-10-29 20:18
svenwith that you can run the same code in EL1 and EL2 and it just works out
#asahi-dev · 2026-10-29 20:17
svenon arm if a bit in HCR is set (which is always set on Apple hardware) and if you're running in EL2 *every* access to a _EL1 reg is forwarded to the _EL2 reg instead
#asahi-dev · 2026-10-29 20:17
snooze6214[m]oh right, my bad
#asahi-dev · 2026-10-29 20:17
svenSPTM is running in GL2 and XNU in EL2 usually
#asahi-dev · 2026-10-29 20:17
svenno
#asahi-dev · 2026-10-29 20:17
snooze6214[m]aah makes sense, because sptm is expecting xnu to be running in el1?
#asahi-dev · 2026-10-29 20:15
svenwhich i don't do in the emulator because i'm cutting every corner i can :D
#asahi-dev · 2026-10-29 20:15
svenso i guess XNU reads the _EL2 variants while SPTM writes to the _EL1 variants which on real hardware get aliased to the _EL2 ones
#asahi-dev · 2026-10-29 20:14
sven*sigh*
#asahi-dev · 2026-10-29 20:14
svenoh.... yes
#asahi-dev · 2026-10-29 20:14
snooze6214[m]sven: this seems shady no?... (full message at <https://matrix.org/oftc/media/v1/media/download/AXgXBRz1Kk8OaZclF3T-RNZfQMVWIt4W5vpSlSNEbSJkcyRhlp6pZIFhYkVwgdHLePz7mDCrvGaX6ODqgJVxOa9Ceh0WW49AAG1hdHJpeC5vcmcvaFRITkZha3VueFJnbFB3WnFaT21nb3Za>)
#asahi-dev · 2026-10-29 20:02
snooze6214[m]ack, makes sense
#asahi-dev · 2026-10-29 19:55
svenand then see what's being written and read
#asahi-dev · 2026-10-29 19:55
svenjust add the printfs to VREG_MASKED_ALIAS
#asahi-dev · 2026-10-29 19:55
sveni'd add printfs for reading/writing any of the CTRR {A,B,C,D} sysregs
#asahi-dev · 2026-10-29 19:50
sventhere's also CTXR but i'm not sure what it does, the sysregs look more complex than the CTRR ones at least
#asahi-dev · 2026-10-29 19:49
svenit's a bunch of sysregs that make a memory region read-only
#asahi-dev · 2026-10-29 19:49
snooze6214[m]i see
#asahi-dev · 2026-10-29 19:49
svenit's a newer version of that i think
#asahi-dev · 2026-10-29 19:48
snooze6214[m]honestly, not sure :( also is CTRR related to this: https://blog.siguza.net/KTRR/
#asahi-dev · 2026-10-29 19:46
svenroregion kinda sounds like CTRR, but why would it allocate read-only memory?!
#asahi-dev · 2026-10-29 19:45
svenhm, so i guess that 0x0 - 0xfff is the issue? i.e. that's what it thinks is the ro region?
#asahi-dev · 2026-10-29 19:41
snooze6214[m]Does anyone know how rorgn_begin and rorgn_end are set under SPTM? (referenced here https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/osfmk/kern/zalloc.c#L6518)... (full message at <https://matrix.org/oftc/media/v1/media/download/AZQLmArQASkYF-UWY0ViR_bPis2IW9NKVHoTeec1g13Uxbu0g0-FlCHZvCj58HdOqCvurwmpZLWi-v7l-BKGzyRCeh0UfI8wAG1hdHJpeC5vcmcvVllLcmhKTlhIVGpHRkNRRVpidEFVVUdh>)
#asahi-dev · 2026-10-29 18:14
yukahttps://termbin.com/e7id
#asahi-dev · 2026-10-29 18:05
yukafor some reason m1n1 deletes atcphy3?
#asahi-dev · 2026-10-29 17:56
yukadiff so far: https://termbin.com/gnj67
#asahi-dev · 2026-10-29 17:51
yukaI also adjusted the gpios. the function-hdmi_hpd now points to pinctrl_aop
#asahi-dev · 2026-10-29 17:24
yukait now boots without crashing, should theoretically have probed dcpext0 etc. but nothing happens when I plug in hdmi
#asahi-dev · 2026-10-29 17:23
yukaI'm trying to get hdmi working
#asahi-dev · 2026-10-29 17:22
yukaah no the first was correct

plus ›