#
…

2025-04-06

00:08ece314378925355451680698427415 has joined #asahi-re
00:36mischa85 has quit [Ping timeout: 480 seconds]
00:58mischa85 has joined #asahi-re
00:59pb17 has quit [Ping timeout: 480 seconds]
01:06mischa85 has quit [Ping timeout: 480 seconds]
01:15ddxtanx has quit [Remote host closed the connection]
01:15mischa85 has joined #asahi-re
01:17ddxtanx has joined #asahi-re
01:24mischa85 has quit [Ping timeout: 480 seconds]
01:32pb17 has joined #asahi-re
02:13mischa85 has joined #asahi-re
02:21mischa85 has quit [Ping timeout: 480 seconds]
03:16pb17 has quit [Ping timeout: 480 seconds]
03:23pb17 has joined #asahi-re
03:30red_rider has joined #asahi-re
03:31mischa85 has joined #asahi-re
03:39mischa85 has quit [Ping timeout: 480 seconds]
04:09red_rider has quit [Ping timeout: 480 seconds]
04:12WindowPain has joined #asahi-re
04:14mischa85 has joined #asahi-re
04:23mischa85 has quit [Ping timeout: 480 seconds]
04:32mischa85 has joined #asahi-re
04:40mischa85 has quit [Ping timeout: 480 seconds]
05:01Halian has quit [Quit: I'll be back.]
05:02pb17 has quit [Ping timeout: 480 seconds]
05:24pb17 has joined #asahi-re
05:55red_rider has joined #asahi-re
06:02red_rider has quit [Remote host closed the connection]
06:33mischa85 has joined #asahi-re
06:36pb17 has quit [Ping timeout: 480 seconds]
06:41mischa85 has quit [Ping timeout: 480 seconds]
07:10pb17 has joined #asahi-re
07:21chadmed has quit [Quit: Konversation terminated!]
07:21chadmed has joined #asahi-re
07:22JayBeeFOSS has quit [Ping timeout: 480 seconds]
07:23JayBeeFOSS has joined #asahi-re
07:25mischa85 has joined #asahi-re
07:30mattia013 has quit [Remote host closed the connection]
07:33mattia013 has joined #asahi-re
07:35mischa85 has quit [Ping timeout: 480 seconds]
07:57mischa85 has joined #asahi-re
08:31pb17 has quit [Ping timeout: 480 seconds]
08:49pb17 has joined #asahi-re
09:46mattia013 has quit [Quit: mattia013]
09:46mattia013 has joined #asahi-re
10:19thunfisch has quit [Ping timeout: 480 seconds]
10:26pb17 has quit [Ping timeout: 480 seconds]
10:27thunfisch has joined #asahi-re
10:42pb17 has joined #asahi-re
11:21opticron has quit [Read error: Connection reset by peer]
11:26opticron has joined #asahi-re
11:38chaos_princesssven: do we know how xnu stars secondaries on m4?
11:39svenso I think it has to happen inside SPTM
11:39chaos_princessas in: genter to sptm with a "do start secondaries" syscall?
11:40svenI 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
11:40svenbut i haven't found the actual code that does the bringup now
11:40nickchanit definitely happens inside sptm according to some tweets i have seen
11:40svenif xnu did this it could also hijack SPTM
11:41nickchanit also has to because the core comes out of reset in EL2 with GL available but disabled
11:41svennow i wonder how this is locked down in raw boot mode
11:41chaos_princessis there a chance that sptm is not the first/only code that runs there, and it jumps to iboot or sth?
11:42svensiguza 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
11:42svenand then just disabled SPRR/GXF/etc. in there
11:43nickchanthere are like 4 ctrr regions that can be configure on m4
11:43chaos_princesscan we read the state of those?
11:43nickchanit's cpu registers so it should be possible
11:44svenunless they're locked down to just return 0 or whatever, yes
11:44chaos_princesswould be interesting to do for both raw and macho and compare
11:44chaos_princessand in general just see what is there
11:44nickchanso m1n1's apple_regs.json already has CTRR A and B
11:44nickchanbut m4 supposedly also have C and D
11:48nickchantry s3_0_c11_c6_6 for CTRR_C_LWR_EL2 and s3_0_c11_c6_7 for CTRR_C_UPR_EL2
11:49nickchanand s3_0_c11_c7_0 for CTRR_D_LWR_EL2, s3_0_c11_c7_1 for CTRR_D_LWR_EL2
11:50nickchanerm s3_0_c11_c7_1 should be CTRR_D_UPR_EL2
11:50j`ey /win 108
11:50j`eywoops sorry
11:51nickchanbut of course if isa extensions are being disable it's also possible that those regs just don' twork
11:52chaos_princessdoesn't hurt to try
11:53chadmedthey shouldnt be disabled if a macho m1n1 is enrolled though right
11:54chaos_princessmischa85: could you try reading out all ctrr regs in both modes
11:54nickchanchadmed: they will not be disabled in that situation but it would be EL2 under sptm
11:57nickchanin my understanding CTRR should have multiple parts, EL1 restriction, EL2 restriction and DRAM restriction
11:57nickchanbut m1n1's apple_regs.json makes absolutely no mention of anything related to DRAM restrictions
11:58nickchanEL1 restriction and EL2 restrictions limit instruction fetches, DRAM restrictions ensure memory ranges cannot be written to
12:06svendram restriction is MMIO iirc
12:08svenand the sysreg restrictions at least limit writes to caches
12:09svendidn't the sysregs also change when they introduced PPL? i'm not sure they still limit instruction fetches these days
12:14pb17 has quit [Ping timeout: 480 seconds]
12:14mischa85chaoss_princess: currently A and B are defined in apple_regs, how do i translate s3_0_c11_c6_6 to "enc": [3, 4, 15, 9, x ]
12:15mischa85x is 1, 2, 3 and 4 for A and B
12:16svens3_0_c11_c6_6 is [3, 0, 11, 6, 6] or what do you mean?
12:16yuyichao_ has quit [Ping timeout: 480 seconds]
12:17mischa85oh i expected some complicated logic behind it again
12:17mischa85excuse me, on it
12:17nickchanyou can also mrs((3,0,11,6,6)) in the shell
12:19mischa85CTRR_C_LWR_EL2 = 0x10004e1c000, CTRR_C_UPR_EL2 = 0x10004e27000, CTRR_D_LWR_EL2 = 0x0, CTRR_D_LWR_EL2 = 0x0
12:22sventhat's likely the coprocessor firmware region
12:23nickchanmischa85: how about A and B?
12:24mischa85CTRR_A_LWR_EL12 = 0x0, CTRR_A_UPR_EL12 = 0x0, CTRR_B_LWR_EL12 = 0x0, CTRR_B_UPR_EL12 = 0x0
12:25mischa85no these are correct
12:26nickchanmischa85: EL12 is EL1
12:26nickchanof course they should be 0
12:26nickchanit's the vhe register aliases
12:26nickchantry the _EL2 registers
12:28mischa85CTRR_A_LWR_EL2 = 0x1000000c000, CTRR_A_UPR_EL2 = 0x100002af000
12:29mischa85CTRR_B_LWR_EL1 = 0x10000000000, CTRR_B_UPR_EL1 = 0x1000181f000
12:30nickchanokay that's _EL1 but since VHE is always active that should just be _EL2
12:31mischa85yes these are the same for EL2
12:31nickchanapple used 3 CTRR regions for it but previous chips can only do 2
12:32nickchansven: what do you think
12:33svenif this was my machine I'd dump these regions and take a look at them, but since they contain apple code we shouldn't share them unfortunately . they seem to all be rather large though.
12:34svenalso dump that cpu start region and look for the IORVBAR value or however that's called
12:35nickchansven: /cpus/cpu<n>/cpu-impl-reg
12:35nickchanthat should be the IORVBAR
12:35sveni'd take a look at that value and see if it happens to point into one of these CTRR regions
12:35svenespecially for the secondary cores
12:46pb17 has joined #asahi-re
12:47mattia013 has quit [Remote host closed the connection]
12:49mattia013 has joined #asahi-re
12:52nickchanmischa85: maybe do read64(u.adt["/cpus/cpu1"].cpu_impl_reg[0]) following sven's advice
12:52nickchannot sure which core m4 boots on but check that as well
12:53mischa85i'll check
12:55mischa85cpu0-9: 0x110010005d68001, cpu 10-16: 0x210010005d68001
12:55nickchansven: it's all locked!
12:56svennot inside CTRR though
12:56svenbut that explains why you had issues bringing up the other cores
12:56nickchanokay so supposed put code at 0x10005d68000 and supposedly all other cores would end up there
12:57nickchanmischa85: hmmm... is that inside m1n1?
12:57svenalso, where is m1n1 located?
12:57svenyeah, could be that it was just locked by m1n1
12:57mischa85m1n1 base: 0x10005d68000
12:58nickchanokay so that's right at m1n1 base and apple goes out of the way to make sure it's not the entry point *either*
12:58nickchanbecause entry point is +0x800
12:59nickchanit's almost as if it's designed for m1n1
13:00svendoesn't m1n1 set that to its reset vectors as well?
13:01nickchanit might be because of alignment requirements on that reg
13:01svenbut i don't think we lock that reg down
13:01nickchanbut on older socs bit 11 can be configured
13:02svenm1n1's entrypoint is 0x800 from its base
13:03nickchansven: yep and it is secondary entry point as well
13:03sventhe only weird part is that the reg is locked
13:04svenor does it lock automatically after writing to it these days?
13:06nickchanmischa85: you have not attempted to start secondaries in the same boot right
13:07mischa85nickchan: no for sure not. just the shell on bringup m1n1
13:07nickchanokay so it's iboot that did that
13:10nickchanmischa85: maybe start offset is wrong?
13:11nickchanhave you tried every 0x4000 from pmgr base to a max of 0x100000?
13:12mischa85you mean this one? misc-cores-offset = 557056 -> 0x88000 (same as m3)
13:13nickchanmischa85: yeah
13:14nickchanso it's in the adt these days interesting
13:14nickchanback then we bruteforce
13:18mischa85yeah there are quite some new values compared to t6031
13:18mischa85there's also cluster-ctl-offset = 131072
14:00pb17 has quit [Ping timeout: 480 seconds]
14:17pb17 has joined #asahi-re
15:44pb17 has quit [Ping timeout: 480 seconds]
16:15pb17 has joined #asahi-re
16:32mischa85 has quit [Ping timeout: 480 seconds]
16:54mischa85 has joined #asahi-re
16:56chadmed has quit [Quit: Konversation terminated!]
16:56chadmed has joined #asahi-re
17:03mischa85 has quit [Ping timeout: 480 seconds]
17:11mischa85 has joined #asahi-re
17:24pb17 has quit [Ping timeout: 480 seconds]
17:45pb17 has joined #asahi-re
17:50swiftraccoon has quit [Remote host closed the connection]
17:56swiftraccoon has joined #asahi-re
18:00glem81005488 has quit [Quit: bye.]
18:16swiftraccoon has quit [Ping timeout: 480 seconds]
18:18glem810054889 has joined #asahi-re
18:22swiftraccoon has joined #asahi-re
18:28nela has joined #asahi-re
18:28swiftraccoon has quit [Remote host closed the connection]
18:30swiftraccoon has joined #asahi-re
18:56pb17 has quit [Ping timeout: 480 seconds]
19:20pb17 has joined #asahi-re
21:18okb has quit [Read error: Connection reset by peer]
21:35commandoline has quit [Quit: Bye!]
21:36commandoline has joined #asahi-re
21:37commandoline has quit []
21:41commandoline has joined #asahi-re
22:33pb17 has quit [Ping timeout: 480 seconds]
22:50pb17 has joined #asahi-re
…