#
✕ nick:sven
#asahi-re · 2025-04-06 11:44
svenyeah
#asahi-re · 2025-04-06 11:44
svenunless they're locked down to just return 0 or whatever, yes
#asahi-re · 2025-04-06 11:42
svenand then just disabled SPRR/GXF/etc. in there
#asahi-re · 2025-04-06 11:42
svensiguza suggested yesterday that it either has to be a sysreg or something that applies to all cores directly after they're out of reset or that they do something cursed like putting a single page under CTRR and locking down the secondary reset vectors to that one
#asahi-re · 2025-04-06 11:41
svennow i wonder how this is locked down in raw boot mode
#asahi-re · 2025-04-06 11:41
svenyeah
#asahi-re · 2025-04-06 11:40
svenif xnu did this it could also hijack SPTM
#asahi-re · 2025-04-06 11:40
svenbut i haven't found the actual code that does the bringup now
#asahi-re · 2025-04-06 11:40
svenI think SPTM does that all automatically. i've found a function in there that parses the ADT and finds the cpu-impl-regs and maps them
#asahi-re · 2025-04-06 11:39
sveneventually they all end up at XNU's entry point https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/arm64/sptm/start_sptm.s#L34
#asahi-re · 2025-04-06 11:39
svenso I think it has to happen inside SPTM
#asahi-re · 2025-04-05 13:18
svenUnkSytemRegWrite followed by a bunch of numbers is kinda annoying to read
#asahi-re · 2025-04-05 13:18
svenis there a simple way to define custom sysregs in ghdira?
#asahi-re · 2025-04-05 10:00
svenactually try out how wfi behaves
#asahi-re · 2025-04-05 10:00
sventhat's not what i'm saying
#asahi-re · 2025-04-05 09:54
svenessentially figure out if wfi ever loses register state (e.g. when sleeping for a longer time)
#asahi-re · 2025-04-05 09:39
svenwould need an M4 to figure out what's going on. could just be the magic state machine that decides retention vs. non-retention now
#asahi-re · 2025-04-05 09:39
svenyeah, i'm blind. the save/restore regs stuff is still there
#asahi-re · 2025-04-05 09:37
svenor maybe i'm just blind
#asahi-re · 2025-04-05 09:28
sveni guess
#asahi-re · 2025-04-05 09:16
svenso wfi probably can't enter deep sleep anymore without some help from pmgr or whatever
#asahi-re · 2025-04-05 09:15
svendoesn't look like I can find the save/restore state anymore
#asahi-re · 2025-04-05 08:59
sven*restores
#asahi-re · 2025-04-05 08:58
svenI should probably check if it still saves/restored all registers before wfi
#asahi-re · 2025-04-05 08:58
sveni.e. it loses state when some hw state machine decides it’s time to enter deeper sleep states
#asahi-re · 2025-04-05 08:58
sveneither that or it’s always in automatic mode now
#asahi-re · 2025-04-05 08:12
svenso i guess t8132 just no longer has it?
#asahi-re · 2025-04-05 08:12
svenand even in the SPTM boot path it should try to access that reg, see https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/arm64/sptm/start_sptm.s#L101
#asahi-re · 2025-04-05 08:11
svencomparing with the xnu source drop that means t8132 has NO_CPU_OVRD defined
#asahi-re · 2025-04-05 08:11
svenokay, quick digging into XNU: _arm64_force_wfi_clock_gate on t8132 is just a no-op, _arm64_force_wfi_clock_gate on t8103 write to SYS_IMP_APL_CYC_OVRD
#asahi-re · 2025-04-03 21:14
svenhuh, don't think i see any chicken bits inside t8132 SPTM though
#asahi-re · 2025-04-03 21:05
svenso we'll probably need the chicken bits because SPTM never ran
#asahi-re · 2025-04-03 21:05
svenand for raw it's just iboot -> m1n1.bin in EL2
#asahi-re · 2025-04-03 21:05
svenmy assumption is that for macho it's iboot -> sptm (-> maybe iboot again because sptm's entry seems to eventually return) -> xnu in EL2
#asahi-re · 2025-04-03 21:04
sventhey're either from xnu source dumps or just taken from the xnu entry point
#asahi-re · 2025-04-03 21:03
sven*reversed
#asahi-re · 2025-04-03 21:03
sveni don't think any of the previous chicken bits have been reverse with m1n1 tbh
#asahi-re · 2025-04-03 21:02
sveni currently think so as well
#asahi-re · 2025-04-03 21:02
svenso the sptm for t8112 inside UniversalMac_15.4_24E248_Restore.ipsw contains the chicken sequence
#asahi-re · 2025-04-03 20:59
svenxnu is already loaded with MMU enabled afaict
#asahi-re · 2025-04-03 20:58
svenokay, so on t8112 the chickens are done inside SPTM now so that's probably true for t8132 as well now
#asahi-re · 2025-04-03 17:30
svenyeah, at that point hacking xnu itself might be the easier approach
#asahi-re · 2025-04-03 17:10
sventhat EL2 only issue still makes the hypervisor very painful though
#asahi-re · 2025-04-03 17:07
svenmaybe they just broke raw boot objects in 15.2 and fixed that later
#asahi-re · 2025-04-03 16:59
svenweird
#asahi-re · 2025-04-03 16:58
svenso 15.2 just has no support for custom boot objects / fuOS anymore?
#asahi-re · 2025-04-03 16:58
svenI haven’t looked at iboot at all fwiw
#asahi-re · 2025-04-03 16:58
svenhuh, really?
#asahi-re · 2025-04-03 16:58
svennot yet
#asahi-re · 2025-04-03 16:56
svennot looking forward to that either

plus ›