#
✕ nick:dougall
#asahi · 2021-09-22 05:35
dougall(as always, the devil is in the recursion and tail-call elimination)
#asahi · 2021-09-22 05:33
dougallyeah, I don't think there's a right answer, but lr should be in within the current function or equal to the return address in the first frame in the cases you want to skip it. (LC_FUNCTION_STARTS is helpful for that kind of heuristic on Mach-O files, and you could maybe make some assumptions when the call instruction at lr-4 isn't indirect too)
#asahi · 2021-08-17 13:13
dougallsounds gret :) yeah - last i heard m1n1 doesn't do frequency scaling, so it'd be convenient in that respect - I haven't got around to setting it up myself, but I've been meaning to do that and try to reproduce something like Sushi Roll (https://gamozolabs.github.io/metrology/2019/08/19/sushi_roll.html) at some point
#asahi · 2021-08-17 12:12
dougallnice! can i ask what you're working on/towards? just exploring? (there is a fun edge-case to watch out for with inst_int_store (0x96) and INST_LDST (0x9b) counting fused AMX instructions differently on PMC7, which counts instructions, vs PMC5/6, which count fused ops)
#asahi · 2021-08-17 11:27
dougall(no idea if you're a mac user, but i use `plutil -convert json -o - /usr/share/kpep/a14.plist` to get it as json, and the "counters_mask" has bit (1<<n) set for PMCn iirc)
#asahi · 2021-08-17 11:25
dougallyeah - I've been working on that a bit - the difficulty is finding ways to trigger the events so I can see which PMCs support them, but I had some luck. Let me know if there's anything specific you're wondering about, or I'll try to put together some updated notes soon. For the officially documented ones /usr/share/kpep/a14.plist has the info
#asahi · 2021-08-17 11:19
dougallso, I'm a little confused as I didn't think PMC1 was configurable? but yes - there are a number of events that only work on a subset of PMCs, e.g. retired uops (1) I can only use on PMC7
#asahi · 2021-08-17 11:14
dougallheh, yeah, i have
#asahi · 2021-08-03 16:12
dougallhacky script i use for finding immediate magic numbers in kernelcaches: https://gist.github.com/dougallj/bfbffffe8af7a08e322633d7d7f19af7
#asahi · 2021-07-29 13:01
dougall(thanks - bit of a shame from the perspective of exploring the hardware, but probably to be expected since that's effectively what intel and nvidia do)
#asahi · 2021-07-29 12:50
dougallanyone know if it's possible to load modified AGX (or other) firmware? I'm not clear on whether or not that's a security boundary