#
…

2021-06-03

00:04digitalfx1 has joined #asahi
00:09digitalfx has quit [Ping timeout: 480 seconds]
00:10klltkr has joined #asahi
00:10klltkr has quit []
00:11klltkr has joined #asahi
00:11klltkr has quit []
00:12klltkr has joined #asahi
00:12klltkr has quit []
00:42egavinc__ has joined #asahi
00:46egavinc_ has quit [Remote host closed the connection]
01:37bgb_ has joined #asahi
01:44digitalfx1 has quit [Ping timeout: 480 seconds]
01:48digitalfx1 has joined #asahi
01:52kyjus25 has joined #asahi
02:04kyjus25 has quit [Quit: Leaving.]
02:06kyjus25 has joined #asahi
02:18PhilippvK has joined #asahi
02:22phiologe has quit [Ping timeout: 480 seconds]
02:26hspak0 has joined #asahi
02:31hspak has quit [Ping timeout: 480 seconds]
02:31hspak0 is now known as hspak
02:44kyjus25 has quit [Quit: Leaving.]
02:52Tom__ has joined #asahi
02:59Thomas___ has quit [Ping timeout: 481 seconds]
03:10marvin24 has joined #asahi
03:13marvin24_ has quit [Ping timeout: 480 seconds]
03:44digitalfx1 has quit [Ping timeout: 480 seconds]
03:46digitalfx1 has joined #asahi
03:57digitalfx1 has quit [Ping timeout: 480 seconds]
04:00digitalfx1 has joined #asahi
04:07leifm has quit [Quit: Connection closed for inactivity]
04:08digitalfx1 has quit [Ping timeout: 480 seconds]
04:17digitalfx1 has joined #asahi
04:21bgb_ has quit [Ping timeout: 480 seconds]
04:25digitalfx1 has quit [Ping timeout: 480 seconds]
04:26bgb_ has joined #asahi
04:34digitalfx1 has joined #asahi
04:37bgb_ has quit [Ping timeout: 480 seconds]
04:47artemist has quit [Ping timeout: 483 seconds]
04:59artemist has joined #asahi
05:19VinDuv has joined #asahi
05:36digitalfx1 has quit [Ping timeout: 480 seconds]
05:45digitalfx1 has joined #asahi
05:57r0ni has quit [Ping timeout: 480 seconds]
06:02pugguu has joined #asahi
06:08pugguu has quit [Read error: Connection reset by peer]
06:08pugguu has joined #asahi
06:17VinDuv has quit [Quit: Leaving.]
07:31mazsven: ah, I see you caught my stupid MSI address bug! thanks for that! :D
07:31mazkettenis: ^^
07:37svenmostly kettenis, i just complained ;)
07:37svenbut pcie works just fine now
07:39bisko has joined #asahi
07:39mazsven: that's pretty awesome, thanks for pulling everything together. It'd be good to work on a series that enable that upstream.
07:41svenabsolutely. i'm almost ready for the next version of the dart driver
08:05artemist has quit [Ping timeout: 480 seconds]
08:16frode_0xa has quit [Quit: leaving]
08:16artemist has joined #asahi
08:16frode_0xa has joined #asahi
08:16frode_0xa has quit []
08:22m42uko_ has joined #asahi
08:25m42uko has quit [Ping timeout: 480 seconds]
08:33bgb_ has joined #asahi
09:02jannauany idea what might be at mmio address 0x23d2b9000? it is not mentioned in the ADT as far as I can see. mac os writes up to offset 0x20 quite often. at offset 0x0 is counter and it writes increasing values to offset 0x4, 0x8, 0x10 and 0x20
09:03jannaucould be, the WDT in the adt is at 0x23d2b8000
09:05pipcet[m]so it seems the ADT isn't entirely accurate :-)
09:06jannaumore like incomplete. there is a watchdog at 0x23d2b0000 / 0x23d2b8000 https://github.com/AsahiLinux/docs/wiki/HW:WDT
09:07j_ey that's pipcet[m]'s page :P
09:07pipcet[m]random guess, but I'd think there'd be a non-volatile area so the watchdog knows why it reset..
09:08pipcet[m]j_ey: it's a cargo cult page, I put it there so the big knowledgeable Apple plane would land and tell me more about the WDT :-)
09:08jnwhich size does the ADT specify for the watchdog at 23d2b8000?
09:09pipcet[m]adt.device-tree.arm-io.wdt.reg = <0x3d2b0000 0x00000000 0x00004000 0x00000000 0x3d2b8020 0x00000000 0x00000004 0x00000000 0x3d2b8008 0x00000000 0x00000004 0x00000000 0x3d2b800c 0x00000000 0x00000004 0x00000000 0x3d280000 0x00000000 0x0000c000 0x00000000>
09:09pipcet[m]so it only covers single registers
09:09pipcet[m]except for the last one
09:10jannauthat said, I handle PMC interrupts now in a way to shutdown mac os properly
09:11pipcet[m]jannau: what did you have to do?
09:12jannautrap the PMC msr and wrap the counters on IRQs
09:12jannauI'll prepare a PR
09:13Mary has quit [Quit: Ping timeout (120 seconds)]
09:13pipcet[m]IRQs or FIQs, out of curiosity?
09:13Mary has joined #asahi
09:14jannauAIC IRQs are not handled by the hypervisor
09:20marcanjannau: thanks, had that on my TODO
09:20marcanI think you only need to wrap the control reg, right?
09:21svenkettenis: so.. clocks. it looks like we'll have to find a way to do with a single clock node. we discussed assigned-clocks at some point and concluded that wouldn't work, didn't we?
09:22marcanbasically just keep a shadow flag for FIQ enable, disable the real one FIQ, re-enable once the guest clears the flag
09:22marcan*real one on FIQ
09:22phiologe has joined #asahi
09:22jannauiirc the counters itself have be wrapped
09:23jannauinterrupts are generated as long as bit 48 is set
09:24jannauI'll check. currently I'm shadowing bit 48 for each counter
09:24PhilippvK has quit [Ping timeout: 480 seconds]
09:25bgb_ has quit [Ping timeout: 480 seconds]
09:28hell__jannau: hmmm, now I wonder: if macOS writes to offset 0x20 of 0x23d2b9000 quite often, what happens if one blocks these writes?
09:31marcanjannau: there is an interrupt status bit in the control register
09:32marcanyou can disable IRQ generation in the control register until the guest clears the status bit
09:32marcanwhich is what I was already doing but not shadowing it; the guest asserted because it saw IRQs disabled when it was trying to enable them
09:33kettenissven: I believe assigned-clocks isn't the appropriate mechanism
09:34kettenisbut if the people that matter think it is fine, then I won't object
09:37kettenisor we could add invent properties that have different names but work in a similar way
09:37bgb_ has joined #asahi
09:47grange_c9 has joined #asahi
09:47grange_c has quit [Remote host closed the connection]
09:47grange_c9 is now known as grange_c
09:48svenhm. so assigned-clock-parents is when i e.g. have a clock that can have one out of N parents and i want to select a specific default, isn't it?
09:54kettenisthat is my understanding
09:55svenso i think linux actually requires the clock that's specified in assigned-clock-parents to already be a possible parent
09:56svendoesn't sound like that's the correct mechanism then :/
09:57svenunless i setup clocks 0,...,i-3, i-2, i-1 to be possible parents of clock
09:57svenwhich sounds like a huge hack
10:00digitalfx1 has quit [Ping timeout: 480 seconds]
10:05j_eysven: you didnt document force_bypass_offset and force_bypass_len, unsure if intentional?
10:06svenerm.. nope
10:06svenactually, let's make that yes! i obviously skipped that because it's part of the hack! :P
10:07j_eyI mean, thats what I was considering :P
10:07sveni also messed up their name. they should've been called fake_bypass
10:07svenj_ey: let's just go with that story then ;)
10:10bgb_ has quit [Ping timeout: 480 seconds]
10:10j_ey"A single domain is used to represent a single virtual address spaces.", s/spaces/space/ (just if you end up doing a v4..)
10:11digitalfx1 has joined #asahi
10:11svenoh, there'll definitely be a v4
10:15Raqbit1 has joined #asahi
10:18j_eysven: where are these magic numbers in apple_dart_hw_reset from?
10:18j_ey0x03020100 etc
10:19svenit's just 0,1,2,3,4,5,...
10:19j_eyit's backwards ok, it looks funky!
10:19digitalfx1 has quit [Ping timeout: 480 seconds]
10:20svenyeah, it's because the hw only allows 32bit writes
10:20crabbedhaloablut has quit [Ping timeout: 480 seconds]
10:21Raqbit has quit [Ping timeout: 480 seconds]
10:21Raqbit1 is now known as Raqbit
10:21svennow that i think about that again... it's probably not required
10:22sveni think iboot doesn't leave any dart with a stream remap around
10:22j_eyit can't hurt to be 'pedantic'?
10:22j_eyconservative rather
10:22crabbedhaloablut has joined #asahi
10:24svenah. i also forgot a apple_dart_hw_enable_translation i left in there for debugging
10:24j_eyI was actually going to ask about that
10:24j_eyif you mean the one in the MAX_STREAMS loop
10:25sveni wanted to see which streamid pcie uses and a simple way to do that it to setup empty pagetables and enable translation
10:25j_eyand get a fault?
10:25svenit doesn't hurt to have that there but the code sequence is kinda dumb then
10:26choozy has joined #asahi
10:26bgb_ has joined #asahi
10:28digitalfx1 has joined #asahi
10:42bgb_ has quit [Ping timeout: 480 seconds]
10:52bgb_ has joined #asahi
11:04bgb_ has quit [Ping timeout: 480 seconds]
11:08bgb_ has joined #asahi
11:30pugguu has quit [Ping timeout: 480 seconds]
11:33pugguu has joined #asahi
11:39digitalfx1 has quit [Ping timeout: 480 seconds]
11:41pugguu has quit [Ping timeout: 480 seconds]
11:41pugguu has joined #asahi
11:41pugguu has quit [Read error: Connection reset by peer]
11:43pugguu has joined #asahi
11:47j_eysven: wondering if apple_dart_tlb_flush_walk deserves a comment? looks like you have to flush a full domain at a time, since you ignore `iova`?
11:48digitalfx1 has joined #asahi
11:56svenyeah, maybe
11:56sveni wonder if there is a way to only flush a certain iova range though
11:57sventhere's this 32bit command register that has the flush bit and i doubt that they need 32 commands
11:57svenmaybe some parts of it allow to select a subset
12:01jannaumarcan: just not enaling PMC irqs and lying to the guest about it works as well
12:02pugguu has quit [Remote host closed the connection]
12:05pugguu has joined #asahi
12:10choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
12:50digitalfx1 has quit [Ping timeout: 480 seconds]
12:52bloomjannau: so you have the hv working?
12:54bgb_ has quit [Ping timeout: 480 seconds]
12:57marcanjannau: well, then PMC IRQs don't work but I guess that doesn't matter much :)
12:58digitalfx1 has joined #asahi
13:10thunfisch has quit [Read error: Permission denied]
13:13jannaumarcan: do they work now? i.e. is the guest's FIQ handler invoked
13:15bloomjannau: nice
13:17^GaveUp^ has joined #asahi
13:21TheFirst has quit [Ping timeout: 480 seconds]
13:21^GaveUp^ is now known as TheFirst
13:26balrogmarcan: can 2-machine debugging be done in the hypervisor?
13:35choozy has joined #asahi
13:44pugguu has quit [Remote host closed the connection]
13:45Shiz has quit [Ping timeout: 480 seconds]
13:46pugguu has joined #asahi
13:54pugguu has quit [Read error: Connection reset by peer]
13:55pugguu has joined #asahi
13:57Shiz has joined #asahi
13:59digitalfx1 has quit [Ping timeout: 480 seconds]
14:00kyjus25 has joined #asahi
14:03pugguu has quit [Read error: Connection reset by peer]
14:03pugguu has joined #asahi
14:07digitalfx1 has joined #asahi
14:14berryRed has joined #asahi
14:15digitalfx1 has quit [Ping timeout: 480 seconds]
14:19kyjus25 has quit [Quit: Leaving.]
14:25digitalfx1 has joined #asahi
14:31berryRed has quit [Quit: Leaving]
14:33digitalfx1 has quit [Ping timeout: 480 seconds]
14:34tsida has quit [Remote host closed the connection]
14:36marcanbloom: like the xnu feature?
14:36marcaner balrog
14:36balrogmarcan: yeah
14:37marcanjannau: right now they are ignored, the host needs to manage that like it manages the timers
14:37balrogand would it be possible for m1n1 to trap xnu nmis?
14:37balrogI believe there's a kext available that allows user triggering of them
14:37marcanbalrog: I don't see why it wouldn't work, but I don't know what an "nmi" is here
14:37marcanI mean in ARMv8 terms
14:37balrognon-maskable interrupt equivalent
14:38marcansure, but ARM has no such thing
14:38balroghmm I'm not sure what the equivalent to that is in AVMv8 terms :)
14:38marcanthere's actually a whole funny GIC hack in Linux to do something NMI-ish
14:38marcanwhere instead of masking IRQs the normal way it changes the priority threshold
14:38marcanthat stuff's littered all over the irq masking primitives
14:38j_ey(system_uses_irq_prio_masking)
14:42balroghmm, PANIC_CORE_ON_NMI isn't implemented on arm
14:42balrogbut you can just trigger a panic some other way
14:43digitalfx1 has joined #asahi
14:46marcanI already catch panics if you enable exception vector patching
14:46artemist has quit [Ping timeout: 480 seconds]
14:46marcanit eventually runs a debug break instruction and I catch that then decode the panic
14:47marvin24 has quit [Ping timeout: 480 seconds]
14:47marcanthough right now it's dogslow because it all goes into python
14:47marcanwould need a fast path to be usable with that turned on all the time
14:47marcanI only really used it for early debugging
14:48marcaneither that or just use the symbols to patch that debug break into a hvc and avoid the whole vector patching mess
14:51digitalfx1 has quit [Ping timeout: 480 seconds]
14:56bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:58_whitelogger has joined #asahi
14:59bisko has joined #asahi
14:59digitalfx1 has joined #asahi
15:05bgb_ has joined #asahi
15:05pugguu has quit [Remote host closed the connection]
15:06pugguu has joined #asahi
15:07digitalfx1 has quit [Ping timeout: 480 seconds]
15:08thunfisch has joined #asahi
15:10artemist has joined #asahi
15:17tsida has joined #asahi
15:17bgb_ has quit [Ping timeout: 480 seconds]
15:18digitalfx1 has joined #asahi
15:19balrogmarcan: being able to do two-machine xnu debugging on one machine would be... handy :P
15:19balrogon intel I've done it with vmware
15:23svenso you want to run xnu in a vm essentially to debug it?
15:23marcanwell the hv is already almost a debugger
15:23marcanjust need to actually implement using the debug hw to do single stepping/breakpoints/etc
15:24marcanthen just make hv.py provide a gdb stub on a socket :p
15:24marcanbetter than "two-machine" debugging
15:27bgb_ has joined #asahi
15:35bgb_ has quit [Ping timeout: 480 seconds]
15:39marvin24 has joined #asahi
15:41kettenisyeah, that looks somewhat reasonable
15:42kettenisthe self-referencing clock property doesn't trigger any magic within the linux clock framework?
15:43svenit requires a small hack. i just had to register the clock provider with "empty" clocks before assigning parents.
15:43svenotherwise it would get stuck in a EDEFER loop
15:43svennot sure if the maintainers will like that
15:44svenwould that also work with openbsd and u-boot?
15:46bgb_ has joined #asahi
15:47artemist has quit [Ping timeout: 480 seconds]
15:48ketteniswill have to check u-boot
15:49kettenisbut I think it should be fine
15:49kettenisnot much automatic clock processing u-boot
15:49pipcet[m]I may be missing something obvious again, but what's the reason for the self-reference?
15:50svenremember how the clock nodes like corellium did them sometimes had references to each other?
15:51sventhe linux maintainers ideally want a single node for the clock controller. that self-reference is one way to represent the same thing in the device tree
15:52pipcet[m]no sub-nodes for the clocks?
15:53pugguu has quit [Ping timeout: 480 seconds]
15:54bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
15:54pugguu has joined #asahi
15:57kettenisI wonder if you should just use a different name for that clocks property
15:57svenhm.. probably
15:57kettenisfor example "clock-parents" or maybe "apple,clock-parents"
15:58ketteniscould be a simple array of clock numbers
15:58sveni could also just get rid of the... yeah that
15:58pipcet[m]sven: I guess it's the best you can do under those strange circumstances, though I'd just do it right rather than introduce spurious self references
15:59svenpipcet[m]: why do you think the self-reference is spurious?
16:00pipcet[m]sven: because it would go away if we had one phandle representing each clock
16:01svenkettenis: sounds like a discussion for the mailing list though :-)
16:01pipcet[m]it's simply not true that there is a line connecting the pmgr to itself which serves both as input and output line; it's an internal line connecting one part of the pmgr, which should be represented as one node, to another
16:02kettenissven: yeah, no clock peoplehanging out here it seems
16:02nullThe two ways this is generally done is either to have discrete nodes or to have the internal relationships between those be inferred from the compatible stirng in the driver
16:03nullI haven't been a DT maintainer for a while now, but the self-reference doesn't seem right to me
16:03ketteniswe deliberately don't want to have to encode the relationships in the driver
16:03pipcet[m]again, my armchair opinion is one phandle per clock would work best, as sub-nodes of the pmgr with the address in the reg property.
16:04nullSure; I'm just providing context, and I'd generally agree that it's preferable to get the hierarchy in the DT if this isn't really a discrete unit
16:05svenyup, this unit has been around for at least 7 years now with the only difference being the hierarchy and the available clocks
16:06kettenisthe one-clock-per-node model still has my preference
16:06pugguu has quit [Read error: Connection reset by peer]
16:06pugguu has joined #asahi
16:07svenyeah, mine too
16:07pipcet[m]it also matches quite closely what clock-bindings.txt says.
16:08bgb_ has quit [Ping timeout: 480 seconds]
16:08pugguu has quit [Remote host closed the connection]
16:09kettenissven: I've added the DART interrupts to u-boot
16:09skipwich has joined #asahi
16:10kettenismy problem was related to the commented out clocks, which as a cascading failure resulted in the pci bus numbering being wrong which in turn screwed up the iommu mapping
16:10kettenismaking the clocks optional in u-boot fixed that issue
16:11pugguu has joined #asahi
16:11kettenisdo you have any thoughts on the PCI RID to DART SID mapping we should use?
16:12svennot yet. so the way i understand it we can actually program a sid mapping using some pcie config regs?
16:12kettenisI mapped everything to SID 1 since SID 0 seems to be a catch-all for all RIDs that aren't mapped explicitly in the PCIe host bridge
16:13bisko has joined #asahi
16:14kettenisin the end for the current hardware it doesn't matter all that much since we have separate DARTs for each root port and only one device on each root port
16:14kettenisand everthing is built-in, so no slots where folks can plug in PCIe bridges
16:14svenhm, that may change once we tackle thunderbolt though
16:15svenor is the pcie node for thunderbolt completely different anyway?
16:15bgb_ has joined #asahi
16:18kettenisjudging from the corellium code it is largely the same
16:18kettenisonly has a sinle root port
16:19kettenisthe assiocated DART has more features though it seems
16:20bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:20sveni think i saw in the ADT that it has at least more sids
16:21sveni wanted to look at it but the MMIO region only returned 0xffff.. for all reads
16:21svenprobably needs more magic pokes before it's available
16:23bgb_ has quit [Ping timeout: 480 seconds]
16:26svenhrm. so essentially the pcie hw provides functionality that's similar to what's described in iommu-map, doesn't it?
16:29kettenisyes, the idea is that the driver should program the RID to SID mapping registers to something that matches the iommu-map property
16:29digitalfx1 has quit [Ping timeout: 480 seconds]
16:32digitalfx1 has joined #asahi
16:32bgb_ has joined #asahi
16:32svenmakes sense
16:34kettenisthen I think there is no real reason to change the pcie DT bindings schema
16:35frode_0xa has joined #asahi
16:35kettenisthe example uses SID 1, but we may use 0 in our actual device trees for a bit
16:36kettenismaz: if you have a few spare cycles to look at the way MSIs are done in the binding that would be great
16:39frode_0xa has quit []
16:40frode_0xa has joined #asahi
16:40bgb_ has quit [Ping timeout: 480 seconds]
16:40frode_0xa has quit []
16:41frode_0xa has joined #asahi
16:42digitalfx1 has quit [Ping timeout: 480 seconds]
16:48VinDuv has joined #asahi
16:49bgb_ has joined #asahi
16:50digitalfx1 has joined #asahi
16:57bgb_ has quit [Ping timeout: 480 seconds]
16:58digitalfx1 has quit [Ping timeout: 480 seconds]
17:07digitalfx1 has joined #asahi
17:15digitalfx1 has quit [Ping timeout: 480 seconds]
17:22jkc has quit [Quit: WeeChat 3.0.1]
17:23jkc has joined #asahi
17:23digitalfx1 has joined #asahi
17:25bgb_ has joined #asahi
17:33bgb_ has quit [Ping timeout: 480 seconds]
17:43bgb_ has joined #asahi
17:51bgb_ has quit [Ping timeout: 480 seconds]
18:09bisko has joined #asahi
18:10pugguu has quit [Ping timeout: 480 seconds]
18:13pugguu has joined #asahi
18:17pugguu has quit [Remote host closed the connection]
18:17pastly-antispam has joined #asahi
18:19pugguu has joined #asahi
18:25digitalfx1 has quit [Ping timeout: 480 seconds]
18:27pugguu has quit [Ping timeout: 480 seconds]
18:33digitalfx1 has joined #asahi
18:40kyjus25 has joined #asahi
18:46kyjus25 has quit [Quit: Leaving.]
18:53kyjus25 has joined #asahi
19:35digitalfx1 has quit [Ping timeout: 480 seconds]
19:45digitalfx1 has joined #asahi
19:48bgb_ has joined #asahi
19:59tsida has quit [Remote host closed the connection]
20:00bgb_ has quit [Ping timeout: 480 seconds]
20:02bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:06tobikoch has joined #asahi
20:07bgb_ has joined #asahi
20:10tsida has joined #asahi
20:15bgb_ has quit [Ping timeout: 480 seconds]
20:24bgb_ has joined #asahi
20:32bgb_ has quit [Ping timeout: 480 seconds]
20:42bgb_ has joined #asahi
20:42VinDuv has quit [Quit: Leaving.]
20:43digitalfx1 has quit [Ping timeout: 480 seconds]
20:44kyjus25 has quit [Quit: Leaving.]
20:47kyjus25 has joined #asahi
20:50bgb_ has quit [Ping timeout: 480 seconds]
20:52digitalfx1 has joined #asahi
20:59bgb_ has joined #asahi
21:07bgb_ has quit [Ping timeout: 480 seconds]
21:18bgb_ has joined #asahi
21:26bgb_ has quit [Ping timeout: 480 seconds]
21:36bgb_ has joined #asahi
21:37kyjus25 has quit [Quit: Leaving.]
21:44bgb_ has quit [Ping timeout: 480 seconds]
21:49egavinc__ has quit [Quit: Leaving]
21:51bgb_ has joined #asahi
21:53ihaveamac has quit [Quit: fail]
21:55ihaveamac has joined #asahi
22:00bgb_ has quit [Ping timeout: 480 seconds]
22:10bgb_ has joined #asahi
22:18bgb_ has quit [Ping timeout: 480 seconds]
22:23choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
22:31digitalfx1 has quit [Quit: WeeChat 3.1]
23:21tsida has quit [Remote host closed the connection]
…