#asahi-dev · 2025-12-22 10:27
nickchanI need to block inside apple_smc_probe() until rtkit at least the hello message is processed#asahi-dev · 2025-12-22 10:25
nickchani need the hello message to tell the start of app ep#asahi-dev · 2025-12-22 10:25
nickchan...how come apple_rtkit_wake() returns before apple_rtkit_management_rx_hello() is called#asahi-dev · 2025-12-22 09:55
nickchaninstead of hardcoding their endpoint number#asahi-dev · 2025-12-22 09:53
nickchanand the rtkit consumer needs to be modified to use that interface#asahi-dev · 2025-12-22 09:53
nickchanokay v10 will be a bit more complicated at least drivers/soc/apple/rtkit needs a new interface to convert an endpoint number relative to app endpoint start to an absolute endpoint number#asahi-dev · 2025-12-22 08:09
nickchanmin app ep is 0x6 instead of 0x20 - so smc endpoint is 0x6 instead of 0x20#asahi-dev · 2025-12-22 08:08
nickchanfigured the other important difference needed to do anything specific to rtkit v10#asahi-dev · 2025-12-22 07:03
nickchannamely - macsmc 236000100.smc: error -EINVAL: Failed to start SMC endpoint#asahi-dev · 2025-12-22 07:01
nickchanans2 works as is after adding rtkit v10 support while smc needs additional modifications#asahi-dev · 2025-12-21 17:58
nickchana small patch will make the existing code work#asahi-dev · 2025-12-21 17:57
nickchanalright figured rtkit v10 (iOS 11-13); only critical difference is epmap is completed within 1 message so MGMT_MSG_EPMAP_REPLY_DONE and MGMT_MSG_EPMAP_REPLY_MORE doesn't exist#asahi-dev · 2025-12-20 17:36
nickchansven: any reason why cmd.cdw12 is 1 in the first place? the normal nvme spec does say it is 0-indexed and linux's behavior is also 0-index#asahi-dev · 2025-12-20 17:34
nickchanand linux's behavior would be 0 there for a 4096-byte read there's no special 1-index treatment#asahi-dev · 2025-12-20 17:34
nickchan4096 bytes of data gets read and dma'd#asahi-dev · 2025-12-20 17:34
nickchanon t6000 with or without this line: <https://github.com/AsahiLinux/m1n1/blob/3ef4357c6b7ec727d06a57d698aa5c98258ef7e4/src/nvme.c#L547>#asahi-dev · 2025-12-20 17:29
nickchanuh#asahi-dev · 2025-12-20 16:50
nickchanin this case i need to check linux to see there's no overflow issues there#asahi-dev · 2025-12-20 16:24
nickchanthis nvme is less quirky so it is 0 based as described in the spec#asahi-dev · 2025-12-20 16:24
nickchanfor 4096 bytes i should set cdw12 to 0 instead of 1#asahi-dev · 2025-12-20 16:24
nickchananyways i think i found the actual issue im experiencing with t8015 nvme#asahi-dev · 2025-12-20 15:25
nickchanfix https://github.com/AsahiLinux/m1n1/pull/526#asahi-dev · 2025-12-20 15:09
nickchangit blame says that it's like this since the beginning of time#asahi-dev · 2025-12-20 15:07
nickchanOf course this explodes#asahi-dev · 2025-12-20 15:06
nickchanhttps://github.com/AsahiLinux/m1n1/blob/main/proxyclient/m1n1/proxy.py python code: P_MEMALIGN = 0x602, P_FREE = 0x602#asahi-dev · 2025-12-20 15:06
nickchanhttps://github.com/AsahiLinux/m1n1/blob/8e263536bfe664d8d624bc5071279491a73c38ce/src/proxy.h#L99 c code: P_MEMALIGN = 0x602, P_FREE = 0x603#asahi-dev · 2025-12-20 15:06
nickchan... p.free actually calls memalign #asahi-dev · 2025-12-20 15:01
nickchanokay this is even more cursed, if i p.call the free symbol at the last step instead of using p.free then *that* works#asahi-dev · 2025-12-20 14:54
nickchanthe last p.free would cause a data abort#asahi-dev · 2025-12-20 14:54
nickchanfrom m1n1.loadobjs import * lp = LinkedProgram(u) posix_memalign = next(x for x in lp.symbols if x[1] == "posix_memalign")[0] pp = u.malloc(8) p.call(posix_memalign, pp, 0x4000, 0x4000) p.free(p.read64(pp))#asahi-dev · 2025-12-20 14:53
nickchanhowever when I#asahi-dev · 2025-12-20 14:52
nickchanin rust/src/dlmalloc.rs it can be seen that rust uses posix_memalign() to obtain memory#asahi-dev · 2025-12-20 14:52
nickchanokay i don't understand how rust free ever worked#asahi-dev · 2025-12-20 14:17
nickchanokay i don't think freeing memalign ever worked#asahi-dev · 2025-12-20 14:11
nickchanthat causes m1n1 1.0 to crash as well#asahi-dev · 2025-12-20 13:59
nickchansimply calling p.free(p.memalign(0x4000, 0x1000)) crashes on t6000 on upstream m1n1#asahi-dev · 2025-12-20 13:58
nickchanokay so I dug into the mem corruption issue i have with t8015 nvme and appearetly it may not have anything to do with my own code at all?#asahi-dev · 2025-12-19 11:17
nickchansame build works to chainload on t6000 so it's an issue in my own code paths#asahi-dev · 2025-12-19 10:47
nickchanokay the callsite is in rust_load_image() after a comparison check with 2 and after pt.find_by_partuuid()#asahi-dev · 2025-12-19 10:15
nickchanokay it's an USAGE_ERROR_ACTION in line 4782 of malloc.c#asahi-dev · 2025-12-19 09:41
nickchanget that while trying to chainload after `Searching for partition UUID: ...`#asahi-dev · 2025-12-19 09:41
nickchanif i get dlmalloc: internal error does that mean i have corrupted mem#asahi-dev · 2025-12-18 17:27
nickchanand for later stages the FDT can uncurse everything#asahi-dev · 2025-12-18 17:26
nickchansaving grace is for these socs SMC/ANS/SEP are the only relvant ones in m1n1#asahi-dev · 2025-12-18 17:23
nickchancan have multiple things with the same compatibles and then have 2 different ways of starting the cpu#asahi-dev · 2025-12-18 17:23
nickchanpre-M1 IOP situation regarding mailbox and cpu on/off is all sorts of nonsense :(#asahi-dev · 2025-12-17 16:52
nickchancntvct_el0 is just a sysreg#asahi-dev · 2025-12-17 16:48
nickchana7-a11 pmu events v9... fixed some stuff up regarding 32-bit instruction events. this may be getting annoying#asahi-dev · 2025-12-17 14:49
nickchanbut i am glad that method does work for usb2#asahi-dev · 2025-12-17 14:49
nickchanthat doesn't really work for any phy more complex than usb2