#asahi-dev · 2026-11-04 03:08
Youwes09I fixed it by changing the RTKit layer so the driver owns the connection and shuts it down on unbind, which also makes sure the firmware stops before the buffers go away. does that seem like the right approach? asked about this before but I don't think it got seen...#asahi-dev · 2026-11-04 03:06
Youwes09jannau: question about the 7.4 rebase. mainline changed how Rust drivers hold DMA memory, so a buffer can now only exist while its driver is bound to the device. the PMP driver keeps its DMA buffers in a shared object it hands to RTKit, and that stops building because the compiler can't prove the buffers are gone before the driver unbinds.#asahi-dev · 2026-11-04 03:02
Youwes09myria: saw your message about the M4 events, thanks. I'm in the middle of some hypervisor work on thermals right now, but I'll look at it soon and let you know!#asahi-dev · 2026-11-03 01:34
Youwes09good luck with the M2/M3 testing tonight, let me know if anything breaks#asahi-dev · 2026-11-03 01:34
Youwes09myria: yeah that's totally fine, thanks! looked at the branch and the code is right. one small thing, I think your Signed-off-by has to be the last one since you're submitting it, so the Co-developed-by and my sign-off go above yours#asahi-dev · 2026-11-03 01:20
Youwes09myria: actually, use Yuvan Shen <yuvanshen09@gmail.com> instead, that's the one on my other kernel patch and Outlook tends to filter out emails.#asahi-dev · 2026-11-03 01:17
Youwes09Yuvan Shen <yuvi.shen@outlook.com> it is then#asahi-dev · 2026-11-03 01:14
Youwes09myria: also for the tested-by, you can use Youwes09 <yuvi.shen@outlook.com>#asahi-dev · 2026-11-03 01:12
Youwes09myria: Sent you the patch by email. Sorry for the delay, I made sure it applies and builds on your current branch.#asahi-dev · 2026-11-03 00:58
Youwes09You can shoot me an email at yuvi.shen@outlook.com#asahi-dev · 2026-11-03 00:58
Youwes09Would you like me to email you the patch?#asahi-dev · 2026-11-03 00:57
Youwes09myria: one catch with that: M1/M2 events are only 8 bits and the driver masks them, so on an M1 perf will accept something like r182 and just count 0x82 without complaining. I kept separate 8 and 16 bit formats for that reason...#asahi-dev · 2026-11-03 00:56
Youwes09myria: saw your messages. looks like you already switched to config:0-15 for everyone, so my diff isn't needed anymore#asahi-dev · 2026-11-02 15:58
Youwes09myria: the 16-bit table also points at event_8b, so M3/M4 only show config:0-7 and perf warns on events like r182. I fixed it here by keeping both named event with __ATTR(event, 0444, event_16b_show, NULL), cycles and instructions work after that. Happy to send the diff if you want it!#asahi-dev · 2026-11-02 15:57
Youwes09myria: found one bug in "Support per-implementation event size". PMU_FORMAT_ATTR(event_8b, ...) names the sysfs file event_8b instead of event, so perf can't parse event= anymore and the cycles/instructions aliases break on every chip, M1 too. raw rXXXX still works which is why sleep 5 didn't show it...#asahi-dev · 2026-11-02 15:56
Youwes09myria: tested the PR on my M4 Air (J713), 7.4-rc1. all 60 M4 events count on both P and E cores, two counters on the same event always match exactly, all 10 counters at once work, and perf record works on both clusters!#asahi-dev · 2026-11-02 06:55
Youwes09myria: I have an M4 Air (J713) on 7.4-rc1, I can test the perf PR today#asahi-dev · 2026-11-02 00:02
Youwes09I got around it by having the driver own the RTKit connection and shut it down on unbind (buffers live inside it). PMP and the GPU driver would need some small changes for that. I was wondering how you were planning to handle it though and whether my approach makes sense?#asahi-dev · 2026-11-02 00:01
Youwes09Hey, heads up for when you move past 7.3. Mainline 7.4 changed how Rust drivers hold DMA memory, so a buffer can now only exist while its driver is bound to the device. The Rust RTKit layer keeps driver state in something that has to outlive the driver, so PMP can't keep its buffers there anymore and won't compile. The C side is fine though.