#asahi · 2022-10-13 21:44
AdamTuby[m]not forcing it lol, just suggested it#asahi · 2022-10-13 21:44
AdamTuby[m]sven: sure thing, got it#asahi · 2022-10-13 21:44
AdamTuby[m]jannau: I know of it, it isn't as thorough as even my basic benchmarks#asahi · 2022-10-13 21:42
AdamTuby[m]s/though/thought/#asahi · 2022-10-13 21:42
AdamTuby[m]sven: though you would say so, but as long as the benchmarks are thorough enough and non-speculative, the findings would sure help some microarchitectural researchers out there#asahi · 2022-10-13 21:41
AdamTuby[m]<jannau> "Adam Tuby: how would this go..." <- could you clarify what events are you talking about? I suppose we are not talking about the same thing - the current event selection of PMC2-9 is unknown: both by the official linux kernel driver and by any docs online.#asahi · 2022-10-13 21:39
AdamTuby[m]jannau sven #asahi · 2022-10-13 21:39
AdamTuby[m]reclarifying "I can't share the event encodings as of now, but as long as my benchmarks will produce the same results as I have in my hand right now I'll be happy to share it!".#asahi · 2022-10-13 21:28
AdamTuby[m] * btw, I'm planning on (well, already started) writing a PMU reverse engineering benchmarks library - I would be happy to contribute the findings to the Asahi docs, perhaps even contribute a kernel-module wrapper for interfacing with the PMU.#asahi · 2022-10-13 21:28
AdamTuby[m]I can't share the event encodings as of now, but as long as my benchmarks will produce the same results as I have in my hand right now I'll be happy to share it!#asahi · 2022-10-13 21:26
AdamTuby[m]* the problem? (For the record, I patched the kernel to make all writes to SCTLR_EL1 have bit 26 (UCI) turned on - this makes sure the (defined) `DC` instruction series is enabled in EL0)#asahi · 2022-10-13 21:23
AdamTuby[m]* planning on (well, already started) writing a, * to the Asahi docs, perhaps#asahi · 2022-10-13 21:23
AdamTuby[m]* I'm planning (well, already started) on writing, * to the Asahi docs, perhaps#asahi · 2022-10-13 21:16
AdamTuby[m]* to the Asahi docs, perhaps#asahi · 2022-10-13 21:16
AdamTuby[m]I can't share the event encodings as of now, but as long as my benchmarks will produce the same results as I have in my hand right now I'll be happy to share it!#asahi · 2022-10-13 21:16
AdamTuby[m]btw, I'm planning on writing a PMU reverse engineering benchmark library - I would be happy to contribute the findings to the docs, perhaps even contribute a kernel-module wrapper for interfacing with the PMU.#asahi · 2022-10-13 21:13
AdamTuby[m]here's a pastebin ^#asahi · 2022-10-13 21:13
AdamTuby[m]https://pastebin.com/nn3rfygm#asahi · 2022-10-13 21:09
AdamTuby[m]Any idea where's the problem?#asahi · 2022-10-13 21:09
AdamTuby[m]flushed (I used the barriers for the timing/flush parts). I have some insider information on all of the event encodings of the PMCs and so I tried using the event encodings for L1D cache load misses - and it also didn't notice any flushing of the cache line.#asahi · 2022-10-13 21:09
AdamTuby[m]Unrelated question (although it is related to M1): is there any convenient way to flush a cache line from the data cache in EL0? By the armv8 docs, this can be done using `DC IVAC` - but under EL0 its usage would be undefined (and accordingly it results in an illegal hardware instruction). So I turned to `DC CIVAC` (which both cleans and flushes the cache line), but after timing it with the simple PMC0 timers it didn't seem to have been#asahi · 2022-07-17 10:25
AdamTuby[m]anyone knows why the `/sys/bus/platform/drivers/apple_m1_cpu_pmu` driver has no `unbind` and `bind` files? I'm trying to bind my own platform driver to the `/sys/bus/platform/devices/pmu-e` `/sys/bus/platform/devices/pmu-p` devices, but there is no trace of how to exactly unbind the original driver from those devices.#asahi · 2022-07-16 12:56
AdamTuby[m]<jannau> "Adam Tuby: possibly aic (if..." <- I would assume some system registers are configured such that any access to the PMU pops an interrupt that is handled exclusively by the perf driver. Bummer, I hope it gets fixed.#asahi · 2022-07-16 12:33
AdamTuby[m]loaded a kernel module which tries to read out its value and writes back to it with bit 30 enabled, but it always reads out as 0.#asahi · 2022-07-16 12:32
AdamTuby[m]s/kernl/kernel/#asahi · 2022-07-16 12:32
AdamTuby[m]yea, the PMCR0. I haven't been able to interact with it through the kernl#asahi · 2022-07-16 12:28
AdamTuby[m]jannau: Interesting. I didn't know you have to enable it. Are you talking about the perf driver for the M1 PMU?#asahi · 2022-07-16 12:21
AdamTuby[m]while on macOS I'm able to read/write from/to that register#asahi · 2022-07-16 12:20
AdamTuby[m]loaded a kernel module which always reads out 0 from that register, even if I write to that register one line of assembly prior to reading it#asahi · 2022-07-16 12:20
AdamTuby[m]for instance, the performance monitoring unit (PMU)'s registers - take for example PMCR0#asahi · 2022-07-16 12:19
AdamTuby[m]sven: generally, the System Registers of the ARM architecture of the M1#asahi · 2022-07-16 12:14
AdamTuby[m]btw, just wondering, has anyone here been able to write a kernel module that interacts with system registers successfuly on Asahi? I'm wondering if I'm only the one who thinks it's not possible on Asahi.#asahi · 2022-07-16 12:05
AdamTuby[m]<AdamTuby[m]> "gotcha, will try that. I..." <- got it working! thank you very much jannau chadmed #asahi · 2022-07-16 10:52
AdamTuby[m]chadmed: gotcha, will try that. I actually tried that a few hours ago but I got into a boot loop after not booting Asahi for a long time so I'm now reinstalling it to retry. #asahi · 2022-07-16 10:46
AdamTuby[m]Would appreciate any type of help/guidance,#asahi · 2022-07-16 10:46
AdamTuby[m]Adam.#asahi · 2022-07-16 10:46
AdamTuby[m]Hey, I'm currently trying to disable System Integrity Protection over the Asahi Linux volume in my mac, but after running `csrutil disable` and picking Asahi Linux, it always returns an error claiming: `you must start up from the copy of macOS Recovery that is paired to your startup disk`. I'm confused as to what I should be doing in that case.