#
…

2021-05-30

00:45bloomohh right ok
00:45bloomthe CSC bits in the Corellium code, the intended use is very much not swizzling
00:45bloombut rather doing arbitrary colourspace transforms
00:46bloommost importantly, YUV->RGB
00:46bloom(there are a few variants of YUV, specifying an arbitrary matrix covers them all)
00:47bloomPresumably the 3 x 2-bit enable register is a separate enable for each of 3 planes
00:47bloomand there are 2 more sets of CSC matrix registers
00:47bloomwhich would then be flexible enough for handling, e.g
00:48bloomDesktop as RGB, a video player overlay plane as YUV, and a cursor plane
02:23PhilippvK has joined #asahi-dev
02:26phiologe has quit [Ping timeout: 480 seconds]
03:57PthariensFlame has joined #asahi-dev
03:59PthariensFlame has quit []
05:19VinDuv has joined #asahi-dev
06:40egavinc has joined #asahi-dev
06:57egavinc has quit [Quit: Leaving]
08:48svenhuh. i get "DRAM: alloc space exhausted" with the latest u-boot now
09:20svenhuh. somehow something broke the framebuffer
09:21pipcet[m]corrupt boot args, maybe?
09:42kettenissven: you could try bumping the following #define in include/configs/apple.h
09:43kettenis#define CONFIG_SYS_MALLOC_LEN SZ_64M
09:43svenit crashes in video_clear shortly afterwards. didn't have time to debug what's going on and just disabled the framebuffer for now :D
09:44svenoh.. maybe it's confused because i have nothing connected to hdmi
09:44svenfb init: 640x1136 (32) [s=640] @0x9e0df0000
09:44svenit probably doesn't like that for some reason
09:47kettenisit'll trust whatever m1n1 passes as the framebuffer
09:50sveni think m1n1 passes FDT: framebuffer@9e0df0000 base 0x9e0df0000 size 0x2c6000 in that case
09:50svenlet me try if this works if i connect my screen
09:51jannausven: I can reproduce the error with no screen connected
09:51jannauworks fine with screen
09:51svenyup, also works fine again with a screen here
09:56EER has joined #asahi-dev
12:03klltkr has joined #asahi-dev
12:24bps has quit [Ping timeout: 480 seconds]
12:34svenugh. i think some clock gates actually have *two* parents
12:35pipcet[m]so it's a DAG not a tree?
12:35sveni think so
12:36svenstill need to confirm this. let's see if i can get the hv up and running
13:03VinDuv has quit [Quit: Leaving.]
13:03bps has joined #asahi-dev
13:32egavinc has joined #asahi-dev
14:52VinDuv has joined #asahi-dev
15:20jannauEmantor: 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
15:22Emantorjannau: did you use the Apple KDK?
15:22EmantorI didn't try open source darwin.
15:23EmantorI used KDK version 11.4_20F71.
15:23jannauyes, assuming you mean kernel debug kit
15:25EmantorUnfortunately 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…
15:25EmantorI'll reboot this machine and spin up the guest to get my version, brb
15:25jannauI think it is the version I used, let me check quickly in macos
15:29EmantorYes, 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.
15:34Emantorjannau: did you chainload current m1n1.macho beforehand?
15:34jannauthe kmutil command prints an error
15:34jannauyes, I've chainloaded
15:35Emantorwhats the error?
15:36jannauti fails to find com.apple.iokit.IOACPIFamily as dependency for com.apple.driver.AppleHPET
15:38EmantorAre you missing the kmutil inspect line? I also updated the sources line to the original kernelshamans blog entry for the cache creation.
15:39jannauyes, that is without the inspect line
15:39EmantorCould be that you need another `-r /Library/Developer/KDKs/KDK_11.4_20F71.kdk/System/Library/KernelExtensions` or something like that.
15:39Emantorneed the inspect line, otherwise not all extensions are found.
15:41jannauyes, my fault it was printing a different error without and it looked garbled but was only a typo in the path
15:42jannaustill generates the same file which fails
15:43Emantorhm, you are running the same commandline with -- "cpus=1 debug=0x14e…" as in the wiki entry? Than I am out of ideads.
15:45jannauyes. the only idea I have is to do everything from the second mac os install with relaxed security
15:48EmantorI did everything on the "primary" macOS installation, since the development/Linux one isn't accessible with m1n1 running.
15:49jannauok, 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
15:54EmantorAre you sure CTRR is disabled for the correct Boot Volume?
15:54Emantorbputil has -c, --disable-kernel-ctrr
16:02NicoK has joined #asahi-dev
16:08bps has quit [Ping timeout: 480 seconds]
16:16NicoK has quit [Remote host closed the connection]
16:20bps has joined #asahi-dev
16:28klltkr has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
16:46bloomhow do I switch clip space to -1, 1 hnnngh
16:53* bloomcheated
17:32marcanjannau: do you have ctrr disabled?
17:33marcanoh Emantor already said that
17:34marcanalso heck, how does chainloading even work with ctrr?
17:37EmantorMaybe you have to ask nicely through an IMPDEF register to turn it on?
17:42bloom% 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
17:42bloom^ note to self
18:20jannauEmantor, marcan: apparently I hadn't ctrr disabled. not sure how it got enabled. working now
18:37klltkr has joined #asahi-dev
18:38marcanEmantor: nah, the point of ctrr is iBoot should lock it down already
18:46Emantorthere 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
18:47sventhat's only meant for secondary cores afaik
18:50Emantorhttps://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.
18:51Emantorbut I am just grepping source code, don't mind me (:
18:51Emantor.oO(Whats does CTRR even mean?)
18:52svenoh, maybe i confused it with KTRR
18:52svenso KTRR is kernel text readonly region
18:53jannau"Configurable Text Read-only Region"
18:53svenessentially you setup a memory region and from the on only code from that region is allowed to run in kernel mode
18:53bloomCTRR The Reversible RTCC
18:53sventhen there's a second set of registers in the memory controller that disallow writes to that region
18:55EmantorThe code looks like this has to be reconfigured after sleep since the MMU lock state is lost.
18:55VinDuvCTRR being per cluster doesn’t means it’s not already enabled on the cluster that contains the boot CPU
18:56svenhm, i thought iboot had some fancy way to relock KTRR after deep sleep
18:56svenbut who knows
18:57EmantorVinDuv: Yes, but how does iBoot know which pages are to be protected? code looks like its configurable and setup by the kernel itself.
18:57svenit loads the kernel, it knows which region is supposed to be executable in kernel mode
18:59Emantorright, since the macho is loaded. To me kernel loading still is "copy bytes over there, jump to it.". Hm, idk.
18:59EmantorAnyhow, I am off to sleep, gn8.
19:02svenhm.... so CTRR seems to also make coprocessor firmware readonly. maybe.
19:02sven"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
19:02svenmight be the undocumented CTRR mitigation"
19:02svenofc this is all not documented anywhere :D
19:10svenactually, siguza documented it. looks it's XNU itself which setups KTRR https://siguza.github.io/KTRR/
19:34al3xtjames has quit [Quit: The Lounge - https://thelounge.chat]
19:34al3xtjames has joined #asahi-dev
19:41bps has quit [Read error: No route to host]
19:41bps has joined #asahi-dev
19:46VinDuv has quit [Quit: Leaving.]
20:27nicok113 has joined #asahi-dev
20:29klltkr has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
20:35nicok113 has quit [Quit: Leaving]
21:08EER has quit [Remote host closed the connection]
22:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
22:09thunfisch has quit [Quit: frrrp!]
22:09thunfisch has joined #asahi-dev
22:10thunfisch has quit []
22:10thunfisch has joined #asahi-dev
23:46yrlf has joined #asahi-dev
…