marcan changed the topic of #asahi to: Asahi Linux: porting Linux to Apple Silicon macs | General project discussion | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Topics: #asahi-dev #asahi-re #asahi-gpu #asahi-stream #asahi-offtopic | Keep things on topic | Logs: https://alx.sh/l/asahi
<alyssa> hmmm do I m1 or sleep
<The_DarkFire_[m]> Sleep
<The_DarkFire_[m]> M1 will be there tomorrow
<alyssa> Yeah but so will my homework
<The_DarkFire_[m]> Fair point
Orsira has quit [Quit: WeeChat 3.3]
yuyichao_ has joined #asahi
yuyichao has quit [Ping timeout: 480 seconds]
robinp_ has quit [Read error: Connection reset by peer]
yuyichao_ has quit [Ping timeout: 480 seconds]
Nspace has quit [Quit: Nspace]
phiologe has joined #asahi
PhilippvK has quit [Ping timeout: 480 seconds]
yuyichao_ has joined #asahi
marvin24 has joined #asahi
marvin24_ has quit [Ping timeout: 480 seconds]
kov has quit [Quit: Coyote finally caught me]
kov has joined #asahi
<marcan> well, sounds like this weekend is going to be interesting
<JTL> oh?
<marcan> JTL: M1X/M2
<JTL> ah
<chadmed> they really gonna make me get up at 3am to watch this? *sigh* all business should be conducted on my timezone only
<j_ey> marcan: lets hope they release macbook pros w/o touchbar lol
<marcan> that's pretty much confirmed
<j_ey> :o
<marcan> touchbar is dead
<marcan> (which is unfortunate for M1 MBP owners since... there probably will never be enough momentum for a good ecosystem for those)
<marcan> (but at least we'll do keyboard emu)
<sven> did apple ever create a good ecosystem for the touchbar? it felt pretty useless on my old work-mbp
<marcan> fair point...
<j_ey> its a nice idea, maybe if it was above the normal keys, or something
<dottedmag> Also (no longer made): https://www.artlebedev.com/optimus/maximus/
<j_ey> that was a bit over the top :p
<klange> It's the _touch_ bit that always annoyed me, so Maximum-style in-key displays would be great...
<sven> yup, will ack that later :)
kode54 has quit [Quit: Ping timeout (120 seconds)]
grange_c has quit [Quit: Ping timeout (120 seconds)]
maz has quit [Quit: ZNC 1.8.1+deb1 - https://znc.in]
kenzie has quit [Quit: Ping timeout (120 seconds)]
<klange> Maximus was an idea that came too soon. Those little OLED displays were too expensive in 2005~2007. While not properly keyboard-shaped, you can get a Stream Deck for a similar concept these days for, what, ¥30k?
blasty has quit [Remote host closed the connection]
nico_32 has quit [Remote host closed the connection]
akemin_dayo has quit [Ping timeout: 480 seconds]
Ziemas has quit [Remote host closed the connection]
Hotswap has quit [Remote host closed the connection]
nico_32 has joined #asahi
blasty has joined #asahi
user_ has joined #asahi
user_ has quit []
Hotswap has joined #asahi
Ziemas has joined #asahi
maz has joined #asahi
kode54 has joined #asahi
grange_c has joined #asahi
kenzie has joined #asahi
akemin_dayo has joined #asahi
<rross101> j_ey: a new day, booted with the latest cpufreq/v1 branch and have got all the way to a working serial console with debian setup running. Thanks for your help. Next steps - getting a USB ethernet dongle to work, getting graphics to work?
<j_ey> rross101: nice, using linux.py or run_guest?
<j_ey> graphics should Just Work with the current framebuffer
<rross101> run_guest. The laptop screen just has the logo on it; and I can't get further in the setup because I've no internet. I could copy a filesystem/drivers to a USB drive; not sure where to go to find the right ones
<j_ey> it should print the console to the screnn too
<j_ey> *screen
<rross101> Hmm. not doing that.
JTL1 has joined #asahi
JTL is now known as Guest2710
JTL1 is now known as JTL
Guest2710 has quit [Ping timeout: 480 seconds]
JTL has quit []
JTL has joined #asahi
bps has quit [Remote host closed the connection]
bps has joined #asahi
JTL is now known as JTL1
JTL1 has quit []
JTL has joined #asahi
aleasto has joined #asahi
<povik> j_ey: not here it doesn't (graphics just work)
<povik> with the lagcy framebuffer or SIMPLEDRM, both doesn't work for me
Glanzmann has joined #asahi
<povik> i am actually quite frustrated by it, spent some time trying to get it to work
<j_ey> :/
<povik> the lagacy framebuffer crashes xorg
<Glanzmann> rross101: https://ab34.de/u/asahi.txt
<povik> the SIMPLEDRM never shows up in /dev/dri/ or where it should
<Glanzmann> povik: For me and alyssa it seems to work.
<Glanzmann> At least I worked several days on the mini.
<Glanzmann> That is with Debian testing.
<j_ey> povik: oh, i never tried X, but at least the console should be printed
<povik> i tried deubgging it and saw SIMPLEDRM never gets its probe called
<povik> j_ey: yeah, console works alright with the legacy framebuffer
<Glanzmann> Actually you can use the mini as a desktop, if you have usb sound device and don't mind the tiering in firefox.
<povik> Glanzmann: can you tell more about your setup? do you have SIMPLEDRM enabled?
<povik> i use debian bookworm, let's see if this is the same as testing
<Glanzmann> povik: https://ab34.de/u/asahi.txt
<povik> this is with a DCP driver, right?
<Glanzmann> povik: I followed alyssa lead, documented in the txt above, than I installed xorg, fvwm2, uxterm, firefox, tmux, and so on and ran 'startx'.
<Glanzmann> povik: The DCP driver is already in allysas tree.
<Glanzmann> povik: So that are the exact steps to reproduce.
<povik> guess it has come to that
<Glanzmann> X comes up with the wrong resultion, but you can fix it with xrandr.
<povik> Glanzmann: thanks, i will try merging the DCP driver into my tree
<povik> if that doesn't work, i will try the exact same steps
<Glanzmann> povik: Once you audio driver is ready for beta testing, let me know, than I'll try it.
<povik> Glanzmann: sure will do
Glanzmann has quit [Quit: leaving]
rross101 has quit [Remote host closed the connection]
<alyssa> povik: oh no
el0y has joined #asahi
<alyssa> povik: just looked at your sound driver WIP, looks good :-)
<alyssa> nit - what are the peek/poke functions for? why not just use readl/writel directly?
rross101 has joined #asahi
<povik> :)
<povik> glad there are some eyes on it
<povik> alyssa: no purpouse apart from that it looks nicer to me
<j_ey> ive seen quite a few drivers do that
<povik> yeah, got inspired elsewhere
<j_ey> AIC does it even
rross101 has quit [Remote host closed the connection]
<alyssa> povik: also, how goes the r/e? :]
jbowen has joined #asahi
everslick_ has quit [Remote host closed the connection]
everslick_ has joined #asahi
yuyichao_ has quit [Ping timeout: 480 seconds]
<alyssa> looks like linux-next has PCI+i2c+tipd now, nice :]
<povik> alyssa: haven't done much yet
<sven> next up: horrible dwc3 quirk and a minimal atc phy driver
<sven> and i guess i should start to work on sane device tree commits as well for that stuff
<sven> and then *finally* back to nvme :)
<povik> so far i have been trying the codec to tell me when the audio jack is plugged in
<povik> it has yet to tell me
<alyssa> povik: that's not pinctrl or smc or something?
<povik> well an interrupt goes through pinctrl
<povik> but the codec does the sensing itself
<povik> also learned theres a different jack wiring in china
* alyssa rebases on linux-next/master
<alyssa> diff down to... uh... +9607 -67 ...
<povik> frankly most of my time spent on M1 lately has been trying to get graphics to work
rross101 has joined #asahi
<povik> alyssa: should have jumped on your driver right away
<alyssa> the largest changes in there by line count are DCP and NVMe
<alyssa> DCP, because it is a bloody pain, and NVMe, because upstream wants it copypasted
<alyssa> and +900 lines of device tree changes alone
<alyssa> j_ey: what's the status of pinctrl?
<j_ey> alyssa: I should be sending out v3 soon (not sure if today, but this week for sure)
<alyssa> ack
<alyssa> would be nice to have 90's linux desktop in linux-next anyway :0
<j_ey> Linus pinged me asking me how it was going :)
<j_ey> (Wallej, pinctrl maintainer, not torvalds)
<alyssa> :)
<alyssa> I have yet to interact with Linus Torvalds
<j_ey> *Walleij
rross101 has quit [Remote host closed the connection]
<alyssa> ^ current state of my downstream
yuyichao_ has joined #asahi
<alyssa> povik: might be useful to you, e.g. for dcp you need to cherrypick everything under DCP and RTKit and device tree
<sven> ah, locked darts *sigh*
<alyssa> sven: marcan basically volunteered to take on locked darts after getting agx.py written ;)
<sven> :>
<alyssa> I suppose when agx.py does get written my diff to linux-next will balloon again
<povik> we should get a live chart
<povik> alyssa: re: commits, great, thanks
<alyssa> sven: the drm/cma-helper commit isn't mine but is needed for DCP.
<sven> *shrug*
<sven> i don't even have a screen connected to my development machine :D
<alyssa> I gave it a reviewed-and-tested-by ... guess I should bump it on dri-devel since it's a prereq
<alyssa> it's like 1 line
<alyssa> sent a v2 with my tag on it as a gentle bump
<alyssa> sven: NVMe doesn't build against linux-next
<alyssa> rq_integrity_vec, blk_integrity_rq, ... got yeeted
<j_ey> drivers/nvme is a moving target I guess
<sven> 16:09:41 <sven> next up: horrible dwc3 quirk and a minimal atc phy driver
<sven> 16:10:10 <sven> and i guess i should start to work on sane device tree commits as well for that stuff
<sven> 16:10:17 <sven> and then *finally* back to nvme :)
<sven> ^--
* alyssa moans
<alyssa> oh wait
<alyssa> missing #include
<alyssa> k yeah +1 line fix :)
* sven likes problems that solve themselves!
<alyssa> sven: I am one such problem! :-p
<sven> :D
Nspace has joined #asahi
bps has quit [Ping timeout: 480 seconds]
<povik> i looked over some locked dart commits
<povik> does it have an explanation?
<povik> why does iboot lock the root pointer if it doesnt prevent us from modifying the lookup table?
<povik> also does macos modify the locked dart? does it need to? do we need to?
<povik> i have questions :)
Nspace has quit [Quit: Nspace]
bps has joined #asahi
<sven> no idea why iboot locks that dart
<sven> macos just reuses the pre-configured pagetable and that's what we will have to do as well
<povik> but we can still modify the mapping arbitrarily if we write to memory at that locked pointer, correct?
<sven> what do you mean with "write to memory at that locked pointer"
<sven> but yes, we control the full pagetable
<povik> AFAIK theres a register which says "this is where you should look first to look up virtual addresses"
<povik> this register is locked, but it points into memory we can write to
<sven> yup
<povik> okay
<povik> doesnt make much sense why its locked
<povik> can we lock other darts if we want to?
<sven> yes
<povik> hm
<sven> it's a bit in some register, the dart driver even checks for that and refuses to probe
<sven> we first suspected it was meant to protect the DCP firmware but I don't think so anymore
<sven> the firmware is somehow mapped with this DAPF thing, but that has a different lock bit
bps has quit [Ping timeout: 480 seconds]
<sven> and apparently the co-processors have something like KTRR anyway
<povik> can we modify the firmware? what prevents us?
<sven> it's signed
<povik> assuming its just a blob in memory
<povik> we can write to it at any time
<sven> nope
<sven> we can't
<sven> we can write to some area which contains vtables and stuff but we'd run into the KTRR-like protection if we tried to use that to run our own code
<sven> but we also don't need to run our own code there so we don't really care
<povik> this is just for the challenge of it :)
<sven> at least I enjoy this project because there's no exploiting involved :)
<alyssa> sven: dumb question. why can't we unset the lock bit?
<alyssa> is it like a one-way fuse?
<sven> pretty much
<sven> that bit locks down almost every register
<sven> the only thing left unlocked is the stuff required to flush the translation cache
yuyichao has joined #asahi
<sven> <sven> oh, and that wasn't a dumb question. it was the first thing i tried :D
<sven> ^-- not sure if that went through before my internet died
<j_ey> it didnt
yuyichao_ has quit [Ping timeout: 480 seconds]
artemist has quit [Quit: artemist]
artemist has joined #asahi
yuyichao_ has joined #asahi
yuyichao has quit [Ping timeout: 480 seconds]
skali has joined #asahi
jbowen has quit [Ping timeout: 480 seconds]
jbowen has joined #asahi
___nick___ has joined #asahi
___nick___ has quit []
___nick___ has joined #asahi
bdju has quit [Remote host closed the connection]
skali is now known as skali_
<povik> sven: so to understand this fully: there's some protection mechanism which applies to ranges of physical addresses which makes the coprocessor firmwares read-only?
<sven> we can't even _read_ the firmware from the main processor
<sven> but for the DCP itself the .text section likely is read-only, yes
<sven> and anything that's outside the text section can never be executed
<alyssa> ROP/JOP? :-p
<sven> usually you use that to get a rwx mapping but that won't work here :D
<povik> ah, so this is some effectively isolated memory. okay
yuyichao has joined #asahi
skali_ is now known as skali
skali has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yuyichao_ has quit [Ping timeout: 480 seconds]
yuyichao_ has joined #asahi
yuyichao has quit [Ping timeout: 480 seconds]
bps has joined #asahi
rgort10[m] has joined #asahi
Nspace has joined #asahi
yuyichao has joined #asahi
yuyichao_ has quit [Ping timeout: 480 seconds]
bps has quit [Ping timeout: 480 seconds]
<povik> alyssa: the commit hashes you posted are not in mu-one/linux
<povik> let me know when you push, no hurry
<marcan> sven: ISTR being able to read various firmwares from the AP, way back when I was dumping memory
<marcan> but maybe the DCP isn't one of those
<sven> hm.. i think i could only read everything after the .text section of DCP but didn't see the actual code anywhere
<sven> but i also didn't look very hard so it's possible i missed it
tertu has quit [Remote host closed the connection]
yuyichao_ has joined #asahi
tertu has joined #asahi
<sven> but i'm pretty sure i couldn't access the ANS firmware
Nspace has quit [Quit: Nspace]
erincandescent has quit [Remote host closed the connection]
Nspace has joined #asahi
erincandescent has joined #asahi
yuyichao has quit [Ping timeout: 480 seconds]
bdju has joined #asahi
<sorear> what happens if you try? synchronous exception?
<sven> yup
<sven> (maybe not for DCP if i missed it, but that's what happened when i tried to access memory where the ANS firmware is supposed to exist)
<povik> ah so this lives in the same physical address space after all
<marcan> the memory controller has a lot of carveout/protection features
<povik> could the reason why kernel is passed SEPFW and not the other firmwares in that the interface of SEP is different, and iboot doesnt have a driver for it?
<sven> unlike the other processors SEP can never be shut down
<sven> and you need to setup some shared memory buffers to boot it
<marcan> iBoot has a driver for it
<sven> and SEP has a ROM which the other processors don't
<marcan> it has to
<povik> wait but the interface presented by SEP or the other coprocessors is coded in the firmware, so that does not make sense
<povik> yeah, that does not make sense
<marcan> ?
<sven> ok, let me rephrase: you cannot shut down SEP without SEP cooperating
<sven> but i think the bigger reason is that SEP has a ROM and can verify the firmware you pass it
<marcan> it's off when we boot though, right?
<sven> yes
<marcan> yeah
<marcan> it has its own secureboot chain
<marcan> which the other ASCs don't
<povik> makes sense
<marcan> it also has way, way fancier memory protection
<marcan> and memory encryption
<marcan> and signing
<marcan> if you compromise iBoot you compromise all the other ASCs, but not SEP
<povik> marcan: ^^ was just answering my own question up there
jacoxon has joined #asahi
<marcan> SEP firmware is also encrypted
<marcan> which none of the others are
<marcan> that's one reason it makes sense for it to be off when the OS boots
<marcan> if you want to use its services and trust the secret blob, boot it
<marcan> if you don't, don't
<sven> good point
<marcan> though AIUI the SEP is designed not to have power over the AP either
<marcan> it's basically two-way isolation
<marcan> it still has a DART etc
<sven> yeah
<marcan> so there's not much reason to be concerned about backdoors other than in the SEP services themselves
<povik> marcan: is there some feature of the memory controller i could use to find the burst size register in audio dma?
<povik> is there e.g. a transaction counter?
<povik> i also thought about looking at dart faults, maybe they will have beginnings of the bursts only
rross101 has joined #asahi
gabuscus_ has joined #asahi
jacoxon has quit []
gabuscus has quit [Ping timeout: 480 seconds]
___nick___ has quit [Ping timeout: 480 seconds]
nsklaus_ has joined #asahi
nsklaus has quit [Ping timeout: 480 seconds]
rross101_ has joined #asahi
rross101 has quit [Remote host closed the connection]
rross101_ has quit [Remote host closed the connection]
rross101 has joined #asahi
<rross101> Hey all. Do I need to use a different dts file for the Macbook Pro? Wondering if that's why my keyboard isn't working when I get a kernel to boot.
<j_ey> rross101: builtin keyboard support isnt on an asahi branch
<rross101> ah ok
<j_ey> there's corellium patches for it though
<krbtgt> hey, if you can't read the firmware or write to it, out of sight, out of mind
<krbtgt> it's the ryf way
rross101 has quit [Quit: Page closed]
jbowen has quit [Quit: leaving]
aleasto has quit [Quit: Konversation terminated!]
<alyssa> povik: sorry, rebased and hadn't pushed. branch 20211013 has it now
<alyssa> krbtgt: The DCP driver will work fine in linux-libre unironically.
<alyssa> actually, everything except SEP and Wi-Fi/Bluetooth will..
<krbtgt> gotta love Boratcom
yuyichao_ has quit [Ping timeout: 480 seconds]
bps has joined #asahi
chadmed has quit [Ping timeout: 480 seconds]
s-h-i-n-o-b-i_ has quit [Remote host closed the connection]
Nspace has quit [Quit: Nspace]
yuyichao_ has joined #asahi
nobodynada has joined #asahi
<nobodynada> Hello! I'm most likely going to be getting a M1X (or whatever they call it) as soon as it's available. Once I have the hardware, is there anything I can be doing to help contribute to the project?
<nobodynada> I have cursory knowledge & experience with systems programming but not much with reverse engineering or the Linux kernel (besides what I've learned from watching marcan's streams)