Re: [PATCH v3 12/33] iommu/mediatek: Always tlb_flush_all when each PM resume

2021-11-09 Thread Yong Wu
On Wed, 2021-11-10 at 07:29 +0200, Dafna Hirschfeld wrote: > > On 10.11.21 04:20, Yong Wu wrote: > > On Tue, 2021-11-09 at 14:21 +0200, Dafna Hirschfeld wrote: > > > Hi > > > This patch is needed in order to update the tlb when a device is > > > powered on. > > > Could you send this patch alone wi

Re: [PATCH v2] iommu: intel: do deep dma-unmapping, to avoid kernel-flooding.

2021-11-09 Thread Lu Baolu
Hi Alex, On 2021/11/10 7:56, Alex Williamson wrote: Hi Baolu, Have you looked into this? I am looking at this. I'm able to reproduce by starting and destroying an assigned device VM several times. It seems like it came in with Joerg's pull request for the v5.15 merge window. Bisecting la

Re: [PATCH v3 12/33] iommu/mediatek: Always tlb_flush_all when each PM resume

2021-11-09 Thread Dafna Hirschfeld
On 10.11.21 04:20, Yong Wu wrote: On Tue, 2021-11-09 at 14:21 +0200, Dafna Hirschfeld wrote: Hi This patch is needed in order to update the tlb when a device is powered on. Could you send this patch alone without the whole series so it get accepted easier? Which SoC are you testing on? In p

Re: [PATCH v3 12/33] iommu/mediatek: Always tlb_flush_all when each PM resume

2021-11-09 Thread Yong Wu
On Tue, 2021-11-09 at 14:21 +0200, Dafna Hirschfeld wrote: > Hi > This patch is needed in order to update the tlb when a device is > powered on. > Could you send this patch alone without the whole series so it get > accepted easier? Which SoC are you testing on? In previous SoC, the IOMMU HW don't

Re: [PATCH v2] iommu: intel: do deep dma-unmapping, to avoid kernel-flooding.

2021-11-09 Thread Alex Williamson
Hi Baolu, Have you looked into this? I'm able to reproduce by starting and destroying an assigned device VM several times. It seems like it came in with Joerg's pull request for the v5.15 merge window. Bisecting lands me on 3f34f1259776 where intel-iommu added map/unmap_pages support, but I'm

Re: How to reduce PCI initialization from 5 s (1.5 s adding them to IOMMU groups)

2021-11-09 Thread Krzysztof Wilczyński
Hi Paul, > Thank you for your reply. Thank you for getting back to us with a good insight. [...] > > I am curious - why is this a problem? Are you power-cycling your servers > > so often to the point where the cumulative time spent in enumerating PCI > > devices and adding them later to IOMMU g

[PATCH AUTOSEL 5.14 55/75] iommu/vt-d: Do not falsely log intel_iommu is unsupported kernel option

2021-11-09 Thread Sasha Levin
From: Tvrtko Ursulin [ Upstream commit 5240aed2cd2594fb392239f11b9681e5e1591619 ] Handling of intel_iommu kernel command line option should return "true" to indicate option is valid and so avoid logging it as unknown by the core parsing code. Also log unknown sub-options at the notice level to

[PATCH AUTOSEL 5.15 79/82] iommu/dart: Initialize DART_STREAMS_ENABLE

2021-11-09 Thread Sasha Levin
From: Sven Peter [ Upstream commit 5a009fc1364170b240a4d351b345e69bb3728b3e ] DART has an additional global register to control which streams are isolated. This register is a bit redundant since DART_TCR can already be used to control isolation and is usually initialized to DART_STREAM_ALL by th

[PATCH AUTOSEL 5.15 59/82] iommu/vt-d: Do not falsely log intel_iommu is unsupported kernel option

2021-11-09 Thread Sasha Levin
From: Tvrtko Ursulin [ Upstream commit 5240aed2cd2594fb392239f11b9681e5e1591619 ] Handling of intel_iommu kernel command line option should return "true" to indicate option is valid and so avoid logging it as unknown by the core parsing code. Also log unknown sub-options at the notice level to

Re: How to reduce PCI initialization from 5 s (1.5 s adding them to IOMMU groups)

2021-11-09 Thread Paul Menzel
Dear Robin, Thank you for your reply. Am 09.11.21 um 16:31 schrieb Robin Murphy: On 2021-11-06 10:42, Paul Menzel wrote: Am 05.11.21 um 19:53 schrieb Bjorn Helgaas: On Fri, Nov 05, 2021 at 12:56:09PM +0100, Paul Menzel wrote: On a PowerEdge T440/021KCD, BIOS 2.11.2 04/22/2021, Linux 5.1

Re: How to reduce PCI initialization from 5 s (1.5 s adding them to IOMMU groups)

2021-11-09 Thread Paul Menzel
Dear Krzysztof, Thank you for your reply. Am 08.11.21 um 18:18 schrieb Krzysztof Wilczyński: On a PowerEdge T440/021KCD, BIOS 2.11.2 04/22/2021, Linux 5.10.70 takes almost five seconds to initialize PCI. According to the timestamps, 1.5 s are from assigning the PCI devices to the 142 IOMMU g

Re: [GIT PULL] dma-mapping updates for Linux 5.16

2021-11-09 Thread pr-tracker-bot
The pull request you sent on Tue, 9 Nov 2021 14:53:16 +0100: > git://git.infradead.org/users/hch/dma-mapping.git tags/dma-mapping-5.16 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/372594985c786b40108a5201ca3192223d6c0c40 Thank you! -- Deet-doot-dot, I am a bot. ht

Re: How to reduce PCI initialization from 5 s (1.5 s adding them to IOMMU groups)

2021-11-09 Thread Robin Murphy
On 2021-11-06 10:42, Paul Menzel wrote: Dear Bjorn, Thank you for your quick reply. Am 05.11.21 um 19:53 schrieb Bjorn Helgaas: On Fri, Nov 05, 2021 at 12:56:09PM +0100, Paul Menzel wrote: On a PowerEdge T440/021KCD, BIOS 2.11.2 04/22/2021, Linux 5.10.70 takes almost five seconds to initi

Re: [PATCH 05/10] dma-direct: factor out a helper for DMA_ATTR_NO_KERNEL_MAPPING allocations

2021-11-09 Thread Robin Murphy
On 2021-11-09 14:25, Christoph Hellwig wrote: On Thu, Nov 04, 2021 at 12:36:16PM +, Robin Murphy wrote: - *dma_handle = phys_to_dma_direct(dev, page_to_phys(page)); - /* return the page pointer as the opaque cookie */ - return page; - } +

Re: [PATCH 02/10] dma-direct: unmapped remapped pages when dma_set_decrypted

2021-11-09 Thread Robin Murphy
On 2021-11-09 14:10, Christoph Hellwig wrote: On Thu, Nov 04, 2021 at 12:35:41PM +, Robin Murphy wrote: On 2021-10-21 10:06, Christoph Hellwig wrote: When dma_set_decrypted fails for the remapping case in dma_direct_alloc we also need to unmap the pages before freeing them. Signed-off-by:

Re: [PATCH 06/10] dma-direct: refactor the !coherent checks in dma_direct_alloc

2021-11-09 Thread Christoph Hellwig
On Thu, Nov 04, 2021 at 12:36:08PM +, Robin Murphy wrote: > How about: > remap = IS_ENABLED(CONFIG_DMA_DIRECT_REMAP); > > if (remap && ...) > > for a bit less indentation? FWIW I reckon it's slightly more obvious that > way round. Done.

Re: [PATCH 05/10] dma-direct: factor out a helper for DMA_ATTR_NO_KERNEL_MAPPING allocations

2021-11-09 Thread Christoph Hellwig
On Thu, Nov 04, 2021 at 12:36:16PM +, Robin Murphy wrote: >> -*dma_handle = phys_to_dma_direct(dev, page_to_phys(page)); >> -/* return the page pointer as the opaque cookie */ >> -return page; >> -} >> +!force_dma_unencrypted(dev) && !is_swiotlb_f

Re: [PATCH 04/10] dma-direct: clean up the remapping checks in dma_direct_alloc

2021-11-09 Thread Christoph Hellwig
On Thu, Nov 04, 2021 at 12:35:59PM +, Robin Murphy wrote: >> @@ -166,6 +166,7 @@ static void *dma_direct_alloc_from_pool(struct device >> *dev, size_t size, >> void *dma_direct_alloc(struct device *dev, size_t size, >> dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs) >>

Re: [PATCH 03/10] dma-direct: leak memory that can't be re-encrypted

2021-11-09 Thread Christoph Hellwig
On Thu, Nov 04, 2021 at 12:35:49PM +, Robin Murphy wrote: > Given that this is consistent for all uses of dma_set_encrypted(), seems > like it should be factored into the helper itself. Done. ___ iommu mailing list iommu@lists.linux-foundation.org h

Re: [PATCH 02/10] dma-direct: unmapped remapped pages when dma_set_decrypted

2021-11-09 Thread Christoph Hellwig
On Thu, Nov 04, 2021 at 12:35:41PM +, Robin Murphy wrote: > On 2021-10-21 10:06, Christoph Hellwig wrote: >> When dma_set_decrypted fails for the remapping case in dma_direct_alloc >> we also need to unmap the pages before freeing them. >> >> Signed-off-by: Christoph Hellwig >> --- >> kernel

[GIT PULL] dma-mapping updates for Linux 5.16

2021-11-09 Thread Christoph Hellwig
Just a small set of changes this time. The request dma_direct_alloc cleanups are still under review and haven't made the cut. The following changes since commit 519d81956ee277b4419c723adfb154603c2565ba: Linux 5.15-rc6 (2021-10-17 20:00:13 -1000) are available in the Git repository at: git:

Re: [PATCH v3 12/33] iommu/mediatek: Always tlb_flush_all when each PM resume

2021-11-09 Thread Dafna Hirschfeld
Hi This patch is needed in order to update the tlb when a device is powered on. Could you send this patch alone without the whole series so it get accepted easier? I can resend the patch on your behalf if you want. Thanks, Dafna On 23.09.21 14:58, Yong Wu wrote: Prepare for 2 HWs that sharing p