#
#asahi-dev · 2026-07-23 19:57
svenyup, direct sysreg write from EL0
#asahi-dev · 2026-07-23 19:57
svenlet me double check but iirc it's a direct sysreg write
#asahi-dev · 2026-07-23 19:56
chaos_princessi know, i just expected that the flip is a syscall
#asahi-dev · 2026-07-23 19:56
svenflips between RX and RW
#asahi-dev · 2026-07-23 19:56
svenit's the fast JIT thingy
#asahi-dev · 2026-07-23 19:56
svenyes
#asahi-dev · 2026-07-23 19:56
svenand maybe we can disable that by messing with the commpage
#asahi-dev · 2026-07-23 19:56
chaos_princesscan that be flipped from el0 directly?
#asahi-dev · 2026-07-23 19:56
svenonly exception i know about is that SPRR thing
#asahi-dev · 2026-07-23 19:55
chaos_princessarguably el0/gl0 shouldn't touch msrs anyway
#asahi-dev · 2026-07-23 19:55
sveni'm pretty sure EL1/GL1 is all r/o
#asahi-dev · 2026-07-23 19:54
sven(or GL0, whatever)
#asahi-dev · 2026-07-23 19:54
sveni don't know about the EL0 code
#asahi-dev · 2026-07-23 19:54
chaos_princessis all exclave code r/o? if so, then just patching should work
#asahi-dev · 2026-07-23 19:53
svenmy understanding is that at least XNU and that secure kernel thingy are pre-loaded by iboot
#asahi-dev · 2026-07-23 19:53
chaos_princesswhat about sptm itself? it loads things under it, those can change the code
#asahi-dev · 2026-07-23 19:53
svenbut i guess we will need patching for when EL0 tries to e.g. access that sprr map for JIT
#asahi-dev · 2026-07-23 19:52
svenshould work since we know that xnu's code can't change anyway
#asahi-dev · 2026-07-23 19:52
svenmy current plan is to just replace all the unknown instructions we know about (genter,gexit,msr,mrs for locked sysregs) with hvc
#asahi-dev · 2026-07-23 19:51
sventhen we'd get the trap
#asahi-dev · 2026-07-23 19:51
chaos_princessright, so when kernel goes there, we get a el2 fault
#asahi-dev · 2026-07-23 19:51
svenwe could make the shadow table redirect unknown addresses to a page that's no access in stage 2
#asahi-dev · 2026-07-23 19:51
svenso sptm adds a new page at 0x1234 to the stage 1 table and we don't know about it so the shadow table just has no mapping.. ohh
#asahi-dev · 2026-07-23 19:51
chaos_princessand yes, we will probably need to patch el1 exception handler for instruction emulation anyway
#asahi-dev · 2026-07-23 19:50
chaos_princesscan't we set it as no access in l2 page table?
#asahi-dev · 2026-07-23 19:50
sventhe faul will go to EL1, won't it?
#asahi-dev · 2026-07-23 19:50
chaos_princessdoes it?
#asahi-dev · 2026-07-23 19:49
svenhm.. true, that could work. requires patching the EL1 exception handler but this needs a bunch of patches to xnu anyway
#asahi-dev · 2026-07-23 19:49
chaos_princesslazy trapping? only fill our page table entry when it faults on the relevant address, and kill our entries if get a tlb instruction
#asahi-dev · 2026-07-23 19:44
svenbreak before make is e.g. invalidate old entry -> dsb -> tlbi -> add new entry -> dsb -> entry is live, so there's no maintenance insn we could trap after that entry has been added
#asahi-dev · 2026-07-23 19:41
sveni thought about trapping TLB maintenance instructions but that's not gonna be enough I think. if you're just adding new entries you don't have to invalidate anything if I read the ARM ARM correctly
#asahi-dev · 2026-07-23 19:41
svenpagetables just figure out which functions touch them and sniff arguments there
#asahi-dev · 2026-07-23 19:41
svenmeanwhile, i've been thinking about emulating sprr with shadow pagetables. the trickiest part is probably how to track changes, and i can really only come up with two solutions which i both dislike: a) map all pagetables read-only for the guests and track all changes whenever we get a trap to EL2 and b) since we know that only SPTM can change
#asahi-dev · 2026-07-23 19:26
yukaI can add a condition expression to the macro, but this makes it kinda complex?
#asahi-dev · 2026-07-23 19:25
yukahowever the part I don't have a good solution for is whether to call tps6598x_init for each iterated hpm even if the caller ultimately doesn't want to do anything with it
#asahi-dev · 2026-07-23 19:23
yukaOr maybe they can be the same, as finding a specfic hpm can be done by iterating all and returning early out of the macro
#asahi-dev · 2026-07-23 19:22
yukaand one for "find the hpm with index X (usually 0) and do a thing with it"
#asahi-dev · 2026-07-23 19:22
yukaI think we definitely want some helper function or macro for "do a thing for each hpm in the system"
#asahi-dev · 2026-07-23 19:21
yuka(in m1n1)
#asahi-dev · 2026-07-23 19:21
yukaI'm thinking about how to refactor usb / tps6598x to make it more maintainable
#asahi-dev · 2026-07-23 18:12
svenah, no, now it worked
#asahi-dev · 2026-07-23 18:12
svenlol, even cancel workflow seems to do nothing
#asahi-dev · 2026-07-23 17:44
nickchanit's been running for 2hrs
#asahi-dev · 2026-07-23 17:43
nickchanformat check for 4level paging is still running for some reason
#asahi-dev · 2026-07-23 16:53
barusuOh, I just wanted to confirm with them before I made the purchase
#asahi-dev · 2026-07-23 16:42
nickchannot from a video
#asahi-dev · 2026-07-23 16:32
barusunickchan: do you have the link to the video by any chance?
#asahi-dev · 2026-07-23 16:07
barusuDang it. I guess I'll order it. In the worst case, I can just sell it. I was so excited to set up a custom rig for this. Hope it works
#asahi-dev · 2026-07-23 16:06
nickchan that information is from dosdude1
#asahi-dev · 2026-07-23 16:04
barusuThis is the 14 inch MBP M1 Pro

plus ›