ChanServ changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | Non-development talk: #asahi | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
zumi_ has joined #asahi-dev
zumi has quit [Remote host closed the connection]
zumi_ is now known as zumi
nela has quit [Quit: Ping timeout (120 seconds)]
nela has joined #asahi-dev
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
john-cabaj has joined #asahi-dev
pb17 has quit [Ping timeout: 480 seconds]
pb17 has joined #asahi-dev
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
rrendec has quit [Ping timeout: 480 seconds]
john-cabaj has quit [Ping timeout: 480 seconds]
<chadmed> ive pushed and released speakersafetyd 1.1.0 which runs as the speakersafetyd user by default
<nicolas17> was it root before?
<chadmed> yeah
<nicolas17> ah I see, only privileges it needs are granted by the "audio" group?
<fl0_id> I was experimenting with the bluetooth packet logger on macos for testing resume etc - is there a secret to use that app or is it know that only some combinations of software/hardware firmware work? It just doesn't give any output. kinda like this https://developer.apple.com/forums/thread/761623
<nicolas17> fl0_id: I tried it once and it logged stuff, but it seemed like the bluetooth stack used vendor-defined commands for basic operations (like sending LE advertisements) which the GUI didn't know how to decode
<nicolas17> that's in xcode additional tools package, right?
<fl0_id> nicolas17 well that's a next step. but it would be weird if it doesn't decode anything.
<fl0_id> yes
nyx_o has quit [Read error: Connection reset by peer]
<fl0_id> mmh I thought I maybe had an old version, but it seems the packet logger binary stayed the same, still a 2022 version number
chadmed_ has quit [Remote host closed the connection]
nyx_o has joined #asahi-dev
pb17 has quit [Ping timeout: 480 seconds]
ciara has quit [Remote host closed the connection]
ciara has joined #asahi-dev
pb17 has joined #asahi-dev
psykose has quit [Remote host closed the connection]
psykose has joined #asahi-dev
tobhe_ has joined #asahi-dev
chrisl has joined #asahi-dev
tobhe has quit [Ping timeout: 480 seconds]
chrisl has quit [Ping timeout: 480 seconds]
nora_ has joined #asahi-dev
nora has quit [Ping timeout: 480 seconds]
<chaos_princess> You need to install the profile for it to work: https://developer.apple.com/services-account/download?path=/OS_X/OS_X_Logs/Bluetooth_macOS.mobileconfig
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
<chadmed> nicolas17: tbh the only real permission it needs is CAP_SYS_NICE so idk if the audio group is even necessary
<chadmed> do you need audio to just open a pcm?
<nicolas17> idk how audio works at that level
<nicolas17> does it open a /dev/snd/pcm* device and do read/write/ioctl to it?
<chadmed> yeah
<chadmed> but it does it through alsa-lib
<nicolas17> on my old debian system those devices are "crw-rw----+ 1 root audio", so if you're not in the audio group you can't even open() them
<chadmed> probably still needs audio
<chadmed> yeah
<chadmed> i gave the gentoo user audio membership anyway for good measure
<chaos_princess> somewhat annoying that we can't just dynamicuser it due to blackbox
<nicolas17> if you want to restrict it further for security, you could use ProtectSystem= and friends
<chaos_princess> that too won't hurt, but dynamicuser also simplifies packaging
<nicolas17> if you want to avoid having to create a real user account... yeahhh that's annoying
JayBeeFOSS has quit [Remote host closed the connection]
<nicolas17> (note that DynamicUser implies ProtectSystem)
JayBeeFOSS has joined #asahi-dev
pb17 has quit [Ping timeout: 480 seconds]
chrisl has joined #asahi-dev
<chadmed> chaos_princess: tbh we can probably get rid of blackbox at some point
<chadmed> it was only there to debug issues with the kernel lock but like its clearly stable lmfao
<chaos_princess> Up to y'all, i am not brave enough to sign off on safety decisions :P
<chadmed> it's not in the hot path its purely a debug feature
<chadmed> it just dumps out the last set of VISENSE samples processed so we could see what the codecs were doing
<chadmed> i'll leave it until we sort out the tdm stuff upstream
chrisl has quit [Ping timeout: 480 seconds]
pb17 has joined #asahi-dev
yuyichao_ has quit [Ping timeout: 480 seconds]
zumi_ has joined #asahi-dev
zumi has quit [Remote host closed the connection]
zumi_ is now known as zumi
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
pb17 has quit [Ping timeout: 480 seconds]
r0ni has quit [Ping timeout: 480 seconds]
mildsunrise has quit [Quit: disconnect]
mildsunrise has joined #asahi-dev
pb17 has joined #asahi-dev
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
okb has joined #asahi-dev
pb17 has quit [Ping timeout: 480 seconds]
<sven> wow, totally missed that work
<apalos> I had a chat with jannau in private, but I think it's better to ask here
<apalos> https://lore.kernel.org/u-boot/20250301164922.397441-1-ilias.apalodimas@linaro.org/ is applied in u-boot -next can anyone spin this for m1n1?
<apalos> There are reasons we don't enable by default yet so you have to do a menuconfig to enable it
chrisl has joined #asahi-dev
<apalos> so you will need to enable CONFIG_MMU_PGPROT
<apalos> and CONFIG_CMD_MEMINFO_MAP if you want to dump the mapping in the u-boot command line with 'meminfo'
chrisl has quit [Ping timeout: 480 seconds]
pb17 has joined #asahi-dev
<apalos> jannau: ah nice thanks!
<apalos> Does it still boot?
<apalos> Unfortunately, there are places in u-boot where people were doing const char *blah and the write it...
<apalos> Which now blows up since the strings are emitted in .rodata which is properly protected now
<apalos> We've fixed a few but you never know...
<jannau> I think it still boots not 100% sure I tested though
<apalos> excellent thanks,
<apalos> There's still a messs with EFI runtime services, but I plan to fix this as well at some point and set the permissions for that as well
<jannau> yes, it still boots. tested to be sure
<apalos> great, thanks
<apalos> I think you can enable it then (famous last words)
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
hspak44053 has joined #asahi-dev
hspak4405 has quit [Ping timeout: 480 seconds]
roxfan has quit [Remote host closed the connection]
roxfan has joined #asahi-dev
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
pb17 has quit [Ping timeout: 480 seconds]
zumi_ has joined #asahi-dev
zumi has quit [Remote host closed the connection]
zumi_ is now known as zumi
wtfcxt has joined #asahi-dev
wtfcxt has quit []
wtfcxt has joined #asahi-dev
pb17 has joined #asahi-dev
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
zumi has quit [Remote host closed the connection]
wtfcxt has quit [Quit: https://quassel-irc.org - Komfortabler Chat. Überall. ]
wtfcxt has joined #asahi-dev
wtfcxt has quit []
wtfcxt has joined #asahi-dev
<fl0_id> chaos_princess thx. I found that, but then wasn't sure of that was only for sending to apple and it required rebooting and it was late...
<fl0_id> jannau no I hadn't thanks. I was just going based on wiki info
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
rrendec has joined #asahi-dev
wtfcxt has quit [Ping timeout: 480 seconds]
pb17 has quit [Ping timeout: 480 seconds]
pb17 has joined #asahi-dev
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
pb17 has quit [Ping timeout: 480 seconds]
pb17 has joined #asahi-dev
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
mattia013 has joined #asahi-dev
mischa85 has joined #asahi-dev
chrisl has joined #asahi-dev
<mischa85> aight i'm back on t6041 duties again. this time taking a closer look at what happens regarding the HCR_EL2 register. it crashes on the first call: hcr = HCR(self.u.mrs(HCR_EL2))
___nick___ has joined #asahi-dev
<j`ey> that's pretty weird, just reading a register
chrisl has quit [Ping timeout: 480 seconds]
pb17 has quit [Ping timeout: 480 seconds]
<mischa85> searching HCR_EL2 on the IRC history of this channel results in someone mentioning it being a per-core setting rather than system-wide
<mischa85> so my theory, perhaps this register is tied to a disabled core and it's trying to read it?
<j`ey> mrs reads the current cores register
<mischa85> what sets the current core? i want m1n1 to strictly use cpu4
<j`ey> well current core as in the core that executes that instruction
<mischa85> hmmm, should be fine then
<mischa85> this is odd
<mischa85> no wonder i had to comment out all the register stuff to at least not make it crash
<mischa85> at least not crash before it transfers the kernel
pb17 has joined #asahi-dev
<mischa85> this is the exception it throws: https://gist.github.com/mischa85/6fd90c909d4c4e79820fa4cdbf313927
aissen has quit [Quit: brb]
aissen has joined #asahi-dev
<j`ey> that's an MMU fault
nicolas17 has quit [Ping timeout: 480 seconds]
<mischa85> it's disabled
nicolas17 has joined #asahi-dev
<mischa85> or at least, mmc_init() is not getting called
<mischa85> *mmu_init
kloenk has quit [Remote host closed the connection]
kloenk has joined #asahi-dev
<mischa85> how do you recognize it as MMU fault?
<j`ey> that's what an instruction abort it, when it tries to execute from some invalid adress
<fl0_id> jannau so if I read this correctly, there isn't any consensus in bluez yet, on how to implement this?
<sven> does mrs work with any other register?
<mischa85> well it does for OSLAR_EL1 for example
<mischa85> and MIDR_EL1
<fl0_id> (though not directly relevant, except for how packet logger works)
chrisl has joined #asahi-dev
___nick___ has quit []
elvishjerricco has quit [Remote host closed the connection]
chrisl has quit [Ping timeout: 480 seconds]
___nick___ has joined #asahi-dev
___nick___ has quit []
___nick___ has joined #asahi-dev
<mischa85> ok i want to test some things, but i have some noobish questions. i'm trying read32(MIDR_EL1) which of course doesn't work because it expects an integer. but i cannot for the life of me figure out what that integer should be
<mischa85> MIDR_EL1 also doesn't seem to be defined anywhere in the sourcecode?
<mischa85> i expect it to be defined as an address of some sorts
<mischa85> i'm missing something obvious here
<chaos_princess> That does not make sense, read32 is a memory read, and MIDR_EL1 id a system register
<chaos_princess> like, it is closer to x15 or eax than a memory address
<mischa85> ok, thank you. i'll see if i can find something like that in the m1n1 shell
elvishjerricco has joined #asahi-dev
<mischa85> ok derp got it
<mischa85> mrs() is available in the shell
<mischa85> and it somehow gives me that same instruction abort when i try to do mrs(MIDR_EL1)
<mischa85> which is odd because that register read succeeds when being done from chickens.c
<mischa85> which means something between chickens.c and uartproxy is messing things up
<j`ey> mischa85: in chickens.c it's reading it directly/compiled, with mrs() in the shell, im pretty sure it tries to allocate some memory, and then copy the instruction there
<mischa85> j`ey: thanks. does that mean when mrs() gets called from the hypervisor python script it tries to do the same?
<j`ey> yeah from python it has to copy the instruction to memory somewhere to execute
<j`ey> if it's in the C it's just in the memory loaded when m1n1 starts
<mischa85> i think we're onto something
<mischa85> so that memory allocation fails
<chaos_princess> If memory allocation failed i think you'd have no python at all
<chaos_princess> it looks more like it fails to make it executable
<mischa85> which should be allocated at startup already right?
<mischa85> which reinforces chaos_princess' hunch here
cow123 has joined #asahi-dev
<mischa85> oh boy
<mischa85> i found it
<mischa85> and i feel stupid
<mischa85> guess what i had set: self.mmu_off = False
<mischa85> which means this did not get set: region = 0
<mischa85> which means i can now succesfully read the HCR_EL2 register
<j`ey> nice
pb17 has quit [Ping timeout: 480 seconds]
WindowPain5 has joined #asahi-dev
WindowPain has quit [Ping timeout: 480 seconds]
WindowPain5 is now known as WindowPain
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
chrisl has joined #asahi-dev
pb17 has joined #asahi-dev
<mischa85> alright a lot of the msr() calls now work, obviously. the only things commented out now are AMX_CONFIG_EL1, VMKEYLO_EL2, VMKEYHI_EL2, APSTS_EL12, SPRR_CONFIG_EL1 and GXF_CONFIG_EL1
chrisl has quit [Ping timeout: 480 seconds]
<chaos_princess> time to spam printfs after every line here? https://github.com/AsahiLinux/m1n1/blob/main/src/hv.c#L112
<mischa85> on it
<sven> uh, isn’t it already somewhere inside xnu?
<chaos_princess> "Exception taken from EL2h" - i dont think so?
<j`ey> it could be a exception from the hv
<j`ey> so xnu started, but then somethign went wrong in the hv
jnn is now known as jn
<chaos_princess> i guess we will find out once the printf results return :P
___nick___ has quit [Remote host closed the connection]
<mischa85> ok i took out SYS_IMP_APL_AMX_CTL_EL2, SYS_IMP_APL_APVMKEYLO_EL2, SYS_IMP_APL_APVMKEYHI_EL2, SYS_IMP_APL_APSTS_EL12, SYS_IMP_APL_SPRR_CONFIG_EL1 and SYS_IMP_APL_GXF_CONFIG_EL1 from hv_start(). execution reaches hv_enter_guest but crashes like this: https://gist.github.com/mischa85/864fe86f35034a6bb7f1fe64965cbc62
<j`ey> are you running xnu or linux btw?
<mischa85> xnu
<chaos_princess> time to spam printfs into the fiq handler :P
<mischa85> hv_update_fiq() that is?
<mischa85> proooobably hv_exc_fiq()
<mischa85> doesn't hurt to do both i guess
ddxtanx has quit [Remote host closed the connection]
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
<mischa85> it doesn't log anything from either
<mischa85> but that function is extremely verbose anyway? not much printf to add there...
ethantwa1 has quit [Quit: WeeChat 4.4.2]
ethantwardy has joined #asahi-dev
ddxtanx has joined #asahi-dev
pb17 has quit [Ping timeout: 480 seconds]
<mischa85> is any of the msr() calls i took out absolutely vital? they all crash tho
pb17 has joined #asahi-dev
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]
chrisl has joined #asahi-dev
chrisl has quit [Ping timeout: 480 seconds]