#
…

2021-10-03

00:00alyssa/usr/share/firmware/wifi/C-4378__s-B1/ is.... erm...... large......
00:07alyssaIt's not at all clear to me how preloader-m1 and linux-m1 work together here.
00:13alyssaoh joy, t2linux has the same problems
00:15tylo has joined #asahi
00:18povik has quit [Quit: Page closed]
00:23alyssawhat even
00:30tylo1 has joined #asahi
00:30tylo has quit [Read error: No route to host]
00:33ihaveamac has quit [Quit: fail]
00:39alyssaugh this really needs to be a kernel module doesn't it...
00:39alyssa(Or I really need an initramfs, or to bundle the blob with the kernel image, or..)
00:43alyssadont use blobs, kids..
00:45tylo1 has quit [Ping timeout: 480 seconds]
00:46psykosei wonder what drug would have blob form
00:51jevinskie[m]Just add LSD. Just in time for trick or treating! https://en.m.wikipedia.org/wiki/Candy_Buttons
00:52marcankettenis: the cores don't spin
00:52marcanthere is a wfe in the "spin"loop
00:52marcanthey should be at least clock gated while waiting
00:52alyssais this going to rebuild the whole kernel?
00:53alyssaoh looks like it is. moan.
00:56marcanalyssa: userspace should boot equally fast, and the kernel *shouldn't* spend too much time before it does the pstates thing? it's like <1 second for me
00:56marcanif you have a big difference in userspace perf then something is weird
00:57alyssamarcan: i do (~20%), maybe schedutil is stupid
00:57soreari'd be concerned about machine safety if anything - are there any circumstances where the laptop is likely to overheat if m1n1 sets it to full power and the kernel hangs or panics before it has a chance to take over pstates?
00:58marcannot really, pretty sure there's failsafes for that
00:58marcanbut the point is this shouldn't be necessary
00:58alyssayeah isn't like the #1 job of the SMC making sure that doesn't happen
00:59marcanalyssa: can you benchmark an e-core and a p-core (maybe all of them) with/without cpu_pstates?
00:59marcanI wonder if I botched the DVMR thing
01:00marcanactually, can you try with cpu_pstates but commenting out set_pstate(1, 15)?
01:00marcanif that still works then it's definitely the DVMR thing
01:02marcando you get "Initializing cluster (DVMR: %d)" lines on boot?
01:03marcan(I don't get any of this because it's unnecessary on 12.0...)
01:03riker77_ has joined #asahi
01:04marcanthat one might be something to move to m1n1 tbh
01:07riker77 has quit [Ping timeout: 480 seconds]
01:07riker77_ is now known as riker77
01:08alyssamy machine definitely needs the DVMR thing, cpu_pstates does it right
01:08alyssachromebook is busy rebuilding the entire kernel for the 2nd time today because of course
01:09alyssaI do not see cluster lines at boot
01:10alyssaI do see apple-mcc performance driver init
01:10alyssawtf I saw this earlier
01:11alyssaok, if I don' run cpu_pstates.py at boot, I get the Initializing cluster DVMR 0/1 lines
01:11alyssaif I do run cpu_pstates.py at boot, I don't
01:11alyssa1.660 + 1.540 --- this is without running it and with the cluster lines
01:11alyssa0.992 + 1.567 -- this is with it
01:12alyssaoh in this case userspace is actually slower with it. so maybe the diff in userspace perf is not statistically significant
01:12alyssakernel is still noticeably faster there
01:13alyssa(40% in that case)
01:15alyssawith the pstates, max freqs 2064/3204
01:16alyssawithout the pstates, max_freqs 2064/3204
01:16alyssaso that would seem like it's working? unless that's just from the DT and not the regs (unlike the python..)
01:17alyssaoh that's the DT
01:19alyssabut the fact the initializing cluster messages go away with pstates.py means everything works as expected so it's. not that
01:20alyssamarcan: oh, but wait! the initializing cluster messages are 0.9s and 1.0s into boot.
01:20alyssawhereas with pstates.py first, the whole kernel finishes booting in 1.0s
01:31alyssaso the problem isn't the cluster driver itself, it's just the cluster driver starts way too late in boot
01:39alyssaI do hope this works after all this T_T
02:29robinp has quit [Ping timeout: 480 seconds]
02:35PhilippvK has joined #asahi
02:38phiologe has quit [Ping timeout: 480 seconds]
02:38alyssa(It does not. Though possibly I botched the firmware.)
02:41alyssaOh geez. Corellium is doing the firmware dance in userspace. That code isn't public is it?
02:54* alyssalitters with pritnk
02:57alyssa..that's racy
03:01alyssa(IRQ coming in during setup)
03:05alyssawonder if I have something funny with my setup
03:06alyssasince I'd sort of expect that to be broken for everyone
03:17alyssaunless the driver bug only happens with wrong firmware
03:29kdrag0n[m]marcan: how'd you get capacity-dmips-mhz 326 for the little cluster?
03:30kdrag0n[m]I'm getting ~713 with both your new cpufreq driver and Corellium's: https://github.com/kdrag0n/linux-m1/commit/83b4bfbb156929c89fe1212b98bff27b74233667
03:30kdrag0n[m]explanation is in the commit message
03:35kdrag0n[m]it also looks your cpufreq driver has the same issue as Corellium's, where freqs > 2988 MHz are identical to 2988 in terms of performance: https://github.com/kdrag0n/freqbench/blob/master/results/t8103/asahi-cpufreq/run.log#L46-L49
03:37kdrag0n[m]not sure how to pin freqs on macOS for testing, but those freqs will skew scheduler capacities if left that way
03:37alyssakdrag0n[m]: this is good stuff btw
04:02marvin24_ has joined #asahi
04:05marvin24 has quit [Ping timeout: 480 seconds]
04:38robinp has joined #asahi
05:09marcankdrag0n[m]: that is not a problem with the cpufreq driver, it's a problem with the lack of a cpuidle driver
05:09marcanit can only boost to 3.2GHz on a single core at once
05:10marcanthat requires the other cores to be in deep ("down") sleep, which requires a cpuidle driver since wfi in that mode is non-state-preserving
05:10marcanm1n1 currently does that properly in its internal SMP code, which is why you can benchmark 3.2GHz there
05:11marcanbut not in Linux, so for the time being, even though you can request 3.2GHz, the hardware will cap you at 3GHz
05:11marcan(feel free to comment out those pstates in the devicetree if you don't want it to "lie")
05:11marcankdrag0n[m]: the capacity-dmips-mhz numbers are based on dhrystone benchmarks
05:11marcanI calculated those on my last stream
05:12marcan713 for the e-cores looks like a way too small difference
05:12marcanI did consider the frequency to be 2988 when doing the math
05:13marcanthis might be because CoreMark does a worse job exercising the pcores' wide instruction dispatch than Dhrystone?
05:15marcanalyssa: okay, so everything is working as intended then
05:15marcanin that case I will probably have m1n1 put the p-cores into 2GHz state or so
05:15marcannot full throttle, something reasonable that should speed up boot
05:15marcanand also I might just move the DVMR thing in there because it's one fewer thing for linux to worry about, and 12.0 does it anyway so even *Apple* thinks that belongs in the bootloader
05:20marcankdrag0n[m]: https://youtu.be/Yqc-sDg5YZE?t=11619 this is where I do the benchmarks
05:22marcanI was running on the hypervisor, so that might skew things a bit (timer IRQs galore), but it shouldn't be enough to skew the numbers majorly I'd hope
05:22marcanI can try again on bare metal
05:23kdrag0n[m]marcan: ah that explains the freq behavior
05:23kdrag0n[m]those freqs should probably be marked with the boost flag then
05:24marcanyeah, though I'm not sure if that makes a difference?
05:24marcanif the scheduler does something useful with that, then yes
05:24kdrag0n[m]I don't think the scheduler checks it, but it's a semantic difference at least
05:24marcanI'm not sure there's a way to describe the "1 core 3.2, 2 cores 3.1, 3+ cores 3.0" relationship that the chips have
05:24kdrag0n[m]not sure how to deal with that from a scheduler standpoint
05:24marcanthough it's a <10% difference anyway so it shouldn't be a massive problem
05:25marcanthe whole dmips/mhz thing is massively application-dependent anyway
05:25marcane.g. if you're running a spinloop both CPU cores have exactly the same performance (one iteration per cycle)
05:36psykose has quit [Remote host closed the connection]
05:36psykose has joined #asahi
06:15ar has quit [Ping timeout: 480 seconds]
06:28nepeat has quit [Ping timeout: 480 seconds]
06:31nepeat has joined #asahi
06:41tylo1 has joined #asahi
06:55tylo1 has quit [Ping timeout: 480 seconds]
07:27j_eyalyssa: you found https://github.com/AsahiLinux/linux/commits/sven/20210829 that has the smc driver right? I have some extra patches that start to add a debugfs on top
07:58ar has joined #asahi
08:06j_ey(doesnt have smc gpio though, which I see is what you needed)
08:09povik has joined #asahi
08:42tylo1 has joined #asahi
08:53nepeat has quit [Remote host closed the connection]
08:55aleasto has joined #asahi
08:59tylo1 has quit [Ping timeout: 480 seconds]
09:40nepeat has joined #asahi
09:45povik has quit [Quit: Page closed]
09:52tylo1 has joined #asahi
10:01tylo1 has quit [Ping timeout: 480 seconds]
11:19gabuscus has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
11:19gabuscus has joined #asahi
11:29nico_32 has quit [Ping timeout: 480 seconds]
11:29nico_32 has joined #asahi
12:23alyssaj_ey: nod
12:49nico_32 has quit [Ping timeout: 480 seconds]
12:51nico_32 has joined #asahi
13:00tomtastic has quit [Ping timeout: 480 seconds]
13:05tomtastic has joined #asahi
13:08aleasto has quit [Quit: Konversation terminated!]
13:09aleasto has joined #asahi
13:10aleasto has quit [Remote host closed the connection]
13:11aleasto has joined #asahi
13:16aleasto has quit [Remote host closed the connection]
13:16aleasto has joined #asahi
13:17aleasto has quit [Remote host closed the connection]
13:17aleasto has joined #asahi
13:19aleasto has quit [Remote host closed the connection]
13:19aleasto has joined #asahi
13:20aleasto has quit [Remote host closed the connection]
13:21aleasto has joined #asahi
13:21aleasto has quit []
13:29aleasto has joined #asahi
13:50alyssamaz: Not sure if it makes sense to squash https://rosenzweig.io/0001-arm64-dts-apple-j274-Expose-PCI-node-for-the-Wi-Fi-M.patch and the obvious Bluetooth change into "arm64: dts: apple: j274: Expose PCI node for the Ethernet MAC address"
14:04vup2 has quit [Remote host closed the connection]
14:05vup has joined #asahi
14:17confusomu has joined #asahi
15:07confusomu has quit [Read error: Connection reset by peer]
15:11confusom1 has joined #asahi
16:19kov has joined #asahi
16:31tylo1 has joined #asahi
17:31frode_0xa has joined #asahi
17:31frode_0xa has quit []
17:33frode_0xa has joined #asahi
17:35ihaveamac has joined #asahi
17:46vup has quit [Ping timeout: 480 seconds]
19:53marvin24 has joined #asahi
19:56marvin24_ has quit [Ping timeout: 480 seconds]
20:30frode_0xa has quit [Quit: leaving]
20:31frode_0xa has joined #asahi
20:43kettenisalyssa: not sure providing a default mac address that isn't 00:00:00:00:00:00 is helpful
20:45kettenismaz did provide one for ethernet, because that's the address it ends up with if the device tree doesn't provide an address
20:45kettenisbut even there it probably isn't helpful
21:10vup has joined #asahi
21:51alyssakettenis: ack. that was copypaste fail.
21:51alyssafixed locally, thanks
22:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
22:02yrlf has joined #asahi
22:47everslick has quit [Remote host closed the connection]
22:47everslick has joined #asahi
22:49kdrag0n[m]marcan: I looked into the capacity numbers a bit more, and it seems more like Dhrystone is the one that's not very realistic
22:50alyssasven: atcphy scares me
22:50kdrag0n[m]I ran the benchmarks again with only one active P-core (thanks for the tip) and according to CoreMark, 3.2 GHz is slightly faster than my Zen 2 desktop at max freq
22:51kdrag0n[m]sounds about right given what people have said about the M1
22:51kdrag0n[m]and if that reference is right, then the e-cluster should be too
22:53kdrag0n[m]IPC values look reasonable compared to Snapdragon 888: 10.9 C/MHz (Firestorm) vs 9.3 (Cortex-X1), 7.6 (Icestorm) vs 3.7 (A55) which seems reaosnable considering how old the A55 is
22:55aleasto has quit [Quit: Konversation terminated!]
22:56kdrag0n[m]new commit based on the new data that includes 3.2 GHz (very little difference): https://github.com/kdrag0n/linux-m1/commit/05c296604a42
22:56j_eyheh cool I didnt know the 888 has cortex-X1 cortex-a78 and cortex-a55
22:58alyssathere are so many registers
23:06alyssaright so errr
23:06alyssaGood news, dcpext is 100% compatible with dcp so that's fine
23:07alyssaBad news is macOS does a ton of ATCPHY reg pokes and I don't know what's strictly needed here.
23:07alyssaand there are a lot of tunables and I don't get the corellium code at all.
23:08kdrag0n[m]btw is tracing pmgr supposed to work? macOS panics within a few seconds every time I add the tracer
23:21alyssasven: oh FFS
23:21alyssathese two configs are distinct:
23:22alyssadisplayport over usb type-c
23:22alyssadisplayport over usb4/thunderbolt over usb type-c
23:22alyssaall the ACIOPHY XBAR complexity in the corellium atcphy code ... given ACIO is TBT, maybe that only applies to the latter..
23:22alyssaI mean we need both but.
23:24alyssaI guess there are ATCPHY things regardless. but this is good to keep in mind when corellium references DP
23:27alyssawhat's the deal with the tunables for atcphy though
23:31alyssaoh, but, err, how different are those configs exactly i mean
23:31alyssaI have an adaptor that does HDMI(<->displayport) and USB on the same type-C port, that's not thunderbolt
23:32alyssaI guess that corresponds to REG_ACIOPHY_XBAR_PROTO_USB0_DP1 or REG_ACIOPHY_XBAR_PROTO_DP0_USB1 depending on the orientation
23:36alyssaokay that's enough trying to understand the monstrosity that is the modern USB pec
23:36alyssaat any rate, I'm satisfied that my DCP driver structure will be able to cope. PHY driver issues aside.
…