#
…

2023-09-10

00:06jovahd has joined #asahi-dev
00:38jovahd has quit [Quit: WeeChat 4.0.4]
00:58jeisom has joined #asahi-dev
01:01as400 has quit [Remote host closed the connection]
01:03as400 has joined #asahi-dev
01:21sawyer has quit [Quit: sawyer]
01:51ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:00gabuscus has quit []
02:04chadmed has quit [Remote host closed the connection]
02:20jeisom has quit [Ping timeout: 480 seconds]
02:23lena6 has joined #asahi-dev
02:40gabuscus has joined #asahi-dev
02:52malfunction54 has joined #asahi-dev
03:19tristan2_ has joined #asahi-dev
03:21tristan2 has quit [Ping timeout: 480 seconds]
04:24Graypup__ has quit [Quit: meow]
04:24Graypup_ has joined #asahi-dev
04:35marcanjannau: with my genpd defer patches, it should work if you don't give the genpd to simpledrm as long as dcp owns it and *it* knows how to handle it. however, if you remove DCP from the device tree, just simpledrm will break without explicit multi pd handling.
04:44Graypup_ has quit [Quit: meow]
04:44Graypup_ has joined #asahi-dev
04:45jannauthis is with display/dcp disabled since they must not take over the framebuffer
04:46jannauit will not be a problem for dcp in the final state as the phy will get it's own node and everything has a single power-domain
04:54jannauadding the code to simpledrm shouldn't be a problem. it has already code to handle multiple clocks and regulators
05:07faustine has joined #asahi-dev
05:21chadmed has joined #asahi-dev
05:24chadmed has quit []
05:24chadmed has joined #asahi-dev
05:25faustine has quit [Quit: Lost terminal]
05:39crabbedhaloablut has joined #asahi-dev
06:01marcanin a future where m1n1 can do atcphy stuff and point the display at multiple places, it probably makes sense for it to add the relevant PDs to the framebuffers dynamically
06:34jannauwhy is t602x' ps_dptx_phy_ps always-on? is it not blocked on t602x laptops and disabling it breaks the display? If that's the case we should either add it to dcp's or the panel's power-domain
07:00ellyq has quit [Read error: Connection reset by peer]
07:10mps has quit [Quit: leaving]
07:23compassion1785 has quit [Ping timeout: 480 seconds]
07:27compassion1785 has joined #asahi-dev
07:47eiln has joined #asahi-dev
07:47mps has joined #asahi-dev
08:22marcanjannau: probably yes, back when I did bringup on that I assume I saw it was breaking the display and did the quick fix.
09:06marcanmaz: so we have another fun challenge now. turns out running x86 games in a 4K VM on a 16K host is actually doable and already proven to work well. that neatly sidesteps the whole 4K kernel pain for us, and might easily be the way to go at this point.
09:07marcanbut, that means we need TSO for KVM. right now it's a prctl on the host (not sure if you saw that patch) and I assume it would work as-is to enable TSO globally in the VM if KVM just keeps that state untouched from process context.
09:08marcanbut of course it would be more efficient to only have TSO in the VM where needed, which would mean forwarding that control to the guest. in principle, AIUI the guest can directly twiddle that bit without any VM exits, but we have to explicitly allow that and it would be IMPDEF of course.
09:08marcanalternatively we could have higher level hypervisor calls to forward this to prctl without dropping all the way to qemu or whatever, since I assume a vm exit (or more) to qemu for every context switch in the guest is a really bad idea
09:22marcanactually I'm not sure if the guest ACTLR behaves as intended already, since apple came up with an IMPDEF ACTLR_EL12... I feel like I looked into this already but I'm not sure any more. it might be that right now EL1 always gets default ACTLR (ACTLR_EL12) even if EL2 set something in its ACTLR_EL2, regardless of what is enabled in HACR_EL2.
09:23marcanso we might at the very least need to copy ACTLR_EL12 (impdef) <= ACTLR_EL2 to make the prctl work "automatically" for kvm host processes
09:25marcan(I know you're not going to like any of this, but I hope we can come up with at least a least-horrible solution because, really, using TSO is non-negotiable here, the perf boost for x86 emu is major)
09:26marcanI'd be happy with enabling TSO globally in the VM (Apple already do this for Rosetta on Linux VMs on macOS anyway), we just need to signal it to the guest somehow so FEX can pick it up.
09:28eiln has quit [Quit: WeeChat 4.0.4]
09:28eiln has joined #asahi-dev
09:59hightower3 has joined #asahi-dev
10:05hightower4 has quit [Ping timeout: 480 seconds]
10:15cy8aer has quit [Remote host closed the connection]
10:39roxfan has joined #asahi-dev
10:39cy8aer has joined #asahi-dev
10:57mazmarcan: the one thing I don't want to create is some new form of ABI at the userspace or hypercall level upstream. I know you went down that way in the Asahi tree, and that's fine by me as long as you keep it there. *how* you make it work is interesting though. If you have a bit of a spec/write-up that describes the various controls in the AUX regs at both ELs.
10:58maz... I'd be interested in reviewing it.
10:58jeisom has joined #asahi-dev
11:10eilnrebased and pushed the just-works heap mapping
11:10eilnmarcan: I thought unk_size was firmware size too, but 0x180000 worked on 13.5 (0x100000). turns out unk_size only has to be greater than the current size, which the 0x180000 unknowingly covered.
11:11eilnsorry I wasn't clear. it doesn't have to alloc bottom-up anymore. but it'd be helpful (for me) to leave as is until we confirm the firmware boot mess across all variants. I also haven't checked vm_size for all dts. (rightfully) moving to iova.c is trivial, and I'll handle it right after
11:11eilnhow far do your other machines go before halting? :P
11:12marcanmaz: I mean, eventually this should be upstreamed in *some* form. Especially if we're going down the VM route, it will be incredibly silly to require downstream patches on the guest kernel when hardware support is otherwise not an issue.
11:13marcanI'm not particularly keen on the "this will be downstream forever because upstream won't take it in any form" outcome :/
11:19eiln has quit [Quit: WeeChat 4.0.4]
11:19marcanre ACTLR, I just realized I do know how this works with EL1 since obviously I've tested this in m1n1 HV. I'll write a quick spec.
11:21eiln has joined #asahi-dev
11:22eilnwait my key expired
11:25marcaneiln: will look at camera again a bit later, going to sort out this TSO thing first :p
11:26eilnsounds good, because I messed up my signature lol
11:43marcanso basically, for VM-wide TSO, we need to poke ACTLR_EL12 (e.g. copy it from ACTLR_EL2 to inherit whatever the host configured for that process, or something else)
11:44marcanand then ideally signal the VM somehow, so software running in the guest can know it's in a TSO environment
11:44marcanfor exposing TSO to the VM dynamically, we either disable trapping that reg (and AIDR) and signal it somehow, or we provide some kind of hypercall to poke it.
11:47marcanbit 5 is a pre-spec version of FEAT_AFP
11:48marcanbit 4 sticks some extra x86 flags in CPSR (I think?)
11:49marcannot sure what the rest of the bits do exactly. those 3 are the ones we care about for x86 emu, and TSO is by far the most important one.
11:54marcansorry not CPSR, APSTATE I think? which I think is IMPDEF
11:58marcansupposedly NZCV which should map to CPSR bits unless they added state somewhere else...
12:05marcanah, it's in NZCV bits 26-27 and then save/restore on exceptions is via ASPSR_EL1 bits 1-2 (which is also IMPDEF).
12:06marcanwhich I think apple actually calls APSTATE_EL1? so maybe it's not exceptions? let me check...
12:06mazif you don't need the dynamic flip of TSO inside the guest, then it 's pretty easy to do, and we could probably stick that in a module -- just hook whatever you need to do in the arch-specific vcpu_load/vcpu_put helpers (the module interface itself is to be created).
12:06marcannah it's definitely SPSR semantics, not PSTATE semantics
12:07marcanI'll keep my name then (some of the apple names are terribad)
12:08marcanmaz: well, we all know how stable the Linux kernel APIs are and how sustainable modules are long-term...
12:08mazthey've been around for 30 years.
12:09marcanmodules yes
12:09mazand indeed, I don't plan to have a stable ABI.
12:09mazthat's the distros problem.
12:09marcanyeah, and the point of upstreaming is... not having that problem :)
12:09mazquite.
12:10mazbut this still breaks a lot of things: migration of such a guest is fscked.
12:10marcansure, but I think it's fair to say if you start enabling IMPDEF features migration is fscked
12:10maz(well, migrating an apple guest to anything else is fscked for plenty of reasons)
12:10marcanI mean that's pretty obvious)
12:10marcan(and nobody cares for our use case)
12:12marcanone thing to keep in mind is that if we ever enable the APFLG feature especially, that one *definitely* has to be exposing this impdef stuff to EL0, and there's no trapping this
12:13mazfor IMPDEF regs, you could disable TIDCP, and context switch that in the same location.
12:13marcanwhich means if we're doing that we might as well do what apple intended here, and just expose this raw to the guest and let it deal with it the same way my patch already does on bare metal
12:13mazas long as there is an _EL12/EL02 accessor
12:13marcanand then all KVM has to do is save/restore context for these things
12:14marcanhow are CPU implementors passed to the guest right now? is there passthrough mode or is it always some qemu thing?
12:15mazMIDR values as seen as the host's, directly from KVM. which means that if your vcpu thread migrates from one type to another, you see it.
12:15marcanah, so that isn't trapped?
12:15mazKVM has no provision to cope with asymetric systems.
12:16mazno, this can be overloaded with VMIDR_EL2.
12:16marcanI mean what does KVM do right now?
12:17mazKVM just exposes the host view. nothing else.
12:17marcanand from what I see in the code, that includes AIDR_EL1
12:18marcanthat means my ACTLR code right now will... actually break. because KVM is claiming to be an Apple CPU that supports Apple IMPDEF features, but it doesn't.
12:18marcanat the very least we need to zero out AIDR_EL1 in KVM to make the current state of things not weirdly broken...
12:18mazwell, that's IMPDEF... so any behaviour is compliant!
12:19marcanwell yes, but if you're claiming to be a specific CPU and then not supporting its features, that's kind of broken isn't it :)
12:19mazshow me the spec of that COPU, and we'll talk! :D
12:19marcanoh come on :p
12:20marcanlook I know this sucks for everyone involved but I'm just trying to make this all work in the least shitty way for everyone involved
12:22marcanmaz: anyway, I need to get dinner, but I assume we're not going to have a straight answer for this all anyway at this point so... let's say I want to just implement this in KVM the "apple way" with the features and context switching and everything. re context switching, does this affect the userspace interface and/or how hard is it to add to that without breaking the world? or can I just ignore ...
12:22marcan... all that as long as we don't migrate, and the state stays in the kernel?
12:22ourdumbfuture has joined #asahi-dev
12:25mazwell, I'm willing to help. but I'm also not going to turn KVM upside down for that. my proposal is to allow a module to change the IMPDEF state at load/put time. for stuff such as AIDR, we could either expose it as writable to userspace, or trap it and forward that trap to userspace.
12:27mazthat will give you the possibility to save/restore the state as long as there is an EL12 accessor.
12:45marcansure, either option would work for AIDR
12:45marcanif the IMPDEF state is in a module, keep in mind we also need somewhere to *save* that state
12:46jeisom has quit [Ping timeout: 480 seconds]
12:46marcanthough honestly, I'm not sure a module buys us much
12:47marcanwe're going to have downstream kernels for hwe anyway, and I'm not sure maintaining a kernel patchset vs a module with an unstable API/ABI makes much difference, and for users it also doesn't really make a difference whether they install a module or a whole separate kernel...
13:18chadmed has quit [Read error: Connection reset by peer]
13:19chadmed has joined #asahi-dev
14:01marcaneiln: so on t6000 12.3 I get:
14:01marcan[ 0.933946] apple-isp 384000000.isp: [isp_coproc_ready] 0: coproc in WFI (status: 0x2a)
14:01marcan[ 1.937063] apple-isp 384000000.isp: [isp_firmware_boot_stage1] never received first magic number from firmware
14:01marcan[ 1.939041] apple-isp 384000000.isp: [isp_firmware_boot] failed firmware boot stage 1: -19
14:02marcanwhat's the status of this one? is it supposed to work? should I start looking through macOS traces? :p
14:05eilnthat means the asc hasn't even booted, likely an err in ctrr setup. I patched src/isp.c to add the heap to the phandle so of_iommu can find it. is that there? ah-'s t6000 booted before
14:05jannauah- got further than that, not sure if that's already integrated
14:07marcaneiln: which patch? (I'm still on my branches as is)
14:08eilnI pushed to isp-dapf with yours cherry-picked
14:08marcanthe heap is supposed to be linked statically in the DT, I added that to my t6000 one
14:08marcansame as we do for the GPU
14:09eilnwithout it dart_resv can't find it. I had this issue earlier
14:10marcanI mean what I pushed worked for me on t8103?
14:13eilnit didnt for me. I just rebased on asahi-wip. can you print apple_dart_setup_resv_locked to see if it's getting mapped?
14:14marcanI dumped the DART from m1n1, it gets mapped
14:14marcan page ( 0): 00000000 ... 00004000 -> 0000010000a18000 [11]
14:14marcan ==> ( 622): ... 009bc000 -> 00000100013cc000 size: 009b8000
14:14marcan page ( 622): 009b8000 ... 009bc000 -> 0000010001a08000 [11]
14:14marcan ==> ( 821): ... 00cd8000 -> 0000010001d20000 size: 0031c000
14:14marcan page ( 821): 00cd4000 ... 00cd8000 -> 00000107cf128000 [11]
14:14marcan ==> ( 896): ... 00e04000 -> 00000107cf250000 size: 0012c000
14:15eilnare we sure of the heap_top size? you can run 'log show' in macos to get that string
14:15marcannot exactly, but if that were wrong I'd expect a DART fault and I don't see that...
14:16marcanah wait, I'm not initializing DAPF...
14:17marcan[ 0.957991] apple-isp 384000000.isp: [isp_firmware_boot_stage3] firmware booted!
14:17marcan[ 0.960551] apple-isp 384000000.isp: [isp_enable_irq] about to enable interrupts...
14:17marcan[ 3.999982] apple-isp 384000000.isp: IO: timed out on request [0xe0f140, 0xc, 0xc]
14:17marcan[ 4.001998] apple-isp 384000000.isp: IO: failed to send OPCODE 0x0004: [0xe0f140, 0xc, 0xc]
14:17marcan[ 4.004636] apple-isp 384000000.isp: [isp_firmware_boot] failed to start command processor: -62
14:17marcangets further now
14:18marcan[ 22.841068] apple-dart 3860e8000.iommu: translation fault: status:0x80000404 stream:0 code:0x404 (unknown) at 0x3045c00
14:18marcanwhy that late though
14:19eilnnothing hardware yet, opcode 0x004 is PRINT_ENABLE. only 0xe00000 vs t8103 0x1800000 is suspicious though.
14:19marcanthat just looks like a fault after the driver gives up, not the problem
14:19marcanhm wait something is weird here
14:20marcanthat ininital DART map looks off by a page
14:21marcanah no it's just the dumper is weird
14:21jannauthe end printing in proxyclient is weird / off-by-one
14:22jannaunot sure what I thought when doing it
14:23hightower4 has joined #asahi-dev
14:24marcaneiln: isn't this multi DART business the same old thing from USB?
14:25marcanapple handles it by mirroring DART registers, we just instantiate multiple IOMMUs
14:25marcanthey do this weirdo thing with USB where certain requests go through different DARTs
14:25marcansame story here it looks like
14:25marcanhold on, let me just go back to t8103 and try to clean this up
14:27marcanjannau: we didn't need anything special in USB for this right? the iommu code just handes multiple IOMMUs?
14:29hightower3 has quit [Ping timeout: 480 seconds]
14:29jannaumarcan: yes, just list multiple "iommus"
14:31jannauthat is/will be the easy solution for multiple display output. the display-subsystem node will just list all dart-disp*s, that requires no code in the device drivers
14:33jannauit's currently limited to 2 darts but I think it's should easily extend to more than 2
14:33eilnISP/ANE/AVE just needs TTBR and TLB invalidation mirrored
14:34marcanthat's just a shortcut for "there are multiple DARTs and you need to configure them all"
14:34marcanthat's effectively what you're doing and what Apple does for USB too
14:34marcanthey do it as a horrible hack in the IOMMU driver
14:34marcaninstead of just instantiating the hardware multiple times, which is actually what is going on here
14:34marcanso we just do that
14:35marcanjannau: oh, we need 3 here :/
14:35marcanwas that done in the DART driver?
14:36jannaumarcan: I think it's just increasing MAX_DARTS_PER_DEVICE
14:36sventhe dart driver only supports two right now, I think you can just change a define to make that three
14:36jannauin apple-dart.c
14:36svenyeah, that
14:41marcanhm, now I broke t8103 the same way
14:42marcanand I also don't see things mirrored in the DARTs
14:51eilnwhere is it not mirrored?
14:52marcanI mean the multi-dart thing isn't working now
14:52marcanthe "right" way
14:52marcantrying to figure out why
14:53marcan[ 0.371095] apple-dart 22c0e8000.iommu: sid=0
14:53marcan[ 0.372085] apple-dart 22c0f4000.iommu: sid=0
14:53marcan[ 0.371541] apple-dart 22c0e8000.iommu: adding as dart #0
14:53marcan[ 0.372900] apple-isp 22a000000.isp: failed to init iommu: -517
14:53marcansomething's wack here
14:53marcanoh that's just EPROBE_DEFER lol
14:53eilnmy understanding is that they are not real darts. and initing them as separate iommus might erase the special tunables
14:53marcanthey are absolutely real DARTs
14:54marcanthis is just Apple being very, very stupid in how they represent things in their device tree
14:54marcanwhich is a pattern they have
14:54marcanI believe the underlying reason for the multiple DARTs is performance or perhaps different configurations, where they connect different hardware memory initiators to different DARTs so it doesn't bottleneck on one
14:55marcanwith USB we could see certain kinds of requests wind up on one DART or the other (ask sven about that)
14:57marcanthat EPROBE_DEFER is wrong, isp is making it up
14:58marcanohhh I get it
14:58marcan[ 0.323231] apple-dart 22c0e8000.iommu: DART [pagesize 4000, 16 streams, bypass support: 1, bypass forced: 0, locked: 0, AS 32 -> 36] initialized
14:58marcan[ 0.324633] apple-dart 22c0f4000.iommu: DART [pagesize 4000, 16 streams, bypass support: 0, bypass forced: 0, locked: 0, AS 32 -> 36] initialized
14:58marcan[ 0.326037] apple-dart 22c0fc000.iommu: DART [pagesize 4000, 16 streams, bypass support: 0, bypass forced: 0, locked: 0, AS 32 -> 36] initialized
14:58marcanwe check for matching bypass support
14:58marcanand of *course* apple made that inconsistent
15:02mazmarcan: well, if you only plan to hit upstream after a few *years*, that's probably not something I should be concerned about, and you'll have to convince other people than me!
15:06mazand on a completely unrelated note, I've finally tagged CS v3.2. no significant change with the state of the v3-dev branch, only silkscreen and LCSC reference updates.
15:08marcaneiln: and everything works with 3 proper DARTs :)
15:09marcaneiln: best part? it works without the "CTRR"/tunables setup at all
15:09marcanbecause unlike Apple, our DART driver actually knows how to initialize stuff without relying on random hardcoded register pokes in the device tree
15:12eilndart-tunables-instance-* is in the dt, and is required for the hack
15:12marcanyes, because that sequence is basically initializing the DART
15:12marcanwhich our driver knows how to do normally
15:13eilnwhy would they do this? isn't this easier?
15:13marcanbecause apple lol
15:13marcantheir hardware engineering is pretty good
15:14marcantheir software engineering... is not.
15:14marcanI'm so sorry you got caught up in this mess and I/we didn't catch it earlier and tell you what it's about :(
15:14marcanwould've probably saved you quite a bit of time :/
15:15marcanbut yeah our DART driver knows how to share page tables and everything, it literally just works... (other than that inconsistent bypass thing I had to patch)
15:18eilnthe "tunables" masks unused regs tho, 0x64/0x68/0x6c. interesting
15:18eilnit's fine, I figured out a hack during the ANE days
15:18eilnand it boots all the way?
15:19marcant8103 works all the way to videao, yeah
15:20marcanand yeah, they do init some unknown regs but it doesn't seem to matter
15:20marcanif it ever does we should try to work out what they do
15:21marcant6000 is still broken though
15:21marcaneiln: pushed what I have to the same old branches
15:29svenMost darts have tunables that can just be ignored
15:30svenThey sometimes use regs we have no clue about
15:30svenAnd yeah, dwc3 also has two darts that are merged into a single one inside adt
15:30svenand the splits makes no sense
15:31svenall of device mode and half of host most goes through the first and the other half of host mode through the second one
15:31svenI‘d love to see why they need this specific split :D
15:32mps has quit [Quit: leaving]
15:33svenand, uh, maybe I misremember but I though k mentioned this a while ago when we discussed dapf. maybe I should’ve put more emphasis on just how much of a hack the adt can be
15:39roxfan has quit [Ping timeout: 480 seconds]
15:41eilnmarcan: ah- timed out here (enable APPLE_ISP_DEBUG to print fw logs)
15:41eilnISPASC: ConnectivityTableCreate: optical card rev 0x0
15:41marcanon t8103?
15:41eilnISPASC: ASSERT: ./h10isp/common/misc/H13/CSystemConfiguratorConnectivityH13Jade.cpp, 472: 0
15:42marcanI didn't realize you had one of those too :)
15:42eilnt6000? it's not mine
15:43marcanoh sorry, ah- lol
15:43marcanI parsed that as a word
15:43marcanyeah that's where I assert
15:46ellyq has joined #asahi-dev
15:47marcaneiln: the dsid stuff looks wrong at first glance; the memory controller is laid out very differently on t6k, so those can't be right I think
15:47eilnwe didn't send those yet. we're stuck on cmd_print_enable
15:48eilnit might be the wall of spmi registers
15:48marcanwhere is that?
15:49marcanI feel like we're missing a config somewhere, that optical card 0 thing is sus
15:49marcanlike it's not finding an ID for something
15:50marcaneiln: that looks like a couple SPMI transactions
15:51eilnor the cmd_iova offset is wrong
15:58eilnit's definitely the bootargs, sigh
16:01eilnsorry I'm reinstalling macos rn I can't test the tracer
16:02eilncan you trace (open photobooth app) and hexdump heap_top - heap_top + 0x4000?
16:03eilnI'm guessing the bootargs are at 0xe12f80
16:05eilnand I verified t6000 dsid before
16:08marcanyeah, give me a sec
16:16eilnit should have a 0x1c000, that's constant
16:17mps has joined #asahi-dev
16:28hightower4 has quit [Ping timeout: 480 seconds]
16:33hightower2 has joined #asahi-dev
16:41Guest2157 has quit [Quit: Bridge terminating on SIGTERM]
16:41rhysmdnz has quit [Quit: Bridge terminating on SIGTERM]
16:42Jamie has joined #asahi-dev
16:42Jamie is now known as Guest2417
16:43hightower2 has quit [Ping timeout: 480 seconds]
16:43rhysmdnz has joined #asahi-dev
16:47jlco has joined #asahi-dev
16:50marcanthis is 13.5 so it's at 0xf00000
16:50marcanheap top that is
16:50marcanoffsets are from that
16:51marcanargs.unk4 = 0x1;
16:52marcanthat looks like sensor id, it's 3 for these machines
16:52marcanget that's it
16:52eilncan you get it from heap_top? i.e. 0xf00000 the struct cuts off
17:01marcaneiln: I got it to boot more copying and pasting stuff from there
17:01marcannow it dies at
17:01marcan[ 2.504945] apple-isp 384000000.isp: ch 0: unsupported sensor. Please file a bug report with hardware info & dmesg trace.
17:01marcan[ 2.508506] apple-isp 384000000.isp: ch 0: failed to cache sensor info: -19
17:01eilnmarcan: found it, ipc_iova is offsetted by a page
17:02completenoob has joined #asahi-dev
17:03marcanoh the code has a gate lol
17:04eilnthe 558 preset should be right i think
17:05marcaneiln: I've got video :)
17:06eilnheck yeah!!!
17:06marcanpushed what I have, it's stupidly hardcoded but there you go :D
17:06marcanI should get some sleep, it's 2AM :p
17:06marcanwait, aren't you on the same timezone?
17:07eilnive got work tomorrow (today actually)
17:07marcango get some sleep :p
17:09eilnhere's a really proto extraction script if you want better video https://pastebin.com/j0LpYLWv
17:09marcanthanks :)
17:09eilnI should, sigh. not enough time in the day..
17:10marcanthe args.pad_40[5] = 0x90; is not necessary, so it looks like just the sensor ID
17:10marcanthat should be in the device tree then, since it's in the ADT too
17:10marcan(I'm assuming that's what it is since it matches)
17:11marcananyway, good night ;)
17:11marcanand yeah, mood
17:13lena6 has quit [Ping timeout: 480 seconds]
17:15ChaosPrincessdoes m1n1 have a convenient way to diff a large memory range?
17:15ChaosPrincessin other news, ave firmware finally talks to me: "FW Cfg: prod, tag: AppleAVE2FW-6040.2.1, SHA: f5fece645"
17:23completenoob has quit [Ping timeout: 480 seconds]
17:24ChaosPrincessmarcan: didn't you have something on stream that showed pretty coloured hexdump diffs?
17:24marcanthat's regmon
17:25marcanproxyutils.RegMonitor
17:26marcanthe various m1n1 shells have a hook where if a "mon" variable exists, it'll call mon.poll() after every input
17:26ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
17:26faustine has joined #asahi-dev
17:30eilnI went to dim my computer, but I should reply
17:30eilnChaosPrincess: you built on the isp stuff right? the ipc code can nearly be shared. the TERMINAL channel outputs the logs w/o having to memdiff
17:31ChaosPrincesseiln: not directly on top of isp, but using isp as reference, terminal outputs the logs, yes, but the channel table is different, the iovas are 0xffffffff, i am diffing to find out how exactly the current channel position is signalled
17:33roxfan has joined #asahi-dev
17:33marcanif code can be shared here, it might make sense to have some kind of libispfw or something, especially since both of these drivers are in media/ (ane OTOH, not sure, depends on how different it ends up being)
17:34marcanbut that refactoring can come later too, up to you
17:34marcanprobably easier to hack on the code separately at first
17:34ChaosPrincessim still in the "huge piles of hardcoded register pokes" phase
17:35eilnthey handle memory really, really weird. the firmware iova starts at ipc_iova and is masked by 0x80000000.
17:35eilnalso echo "1 2 hi" > /tmp/ave_log.cfg gets the userspace driver to talk a lot. I'm fairly certain this is a scanf CVE
17:36hightower2 has joined #asahi-dev
17:36ChaosPrincesseiln: yes, the firmware sends the address it wants the kernel to add to iovas
17:37ChaosPrincessalso, thats fw ver?
17:38eilnthere's a firmware bug causing an irq hang (preventing more logs). It should be as chatty as ISP. I was trying to patch the instruction, but apparently since ventura we can't write to segment-ranges anymore, hence I was downgrading earlier
17:44ourdumbfuture has joined #asahi-dev
17:52jacksonchen666 has quit [Ping timeout: 480 seconds]
17:54faustine has quit [Quit: Lost terminal]
17:54ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
17:59ourdumbfuture has joined #asahi-dev
18:08eiln has quit [Ping timeout: 480 seconds]
18:29Retr0id has quit [Read error: Connection reset by peer]
18:29Retr0id has joined #asahi-dev
18:35roxfan has quit [Read error: Connection reset by peer]
18:42midou has quit [Ping timeout: 480 seconds]
18:50amarioguy has joined #asahi-dev
18:50jeisom has joined #asahi-dev
18:51amarioguyquick question, how exactly do you probe for the PCIe XHCI host controller BAR (or in U-boot terms, the "HCCR"/"HCOR")
18:51amarioguytrying to follow the u-boot and linux code that probes for it has not exactly been the easiest lol, is it just a read from the ECAM region?
18:51marcanthere's no firmware, you are the firmware so you get to *assign* a BAR.
18:52marcan(via ECAM writes)
18:52marcanI mean if you're not running on u-boot of course
18:53j`eywhy do isp and ave share anything?
18:54amarioguymarcan: ah that makes sense, so i just assign a BAR to the device?
18:54marcanj`ey: same codebase
18:54marcanamarioguy: yes (after doing a whole bunch of other pcie init)
18:55amarioguy(long story short, trying to upload XHCI controller fw in my edk2 fork lol, was trying to follow u-boot code beforehand)
18:55svenyou’ll also have to configure all the bridges above the device
18:55amarioguyyea that tracks, bus0 seems to just be all the root bridges (w/devices behind those bridges)
18:55marcanI would hope edk2 already has some semblance of PCIe support?
18:55crabbedhaloablut has quit []
18:55marcan(that can do this for you)
18:56marcananyway, I really need to sleep :p
18:56amarioguymarcan: yeah i'm pretty sure it does, i'm probably just being dumb and not seeing smth obvious lol
18:56svenyeah, I’d try to avoid writing that code myself. That uboot and Linux code is partly hard to follow because the whole setup is a bit tricky
18:57sven(maybe not for the apple case where you know about all devices but to do it correctly for the general case of arbitrary pcie busses)
19:01ellyq has quit [Read error: Connection reset by peer]
19:02jannauamarioguy: any progress with the cursed mac studio dcp swap_surfface in m1n1?
19:03jannauthat said, I still have to test the PR on m1 devices
19:04ellyq has joined #asahi-dev
19:26amarioguyjannau: i just ended up blowing away the install and reinstalling 12.3.1 lol, wasn't really using the ventura or sonoma partitions too much anyways
19:27jannauok, no worries
19:27midou has joined #asahi-dev
19:33deflated8837_ has quit [Remote host closed the connection]
19:48darkapex2 has quit [Remote host closed the connection]
19:48darkapex2 has joined #asahi-dev
20:38jannaumarcan: asahi alarm needs a mesa-asahi-edge rebuild for llvm-16
20:42deflated8837 has joined #asahi-dev
23:20abd has joined #asahi-dev
23:34jovahd has joined #asahi-dev
23:47systwi has joined #asahi-dev
23:50systwi_ has quit [Ping timeout: 480 seconds]
…