#
…

2026-10-25

00:03byte has joined #asahi-dev
00:03byte is now known as Guest3823
00:04Guest3823can the smc maintainers please review this, as we need to test this on older macs aswell so i want to get these patches pre-reviewed
00:04Guest3823(all 30*.patch)
00:05Guest3823this is for intel macs, i think we talked about this a long time ago
00:05Guest3823 has quit []
00:19iwuvmika has joined #asahi-dev
00:20hardy94 has quit [Quit: hardy94]
00:26bgb has quit [Remote host closed the connection]
00:31bgb has joined #asahi-dev
01:05veloek_ has joined #asahi-dev
01:07veloek has quit [Ping timeout: 480 seconds]
01:08MichaelReeves[m]ill take a look at macsmc-power (I upstreamed/co-wrote it), but the power supply maintainer (for all of it) is seb reichel, so they'd be the one to review if you sent it upstream
01:13MichaelReeves[m]ehh im sorry I really don't like it and I think upstream would NAK it
01:14MichaelReeves[m]you've almost duplicated the entire driver internally behind checks for smc->is_acpi. I think, at that point, it's probably cleaner to write a seperate new driver
01:15MichaelReeves[m]and there's like stuff for how to read and parse SMC data types in there, but that doesn't belong in a power supply driver, IMO, like we do, it should go in the SMC MFD driver so it is reusable
01:20MichaelReeves[m]on another note, I noticed you included the asahi M1 SPI hid patches. are you planning to upstream SPI hid? if so that would be very useful and appreciated, because I'm upstreaming dockchannel HID (M2+) so if they both get upstream, then HID is fully covered (and previously I thought I'd have to figure out SPI after DC is done)
01:22JamesCalligeros[m]spi hid is a bit of a mess
01:22JamesCalligeros[m]We probably want to figure out the unreasonable irq storm
01:23JamesCalligeros[m]Also for context the “original” smc implementation was a decoupled backend and frontend and upstream had a whinge about it
01:23JamesCalligeros[m]And this is the result
02:18bgb has quit [Remote host closed the connection]
02:18bgb has joined #asahi-dev
02:59___nick___ has quit []
03:00yurix has quit [Remote host closed the connection]
03:00yurix has joined #asahi-dev
03:01agball has quit [Ping timeout: 480 seconds]
03:01___nick___ has joined #asahi-dev
04:49agball has joined #asahi-dev
04:52nora_ has joined #asahi-dev
04:54nora has quit [Ping timeout: 480 seconds]
05:29bgb has quit [Remote host closed the connection]
05:30oolong4 has joined #asahi-dev
05:35bgb has joined #asahi-dev
05:50chadmed has quit [Quit: Konversation terminated!]
05:50chadmed has joined #asahi-dev
05:59agball has quit [Ping timeout: 480 seconds]
06:08oolong4 has quit [Quit: The Lounge - https://thelounge.chat]
06:09oolong4 has joined #asahi-dev
06:11agball has joined #asahi-dev
06:12KimTalmo has quit [Remote host closed the connection]
06:21oolong4 has quit [Quit: The Lounge - https://thelounge.chat]
06:26byte has joined #asahi-dev
06:27byte is now known as Guest3839
06:28Guest3839MichaelReeves[m]: so what are we supposed to do, as m-series and intel macs share a lot of keys (B0AP, B0AC, and a lot more, including the charge limit key used in new intel macs firmware), separate driver will mean duplicate code
06:29chadmedgo back to old versions of the downstream driver, which had a common frontend and then platform-specific backends to talk to the actual hardware
06:29chadmedand take inspiration from it
06:29Guest3839JamesCalligeros[m]: ive seen the original smc implementation in ur linux github repo, this is inspired from that
06:30Guest3839shifts the asahi backend to soc/apple/
06:30Guest3839and creates a new file macsmc-core.c
06:31Guest3839we have tested on mbp16,1 mbp15,1 imac20,1 mbp12,1 and mba4,1
06:31chadmedi dont think the "core" (which is really the frontend) should care at all about implementation details of the backends (is_acpi)
06:32Guest3839uhh so how am i supposed to implement difference between acpi and rtkit code
06:32chadmedeach backend should expose callbacks for the operations that the frontend consumes
06:32Guest3839(power keys in intel macs uses BE instead of LE, so we need to use that, and also hwmon, we dont use dt)
06:33chadmedyes, all of that is implementation details that belongs in your x86/acpi backend
06:33Guest3839we cant do all of that in the backend
06:34Guest3839as you can see here, we need to do that in macsmc-power, for that we need to know if the backend is acpi or rtkit
06:39chadmedno, this is backwards. you should not introduce platform-specific API. what you need to do is rework the core so that it has something like struct macsmc_funcs which would just be a bunch of function pointers to the backend's implementations of e.g. read_u16
06:40chadmedtreat it like a subsystem i guess
06:41Guest3839but the thing is not all keys use BE in battery
06:41Guest3839some use LE
06:41Guest3839standardised "read_u16" wont be able to fix the keys that use LE
06:41chadmedis that limited to just the battery keys or is the whole thing mixed endian
06:42chadmedif the latter, put quirks in your backend
06:42Guest3839whole thing
06:42Guest3839rtc, also uses different keys
06:42Guest3839instead of nvram it uses CLKO
06:42chadmedyeah so your driver should just switch/case on the keys with the wrong endianness
06:43chadmedthe frontend should not care at all
06:45Guest3839wont that be a worse design than just adding quirks?, only the battery sensor is that messed up, every other driver is fine
06:45chadmedyou just said theyre all like that
06:45Guest3839hwmon is fine, rtc we need is_acpi
06:47chadmedi dont think it is a "worse design" to avoid leaking implementation details into places where they do not fundamentally belong
06:47Guest3839chadmed: "you just said theyre all like that", yeah sorry i meant all battery keys are mixed
06:47chadmed"harder to get right" sure
06:47chadmedperhaps send an RFC to the mailing lists anyway
06:48chadmedsince these drivers are upstream its best to get maintainer input. maybe they dont care anymore
06:48chadmedbut imo you should do everything in your power to avoid implementation details in the generic drivers
06:50Guest3839the code in the platform device would get too big, and adding quirks everytime we want to add something or change something is not that great
06:50Guest3839and its not like the battery sensor dont use quirks, it does use quirks for firmware afair
06:51chadmedthats true actually, it does check for the existence of specific keys
06:52chadmedid argue that case is slightly different as its not really something fundamental to the rtkit implementation and does not matter outside the battery driver. if youve got mixed endianness/key-specific stuff happening in rtc (and possibly others) too then thats a bigger problem
06:54Guest3839rtc, we use different keys, that exist on apple silicon too, but apple silicon dosent use them, so we need is_acpi, hwmon is very generic code (i think it can replace ur DT implementation, but i havent done that currently: https://github.com/t2linux/linux-t2-patches/blob/main/3013-hwmon-add-support-for-x86-macs-in-macsmc-hwmon.patch#L196)
06:58Guest3839 has quit [Quit: Page closed]
07:25agball has quit [Ping timeout: 480 seconds]
07:27agball has joined #asahi-dev
07:40agball has quit [Ping timeout: 480 seconds]
07:55mattia013 has quit [Quit: mattia013]
07:56mattia013 has joined #asahi-dev
08:14yukasven: the amcc hv init is sadly very t604x specific
08:14yukaI randomly stared at M4+ device trees enough to notice that the amcc info is scattered all over the place depending on the soc/device
08:15yukaj773g has no amcc-enable-mask
08:15yukaj773s has it in both error-handler and mcc nodes
08:15yukaj714s has it in mcc node only
08:15yukajust as an example :P
08:17yukaI guess the amcc-enable-mask is also fully missing in all template adts
08:17yukaso you couldn't know
08:17agball has joined #asahi-dev
08:22yukaj700 has amcc-enable-mask = 1, amcc-plane-enable-mask = 15, dcs-channel-enable-mask = 15 (all in the mcc node only)
08:23yukawe probably would want amcc-plane-enable-mask there?
08:30rhysmdnz has quit [Quit: Bridge terminating on SIGTERM]
08:30Guest2868 has quit [Quit: Bridge terminating on SIGTERM]
08:30agball has quit [Ping timeout: 480 seconds]
08:32rhysmdnz has joined #asahi-dev
08:32Guest3854 has joined #asahi-dev
08:56aditya has joined #asahi-dev
08:59adityaAny update on the HID drivers upstream process btw?
09:07chadmeddockchannel has been submitted, no progress on spi
09:11bgb has quit [Remote host closed the connection]
09:15yukasven: would you mind sending me the full adt of your base M5 machine so I can take it into account when refactoring this?
09:16bgb has joined #asahi-dev
09:28hardy94 has joined #asahi-dev
09:36chadmed has quit [Quit: Konversation terminated!]
09:38chadmed has joined #asahi-dev
09:38Guest3854 has quit [Quit: Bridge terminating on SIGTERM]
09:38rhysmdnz has quit [Quit: Bridge terminating on SIGTERM]
09:48cy8aer has quit [Remote host closed the connection]
09:50rhysmdnz has joined #asahi-dev
09:51Guest3859 has joined #asahi-dev
09:52svenI’ll dump the adt later today
09:54hardy94 has quit [Remote host closed the connection]
09:55cy8aer has joined #asahi-dev
09:56yukaI'll take another look at the M3 Max dcp issue today, since it would be nice to get brightness control and HDMI out on my daily driver :)
09:59___nick___ has quit []
10:01___nick___ has joined #asahi-dev
10:02al3xtjames2 has joined #asahi-dev
10:04chadmed has quit [Remote host closed the connection]
10:04svenstill kinda surprised amcc is such as mess. it looked so nice in the device tree :/
10:05svenI'd also like to know wtf that interrupt is and why it happens but it made no sense to me
10:05sventhe fault address is usually al over ram
10:07leah2 has quit [Ping timeout: 480 seconds]
10:16leah2 has joined #asahi-dev
10:33hardy94 has joined #asahi-dev
10:41mx08_ has quit [Quit: WeeChat 3.8]
10:43leah2 has quit [Ping timeout: 480 seconds]
10:43mx08 has joined #asahi-dev
10:44al3xtjames23 has joined #asahi-dev
10:45al3xtjames2 has quit [Read error: Connection reset by peer]
10:45al3xtjames23 is now known as al3xtjames2
10:48hardy94 has quit [Remote host closed the connection]
10:48hardy94 has joined #asahi-dev
10:52leah2 has joined #asahi-dev
10:55yurix_ has joined #asahi-dev
10:55yurix has quit [Read error: Connection reset by peer]
10:56yurix_ is now known as yurix
10:58___nick___ has quit [Ping timeout: 480 seconds]
11:01chadmed has joined #asahi-dev
11:04jannauchadmed: do we still need mca changes compared to v7.3 upstream? does downstream macaudio need chnages to work with v7.3 mca?
11:04chadmedit shouldnt, no. are you testing?
11:05leah2 has quit [Ping timeout: 480 seconds]
11:05chadmedi think there are a couple of patches we are still carrying but we might be able to just drop them
11:05jannaunot yet, still rebasing
11:05Bhyve has joined #asahi-dev
11:05chadmedi can test upstream mca with macaudio v4 tomorrow evening
11:06aditya has quit [Quit: Connection closed for inactivity]
11:07MichaelReeves[m]oh are we doing 7.3 rebase already? would it be better to skip p3s 7.2 (I'm only a bit done) and go straight to 7.3, so there's not wasted effort (as MM changes a lot between releases) or is 7.3 probably still a while away
11:07chadmedmight as well go to 7.3
11:08chadmedive got a blog post to write too i suppose
11:08chadmedso much to do and so little time to do it in
11:08jannauI started with the rebase, should be faster this time (at least on GPU side), wifi makes a little trouble
11:10jannauMichaelReeves[m]: does your series apply to v7.3? do our downstream 6GHz changes apply without large copnflicts to it
11:10MichaelReeves[m]that's issues with the M1 wifi chip right? I was planning on re-sending brcm4388 after 7.4-rc1 but if something's changed making it not work that would be annoying
11:10MichaelReeves[m]I based it on 7.3-rc[idk] but there might have been changes in final
11:12MichaelReeves[m]ok my series applies cleanly to 7.3 final, that's good
11:12MichaelReeves[m]I'll check downstream 6hz and all that stuff now
11:13jannau our downstream driver conflicts with commit 08a3f02fea63 (wifi: brcmfmac: fix P2P device removal race in brcmf_detach()) in v7.3 and it looks annoying to resolve
11:13jannauso I was wondering whether to switch to your series
11:14leah2 has joined #asahi-dev
11:14MichaelReeves[m]might as well, the only thing I haven't tested is if it accidentally broke anything with older chips (as I don't have the hardware)
11:15chadmeddid you manage to test WPA2/3 Enterprise?
11:15MichaelReeves[m]no, cause it was school holidays
11:16MichaelReeves[m]it is exam period now and earliest I can test it would be november
11:16chadmedno stress
11:17MichaelReeves[m]if anyone else would like to test that would be appreciated
11:18MichaelReeves[m]0c10263 ("[brcmfmac] Add support for 6G bands and HE") fails to apply on top of 7.3 final + my series
11:18jannauMichaelReeves[m]: does our downstream 6GHz support can be applied on top of your series?
11:18MichaelReeves[m]rest of the stuff seems to
11:18ddxtanx_ has joined #asahi-dev
11:18ddxtanx has quit [Read error: Connection reset by peer]
11:18MichaelReeves[m]it seems like only a small fix, let me see
11:19MichaelReeves[m]yep conflict seems easy to fix
11:19MichaelReeves[m]my home wifi is only 2.4GHz/5GHz, but if I push a branch, can someone test if 6GHz works for them?
11:21bgb has quit [Remote host closed the connection]
11:21MichaelReeves[m]ok all 6Ghz stuff applies cleanly on top of my series now (but, it might not actually work, can't try sorry)
11:22jannauplease push, we'll test it asahi-wip once it's fully rebased
11:23chadmedoh i might have missed something for the bus keepers on j313 and j293
11:24chadmedi will investigate tomorrow
11:24chadmed(well i didnt miss it, i just thought it might have been nothing but now im not so sure)
11:24jannauthe series from the mailing list did not apply cleanly because v7.3 misses fbt and okc features
11:27bgb has joined #asahi-dev
11:28MichaelReeves[m]on the branch do you want just 6GHz or the rest of the stuff downstream too
11:38MichaelReeves[m]going to bed, will push branch tmrw
11:38jannaugood night
11:39jannauI don't want feature regressions compared to v7.2 downstream
12:07yukabooting 14.8.3 in the hv on M3 Max has regressed
12:13jannauregressed how? do you patch com.apple.kernel:_recount_transition? are the EL2 mrs/msr still patched out?
12:14meow676767676 has quit [Quit: The Lounge - https://thelounge.chat]
12:17yukaYes, I'm still patching that. With m1n1 main it panics very early.
12:19yukachainloading v1.6.0 gets much further before it then also panics
12:24Bhyve has quit []
12:24yukaAh I always used --cpus 4,5,6,7,8...
12:24yukato disable e-cores
12:24yukathis fixes the boot on v1.6.0
12:26yukaand also on main
12:26yukaso maybe not that much regressed after all, it just seemed like it because the e-cores now fail earlier, or maybe more likely that failure is just nondeterministic so it is difficult to observe
12:30svenI think I saw that on m4 pro as well and fixed it with some of the bootargs I inject
12:31sventhe cpu and cluster power stuff
12:31meow676767676 has joined #asahi-dev
12:39snooze6214[m]sven: hv on a18 pro faults with an SError while still executing m1n1 code i think
12:39snooze6214[m]Seems to fault reading the end of the "reserved sprr pool" according to L2C_ERR_ADR in the exception info
12:41dud has joined #asahi-dev
12:52svencan you upload your m1n1-raw.elf and/or figure out in which function that happened?
12:54snooze6214[m]$ aarch64-unknown-linux-gnu-addr2line -e build/m1n1-raw.elf 0x4ac58
12:54snooze6214[m]/home/.../.../.../m1n1/src/hv/hv_sprr.c:635
12:55snooze6214[m]i assume the address is PC is the right one to check? but it seems to be the end of sprr_mirror_entry
12:56snooze6214[m]i can upload my m1n1-raw.elf too, but my internet kind of sucks rn, might take a while :')
12:57snooze6214[m]nvm that was faster than i thought
12:57myriaFor those interested, everything I tracking patch wise is in torvalds master except the ATCPHY 3 via 4, and GPIO_SHARED_PIN
12:58myria*HAVE_SHARED_GPIOs
12:59chadmeddid we not pick that up via our soc tree?
12:59chadmedthe required codec changes are in torvalds master
13:02sventhat shared pin should be part of the drivers soc PR unless I messed up
13:03svensnooze6214[m]: thanks. SErrors are async so it likely fauled a few instructions earlier
13:04sventhis is m1n1's main branch, right?
13:04snooze6214[m]yep from the main branch
13:05svenany additional local changes?
13:06svenit looks like it's trying to access past the end of the sprr reservation: PT[10166e28000:101e6e2c000] -> RESERVED SPRR POOL
13:06myriasven, chadmed: was in a pull to soc/drivers, but isn't in soc/drivers-7.4
13:09myriaAh, they moved it
13:10myriaThat's right, they consolidated it by enabling it on all arm64 platforms
13:10myriaYep, sorry, ignore me
13:10myriaThen it's just the ATCPHY changes to go
13:10myriaWhich, will probably come in later this week
13:10svensnooze6214[m]: dunno how that can happen, i'd add some debug prints around the sprr allocation stuff
13:14snooze6214[m]gotcha, let me spend some time with it :)
13:14svenand probably also in mirror_entry and maybe mirror_table since that's where it probably faults
13:14sveni wouldn't be surprised if there's some subtle error in there
13:15kennw has joined #asahi-dev
13:16svenif the i passed in to mirror_entry is too large that would cause it to write past its bounds i think.
13:20agball has joined #asahi-dev
13:22bgb has quit [Remote host closed the connection]
13:25svenuhh... why is that thing you pasted cut off?
13:25sven"diff --git a/src/hv/hv_sprr.c b/src/hv/hv_s" <--
13:25svenare there some hv_sprr.c changes after all?
13:27bgb has joined #asahi-dev
13:28agball has quit [Ping timeout: 480 seconds]
13:34snooze6214[m]my bad, wait
13:36snooze6214[m]the build i sent you shouldn't have that
13:36svenyeah well
13:36svensize = ALIGN_UP(size + 0x1000, SPRR_CHUNK_TABLES * SPRR_TABLE_SIZE); that's your issue
13:36snooze6214[m]no no, it faults without that
13:37snooze6214[m]wait, let me rebuild to be sure
13:37snooze6214[m]im fairly sure i made that change just to check what changes the base and top addresses in the mappings
13:38svenhrm.. looking at it again it shouldn't actually cause an issue
13:38svenit's just gonna reserve 2GiB + 0x1000
13:38snooze6214[m]can confirm, still faults without it
13:39svenok, time to add debug prints then
13:41svenmaybe also add a panic to mirror_entry when i >= 0x800
13:43svenit's already in the guest there fwiw
13:52bgb has quit [Remote host closed the connection]
13:58bgb has joined #asahi-dev
14:01___nick___ has joined #asahi-dev
14:10ev4[m]maybe dumb question: what is the right way to run m1n1 rust tests? i can build fine, but running cargo test with all of the cargo build flags/args in the Makefile throws a bunch of errors about missing core imports
14:16chaos_princessm1n1 has tests?
14:17svensomeone contributed some python tests at least iirc
14:17chaos_princessoh, the softfloat library has it
14:17chaos_princessthe short answer is - you don't
14:17ev4[m]yeah the softfloat has some. ah :(
14:19ev4[m]dang, i was hoping to write a test for my changes. ill figure something out. thanks!
14:21chaos_princesswhat are you changing
14:22ev4[m]adding signature verification to chainloading, i miss secure boot
14:31aissen_ has quit []
14:31aissen has joined #asahi-dev
14:34snooze6214[m]wth... all i did was add debug prints??? diff: https://termbin.com/myrry
14:34snooze6214[m]and somehow the SError didnt pop up??? the hv hung after a bit tho: https://termbin.com/bdsj
14:35Yushi has quit [Remote host closed the connection]
14:35Yushi has joined #asahi-dev
14:38svenyuka: should usb device mode work on m5 inside m1n1?
14:39svenodd. let me try to reboot everything then
14:46svenokay, works now
14:48yukawas the cable maybe not plugged in during the previous boot?
14:50svencould be, i've also switched cables from c-to-c to a-to-c via a hub
14:52svennvram is the only stuff in the adt that contains private stuff like wlan ssids, etc. isn't it?
15:00svensnooze6214[m]: you want to dump the state of all cores, it's also helpful if you have a development kernel with symbols
15:01svenit also still seems to hang very early
15:03yukahow do you get the symbols for macOS 26 / 27
15:03svendon't they have a KDK for those already?
15:04yukathe kernel.development.*.dSYM dirs are no longer included in the KDK
15:05svenugh.. that's annoying :(
15:05svenbut i though i had some symbols at least for macos 27 on m1
15:05svenlet me check again
15:08croissant` has joined #asahi-dev
15:10bgb has quit [Remote host closed the connection]
15:15croissant has quit [Ping timeout: 480 seconds]
15:16bgb has joined #asahi-dev
15:16svenhrm, can't find it anymore
15:16svenmaybe i'm just misremembing and looked at a previous kernel then
15:17yukais it possible that the symbols are somehow included in the kernel.development.*?
15:22xdbob has quit [Remote host closed the connection]
15:23xdbob has joined #asahi-dev
15:29jannauthe 26.7.1 KDK still has *.dSYM dirs for the kasan and release kernel
15:30yukawhat is the difference between release and development kernel for our purposes?
15:30yukaI asked since sven said:
15:30yuka> it's also helpful if you have a development kernel with symbols
15:31yukaand the documentation explicitly mentions kernel.development.*.dSYM which no longer exists
15:33Bhyve has joined #asahi-dev
15:38jannauI assume it's different builds of the same kernel. maybe turning some debug builds on and possibly less optimizing compiler
15:39sventried to boot the hv on m5 and it hangs very very early inside SPTM :(
15:40yukasven: in the M5 adt you sent me, it also has amcc-enable-mask = 1, amcc-plane-enable-mask = 15
15:40yukaand you might want amcc-plane-enable-mask?
15:40yukanot sure if that matters at this stage
15:40sveni've just disabled the amcc stuff for now
15:40yukaah fair
15:40sventhat only matters once it's far into xnu
15:47svenhrm, looks like it fault trying to read S3_0_C11_C9_0
15:50svenTagOffset_EL2 according to debug strings I think...
15:50snooze6214[m]sven: how do i dump state of all cores with m1n1? i seem to be stuck spinning, also there's some strings pointed by the registers so i might be stuck in some error handler? https://termbin.com/mmyt
15:51svensnooze6214[m]: ah.. the other cores might not even be up i think. otherwise cpu(n) and then context()
15:51sveni guess m5 hv even without secure kernel is gonna be "fun" *sigh*
15:52svensnooze6214[m]: and yeah, that looks like a panic loop. could even be SPTM's panic loop that early
15:53svendump ELR_EL12, ESR_EL12 and FAR_EL12
16:04sven*sigh* yeah... this is some MTE crap
16:08snooze6214[m]:( im stuck with the serror again
16:12svenno idea why, haven't run into an SError on m5 so far
16:12svenjust this MTE crap but that shouldn't be there on a18 pro I think
16:19meow676767676 has quit [Ping timeout: 480 seconds]
16:24hex86[m]sofus: Thank you so much for the feedback!
16:24hex86[m]Working through it now
16:24hex86[m]and to answer your question, I would really like to get it upstreamed; There's basically nobody using the haptic functionality in the kernel right now (See: Libinput) and so having more of the haptic functionality actually in the kernel would definitely help push adoption
16:24hex86[m]But I think a lot of the pre-requisite patches that lead up to it haven't been upstreamed yet
16:25hex86[m]So I don't even know how I'd get started on getting these upstreamed 😅
16:26hex86[m]I'd really like to take on the work of getting the pre-requisite patches upstreamed, I've submitted to the kernel before but I've never tried upstreaming patches from kernel forks, and I'd like to get experience on that, but I might need some advice because I've never tried
16:27hex86[m]and the magicmouse / apple hid drivers get a patch every so often anyways, as they're used for non-macbook devices too, and so finally getting these upstreamed would probably help reduce asahi maintainence burden too :D
16:31Bhyve has quit []
16:34meow676767676 has joined #asahi-dev
16:38sofusAmazing! Im not super familiar with how to handle dependencies. The dockchannel-hid driver which i imagine is the biggest pre-requisite, is activly being upstreamed
16:39sofusTechnically the driver depends on magic-mouse having mtp thing, but maybe that can just be ignored. If the dockchannel-hid driver works with the actuator, maybe its enough to simply write 'depends on: xxx'
16:42fatcullen has joined #asahi-dev
16:45msimonelli224 has joined #asahi-dev
16:46lynndotpy72 has quit [Quit: bye bye]
16:47lynndotpy72 has joined #asahi-dev
16:47bgb has quit [Remote host closed the connection]
16:47lynndotpy72 has quit [Read error: Connection reset by peer]
16:48lynndotpy72 has joined #asahi-dev
16:50msimonelli22 has quit [Ping timeout: 480 seconds]
16:50msimonelli224 is now known as msimonelli22
16:52bgb has joined #asahi-dev
17:05lynndotpy724 has joined #asahi-dev
17:12lynndotpy72 has quit [Ping timeout: 480 seconds]
17:12lynndotpy724 is now known as lynndotpy72
17:13hex86[m]sofus: Yeah I think so, and even the magicmouse.c file itself is really different from upstream, I have no idea how to even start with handling all of that.. 🫪
17:13hex86[m]Do you mean putting it into the probe of the magicmouse or actuator?
17:14hex86[m]*magicmouse instead of putting it into the actuator
17:24fatcullen has quit [Quit: This computer has gone to sleep]
17:24fatcullen has joined #asahi-dev
17:29sofusthe probe of the actuator. I will give you a small example by what i mean, but im really not sure its correct/better
17:35yuyichao has joined #asahi-dev
17:39yuyichao_ has quit [Ping timeout: 480 seconds]
17:39fatcullen has quit [Quit: This computer has gone to sleep]
17:41bgb has quit [Remote host closed the connection]
17:44fatcullen has joined #asahi-dev
17:46bgb has joined #asahi-dev
17:49sillyevelyn has joined #asahi-dev
18:04agball has joined #asahi-dev
18:06svenyeah well.. m5 hv is gonna be quite cursed as well i think :(
18:14agball has quit [Ping timeout: 480 seconds]
18:14agball has joined #asahi-dev
18:17sveni have the fun problem that the MTE tags are stored at the end of RAM and I can't change that because the register is locked where I also want to store my SPRR shadow tables now
18:18svenso it's either back to patching SPTM's check that panics if I steal too much memory at the beginning of RAM or I have to find another way to steal memory from SPTM
18:28svensnooze6214[m]: ah, now i finally saw that string: "000001001de14000-0x000001001df77fff] CTRR-C regions don't match"
18:28sventhat's an error string generated somewhere early in SPTM's boot code
18:28snooze6214[m]yeahh, also i think i figured out why i am getting serrors
18:29svenit might just be that a18 pro wants a slightly different memory map
18:30svendoes a18 pro already have exclaves?
18:31svenand why do you get serrors? i'm curious
18:33snooze6214[m]and that stopped the serrors
18:34svenoh, the carve out regions
18:35snooze6214[m]but yeah now the hv is stuck at this CTRR-C regions don't match thingy
18:35snooze6214[m]ill raise a PR for this fix tho :)
18:36svenit's complaining that the region in AMCC doesn't match the region in the CTRR sysreg I think
18:36svenor maybe it really wants a different memory map
18:37sventhe sysreg CTRR regions are written by SPTM but the regions inside AMCC are set up by iboot
18:38svenso i fake the values inside AMCC (https://github.com/AsahiLinux/m1n1/blob/51b747dced07a58eacf5dabc31ed6f00bcfa20fd/proxyclient/m1n1/hv/__init__.py#L2074) but if a18 pro's SPTM writes something different to the CTRR sysregs it'll panic
18:38svenAMCC [0x00000100060a0000-0x00000100060abfff] and ACC [0x000001001de14000-0x000001001df77fff] <-- first is what it reads from MMIO and second is what it wrote itself iirc
18:39svenwhich macos version is this?
18:40sven25G82?
18:40fatcullen has quit [Quit: This computer has gone to sleep]
18:42snooze6214[m]okay i feel dumb... i dont have the latest copy of m1n1 🤦‍♂️
18:44snooze6214[m]i realized when i couldnt find the amcc.py file... im sorry lol
18:44svenlooks like the a18 pro has exclaves, so that's gonna be fun :P
18:44sveni dunno how far boot will get since SPTM still fails with some MTE crap on m5
18:45svenlong before it even reaches its exclave bootstrap code I think. but that's probably gonna be fine, the real test will be what happens once XNU is up and tries to talk to something it expects to run inside those exclaves
18:46snooze6214[m]now it stoped at: TTY> HV: AMCC interrupt hook failed; can't start the hypervisor
18:46snooze6214[m]and then just quits the hv
18:46svenyou can just disable that function, it only matters once it's inside XNU
18:47sventhat's probably related to the ADT differences yuka mentioned
18:47svenjust make hv_amcc_init return true at the very beginning
18:48snooze6214[m]alright 👍️
18:51sillyevelyn has quit [Remote host closed the connection]
18:52snooze6214[m]yoo i see a loading bar :)
18:52svenyou should also see xnu's debug output at that point
18:52svenif it panics that's very helpful
18:53snooze6214[m]no debug logs tho... i think it panicked because the loading bar is stuck :/
18:54svenit should start outputting debug logs at that point
18:54svenwhat bootargs do you pass?
18:54svenyou want at least debug=0x14e serial=3 wdt=-1
18:54chaos_princessjust to clarify, you have both m1n1 and xnu logs open, right?
18:55sven^-- that too :D
18:55millefy14 has joined #asahi-dev
18:55aurora_ has joined #asahi-dev
18:56svenwhen you see the progress bar SPTM has handed control to XNU and it prints something like "Darwin Kernel 26.x.x..." very very early
18:56svenif it fails even before that you'll have to debug with the hv
18:56svencontext should show it's stuck inside a 1: wfe b 1b loop
18:57sventhe dump ELR_EL12, FAR_EL12, ... to figure out what cause the exception
18:57snooze6214[m]yep it is stuck in a loop: wfe b loop
18:58svenso then dump the exception register file and see what actually cause the exception
18:58sventhis has to be very early if you really see nothing on the second ACM device
19:00aurora has quit [Ping timeout: 480 seconds]
19:00aurora_ is now known as aurora
19:04snooze6214[m]* u.mrs(ELR_EL12)
19:04snooze6214[m]0xfffffe003cf4ba84
19:04snooze6214[m]u.mrs(FAR_EL12)
19:04snooze6214[m]0xfffffebcb4130000
19:04snooze6214[m]is there some way to see the disassembly at some address in m1n1?
19:05snooze6214[m]u.mrs(ESR_EL12)
19:05snooze6214[m]this just means serror i think?
19:06snooze6214[m]chaos_princess: ah nvm... this is probably it 🤦‍♂️im sorry again 😭
19:07svendisassemble(addr, size) from the hv shell should work I think
19:07snooze6214[m]will xnu logs appear as another tty in /dev?
19:07svenor maybe it was disassmble_at
19:07chaos_princesssnooze6214[m]: everyone started out knowing ~nothing, don't worry
19:07svenyes, you should have two ttys in /dev
19:07chaos_princessyes, usually the same device but with 3 instead of 1
19:07sventhey should already be there before you start the hv
19:08svendisassemble_at actually
19:08snooze6214[m]hmm neo has a usb hub in between, so i dont think they'll pop up... i know yuka was talking about this a while back
19:08svenif the first one pops up the second one will also appear
19:08chaos_princessttys are virtual
19:09svenif i were to bet this is an UNDEF instruction because there's some new sysreg in the a18 pro kernel the m4 pro one doesn't have ;)
19:10ZacharyEdminster[m] has joined #asahi-dev
19:13agball has quit [Remote host closed the connection]
19:24snooze6214[m]i dont see a new ACM device come up in /dev :( https://termbin.com/v45e idk if this matters but im using debugusb + kisd
19:25svenohh... i assumed it was already running in device mode
19:26snooze6214[m]yeah, i didnt get device more working because of the usb hub thing that yuka mentioned
19:26sventhen you'll have to debug from the hv :(
19:27snooze6214[m]alright, ill look into it tomorrow then. thanks for all the help :)
19:27snooze6214[m]s/more/mode/
19:27svennext step is to use disassemble_at and figure out what generated the exception
19:28svenchances are it's a msr/mrs for some sysreg
19:31hello0092 has joined #asahi-dev
19:51yukathere is no second iodev for debugusb
19:52yukaso this is correct, you can't properly use the hv vuart on the Neo
19:52yukapeople have gotten it to work by doing usb3 device mode, since the usb3 lanes are not going through the hub. there is only sloppy code for this though.
20:19fatcullen has joined #asahi-dev
20:22fatcullen has quit []
20:31fatcullen has joined #asahi-dev
20:33fatcullen has quit []
20:34fatcullen has joined #asahi-dev
20:36midou_ has quit [Ping timeout: 480 seconds]
20:37fatcullen has quit []
20:39fatcullen has joined #asahi-dev
20:41fatcullen has quit []
20:51fatcullen has joined #asahi-dev
21:07___nick___ has quit [Ping timeout: 480 seconds]
21:21svenok, pretty sure that sptm doesn't set up any stage 2 translations for cl4 so this shouldn't be too bad I think
21:23svenstill gotta figure out where to place the shadow pagetables though with that new MTE crap
21:28hex86[m]ok sofus I should have responded to everything from your review now! :D
21:28hex86[m]Haha hopefully we can get this merged at some point, I've left it sitting around for maybe a little too long!
21:29chaos_princesshow does mte interact with virtualization?
21:29svenI have no idea :D
21:29iwuvmika has quit [Remote host closed the connection]
21:30svenso far the issue is that there's some apple IMPDEF reg that points to end_of_useable_ram - $whatever and that's where I store the sprr shadow pageables
21:30chaos_princessyea, trying to read the relevant sections of arm arm, and intel sdm is a lot more comprehensible in general
21:30svenand sptm really wants to be able to access (or at least create pagetable entries) for that region
21:31svenwriting to that IMPDEF register to move that region results in an serror ofc :(
21:32chaos_princesswhat about having shadow page tables right before it in physical memory, but hide them from sptm
21:32chaos_princessand virtualize said reg
21:33svenI don't know if SPTM tries to write to that region.. though I guess I could remap those writes via stage 2
21:33chaos_princessdoes macos expose mte to vms?
21:34chaos_princesslike, qemu, or utm, or w/e
21:34svenyeah, I think that might work. [fake mte tag region][sprr shadow pagetables][real mte tag region] and then just map fake to real via stage 2 and pretend RAM ends after the fake region
21:34svenno idea
21:34svenbut I'd assume mte can just be enabled at el1 no matter what the state at el2 is
21:35chaos_princesswhere does el1 mte store tags?
21:35chaos_princesssince that can probably be remapped
21:36iwuvmika has joined #asahi-dev
21:37svenno idea
21:38svenapparently "tag ram" stores the allocation tags and that seems to be IMPDEF? I dunno
21:43fatcullen has quit [Quit: This computer has gone to sleep]
21:51svenah.. I think there's no need for a separate EL1 storage because the allocation tags are for _physical_ addresses
21:51rany has quit [Quit: Leaving]
21:52rany has joined #asahi-dev
22:02slowlydev has joined #asahi-dev
22:04slowlydev has quit []
22:09midou has joined #asahi-dev
22:10jsk_ has joined #asahi-dev
22:13jsk has quit [Ping timeout: 480 seconds]
22:14jsk_ is now known as jsk
22:18svenyeah, it's tagging (real) physical addresses
22:18svenbut I think I may have found a way to steal some memory (just a little 2 GiB hole) from SPTM without it complaining :D
22:18svenlet's see if that works
22:18svenif it doesn't I'll just go back to patching out that panic and steal memory from the beginning of RAM again
22:20yukaI sadly only managed to set up the reproducer for dcp and get the traces for comparison. I see a few differences in the endpoints started, in invalidations etc. But probably need to get the m1n1 experiment into either state in order to isolate the cause.
22:20yuka(reproducer is currently still linux)
22:20rosalyntg has quit [Remote host closed the connection]
22:21yukawill continue from here on tuesday probably
22:22fatcullen has joined #asahi-dev
22:22yukabut yeah this log line never appears:
22:22yuka> - [ap_link.c:308]shared memory dva: 0x1000003c000 0xffffffff004f0000
22:22rosalyntg has joined #asahi-dev
22:24mmediouni[m]chaos_princess: no MTE exposed through virtualization right now
22:25croissant` has quit []
22:25mmediouni[m]tags are stored in a tag memory region that's accessible only to SPTM but with a twist. If the pages that reference that tag page are not using MTE, then the underlying MTE tag page is usable as regular memory
22:25croissant has joined #asahi-dev
22:26JamesCalligeros[m]yuka: is this still 14.8.3 on m3*?
22:26svenyuuup, creating a SPTMDebug memory region and just making it 16 KiB (which it actually is supposed to be I think) + 2 GiB seems to work :D
22:26yukaJamesCalligeros[m] Yes on M3 Max
22:27chaos_princesscan confirm the above
22:27JamesCalligeros[m]the tracer in main should be good enough to see whats going on now
22:27mmediouni[m]sven: virtual MTE (on virtual memory instead of physical, so that you can have different tags on the same underlying physical page depending on the view) is an ARMv10 feature - FEAT_VMTE
22:27chaos_princessalso starting endpoints in macos order did not help (i think)
22:28svenmmediouni[m]: ah, makes sense!
22:28svendo you know why they don't expose MTE in vms?
22:28JamesCalligeros[m]oh yeah i remember you mentioning this a little while ago now
22:28mmediouni[m]lower priority item, I expect it to come at some point
22:29JamesCalligeros[m]i hope we dont have to feed it a bunch of property chunks before starting things now, that would suck big time
22:29chaos_princessand yes, things go wrong quite early, even before they start chatting over afk/epic
22:29mmediouni[m]MS asked for FEAT_VMTE and x86's memory tagging extension is also virtual memory-based
22:29JamesCalligeros[m]oh even better....
22:30mmediouni[m]Apple and Android-land most likely going to stick with pMTE
22:31svenalright, it's crashing some some sysreg inside XNU now that I don't patch out yet. enough progress for today
22:31svenwould be nice if this all works without hacking exclave support into all this
22:32jannauis it only m3 max? dcp m3 and m3 pro works? I mostly ignored m3* dcp for now
22:32chaos_princesssomeone got one of those two working (don't remember which)
22:32chaos_princessbut max is problematic
22:32JamesCalligeros[m]sofus and a-ramses both have DT MRs that supposedly work
22:32JamesCalligeros[m]ok i feel a lot better if its just the max, but that is weird
22:33JamesCalligeros[m]is there some power domain we're not switching on?
22:35fatcullen has quit [Quit: This computer has gone to sleep]
22:40hardy94 has quit [Quit: hardy94]
22:46fatcullen has joined #asahi-dev
23:04fatcullen has quit [Quit: This computer has gone to sleep]
23:06fatcullen has joined #asahi-dev
23:36chadmed has quit [Quit: Konversation terminated!]
23:36chadmed has joined #asahi-dev
23:40ninelore_ is now known as ninelore
23:42rany has quit [Quit: Leaving]
23:42rany has joined #asahi-dev
23:44bgb has quit [Remote host closed the connection]
23:50bgb has joined #asahi-dev
23:56iwuvmika has quit [Ping timeout: 480 seconds]
…