#
…

2026-06-17

00:03hdbngr has quit [Read error: No route to host]
00:23anon has joined #asahi-dev
00:34freetolga has quit [Quit: Connection closed for inactivity]
01:00pb17 has quit [Ping timeout: 480 seconds]
01:02pb17 has joined #asahi-dev
01:30amarioguy has quit [Read error: Connection reset by peer]
01:59nnym has quit [Remote host closed the connection]
02:00yurix has quit [Remote host closed the connection]
02:00yurix has joined #asahi-dev
02:00nnym has joined #asahi-dev
02:25kaleryeblueberryoboe has joined #asahi-dev
02:33tobhe has joined #asahi-dev
02:39tobhe_ has quit [Ping timeout: 480 seconds]
03:02tjemke775 has joined #asahi-dev
03:02XeR has quit [Remote host closed the connection]
03:04XeR has joined #asahi-dev
03:05XeR has quit [Remote host closed the connection]
03:06XeR has joined #asahi-dev
03:07tjemke77 has quit [Ping timeout: 480 seconds]
03:07tjemke775 is now known as tjemke77
03:12turboretor has joined #asahi-dev
03:59kaleryeblueberryoboe has quit [Ping timeout: 480 seconds]
04:01marvin24 has quit [Ping timeout: 480 seconds]
04:08kaleryeblueberryoboe has joined #asahi-dev
04:15ocaml_ has joined #asahi-dev
04:17ocaml_ has left #asahi-dev [#asahi-dev]
04:21arunava has joined #asahi-dev
04:22pb17 has quit [Ping timeout: 480 seconds]
04:28arunava has quit [Remote host closed the connection]
04:29eluks has quit [Remote host closed the connection]
04:30eluks has joined #asahi-dev
04:34arunava has joined #asahi-dev
04:41pb17 has joined #asahi-dev
04:47arunava has quit [Ping timeout: 480 seconds]
04:53kaleryeblueberryoboe has quit [Remote host closed the connection]
04:54kaleryeblueberryoboe has joined #asahi-dev
05:11kaleryeblueberryoboe has quit [Ping timeout: 480 seconds]
05:16jvoisin has quit [Ping timeout: 480 seconds]
05:32mattia013 has joined #asahi-dev
06:07jvoisin has joined #asahi-dev
06:24Calandracas__ has quit [Ping timeout: 480 seconds]
06:37sofus has joined #asahi-dev
07:14mattia013 has quit [Remote host closed the connection]
07:19mripard has joined #asahi-dev
07:37sofusanyone with an m1/m2 willing to test my avd driver? Fair warning: it might cause a system freeze
07:38sofusyou can get the firmware here https://github.com/sofus13/avd-fw.git run make (use VERSION=2 for M1) and copy to the vendor/apple firmware path
07:38chadmedis the fw just a shim
07:38chadmedto set up irqs?
07:40chadmedwheres the driver
07:41sofusnot entirely sure what shim is, the fw does a few register writes and forwards irq's
07:45chadmeda shim is something that sits between two other things but doesnt really do much by itself. the term comes from thin sheets of metal that are used to space things out a precise amount but in software refers to small bits of software that basically just shuttle messages between two other bigger pieces of software
07:48sofusah okay, i guess its basicly a shim
07:49sofusbut also kinda not, the linux driver only recieves from it
07:53chadmednot sure i like the trace replays in avd_hw.c. do we understand what any of that does? iirc some of it was setting up interrupts and tunables but not all of it
07:54chadmed(its been like 3.5 years since i looked at avd)
07:55sofusim pretty sure its tunatables, i dont like it either.
07:59sofusi found https://github.com/ArcaneNibble/m1n1/blob/avd/proxyclient/m1n1/hw/avd.py which has names for most of the registers on m2
08:00chadmedoh god it actually has been 4 years
08:01chaos_princessbtw, have you ran h264 conformance on it?
08:01chadmedok yeah so that avd_boot sequence is setting up irqs and stuff
08:02chadmedyou can probably make that a bit less ambiguous by defining some of those things we know about
08:03chaos_princesshttps://pastebin.com/LcMSyfUU - this is my pre-sorted conformance test dir from when i was poking at it. ns-vt means 'macos does not support it, do not bother', and ns-ffmpeg is 'ffmpeg does not support it'
08:06sofuschadmed: yes, im gonna clean it up soon
08:07svenkettenis: yeah, I just don’t remember who it was but it seems quite reasonable and simple to implement so far
08:08sofusthe driver is not smart about resets, so if an error happens while multiple things are decoding they all fail
08:12gargantua has joined #asahi-dev
08:31cy8aer has quit [Remote host closed the connection]
08:32Calandracas has joined #asahi-dev
08:33Sobek[m]sofus: What is this driver for ?
08:33chadmedvideo decoder
08:33sofusSobek[m]: avd - apple video decoding
08:37sofusin the device tree, the base m1 is the only one with avd-version = 3, all others have 4
08:37sofusif that means what i think it does, supporting m3 and up should not be hard
08:38chaos_princessstrange, as we know that m3 grew on av1 support
08:39chadmedwasnt av1 around unofficially before that? or am i thinking of vp9
08:39sofusyeah, i have my theories, but i cant be sure
08:39chaos_princessvp9, and even in m3 the system is still tsundere about it and only allows safari to use it
08:40chadmedno videotoolbox?
08:40sofusif anyone with an m3 (or higher) would send me fw for the cm3 i could verify it
08:41chaos_princessrip it out of the kdk
08:41chaos_princessit is baked into the kext
08:41sofusok sure
08:41Sobek[m]chaos_princess: The system as in macOS, right ? Asahi might be able to use it ? Or is this a dangerous patent license minefield ?
08:41sofuscan i do the same with tunatables?
08:41chaos_princessif you throw the kext into ghidra
08:42chadmedianal but my understanding is that apple has paid whatever licence fees as the "implementor" being that the implementation of the codec is in hardware
08:42chaos_princessSobek[m]: macos only supports vp9 reluctantly, and only for playing youtube in safari. But the hw is there.
08:42chadmedobv only a problem for avc/hevc/vvc (if it ever happens)
08:42chaos_princessvvc is a joke
08:43chadmedunless the streamers really put their feet down i suspect itll still end up a "standard" anyway
08:43cy8aer has joined #asahi-dev
08:43chadmeditll get added to dvb at the very least
08:44chaos_princessi don't expect it to be used outside of dvb/atsc/similar.
09:12sofusany clue what codenames corespond to what devices?
09:13sofusbased on tunatables i think im right
09:37arunava has joined #asahi-dev
09:38arunavahi, i got a spare mac m1, a linux machine, and plenty of free time (holidays ye :), i've prev ctfs and programming exp in c/py etc. anything good first issue for me to poke into (can be anything)..? thanks.
10:00arunava has quit [Read error: Connection reset by peer]
10:05arunava has joined #asahi-dev
10:15arunava has quit [Read error: Connection reset by peer]
10:16arunava has joined #asahi-dev
10:29arunava has quit [Read error: Connection reset by peer]
10:39enick_227111 has quit [Quit: Bridge terminating on SIGTERM]
10:39rhysmdnz1111 has quit [Quit: Bridge terminating on SIGTERM]
10:45arunava has joined #asahi-dev
10:46paulwalker has joined #asahi-dev
10:48rhysmdnz has joined #asahi-dev
10:49Jamie has joined #asahi-dev
10:49Jamie is now known as Guest11490
10:59midou has quit [Ping timeout: 480 seconds]
11:04kitlith has quit [Read error: Connection reset by peer]
11:04kitlith has joined #asahi-dev
11:05arunava has quit [Remote host closed the connection]
11:56XeR has quit [Remote host closed the connection]
11:56XeR has joined #asahi-dev
11:57midou has joined #asahi-dev
12:07picnoir has quit [Ping timeout: 480 seconds]
12:17pb17 has quit [Ping timeout: 480 seconds]
12:18gargantua has quit [Ping timeout: 480 seconds]
12:19kaleryeblueberryoboe has joined #asahi-dev
12:21picnoir has joined #asahi-dev
12:31pb17 has joined #asahi-dev
12:32kaleryeblueberryoboe has quit [Ping timeout: 480 seconds]
12:45yurix has quit [Remote host closed the connection]
12:46yurix has joined #asahi-dev
13:59jvoisin` has joined #asahi-dev
14:03jvoisin has quit [Ping timeout: 480 seconds]
14:13minecrell has quit [Quit: :/]
14:31mattia013 has joined #asahi-dev
14:31jvoisin` has quit []
14:31jvoisin has joined #asahi-dev
14:33fl0_id_afk has quit [Quit: ZNC - https://znc.in]
14:33fl0id_oftc has quit [Quit: ZNC - https://znc.in]
14:35fl0id_oftc has joined #asahi-dev
14:35step21 has joined #asahi-dev
14:39amarioguy has joined #asahi-dev
15:16hardy94 has joined #asahi-dev
15:26hardy94 has quit [Quit: hardy94]
15:26hardy94 has joined #asahi-dev
15:35svenbah, running into that instruction abort with FAR: 0x2000000 issue again now *sigh*
15:35svenjust this time with gcc instead of clang :(
15:46svenhrm... thinking about that one again. we know that the core loads a value from the stack for LR that should've been overwritten and we're in the middle of mmu enabling code
15:47svenis there any way that old value somehow made it into some cache that's now enabled and we read the stale value instead of the correct that should've been propagated to DRAM? i don't quite see how that could happen though
15:48pb17 has quit [Remote host closed the connection]
15:48pb17 has joined #asahi-dev
15:54chaos_princessspam every single cache flush thingy around it?
15:55svenit's very fragile, even a few printfs make it disappear :D
15:56svenit's just very fishy that this happens on the return just after we enable caches+mmu
15:56sveni just don't see how that old value could somehow end up in cacheline
16:19sofus has quit [Quit: leaving]
16:22svenhrm, so i guess the stack is still mapped cachable by the other cores and they might speculatively read it for some reason? maybe? so core 1 writes stale value X to stack, core 0 decides to speculate and read it so that we now have a cacheline with value X, core 1 writes value Y to stack (and directly to DRAM bypassing all caches), core 1 enables
16:22svencaches, core 1 tries to read the value back but now gets the stale cachline value X?
16:22svendunno if that makes sense or if there's any reason for the first core to speculatively read that value
16:30jmax[m]A shot in the dark, Can we use percpu stacks and globals? Or is that already the case but we have instances where cores share pointers to date in their own stacks? Or do we not even do that and we suspect cores are snooping each other's caches through speculation?
16:30jmax[m]Thinking if it's only related to code layout/vars/stack use and not timing, you could just change the MMU mappings for all regions to be Device to disable speculation and see if the issue goes away (as an experiment)
16:30jmax[m]Is the sensitivity (crashing vs not) mostly related to code layout/memory addresses? Or is it related to latencies? (I.e. if you only change a loop counter in some delay function, does the issue go away)?
16:31sveneach core already has their own stack which is why i'm not sure this can even happen. it would have to be core 0 deciding to speculatively fetch core 1's stack for some weird reason at just the wrong time
16:32sveni don't know what it's related to, putting barriers at the right/wrong places makes it disappear. putting udelay or printf somewhere also makes it disappear
16:32svenincreasing the stack size also makes it disappear
16:46rhysmdnz has quit [Quit: Bridge terminating on SIGTERM]
16:46Guest11490 has quit [Quit: Bridge terminating on SIGTERM]
16:50rhysmdnz has joined #asahi-dev
16:51Guest11500 has joined #asahi-dev
17:02Ardu0us_ has joined #asahi-dev
17:07Ardu0us has quit [Ping timeout: 480 seconds]
17:27marvin24 has joined #asahi-dev
17:37pb17 has quit [Ping timeout: 480 seconds]
17:38gargantua has joined #asahi-dev
17:46jmax[m]I remember you running into this a long while ago. Was it happening on the same SoC you're hitting it on now or is it still the same SoC as before?
17:46jmax[m]Maybe it's one of these messy things related to multiple layers of caches? Like a core speculating and bringing the data into its own _cluster's_ L2 then another core in the same cluster reading the stale value?
17:46jmax[m]Yeah I think the best first step would be to create the absolutely smallest repro (a super localized diff, for example a single byte change in a single instruction, which may affect it), since it seems to be super sensitive to any kind of change to code structure or data access patterns. But yeah I'd imagine things going into weird states as cores race to enable the MMU and their caches.
17:49pb17 has joined #asahi-dev
17:50yukainteresting! t8140 boots to a shell with 26.6 beta 2 iboot and nohlt in the cmdline
17:50yukaand unmodified 7.1 kernel
17:50svenjmax[m]: i haven't been able to build a simple reproduction case yet unfortunately :D same soc fwiw
17:50svenyuka: \o/
17:50yukaSo nohlt at least partially does the thing I wanted to add with the erratum
17:50svensmp or single core?
17:51yukaI wonder if it is because I have so few drivers enabled that none of them is using delay() :D
17:51sveni think the only two wfis that matter are the idle loop and that __delay function when wfit is available
17:51yukaexactly, and I haven't found out yet if nohlt would prevent the wfit in the delay function from being used
17:51sveni don't think so
17:51svenat least i didn't find any mechanism that would prevent that
17:51yukaexactly
17:52svenmaybe just luck lol?
17:52yukayeah probably
17:52svenlike, that wfit just by pure chance decides not to drop any state :D
17:52mazI'm happy to review a patch nuking wfit in __delay.
17:52yukaOh let me just run the wfi experiment
17:52yukabut with wfit
17:52maz(when nohlt is present, of course)
17:52yukamaz: I will bring that up next, if I can confirm that this is the remaining problem
17:53mazyuka: do you boot at EL1 or EL2?
17:53sveni think will suggested to introduce idle={wfi,wfe,nop} which should also work nicely
17:53mazsven: yeah, we talked about it f2f yesterday.
17:53svenah nice :)
17:53svenshe already checked that wfi even in EL1 sometimes just drops all state
17:54svenat least this motivated me to finally prototype this psci-via-efi-runtime thingy
17:54mazit's going to be interesting in a guest, we'll have to make sure that we never WFI there at all.
17:55svenwe should be able to trap wfi to el2, shouldn't we?
17:56mazyes, but we tend to leave the vcpu to WFI in the guest if it is alone in the run queue. this optimisation will have to go.
17:57mazalthough it is more useful for WFE than WFI on this HW, since we don't have any direct injection of interrupts.
17:57mazhopefully WFE is not affected by this crap.
17:58sveni've been told it isn't
17:58* mazquietly puts the M4 mini in the rack...
18:02yukaI'm confused
18:03yukaabout wfit
18:03yukait does not lose state, but it also does not take as long as I expected to execute
18:03yukait behaves like a nop from what I can tell
18:03yukaI mean, I guess that's a valid implementation
18:04yukait's still just a hint
18:04hardy94@sven does it makes sense to write an qemu based emulator to trace the upper working Code from Apple ?
18:05svenwhat upper working code from apple do you mean?
18:05gargantu1 has joined #asahi-dev
18:05hardy94i have set up an qemu based Emulator for the A18 Pro
18:05hardy94it uses the ipsw for macOS to boot
18:06sveni'm still confused what you are suggesting. what code do you want to run in there?
18:06hardy94i am trying to run the Apple binary which is quite esseantial if we wanna run our (m1n1) binaries
18:06sven*what* apple binary?
18:07hardy94the macOS kernel and so on
18:07chaos_princessand how does that help with running m1n1?
18:08gargantua has quit [Ping timeout: 480 seconds]
18:08hardy94it is quite simple ... if we have an working emulator we know how the device runs. The deployment time of the m1n1 takes approx 2 Minutes and thats a huge time in my humble
18:08hardy94we can do stack traces
18:09chaos_princess> if we have an working emulator
18:09chaos_princessthat's a very load-bearing if
18:09hardy94chaos_princess: thats right
18:09chaos_princessespecially since it would require you to already know how the hw works
18:09hardy94not at all
18:09yukahardy94 thinks claude coded a working emulator ;-)
18:09hardy94we have to understand the system topology
18:10svenwhat do you mean with system topology?
18:10chaos_princessi'd say necessary, but not sufficient, proceed
18:10hardy94yuka: give it at least a try
18:10chaos_princessgive what a try
18:10svenso is that what actually happened? you asked claude to write an a18 pro emulator? :/
18:11hardy94sven: i know you hate the discussion. i gave him the binarys and he proceeded well
18:11sven*sigh*
18:11chaos_princesshardy94: we do not do that here
18:11svenplease read that and then stop wasting our time
18:11chaos_princessdo that somewhere else
18:12chaos_princessalso, "binarys" = copyright-tainted, so just no
18:12hardy94i do not modify their binarys
18:13fr4gm3nt3dm3m0r1e5[m]I wish it was legal to make closed so open
18:13chaos_princessdoesn't matter, if you fed disasm into a llm, this is automatically a "just stop"
18:13svenno need to have this discussion here, we have a policy against using gen ai so if you want to contribute please follow that. if you want to start a separate project that somehow uses claude to port linux or m1n1 or whatever to these machines, sure, go ahead, but please leave us alone
18:14hardy94so i understood it quite well
18:48hardy94 has quit [Quit: hardy94]
18:50yukanohlt does not seem to be enough for t8132 not to lose state. it's happens less often (I get further in the boot process and see other crashes) but not fixed.
18:51yukaone particular crash with nohlt which looks like lost state
18:51hardy94 has joined #asahi-dev
18:52svenhm.. so there must be another wfi somewhere then
18:54yukaOr wfit loses state after all, even though I can not reproduce it in m1n1
18:54sventry_check_zero does call udelay
18:56steinsgate has joined #asahi-dev
18:57yukaI mean even without setting up timer interrupts, wfit / wfet both return immediately
19:00yukareproduced it
19:00yukahad to give it a value big enough
19:01svenguess it's time to write that idle=wfe patch and also stop udelay from using wfit then ;)
19:02yukaidle=wfe does not help us
19:02yukait just gets stuck
19:02yukaand never wakes up again
19:03yukaat least when replacing wfi with wfe directly
19:04yukaBut as maz suggested nohlt could also stop delay from using wfit
19:05svenif we use nohlt we can't even idle with psci or anything else. that's not gonna be fun long term
19:06yukaOh, that's not good
19:06yukaso we need nohlt but only disabling the default idle state
19:06svenwhich brings us back to idle={wfi,wfe,nop} like will suggested i guess
19:07sventhough maybe wfe isn't a subset for wfi i guess. don't really feel like reading the reference manual to figure out the difference right now
19:09yukaOkay, I will write a response to will now
19:09yukadescribing the findings in wfe and wfit
19:23minecrell has joined #asahi-dev
19:28jannauyuka: the boot cpu on m4 never loses state in wfi? Doesn't that suggests that it is still somehow configurable?
19:28yukaNot only on M4
19:28yukaAlso on M3 if you set WFI_MODE = 0
19:28yukaand M1 Pro....
19:29jannauif that's the case switch_boot_cpu() might be a bad idea as well
19:30yukaall the way back, the "default" state was that the boot cpu does not lose state, but other cores do (on some older cpus, the first p-core also doesn't lose state, but the first e-core on M4 / A18 Pro does lose state)
19:35yukajannau: but it's still possible that switch_boot_cpu. the idle loop won't run before the patching.
19:35jannauI'm ignoring cases which do not causes trouble due to CYC_OVRD
19:35yuka*that switch_boot_cpu could work
19:35svenboth early_param and alternative patching are early enough afaict
19:35svenfor both idle loop and __delay
19:35sven__delay because the cpufeature detection also only happens after early_param stuff and just before the alternative patching afaict
19:36yuka"do not causes trouble due to CYC_OVRD" <-- what do you mean by this?
19:37jannauwe don't have trouble on m1* - m3* because we can prevent wfi loosing state
19:37yukaI was just explaining that this behavior of the boot core being special isn't new on M4
19:37svencould it be that we have some irqs unmasked or something that constantly reach the first core?
19:37jannauI have trouble believing this
19:39yukano, I can actually see the delay happening
19:39yukait does not wake up early on the boot core
19:39flokliI installed 26.6 beta 2 (mBoot-18000.160.14.501.1) and msr((3, 5, 15, 1, 3), mrs((3, 5, 15, 1, 3))) does throw an exception. t6040
19:42yukawould be interesting to play around with ACC_OVRD on < M3
19:42yukawhile CYC_OVRD_WFI_MODE = 0
19:42yukabut I didn't see any difference after setting and unsetting a few things in there
19:47yuka* <= M3
19:49yukaI'm still unsure why the M4 / M4 Pro are still (regularly) crashing in boot with smp with the wfi/wfit patched out, while I have not seen a single such crash on A18 Pro
19:59kaleryeblueberryoboe has joined #asahi-dev
20:14kaleryeblueberryoboe has quit [Ping timeout: 480 seconds]
20:27pb17 has quit [Ping timeout: 480 seconds]
20:27hardy94 has quit [Quit: hardy94]
20:28kaleryeblueberryoboe has joined #asahi-dev
20:39pb17 has joined #asahi-dev
20:41linuxgemini has quit [Quit: getting (hopefully fresh) air o/]
20:50kaleryeblueberryoboe has quit [Remote host closed the connection]
20:53hardy94 has joined #asahi-dev
20:53hardy94 has quit []
20:55mattia013 has quit [Remote host closed the connection]
21:11gargantu1 has quit [Ping timeout: 480 seconds]
21:19Yushi has quit [Remote host closed the connection]
21:20Yushi has joined #asahi-dev
21:26lederstr- has joined #asahi-dev
21:33lederstrumpf has quit [Ping timeout: 480 seconds]
21:34chaos_princessthe dcp when left in boot mode does not appreciate pmgr misc turning the dcs/fabric clocks down.
21:34chaos_princessso, that will have to wait until dcp driver i think
21:43jannaudid I add "apple,min-state = <4>;" to the power-state?
21:43chaos_princesswith misc removed and everything else left as-is, it survives a sleep cycle
21:45jannaups_disp*_cpu
21:45yukaquestion: how do you run/use the proxyclient/hv/trace_* scripts?
21:45yukaI have until now pasted snippets of them into my hv shell
21:45chaos_princess-m to run_guest
21:46JamesCalligeros[m]Oh no is that not documented in the user guide
21:46chaos_princessdoesn't loook like those have min-state
21:47jannaulooks like I only added them to t8122 and not t6030 / t6031
21:49yukaJamesCalligeros[m] nope
21:49jannauissue might be that framebuffer0 uses "power-domains = <&ps_disp_fe>;"
21:49JamesCalligeros[m]yuka: ill fix that later today
21:50JamesCalligeros[m]Bit of a silly oversight :p
21:50jannauthat should be ps_disp_cpu
21:54jannauchaos_princess: fixes pushed to asahi-wip
21:55yukawould be very nice if that fixes my display not turning on again after sleep :p
21:55chaos_princessty, will re-test pmgr misc in a bit
22:22chaos_princessyea, whatever happened makes it even worse, now it kills the display on boot
22:25jannaujust with pmgr-misc?
22:26chaos_princesswith changes in -wip
22:27yukaonly -wip has the same
22:28jannaurevert the t603x-j514-j516.dtsi change
22:29jannaut6030 / t6031 have inverted ps_disp_cpu / ps_disp_fe dependencies
22:30jannaumake that only t6031
22:31jannauI'll look at it tomorrow
22:37pb17 has quit [Ping timeout: 480 seconds]
22:44Extern has joined #asahi-dev
22:47pb17 has joined #asahi-dev
23:14Deewiant has quit [Remote host closed the connection]
23:17Deewiant has joined #asahi-dev
…