Re: [PATCH 05/18] iommu/fsl_pamu: remove support for multiple windows
From: Will Deacon <will@kernel.org>
Date: 2021-03-30 12:23:35
Also in:
dri-devel, kvm, linux-arm-kernel, linux-arm-msm, linux-iommu, linuxppc-dev, virtualization
On Tue, Mar 16, 2021 at 04:38:11PM +0100, Christoph Hellwig wrote:
The only domains allocated forces use of a single window. Remove all the code related to multiple window support, as well as the need for qman_portal to force a single window. Remove the now unused DOMAIN_ATTR_WINDOWS iommu_attr. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Li Yang <redacted> --- drivers/iommu/fsl_pamu.c | 264 +------------------------- drivers/iommu/fsl_pamu.h | 10 +- drivers/iommu/fsl_pamu_domain.c | 275 +++++----------------------- drivers/iommu/fsl_pamu_domain.h | 12 +- drivers/soc/fsl/qbman/qman_portal.c | 7 - include/linux/iommu.h | 1 - 6 files changed, 59 insertions(+), 510 deletions(-)
[...]
+ set_bf(ppaace->impl_attr, PAACE_IA_ATM, PAACE_ATM_WINDOW_XLATE); + ppaace->twbah = rpn >> 20; + set_bf(ppaace->win_bitfields, PAACE_WIN_TWBAL, rpn); + set_bf(ppaace->addr_bitfields, PAACE_AF_AP, prot); + set_bf(ppaace->impl_attr, PAACE_IA_WCE, 0); + set_bf(ppaace->addr_bitfields, PPAACE_AF_MW, 0); mb();
(I wonder what on Earth that mb() is doing...)
quoted hunk ↗ jump to hunk
diff --git a/drivers/iommu/fsl_pamu_domain.h b/drivers/iommu/fsl_pamu_domain.h index 53d359d66fe577..b9236fb5a8f82e 100644 --- a/drivers/iommu/fsl_pamu_domain.h +++ b/drivers/iommu/fsl_pamu_domain.h@@ -17,23 +17,13 @@ struct dma_window { }; struct fsl_dma_domain { - /* - * Number of windows assocaited with this domain. - * During domain initialization, it is set to the - * the maximum number of subwindows allowed for a LIODN. - * Minimum value for this is 1 indicating a single PAMU - * window, without any sub windows. Value can be set/ - * queried by set_attr/get_attr API for DOMAIN_ATTR_WINDOWS. - * Value can only be set once the geometry has been configured. - */ - u32 win_cnt; /* * win_arr contains information of the configured * windows for a domain. This is allocated only * when the number of windows for the domain are * set. */
The last part of this comment is now stale ^^
- struct dma_window *win_arr; + struct dma_window win_arr[1]; /* list of devices associated with the domain */ struct list_head devices; /* dma_domain states:
Acked-by: Will Deacon <will@kernel.org> Will