#
✕ nick:sven
#asahi · 2021-06-07 15:40
svenyup, in iommu_get_def_domain_type there is a check before it calls to the iommu driver to get the default domain: if (dev_is_pci(dev) && to_pci_dev(dev)->untrusted) return IOMMU_DOMAIN_DMA;
#asahi · 2021-06-07 15:40
sven*dev_is_untrusted
#asahi · 2021-06-07 15:39
sveni think if dev_is_untrested is set it defaults to DMA domains anyway
#asahi · 2021-06-07 15:39
svenoh, good point!
#asahi · 2021-06-07 15:17
sveni think iommu_dma_map_page uses __iommu_dma_map_swiotlb which uses bounce buffers. and from what i can tell dma_map_page is used for streaming dma
#asahi · 2021-06-07 15:11
svenor maybe that was just a patchset i saw, let me check
#asahi · 2021-06-07 15:11
svenarnd: afaik the iommu code already has the option to use bounce buffers for untrusted pci devices
#asahi · 2021-06-07 15:09
svenbypass mode hasn't broken anything yet while using usb but i'm not confident there yet
#asahi · 2021-06-07 15:09
svenarnd: from what i can tell it always maps everything as coherent.
#asahi · 2021-06-07 15:03
sven(it kinda works by accident already if you just remove the BUG_ON)
#asahi · 2021-06-07 15:02
svenso i don't think the iommu_pagesize > cpu_pagesize fix is going to require a lot of changes, but it'll certainly require reviewing the entire code to be comfortable it doesn't break anything by accident
#asahi · 2021-06-07 15:01
svenagreed
#asahi · 2021-06-07 14:55
sven:D
#asahi · 2021-06-07 14:54
sveni think so. i haven't tested this in detail but from what i can tell you can limit access inside the page down to that level
#asahi · 2021-06-07 14:52
svendart also supports subpage protection fwiw, but patching *that* into the iommu code would be more annoying
#asahi · 2021-06-07 14:50
svenj_ey: oh, sure.
#asahi · 2021-06-07 14:50
svenj_ey: the point is that reviewing 1k lines of code is already quite a lot. adding the 16k/4k thing on top that makes it even worse
#asahi · 2021-06-07 14:43
svenat least it boots this way. we can always tackle the 16k support later
#asahi · 2021-06-07 14:43
svenit might be possible to make the kernel deal with 16k iommu when built for 4k but the dart driver itself is already >1k loc or so
#asahi · 2021-06-07 14:42
svenand i'm sure there will be third party repos that will ship the distro kernels with 16k support then
#asahi · 2021-06-07 14:41
sveni'd be happy with 4k without thunderbolt as a fallback. that way most people can at least use this
#asahi · 2021-06-07 14:41
svenall we know about the gpu mmu is that it's not a dart
#asahi · 2021-06-07 14:38
svenhow many distro ship 16k pagesize kernels these days?
#asahi · 2021-06-07 14:32
svenbut all others seem to support bypass mode
#asahi · 2021-06-07 14:32
svencan't access the thunderbolt ones but i suspect they won't allow bypass either
#asahi · 2021-06-07 14:31
svenand then i just program a static linear map and tell the iommu api that this iommu really needs a bypass domain
#asahi · 2021-06-07 14:30
svenso for the pcie ones i have a dma-ranges on the pcie bridge that limits DMA to the first 4G
#asahi · 2021-06-07 14:30
sventhe pcie ones don't, the usb ones do
#asahi · 2021-06-07 14:30
svenarnd: i found the bit in the DART mmio space that tells us if they support bypass mode
#asahi · 2021-06-07 13:59
svenand now it should boot just fine with a 4k pagesize kernel as well :)
#asahi · 2021-06-07 13:58
svenok, should be back
#asahi · 2021-06-07 13:45
svenyes, i removed it because i was preparing the upstream submission
#asahi · 2021-06-07 13:45
svenyes, i removed it becau
#asahi · 2021-06-07 13:35
svenyou'll also need https://lore.kernel.org/linux-usb/YL3ve%2FrxTlIzErlX@infradead.org/T/#m23583793ac437503588690662f3daffb0e01f9d2 if you run with a 4k kernel or want the iommu in bypass mode
#asahi · 2021-06-07 13:35
svenbut other than that it should have everything required
#asahi · 2021-06-07 13:34
svennot sure if that contains the dwc3 nodes fwiw
#asahi · 2021-06-06 18:37
svenyup
#asahi · 2021-06-06 18:31
sveni think there's a good chance it's the same on the mini
#asahi · 2021-06-06 18:16
svenhrm, how strange
#asahi · 2021-06-06 18:14
sventhe main irq should just be a MSI in the pcie controller
#asahi · 2021-06-06 18:14
svendoes wifi use gpio?
#asahi · 2021-06-06 13:12
svendarts somtimes have similar -region-base properties
#asahi · 2021-06-06 13:12
sventhat's probably the region it's allowed to allocate from
#asahi · 2021-06-06 12:59
svenlooks like it's a bespoke iommu for the gpu then
#asahi · 2021-06-06 12:55
svenalright.. so we're looking for another hidden iommu for the gpu then
#asahi · 2021-06-06 12:50
svenit mainly talks about sprr/gxf but it also mentions that the gpu may reuse the same pagetables as the cpu
#asahi · 2021-06-06 12:49
svenhttps://patents.google.com/patent/US20210064539A1
#asahi · 2021-06-06 12:45
sventhat's what that gxf/sprr patent sorta hints at
#asahi · 2021-06-06 12:45
svenbloom: would it make sense if the GPU has just the same view of memory as the userspace app?
#asahi · 2021-06-06 10:54
svenoh well.. we first need gpio/pinctrl and then i2c upstreamed anyway

plus ›