2023-11-28
00:18rndm has joined #asahi-dev
00:23rndm has quit [Remote host closed the connection]
00:24kidplayer666 has quit [Quit: Connection closed for inactivity]
00:25rndm has joined #asahi-dev
00:40i509vcb has joined #asahi-dev
00:57pounce has quit [Ping timeout: 480 seconds]
01:03pounce has joined #asahi-dev
03:26hightower3 has joined #asahi-dev
03:33hightower2 has quit [Ping timeout: 480 seconds]
04:14crabbedhaloablut has joined #asahi-dev
04:14jeisom has quit [Read error: Connection reset by peer]
04:14jeisom has joined #asahi-dev
04:25i509vcb has quit [Quit: Connection closed for inactivity]
04:28tbodt has quit []
04:28tbodt has joined #asahi-dev
04:32jeisom has quit [Ping timeout: 480 seconds]
04:43tristan2 has joined #asahi-dev
04:45tristan2_ has quit [Ping timeout: 480 seconds]
06:54kidplayer666 has joined #asahi-dev
06:58veebop has joined #asahi-dev
07:02elvishjerricco has quit [Read error: No route to host]
07:03elvishjerricco has joined #asahi-dev
07:04capta1nt0ad has joined #asahi-dev
07:35richyliu2 has quit [Ping timeout: 480 seconds]
07:39richyliu2 has joined #asahi-dev
08:24capta1nt0ad has quit [Ping timeout: 480 seconds]
08:33pjakobsson_ has quit [Ping timeout: 480 seconds]
08:36capta1nt0ad has joined #asahi-dev
08:54capta1nt0ad has quit [Remote host closed the connection]
08:55capta1nt0ad has joined #asahi-dev
09:04kidplayer666 has quit [Quit: Connection closed for inactivity]
09:18capta1nt0ad has quit [Ping timeout: 480 seconds]
10:02kidplayer666 has joined #asahi-dev
11:04capta1nt0ad has joined #asahi-dev
11:13capta1nt0ad has quit [Ping timeout: 480 seconds]
11:18russelltg has quit [Quit: Connection closed for inactivity]
11:19RoguePlanet has joined #asahi-dev
11:19RoguePlanet has quit []
12:39svencan anyone who has multiple M-series SoCs connect the same usb 3 device in the same orientation to all of them and trace atcphy? i want to confirm that there are no differences between the various generations
12:41svenmainly because there were some reports of usb3 being a bit flaky but I think that's because I have the atcphy/dwc3 order wrong in the current kernel
12:44ydalton has joined #asahi-dev
13:14jeisom has joined #asahi-dev
13:24darkapex1 has quit [Ping timeout: 480 seconds]
13:25jeisom has quit [Quit: Leaving]
13:31nicolas17 has quit [Ping timeout: 480 seconds]
14:07DannyBWhee. i figured out why the m3 mmu hangs but i'm not sure what to do about it. It seems the state that m1n1 expects us to start in is not how things start for the m3. So for example, i have to clear the TCR register in chickens (or at least set it to the value that XNU does), to make the MMU init work, even though the MMU init *also* sets the TCR register itself. If i don't, the chip hangs when we set the SCTLR
14:07DannyBXNU resets the TCR very early and uses statically allocated bootstrap pagetables very early in the init until it sets up real pagetables.
14:07DannyBUnless someone has a better idea, i'm going to assume that the set of things that m1n1 wants is defined as "however the m1/m2 chip registers start right now", and ensure we put the m3 in the same state in chickens.
14:07DannyBThe alternative would be to have a real spec of what we expect the invariants to be for m1n1, and put all the chips in that state. Maybe later
14:07DannyBregister. So i assume something changed that is causing addresses to be translated or whatever in a way that we don't want on the m3, but not m1/m2. The MMU is not on when we get it on m3, so i have no idea why this has any effect, but it does!
14:12svenhrm, i think when i wrote the original MMU code I didn't rely on any previous state of the architectural registers
14:15svenI'd try to remove the sprr/gxf init from m1n1's mmu and see if that changes anything. I think we only need that for the HV
14:16svenhrm, no, looking at it again we leave SPRR/GXF disabled in the MMU init and only prepare everything for the HV
14:17svenI think it's just the call to mmu_init_sprr() which may do weird things if they changed those regs
14:20DannyBAs for chickens themselves, i automated running every combination of lines in chickens for m3 and they all have the same behavior if i don't play with TCR (IE none of them change that we hang the chip the second MMU is turned on)
14:20DannyBI also was able to get most of the names/info of these chicken bits from the kernel debug info
14:21DannyB(On the plus side, i did figure out 75% of the unknown chicken bits we are using on the M2 and documented them :)
14:21svenhave you checked if the initial xnu pagetables look weird in some way or how that TCR value XNU differs from the one inside m1n1?
14:23DannyBYes. I have the initial XNU TCR value, and decoded it, ours did not look crazy but maybe i decoded it wrong.
14:23DannyBThe initial TCR, and bootstrap pagetables, are the same in XNU for 14.2 for m2/m3. I was going to look at older kernels today see if it was differnet before, and they just chose something in 14.2 that works for all
14:24svenj`ey: i'm only asking dumb questions anyway because that usually helps when i'm stuck at weird bugs like that :D
14:27svenor, wait, you first set it to the XNU value and then later m1n1 overwrites it and the MMU works then?
14:29john-cabaj has joined #asahi-dev
14:31DannyB"This control has an effect regardless of whether stage 1 of the EL1&0 translation regime is enabled or not."
14:37DannyB"This affects addresses generated in EL0 and EL1 using AArch64 where the address would be translated by tables pointed to by TTBR0_EL1. It has an effect whether the EL1&0 translation regime is enabled or not."
14:37DannyBwhat does it mean to affect the address generation if they would be translated, but it has effect whether the translation is enabled or not?
14:38DannyBi guess they mean it has effect if it would be translated if the translation was on, even if translation is off?
14:39svendo they write to TCR in the chicken bit sequence inside xnu? maybe there's some truly weird hw bug where they have to do that specifically ordered w.r.t some chicken bit
14:44DannyBThe open source code of this part is actually correct (IE it matches the compiled kernels):
14:44DannyBhttps://github.com/apple-oss-distributions/xnu/blob/xnu-10002.41.9/osfmk/arm64/start.s#L636
14:45DannyB#define TCR_EL1_BOOT (TCR_EL1_BASE | (T1SZ_BOOT << TCR_T1SZ_SHIFT) | (TCR_TG0_GRANULE_SIZE))
14:49nicolas17 has joined #asahi-dev
14:57ydalton has quit [Remote host closed the connection]
15:12darkapex1 has joined #asahi-dev
15:13svendouble checked that we also overwrite tcr from m1n1 so the previous value really shouldn’t matter :/
15:18sveni'm still very confused because we overwrite TCR anyway. what state is left that get cleared by first setting that one to zero?
15:23svenalso looked for missing barriers but we have a isb inbetween setting up tcr and enabling the mmu
15:42pounce has quit [Ping timeout: 480 seconds]
15:47nicolas17does anyone here have M3 Max? Siguza was looking for the bootrom version and CPRV (which appear on the DFU serial string)
15:53pounce has joined #asahi-dev
15:53nimprod3l has joined #asahi-dev
16:03mazhuh, I never realised: generating a reset command from a CS on a M2 that is powered-off brings it back to life (tested on M2 Pro mini and M2 MBA). doesn't work on my M1 mini.
16:10kettenisit only seems to work if you power down the machine with CS connected to another machine
16:28DannyBnicolas17: I have one. what do you need? (I'm not near it for a few hours, but can get it when i am back)
16:29DannyB@sven: We do call memory allocation functions prior to setting the TCR. But the MMU is disabled. So the only effect could be from top byte ignore i guess?
16:32nicolas17DannyB: enter DFU, run "irecovery -q" from the other machine, it will show CPRV and SRTG (bootrom version)
16:36svenim pretty sure the memory allocation functions just do internal bookkeeping and ignore whatever the mmu does
16:42DannyBOne random thing i noticed - we init the mcc, and init the mmu, but we never actually set the cache to a known state (disabled or enabled). mcc_init just sets up the registers. Apple's MCC init explicitly disables and then enables cache.
16:47DannyBin any cse, this has all been useful so far. i'll go try some stuff here and see what happens
17:04pounce has quit [Ping timeout: 480 seconds]
17:06pounce has joined #asahi-dev
17:17pounce has quit [Ping timeout: 480 seconds]
17:39pounce has joined #asahi-dev
17:51pounce has quit [Ping timeout: 480 seconds]
18:03pounce has joined #asahi-dev
18:05elvishjerricco has quit [Ping timeout: 480 seconds]
18:16nimprod3l has quit [Read error: Connection reset by peer]
18:17nimprod3l has joined #asahi-dev
18:20nyx_o has quit [Ping timeout: 480 seconds]
18:28pounce has quit [Ping timeout: 480 seconds]
20:11pounce has joined #asahi-dev
20:21john-cabajApologies if this has been discussed, but have any Asahi patches been upstreamed in 6.6 not in 6.5? It's easy enough to backport Asahi commits following the v6.6 tag, but if any patches fell in 6.6, it's trickier to determine.
20:25nimprod3l has quit [Ping timeout: 480 seconds]
20:26j`eyjohn-cabaj: you mean you have a 6.5 kernel tree, and want to port the patches from the curent 6.6 asahi tree?
20:34pounce has quit [Ping timeout: 480 seconds]
20:35crabbedhaloablut has quit []
20:50john-cabajCorrect
20:56elvishjerricco has joined #asahi-dev
20:56john-cabajThere's definitely iommu changes between 6.5 and 6.6 that some Asahi patches will need backported, possibly others.
20:56john-cabajBut those weren't Asahi specific. Anything Asahi specific existing upstream in 6.6 not in 6.5 is a bit of a blind spot.
20:59john-cabajGood idea, that's a start.
21:00john-cabajThanks
21:02john-cabajYeah, could do that too. Then will need backport kernels to previous releases. But that still might be easier.
21:27elvishjerricco has quit [Remote host closed the connection]
21:28blazra3 has joined #asahi-dev
21:30blazra has quit [Remote host closed the connection]
21:30blazra3 is now known as blazra
21:42elvishjerricco has joined #asahi-dev
21:45qyousef has quit [Write error: connection closed]
21:45qyousef has joined #asahi-dev
21:46kuruczgy has quit [Read error: Connection reset by peer]
21:46d4ve has quit [Read error: Connection reset by peer]
21:46amada95 has quit [Read error: Connection reset by peer]
21:46coder_kalyan has quit [Read error: Connection reset by peer]
21:46signaryk has quit [Read error: Connection reset by peer]
21:46alethkit has quit [Write error: connection closed]
21:46handlerug has quit [Write error: connection closed]
21:46probie has quit [Write error: connection closed]
21:46akspecs has quit [Write error: connection closed]
21:46okt has quit [Write error: connection closed]
21:46tsujp has quit [Write error: connection closed]
21:46rosefromthedead has quit [Write error: connection closed]
21:46pldtf has quit [Write error: connection closed]
21:46ella-0 has quit [Write error: connection closed]
21:46cds has quit [Write error: connection closed]
21:46dubiousness has quit [Write error: connection closed]
21:46dk_ has quit [Write error: connection closed]
21:46elvishjerricco has quit [Remote host closed the connection]
21:46cds has joined #asahi-dev
21:46probie has joined #asahi-dev
21:46dk_ has joined #asahi-dev
21:46okt has joined #asahi-dev
21:46signaryk has joined #asahi-dev
21:46tsujp has joined #asahi-dev
21:46coder_kalyan has joined #asahi-dev
21:46kuruczgy has joined #asahi-dev
21:46handlerug has joined #asahi-dev
21:46rosefromthedead has joined #asahi-dev
21:46alethkit has joined #asahi-dev
21:46akspecs has joined #asahi-dev
21:46pldtf has joined #asahi-dev
21:46amada95 has joined #asahi-dev
21:46dubiousness has joined #asahi-dev
21:46ella-0 has joined #asahi-dev
21:46d4ve has joined #asahi-dev
21:46esden has quit [Ping timeout: 480 seconds]
21:47esden has joined #asahi-dev
22:05jole has quit [Remote host closed the connection]
22:05jole has joined #asahi-dev
22:08jole has quit [Remote host closed the connection]
22:08jole has joined #asahi-dev
22:39jeisom has joined #asahi-dev
23:14so101 has joined #asahi-dev