#
#asahi-dev · 2023-05-05 15:50
kettenismarcan: looks like you broke chainloading
#asahi-dev · 2023-05-05 11:13
marcan(that all changes in apple mode, there they mix in a per-boot random value and other modifiers, which among other things lets them just use constants for the kernel keys since they are internally diversified anyway)
#asahi-dev · 2023-05-05 11:11
marcanthe spec says the PAC function must be a strict function of (input, modifier, keys), so this should hold for all compliant implementations
#asahi-dev · 2023-05-05 11:10
marcanand pacga works even with PAC disabled on EL2
#asahi-dev · 2023-05-05 11:09
marcanmaz: also pacga and pacia give the same result (modulo bit mask) for the same inputs/keys, so if you want to bypass SCTLR/etc issues, just move the I keys into the G keys and use pacga and do your own bit masking to emulate what the guest would do
#asahi-dev · 2023-05-05 11:07
mazwell, the obvious conclusion is that I must have screwed up. I'm shocked.
#asahi-dev · 2023-05-05 11:04
marcanmaz: also FWIW, TGE doesn't seem to make a difference here
#asahi-dev · 2023-05-05 11:01
mazmarcan: right. I must have messed up when I tried that months ago. TGE definitely is a good hint. thanks again.
#asahi-dev · 2023-05-05 10:58
marcanmaz: still works, make sure SCTLR_ELx has PAC enabled on both ELs of course
#asahi-dev · 2023-05-05 10:57
marcanlet me try pacia too just in case
#asahi-dev · 2023-05-05 10:55
marcanlet me try pacia too just in case
#asahi-dev · 2023-05-05 10:54
mazI'll get back to that at some point. I'm too deep into other sort of trap handling to context-switch now... thanks for giving it a go!
#asahi-dev · 2023-05-05 10:52
mazthey avoid the whole save/restore madness, which is terribly crap.
#asahi-dev · 2023-05-05 10:51
mazgotcha.
#asahi-dev · 2023-05-05 10:51
marcanand enables the vmkey thing
#asahi-dev · 2023-05-05 10:51
marcanthe apple mode enables more keys and splits out the key registers for EL1/EL2/EL12 etc
#asahi-dev · 2023-05-05 10:50
mazmarcan: I have no idea what the Apple mode is though.
#asahi-dev · 2023-05-05 10:50
mazmarcan: interesting. I wonder if I get caught by the PAC emulation happening once TGE has been switched back to 1. but the spec doesn't say anything about the value of TGE, and I guess it could use some tightening...
#asahi-dev · 2023-05-05 10:42
marcanoh, and once you've enabled Apple mode in EL2 you can't turn it off again
#asahi-dev · 2023-05-05 10:41
marcanin particular EL2 changes, but EL1 doesn't since I didn't enable Apple mode for EL1 (which has its own register)
#asahi-dev · 2023-05-05 10:41
marcanwhen I enable Apple mode indeed I get different results
#asahi-dev · 2023-05-05 10:38
marcanthis is on m1pro though
#asahi-dev · 2023-05-05 10:38
marcanmaz: tried a pacga in EL2/1/0 with TGE=0 and I get the same results, what am I missing?
#asahi-dev · 2023-05-05 10:25
mazone potential alternative would be to have a custom mini-guest that is used only for the purpose of computing the PAC for ERETA{A,B}, but that is incredibly overkill.
#asahi-dev · 2023-05-05 10:23
mazit implies it, as ERETAA has to be emulatable by a higher EL. withtout that, you cannot emulate PAC correctly.
#asahi-dev · 2023-05-05 10:22
marcandoes the spec say the authentication should be the same regardless of EL/TGE state?
#asahi-dev · 2023-05-05 10:22
mazI've vaguely heard of something like that.
#asahi-dev · 2023-05-05 10:21
marcanso I *think* Apple's custom PAC stuff is only enabled if you flip the right bits, so without that it *should* be spec-compliant
#asahi-dev · 2023-05-05 10:21
mazhowever, M2 seems to use different seeds for the authentication depending on the EL that performs it
#asahi-dev · 2023-05-05 10:21
marcanOh hmm...
#asahi-dev · 2023-05-05 10:20
mazmarcan: with NV, we have to trap ERET between the virtual EL2 and EL1. which means that when you do an ERETAA/ERETAB, EL2 needs to emulate the authentication.
#asahi-dev · 2023-05-05 09:48
marcanfor macOS in m1n1 I set it to some random (maybe) constant
#asahi-dev · 2023-05-05 09:48
marcanAIUI VMKEY* is a randomizer key mixed in so that different VMs have different PAC hashes, but it should be completely harmless to set it to any arbitrary (consistent) value.
#asahi-dev · 2023-05-05 09:47
marcanmaz: that's for PAC, what are you thinking of?
#asahi-dev · 2023-05-05 08:30
mazmarcan: VMKEYLO_EL2 caught my eye... I wonder if that's the key to another problem NV I've been facing...
#asahi-dev · 2023-05-05 04:08
svenhmmm, nothing suspicious at first glance there
#asahi-dev · 2023-05-05 03:57
eilnfixed
#asahi-dev · 2023-05-05 03:48
marcansven: fyi, someone with a broken 10Gbps USB3 device: https://www.reddit.com/r/AsahiLinux/comments/134t1rl/10gbps_usb_cable_support_missingproblematic/
#asahi-dev · 2023-05-05 03:48
eilnwait i counted wrong hold on a min
#asahi-dev · 2023-05-05 03:47
eilnlmk if experiments/ane.py still runs fine
#asahi-dev · 2023-05-05 03:46
eilnmerged & commented out the pd patch in ane-t6000 branch https://github.com/eiln/m1n1.git
#asahi-dev · 2023-05-05 03:44
marcanmight not have the same hierarchy there, or not get stuck if powered up in the wrong order
#asahi-dev · 2023-05-05 03:43
eilnt8103 is unaffected, jannau/sasha has been testing ane0/ane2 for me
#asahi-dev · 2023-05-05 03:40
marcanshould make the pmgr_adt_clocks_enable work properly now
#asahi-dev · 2023-05-05 03:40
marcan(untested but eh)
#asahi-dev · 2023-05-05 03:40
marcaneiln: pushed a thing, please try it
#asahi-dev · 2023-05-05 03:38
marcanit tries to power up devices before their parents
#asahi-dev · 2023-05-05 03:38
marcanok, I just realized pmgr.c is broken :p
#asahi-dev · 2023-05-05 03:35
eilnah, ty. looking into it
#asahi-dev · 2023-05-05 03:34
marcanthe 0 is what matters, the other flags have specific meanings. b would include PARENT_OFF which is your hint that something is wrong there.

plus ›