#
…

2021-09-02

00:08muscularduckling has joined #asahi
00:18muscularduckling has quit [Quit: Igloo IRC: https://iglooirc.com]
00:23muscularduckling has joined #asahi
00:55muscularduckling has quit [Quit: Igloo IRC: https://iglooirc.com]
01:21muscularduckling[m] has joined #asahi
02:09phiologe has joined #asahi
02:13PhilippvK has quit [Ping timeout: 480 seconds]
02:25tomtastic has quit [Ping timeout: 480 seconds]
02:29tomtastic has joined #asahi
02:34malvo has quit [Ping timeout: 480 seconds]
02:35malvo has joined #asahi
03:12yuyichao has joined #asahi
03:25Rakshit[m] has joined #asahi
03:56marvin24 has joined #asahi
03:59marvin24_ has quit [Ping timeout: 480 seconds]
04:43linearcannon has quit [Read error: Connection reset by peer]
05:26gladiac is now known as Guest6046
05:26gladiac has joined #asahi
05:32Guest6046 has quit [Ping timeout: 480 seconds]
05:53linearcannon has joined #asahi
06:15gabuscus has quit [Read error: Connection reset by peer]
06:20gabuscus has joined #asahi
07:08marcangoing to stream spme pmgr/clock driver stuff in a bit, see #asahi-stream :)
07:28bps has joined #asahi
08:23mazsven: do PCI devices see IOVAs in the low 4GB range? I seem to remember they do, right?
08:24mazso what guarantees that we never provide an endpoint with the MSI doorbell as something to DMA from/to?
08:25maz(I fear I know the answer to that question)
08:28svenunless you setup dma-ranges to excluse the msi page in the pcie node only luck
08:29svenunless the iommu framework can figure out the msi doorbell somehow, but i don't think so
08:30mazsven: that's what I thought. I seem to remember there was something to exclude some MSI ranges because HiSilicon messed up their SMMU across several generations. Time to poke Robin...
08:32sventhere's a get_resv_regions that the iommu driver can implement
08:43kettenis_maz: must admit that I cheated in OpenBSD and simply remove the first and last page from the iova window in the OpenBSD DART driver
09:02mazkettenis_: cheating is always good! :)
09:13TheJollyRoger2 has joined #asahi
09:14mazsven: I think we need to implement something similar for the dart driver.
09:14TheJollyRoger has quit [Remote host closed the connection]
09:14mazI'll dig into that shortly.
10:43aleasto has quit [Quit: Konversation terminated!]
11:29aleasto has joined #asahi
11:58kendfinger has quit []
11:58kendfinger has joined #asahi
12:05robher has quit []
12:05robher has joined #asahi
12:12al3xtjames1 has joined #asahi
12:12al3xtjames has quit [Remote host closed the connection]
12:12al3xtjames1 is now known as al3xtjames
12:16nskl has quit [Quit: WeeChat 3.2]
12:20bps has quit [Ping timeout: 480 seconds]
13:13bps has joined #asahi
13:48marvin24_ has joined #asahi
13:52marvin24 has quit [Ping timeout: 480 seconds]
14:02yuyichao has quit [Ping timeout: 480 seconds]
14:14nsklaus has joined #asahi
14:20erincandescent has quit [Remote host closed the connection]
14:21erincandescent has joined #asahi
14:26yuyichao has joined #asahi
15:23cz3 has quit []
15:23cz3 has joined #asahi
15:32Andalu30 has joined #asahi
15:51marvin24 has joined #asahi
15:54marvin24_ has quit [Ping timeout: 480 seconds]
16:04simjnd has joined #asahi
16:05dnjmis[m] has joined #asahi
16:23maennich has quit []
16:23maennich has joined #asahi
16:36simjnd has quit [Ping timeout: 480 seconds]
17:22maznot pretty, but does the trick.
17:27j_eymaz: how come intel/amd/virtio do a similar thing, but not smmu?
17:28mazj_ey: because funnily enough, not translating the MSI doorbell is an x86-ism.
17:28mazj_ey: the usual system architecture on ARM is that the MSI doorbell is translated by the SMMU, which avoids this kind of horror.
17:29mazj_ey: the only other case we have of this is the "quality" implementations of the ITS by HiSi (D03/D05/D06).
17:30j_eyso a reserved region is just untranslated/identity then?
17:30mazeffectively, yes. it is a black hole in the IOVA, and never reaches the IOMMU.
17:31simjnd has joined #asahi
17:31mazwuich is really fun for VMs that have their memory on top of that precise address...
17:31mazwhich*
17:40svenlooks good to me
17:41marcanfwiw, tl;dr on today's stream is... pmgr doesn't seem to *do* all that much at least in the low ranges, at least on the mac mini
17:42svenj_ey: the iommu core understands a few different types of reserve regions fwiw, see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/iommu.h#n100
17:42sven*reserved
17:42marcan95% is clock gates, which at this point might also be power gates for all I know
17:42marcanbecause they aren't really called clock gates, and often the power gates reference the same IDs
17:42marcanthey are called "power states"
17:42marcanthe actual power gates register range is almost untouched, I saw macos poke like... 3
17:42marcanand I don't know what they are
17:44marcanin reality pmgr is surprisingly quiet post-boot
17:44marcanI could only see actual power state changes with something obvious like pulling up a video that enables the video decoder
17:44svenso it's all hardware magic (or coprocessors) doing the power stuff?
17:44marcanit's starting to sound like that
17:44kettenis_did you try suspending the machine?
17:45marcanyes (which crashes the HV, but definitely pokes a pile of state regs)
17:45marcanand there's things like the power states for the CPUs represent the currently running CPUs, but they obviously aren't turned on *that way*
17:45marcanso there is clearly abstraction going on
17:46marcani.e. we know we don't need to touch this to spin up cores, yet the ps regs for each CPU and the clusters overall accurately represent the current state of what CPUs have been spun up
17:46marcanit looks like this is a relatively high level abstraction for what power/idle state a given device is in (most of which only have 2 states)
17:47marcanand now I wonder if clocks is the right abstraction in linux for this, though it might be the best we can do for now
17:47marcanthey also use this device concept to trigger voltage/performance states for some devices
17:48marcane.g. any SoC block requiring high performance can put the whole SoC power domain into a higher voltage state
17:48marcan(that's the "everything but gpu/cpu" domain basically)
17:49marcanI still don't know how clocks are controlled, what regs they map to
17:49marcanI only found like 4 proper cross-refs from the devices table to clocks, everything else is null, which is bizarre
17:49marcanmaybe this is also all automagic stuff controlled by the pmu or something...
17:49mazmarcan: this looks a bit like the voting system that most qualcomm SoCs implement (you can vote on the power state of a block, and the HW aggregates the votes to satisfy the independent requirements within the physical constraints).
17:50kettenis_so you're thinking one of the coprocessors is repsonding to the bits we twiddle by doing tha actual power/clock management?
17:50marcanI'm not sure if there's "voting" here per se, at the hw level
17:50marcanI know multiple devices in the ADT reference the same power rails to set a voltage
17:50marcanso that could be done in software
17:50marcankettenis_: yeah, possibly
17:50j_eymaz: shame about the powermetrics segfault :D
17:50marcanlol yeah
17:50sventhere's also a clock-frequencies and clock-frequencies-regs property in PMGR iirc, but running grep on XNU and all kernel extensions doesn't find _any_ reference to the regs one
17:51marcanwell, that might be a good reason to implement SMP in the HV
17:52marcanthe PMP firmware definitely talks SPMI and ooooh here are the strings of the perf counters I was not finding in the ADT
17:53marcanthis is pretty small though, it looks like it could be mainly sampling, not control, but I'm not sure
17:57aleasto has quit [Quit: Konversation terminated!]
18:09simjnd has quit [Remote host closed the connection]
18:38cepheus has quit [Quit: issued !quit command]
18:43cepheus has joined #asahi
19:01Andalu30 has quit [Ping timeout: 480 seconds]
19:08jbowen has quit [Ping timeout: 480 seconds]
19:15jbowen has joined #asahi
19:16tomtastic has quit [Quit: ZNC - https://znc.in]
19:16tomtastic has joined #asahi
19:32Chainsaw has quit []
19:32Chainsaw has joined #asahi
19:35Ariadne has quit []
19:35Ariadne has joined #asahi
19:42jbowen has quit [Ping timeout: 480 seconds]
19:56jbowen has joined #asahi
20:19jmcneill_ is now known as jmcneill
20:21jbowen has quit [Ping timeout: 480 seconds]
20:27jbowen has joined #asahi
21:43aleasto has joined #asahi
22:03aleasto has quit [Remote host closed the connection]
22:05aleasto has joined #asahi
23:08aleasto has quit [Remote host closed the connection]
23:13aleasto has joined #asahi
23:24gladiac is now known as Guest6107
23:24gladiac has joined #asahi
23:30Guest6107 has quit [Ping timeout: 480 seconds]
23:58gladiac is now known as Guest6112
23:58gladiac has joined #asahi
…