#asahi-re · 2022-04-06 11:44
kameksI mean, the iOS SDK license forbid RE, but does it also apply to mac as well ? Or do you think Apple would be more relax about it ?#asahi-re · 2022-04-06 11:42
kameksone thing I'm wondering, is whether I risk being banned from access to iOS sdk by doing so#asahi-re · 2022-04-06 11:42
kameksI bought a mac to develop an iOS app, but at the same time, as a graphics programmer I'm very much interested to tinker with GPU RE#asahi-re · 2022-04-06 11:41
kameksHey there#asahi-re · 2022-04-06 11:08
rqou_works well enough to encode a single frame with hardcoded settings#asahi-re · 2022-04-06 11:08
rqou_wip reverse engineering of the prores encoder https://github.com/rqou/m1n1/tree/prores#asahi-re · 2022-04-04 12:51
YichaoYu[m]on a related note, a failed cas does generate a count on the counter where a failed stxr does (180/0xb4)#asahi-re · 2022-04-04 12:47
YichaoYu[m]if the comparison failed, still with no contention, it takes 58 cycles per loop on the p core#asahi-re · 2022-04-04 12:47
YichaoYu[m]for a successful relaxed ordered cas with no contention, the loop takes 3 cycles on the P core (compared to ~1 cycle if it was a simple store).#asahi-re · 2022-04-04 12:44
YichaoYu[m](hand writen -> script generated...)#asahi-re · 2022-04-04 12:44
YichaoYu[m]and the fail case ~20 lines below#asahi-re · 2022-04-04 12:43
_jannau_the first will give you load/store exclusive atomics the later has explicit atomic instructions#asahi-re · 2022-04-04 12:43
YichaoYu[m]asm here https://github.com/yuyichao/m1_pmu_test/blob/cf4fbcc3e740e258339637c64062385a140c666b/src/libtests_atomic.s#L241-L246#asahi-re · 2022-04-04 12:43
YichaoYu[m]yes when I cross-checked it in julia, and for my original test it's hand written assembly#asahi-re · 2022-04-04 12:42
YichaoYu[m]and yes, successful weak ordering cas is really cheap#asahi-re · 2022-04-04 12:42
_jannau_do you target armv8-a. or armv8.1-a (or later) #asahi-re · 2022-04-04 12:41
YichaoYu[m]I was basically doing a cas with the wrong compare value with no contention.#asahi-re · 2022-04-04 12:41
YichaoYu[m]note that I'm talking about single thread here#asahi-re · 2022-04-04 12:40
TellowKrinkle[m]Whether that was to the detriment of the failure case I don't know#asahi-re · 2022-04-04 12:40
TellowKrinkle[m]I remember seeing on the Swift forums that Apple CPUs have no performance penalty for uncontested atomic refcounting (which Swift used CAS for), so they definitely optimized the success case#asahi-re · 2022-04-04 12:38
YichaoYu[m]and this difference is especially pronouced with more relaxed ordering, and especially on the P cores#asahi-re · 2022-04-04 12:37
YichaoYu[m]I don't really know how people implement atomics these days but is it possible that these atomic operations are actually ucoded and internally it's still using something similar to llsc?#asahi-re · 2022-04-04 12:36
YichaoYu[m]it also generates many more counts on the counters that I suspect related to uops issued.#asahi-re · 2022-04-04 12:35
YichaoYu[m]I noticed that a failed cas instruction seems to be about 2-10x slower than successful ones, depending on the memory order on the m1. And I don't see this on intel.#asahi-re · 2022-04-03 11:05
rqou_not sure i even own any thunderbolt devices#asahi-re · 2022-04-03 11:04
sventhe easiest way is probably to run macOS, connect some thunderbolt device and then break in the hypervisor and read it from there#asahi-re · 2022-04-03 11:04
rqou_ok, i'll look at this some other time#asahi-re · 2022-04-03 11:04
rqou_F#asahi-re · 2022-04-03 11:03
svenyes#asahi-re · 2022-04-03 11:03
rqou_even if i just want to read register 0?#asahi-re · 2022-04-03 10:50
svenbut if you do that without ATCPHY or handling that CIO co-processor you get ~2 seconds until the entire SoC reboots#asahi-re · 2022-04-03 10:49
sventechnically it only requires you to poke some "thunderbolt clock" or something that's different from the normal PMGR stuff#asahi-re · 2022-04-03 10:49
svengetting the thunderbolt DART up requires ATCPHY to be up and that CIO co-processor to be running as well#asahi-re · 2022-04-03 10:49
sventhat's more complex#asahi-re · 2022-04-03 10:33
rqou_(i'm just trying to check the parameter registers to see if they're very different or not)#asahi-re · 2022-04-03 10:32
rqou_hmm, then i get 0xffffffff trying to read any of the DART registers#asahi-re · 2022-04-03 10:27
jannauthe clock-gates are in '/arm-io/apciec0' and not in the dart node#asahi-re · 2022-04-03 10:22
rqou_0xffffffffffffffff#asahi-re · 2022-04-03 10:22
rqou_TTY> pmgr: Error getting /arm-io/dart-apciec0 clock-gates.#asahi-re · 2022-04-03 10:22
rqou_>>> p.pmgr_adt_clocks_enable(f'/arm-io/dart-apciec0')#asahi-re · 2022-04-03 10:22
rqou_btw, why doesn't attempting to turn on dart-apcieN work?#asahi-re · 2022-04-03 09:33
svenI’ve never seen a bit to indicate “don’t add this to the tlb” but “accesses to this page bypasses all caches” is pretty common#asahi-re · 2022-04-03 07:50
rqou_idk if it bypasses all caches or just the iommu TLB#asahi-re · 2022-04-03 07:49
rqou_this only affects iommu pages, but yes#asahi-re · 2022-04-03 07:19
svenwhich wouldn't be great if we accidentally set that for all pages :D#asahi-re · 2022-04-03 07:19
svenuh, uncacheable might also mean that access to that page bypasses all caches#asahi-re · 2022-04-03 05:58
rqou_unrelatedly, does anybody know how to fix ghidra's varargs ABI?#asahi-re · 2022-04-03 05:57
rqou_at some point should investigate whether or not that bit actually makes the page not be cached (presumably in the DART TLB?)#asahi-re · 2022-04-03 05:57
rqou_idk, i'm not really a good kernel dev#asahi-re · 2022-04-03 05:47
jannauor maybe we can, just extend the 'fmt != ARM_MALI_LPAE' with 'fmt != APPLE_DART'