marcan changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
<bloom> ohh right ok
<bloom> the CSC bits in the Corellium code, the intended use is very much not swizzling
<bloom> but rather doing arbitrary colourspace transforms
<bloom> most importantly, YUV->RGB
<bloom> (there are a few variants of YUV, specifying an arbitrary matrix covers them all)
<bloom> Presumably the 3 x 2-bit enable register is a separate enable for each of 3 planes
<bloom> and there are 2 more sets of CSC matrix registers
<bloom> which would then be flexible enough for handling, e.g
<bloom> Desktop as RGB, a video player overlay plane as YUV, and a cursor plane
PhilippvK has joined #asahi-dev
phiologe has quit [Ping timeout: 480 seconds]
PthariensFlame has joined #asahi-dev
PthariensFlame has quit []
VinDuv has joined #asahi-dev
egavinc has joined #asahi-dev
egavinc has quit [Quit: Leaving]
<sven> huh. i get "DRAM: alloc space exhausted" with the latest u-boot now
<sven> huh. somehow something broke the framebuffer
<pipcet[m]> corrupt boot args, maybe?
<sven> no
<kettenis> sven: you could try bumping the following #define in include/configs/apple.h
<kettenis> #define CONFIG_SYS_MALLOC_LEN SZ_64M
<sven> it crashes in video_clear shortly afterwards. didn't have time to debug what's going on and just disabled the framebuffer for now :D
<sven> oh.. maybe it's confused because i have nothing connected to hdmi
<sven> fb init: 640x1136 (32) [s=640] @0x9e0df0000
<sven> it probably doesn't like that for some reason
<kettenis> it'll trust whatever m1n1 passes as the framebuffer
<sven> i think m1n1 passes FDT: framebuffer@9e0df0000 base 0x9e0df0000 size 0x2c6000 in that case
<sven> let me try if this works if i connect my screen
<jannau> sven: I can reproduce the error with no screen connected
<jannau> works fine with screen
<sven> yup, also works fine again with a screen here
EER has joined #asahi-dev
klltkr has joined #asahi-dev
bps has quit [Ping timeout: 480 seconds]
<sven> ugh. i think some clock gates actually have *two* parents
<pipcet[m]> so it's a DAG not a tree?
<sven> i think so
<sven> still need to confirm this. let's see if i can get the hv up and running
VinDuv has quit [Quit: Leaving.]
bps has joined #asahi-dev
egavinc has joined #asahi-dev
VinDuv has joined #asahi-dev
<jannau> Emantor: which kernel did you use for the hypervisor? I have no luck with xnu-7195.121.3~9/DEVELOPMENT_ARM64_T8101 it fails early over an assertion: https://gist.github.com/jannau/d27a43515909abb6485ca75367c388f6
<Emantor> jannau: did you use the Apple KDK?
<Emantor> I didn't try open source darwin.
<Emantor> I used KDK version 11.4_20F71.
<jannau> yes, assuming you mean kernel debug kit
<Emantor> Yes.
<Emantor> Unfortunately mu 5.12.4 kernel has borked xhci support on the ASMedia Chip, so my USB dies from time to tim -_-. Still waiting for the NixOS channel to advance…
<Emantor> I'll reboot this machine and spin up the guest to get my version, brb
<jannau> I think it is the version I used, let me check quickly in macos
<Emantor> Yes, Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/DEVELOPMENT_ARM64_T8101 looks to be the same.
<Emantor> jannau: did you chainload current m1n1.macho beforehand?
<jannau> the kmutil command prints an error
<jannau> yes, I've chainloaded
<Emantor> whats the error?
<jannau> ti fails to find com.apple.iokit.IOACPIFamily as dependency for com.apple.driver.AppleHPET
<Emantor> Are you missing the kmutil inspect line? I also updated the sources line to the original kernelshamans blog entry for the cache creation.
<jannau> yes, that is without the inspect line
<Emantor> Could be that you need another `-r /Library/Developer/KDKs/KDK_11.4_20F71.kdk/System/Library/KernelExtensions` or something like that.
<Emantor> You
<Emantor> need the inspect line, otherwise not all extensions are found.
<jannau> yes, my fault it was printing a different error without and it looked garbled but was only a typo in the path
<jannau> still generates the same file which fails
<Emantor> hm, you are running the same commandline with -- "cpus=1 debug=0x14e…" as in the wiki entry? Than I am out of ideads.
<jannau> yes. the only idea I have is to do everything from the second mac os install with relaxed security
<Emantor> I did everything on the "primary" macOS installation, since the development/Linux one isn't accessible with m1n1 running.
<jannau> ok, I did the same. switching between m1n1 and mac os on the secondary install is not that much more inconvenient than booting the primary mac os install
<Emantor> Are you sure CTRR is disabled for the correct Boot Volume?
<Emantor> bputil has -c, --disable-kernel-ctrr
NicoK has joined #asahi-dev
bps has quit [Ping timeout: 480 seconds]
NicoK has quit [Remote host closed the connection]
bps has joined #asahi-dev
klltkr has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<bloom> how do I switch clip space to -1, 1 hnnngh
* bloom cheated
<marcan> jannau: do you have ctrr disabled?
<marcan> oh Emantor already said that
<marcan> also heck, how does chainloading even work with ctrr?
<Emantor> Maybe you have to ask nicely through an IMPDEF register to turn it on?
<bloom> % DYLD_LIBRARY_PATH=/Users/bloom/mesa/build/src/gallium/targets/libgl-xlib/ deqp-runner run --caselist ~/VK-GL-CTS/android/cts/master/gles2-master.txt --deqp ~/VK-GL-CTS/bld/modules/gles2/deqp-gles2 --output scissor-run -- --deqp-visibility=hidden --deqp-surface-width=256 --deqp-surface-height=256
<bloom> ^ note to self
<jannau> Emantor, marcan: apparently I hadn't ctrr disabled. not sure how it got enabled. working now
<Emantor> \o/
klltkr has joined #asahi-dev
<marcan> Emantor: nah, the point of ctrr is iBoot should lock it down already
<Emantor> there seems to be code to handle ctrr lockdown in the darwin kernel, see https://github.com/apple/darwin-xnu/blob/a1babec6b135d1f35b2590a1990af3c5c5393479/osfmk/arm64/amcc_rorgn.c#L553 foe example
<sven> that's only meant for secondary cores afaik
<Emantor> https://github.com/apple/darwin-xnu/blob/8f02f2a044b9bb1ad951987ef5bab20ec9486310/osfmk/arm64/cpu.c#L847 indicates that this needs to be done by the first cpu being started in the cluster.
<Emantor> but I am just grepping source code, don't mind me (:
<Emantor> .oO(Whats does CTRR even mean?)
<sven> oh, maybe i confused it with KTRR
<sven> so KTRR is kernel text readonly region
<jannau> "Configurable Text Read-only Region"
<sven> essentially you setup a memory region and from the on only code from that region is allowed to run in kernel mode
<bloom> CTRR The Reversible RTCC
<sven> then there's a second set of registers in the memory controller that disallow writes to that region
<bloom> RRTC
<Emantor> The code looks like this has to be reconfigured after sleep since the MMU lock state is lost.
<VinDuv> CTRR being per cluster doesn’t means it’s not already enabled on the cluster that contains the boot CPU
<sven> hm, i thought iboot had some fancy way to relock KTRR after deep sleep
<sven> but who knows
<Emantor> VinDuv: Yes, but how does iBoot know which pages are to be protected? code looks like its configurable and setup by the kernel itself.
<sven> it loads the kernel, it knows which region is supposed to be executable in kernel mode
<Emantor> right, since the macho is loaded. To me kernel loading still is "copy bytes over there, jump to it.". Hm, idk.
<Emantor> Anyhow, I am off to sleep, gn8.
<sven> hm.... so CTRR seems to also make coprocessor firmware readonly. maybe.
<sven> "Thus, the regions that are locked down are all __TEXT segments of coprocessor firmwares; this strongly suggests that Apple has added a new mitigation to make coprocessor __TEXT segments read-only in physical memory, similar to KTRR on the AMCC (probably Apple's memory controller) but for coprocessor firmwares instead of just the AP kernel. This
<sven> might be the undocumented CTRR mitigation"
<sven> ofc this is all not documented anywhere :D
<sven> actually, siguza documented it. looks it's XNU itself which setups KTRR https://siguza.github.io/KTRR/
al3xtjames has quit [Quit: The Lounge - https://thelounge.chat]
al3xtjames has joined #asahi-dev
bps has quit [Read error: No route to host]
bps has joined #asahi-dev
VinDuv has quit [Quit: Leaving.]
nicok113 has joined #asahi-dev
klltkr has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
nicok113 has quit [Quit: Leaving]
EER has quit [Remote host closed the connection]
yrlf has quit [Quit: The Lounge - https://thelounge.chat]
thunfisch has quit [Quit: frrrp!]
thunfisch has joined #asahi-dev
thunfisch has quit []
thunfisch has joined #asahi-dev
yrlf has joined #asahi-dev