ChanServ changed the topic of #asahi-re to: Asahi Linux: porting Linux to Apple Silicon macs | Hardware / boot process / firmware interface reverse engineering | WARNING: this channel (only) may contain binary reverse engineering discussion | RE policy: https://alx.sh/re (MANDATORY READ) | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-re
haichenzhou[m] has joined #asahi-re
riker77_ has joined #asahi-re
riker77 has quit [Ping timeout: 480 seconds]
riker77_ is now known as riker77
phiologe has joined #asahi-re
PhilippvK has quit [Ping timeout: 480 seconds]
jakebot has quit [Quit: The Lounge - https://thelounge.chat]
jakebot has joined #asahi-re
nicolas17 has quit [Quit: Konversation terminated!]
MajorBiscuit has joined #asahi-re
the_lanetly_052 has joined #asahi-re
MajorBiscuit has quit [Quit: WeeChat 3.4]
MajorBiscuit has joined #asahi-re
bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bisko has joined #asahi-re
the_lanetly_052 has quit [Ping timeout: 480 seconds]
bisko has quit [Ping timeout: 480 seconds]
MajorBiscuit has quit [Ping timeout: 480 seconds]
MajorBiscuit has joined #asahi-re
MajorBiscuit has quit []
bisko has joined #asahi-re
bisko has quit []
bisko has joined #asahi-re
balrog has quit [Quit: Bye]
balrog has joined #asahi-re
nik875[m] has joined #asahi-re
bisko has quit [Quit: Textual IRC Client: www.textualapp.com]
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #asahi-re
bisko has joined #asahi-re
bisko has quit []
bisko has joined #asahi-re
skipwich has quit [Read error: Connection reset by peer]
skipwich has joined #asahi-re
bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bisko has joined #asahi-re
bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bisko has joined #asahi-re
bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bisko has joined #asahi-re
bisko has quit []
bisko has joined #asahi-re
<haichenzhou[m]> is it possible to read the performance counters from user space on M1?
<haichenzhou[m]> I'm currently reversing the M1 performance counters. when I execute `mrs pmuserenr_el0, 0xf` to enable user space access to performance counter, there is an illegal instruction error. I'm not sure if that is because both msr and mrs instruction can only be used under R0. So what I need to do is using a kernel module to read the performance counters?
<_jannau_> haichenzhou[m]: not directly with an unmodified kernel. Apple doesn't have the ARM performance counters but their custome implementation
<_jannau_> a driver for it is already in the kernel
<marcan> the Apple implementation does have a userspace access toggle, but I don't think our kernel driver currently supports it and either way it's completely incompatible with the ARM version, so you need custom userspace too at that point
<_jannau_> the ARM performance registers have an userspace toggle as well, forcefully disabled in the kernel
<marcan> https://oftc.irclog.whitequark.org/asahi/2021-11-16#30381586 <- this is how you use them from Linux userspace (via the kernel driver)
bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<haichenzhou[m]> Thanks, it seems that the msr name i used was ARM's and Apple does have a different name. Now I successfully read the content in my kernel module.
<haichenzhou[m]> registers a syscall, thus I can simply use inline assembly to get the value of certain system register. But as you show, there is already a driver with good functionalities. Could I just used the driver in userspace? (like perf executable do?).
<haichenzhou[m]> I still don't understand how to access the driver or use my own kernel module from userspace. (Sorry I'm really a newbie into kernel). What I want to do is fuzzing all the event_id based on whether certain code is runned (either causing loads of cache hit or no cache hit), to determine which id is related to certain event. I'm not sure if that is doable and how to do that. My initial guess was that I could make a kernel module which
<haichenzhou[m]> * Thanks, it seems that the msr name i used was ARM's and Apple does have a different name. Now I successfully read the content in my kernel module.
<haichenzhou[m]> I still don't understand how to access the driver or use my own kernel module from userspace. (Sorry I'm really a newbie into kernel). What I want to do is fuzzing all the event_id based on whether certain code is runned (either causing loads of cache hit or no cache hit), to determine which id is related to certain event. I'm not sure if that is doable and how to do that. My initial guess was that I could make a kernel module which
<haichenzhou[m]> registers a syscall, thus I can simply use inline assembly to get the value of certain system register. But as you show, there is already a driver with good functionalities. Could I just used the driver in userspace? (like what perf executable does?).
<_jannau_> user space access is possible after setting bit 30 in SYS_APL_PMCR0_EL1. I only tested reads from SYS_APL_PMCx though
<haichenzhou[m]> Sure, I will have a try.
amarioguy has joined #asahi-re
nicolas17 has joined #asahi-re
pazyleon[m] has joined #asahi-re
<holyspirit[m]> can anyone help me to work out why my keyboard isnt responding in grub menu of asahi linux minimal isntall mac mini m1
chengsun has quit [Quit: Quit]
chengsun has joined #asahi-re
<holyspirit[m]> how do you get mac mini m1 chip to allow keyboard to work on grub menu
<AdryzzOLEDEdition[m]> https://matrix.to/#/#_oftc_#asahi:matrix.org
bisko has joined #asahi-re
<kode54> holyspirit[m]: you have to hook it up to a USB-A to USB-C adapter and plug it into one of the C ports