#
#asahi-dev · 2023-05-27 19:33
maznp[
#asahi-dev · 2023-05-27 19:32
sid-linuxThanks for taking the time to chat with me about this btw. It was helpful even though resolution is unknown at the moment
#asahi-dev · 2023-05-27 19:30
mazwell, I don't have much hope this is going to get magically fixed, unless someone reverse engineers what macos does.
#asahi-dev · 2023-05-27 19:30
sid-linux(Though rr does already pass many of its internal tests already on M2 but is hamstrung by this PMU not interrupting limitation)
#asahi-dev · 2023-05-27 19:24
sid-linuxblocker at the moment
#asahi-dev · 2023-05-27 19:24
sid-linuxOnce the PMU is able to issue interrupts it will be very easy to get rr to work on M2. I think that is the main
#asahi-dev · 2023-05-27 19:23
sid-linuxThe end objective is to get the rr record/replay debugger to work on M2. (I understand it works on the M1 but I haven't tried that out myself as I dont have access to an M1 unfortunately)
#asahi-dev · 2023-05-27 19:12
mazbut the driver was based on a description of the HW written by marcan. the assumption was that the HW was similar, but it obviously isn't...
#asahi-dev · 2023-05-27 19:09
sid-linux:-)
#asahi-dev · 2023-05-27 19:09
mazyup
#asahi-dev · 2023-05-27 19:08
sid-linuxyou probably wrote the original apple_cpu_pmu_m1.c ?
#asahi-dev · 2023-05-27 19:08
sid-linux:-) ... Though you probably know a lot more than me anyways ! guessing from your irc nic and the git-blame
#asahi-dev · 2023-05-27 19:06
mazI know as much as you do. that's the beauty of undocumented HW.
#asahi-dev · 2023-05-27 19:05
sid-linuxCould it be a big deal to get it to work? Or could it just be a bug/something different about the M2 PMU?
#asahi-dev · 2023-05-27 19:01
mazI guess they dropped the interrupt signalling this time around, and we don't support the exception mechanism.
#asahi-dev · 2023-05-27 19:00
sid-linuxYes that what jannau seemed to imply here too on https://github.com/AsahiLinux/linux/issues/150#issuecomment-1563381619
#asahi-dev · 2023-05-27 18:59
mazoh well.
#asahi-dev · 2023-05-27 18:59
mazso the driver is broken on M2.
#asahi-dev · 2023-05-27 18:59
mazah, no sample indeed. works fine on M1.
#asahi-dev · 2023-05-27 18:59
sid-linux(i did see it woke you up 31284 times but what does it say for number of samples collected)
#asahi-dev · 2023-05-27 18:58
sid-linuxDid your perf tell you that it collected some samples
#asahi-dev · 2023-05-27 18:57
sid-linuxBy seeing no samples were collected. On intel for a similar counter I usually will see thousands of samples
#asahi-dev · 2023-05-27 18:57
mazhow did you gather that there was no interrupts?
#asahi-dev · 2023-05-27 18:57
sid-linuxOh yes... so you're just seeing all zeros?
#asahi-dev · 2023-05-27 18:56
maz"cat /proc/interrupts" is your friend.
#asahi-dev · 2023-05-27 18:56
sid-linuxon your M2
#asahi-dev · 2023-05-27 18:56
sid-linuxHow do did you gather there are no interrupts btw?
#asahi-dev · 2023-05-27 18:56
mazM1 definitely generates interrupts.
#asahi-dev · 2023-05-27 18:56
mazno interrupt though.
#asahi-dev · 2023-05-27 18:55
mazM2 pro.
#asahi-dev · 2023-05-27 18:55
maz"[ perf record: Woken up 31284 times to write data ]"
#asahi-dev · 2023-05-27 18:55
sid-linuxit never interrupts (as it should)
#asahi-dev · 2023-05-27 18:55
sid-linuxWhen you set a PMU counter to interrupts after a few events it will do that; but here while PMU counts,
#asahi-dev · 2023-05-27 18:54
sid-linuxHere is something the proves that something is indeed awry https://github.com/AsahiLinux/linux/issues/150#issuecomment-1565303888
#asahi-dev · 2023-05-27 18:45
mazwhat's the symptom?
#asahi-dev · 2023-05-27 18:28
sid-linuxprobably IRQ related but I don't know much about IRQ kernel internals on linux
#asahi-dev · 2023-05-27 18:23
sid-linuxTL;DR while the PMU on M2 seems to work, it is not able to deliver notifications after a certain number of events have been triggered.
#asahi-dev · 2023-05-27 18:21
sid-linuxPlease see https://github.com/AsahiLinux/linux/issues/150 for more details
#asahi-dev · 2023-05-27 18:20
sid-linuxI'm having problems with the PMU on the M2
#asahi-dev · 2023-05-27 18:20
sid-linuxHi -- this is my first message on this group ! Please guide me if my question is better discussed elsewhere !
#asahi-dev · 2023-05-27 05:50
jannauand even that is not shared, there is a multiplexer which we currently ignore
#asahi-dev · 2023-05-27 05:50
jannauonly thing that is shared between the usb ports is the interrupt of the usb-c port switch and PD controllers
#asahi-dev · 2023-05-27 05:03
marcanthe HV also intercepts power domain controls so macOS doesn't go trying to shut down the ones the HV uses
#asahi-dev · 2023-05-27 05:02
marcanm1n1 also has code to forward this to the Linux DT for the same reason
#asahi-dev · 2023-05-27 05:01
nicolas17ah cool
#asahi-dev · 2023-05-27 05:01
nicolas17is it separate controllers?
#asahi-dev · 2023-05-27 05:01
marcaneach port has an independent controller, DART, etc. so we can just steal one
#asahi-dev · 2023-05-27 05:01
marcannicolas17: we remove specifically the one port m1n1 uses
#asahi-dev · 2023-05-27 04:55
nicolas17an interesting question showed up in another chat, can you use USB from macOS when running under m1n1? if so how does that work, given that m1n1 is using USB by itself? is it virtualizing the USB controller for macOS to use it concurrently?
#asahi-dev · 2023-05-27 04:42
nicolas17so this is one of the few chips without strict firmware signature checking, and you're doing your own firmware?

plus ›