Some improvements for iommu
Subsystems (9)
cover Some improvements for iommu
Hi,
The first patch masks some functions as static, and the second patch changes to use the gfp parameter from iommu_ops->map() to allocate ARM page pages. Any comments are welcome. Thanks.
Baolin Wang (2):
iommu: Mark __iommu_map/__iommu_map_sg as static
iommu: Add gfp parameter to io_pgtable_ops->map()
drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- drivers/iommu/arm-smmu-v3.c | 2 +- drivers/iommu/arm-smmu.c | 2 +- drivers/iommu/io-pgtable-arm-v7s.c | 10 +++++----- drivers/iommu/io-pgtable-arm.c | 10 +++++----- drivers/iommu/iommu.c | 10 +++++----- drivers/iommu/ipmmu-vmsa.c | 2 +- drivers/iommu/msm_iommu.c | 2 +- drivers/iommu/mtk_iommu.c | 2 +- drivers/iommu/qcom_iommu.c | 2 +- include/linux/io-pgtable.h | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/2 iommu: Mark __iommu_map/__iommu_map_sg as static
Now the __iommu_map() and __iommu_map_sg() are used only in iommu.c file, so mark them as static.
--- drivers/iommu/iommu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/iommu/iommu.c +5 -5
@@ -1924,8 +1924,8 @@ static size_t iommu_pgsize(struct iommu_domain *domain,return pgsize; } -int __iommu_map (struct iommu_domain *domain,unsigned long iova, -phys_addr_t paddr,size_t size,int prot,gfp_t gfp) +static int __iommu_map (struct iommu_domain *domain,unsigned long iova, +phys_addr_t paddr,size_t size,int prot,gfp_t gfp) {const struct iommu_ops *ops = domain->ops;unsigned long orig_iova = iova;
@@ -2075,9 +2075,9 @@ size_t iommu_unmap_fast(struct iommu_domain *domain, }EXPORT_SYMBOL_GPL (iommu_unmap_fast); -size_t __iommu_map_sg (struct iommu_domain *domain,unsigned long iova, -struct scatterlist *sg,unsigned int nents,int prot, -gfp_t gfp) +static size_t __iommu_map_sg (struct iommu_domain *domain,unsigned long iova, +struct scatterlist *sg,unsigned int nents,int prot, +gfp_t gfp) {size_t len =0 , mapped =0 ;phys_addr_t start;
Signature · 1 line
1.8.3.1
PATCH 2/2 iommu: Add gfp parameter to io_pgtable_ops->map()
In reply to Baolin WangNow the ARM page tables are always allocated by GFP_ATOMIC parameter, but the iommu_ops->map() function has been added a gfp_t parameter by commit 781ca2de89ba ("iommu: Add gfp parameter to iommu_ops::map"), thus io_pgtable_ops->map() should use the gfp parameter passed from iommu_ops->map() to allocate page pages, which can avoid wasting the memory allocators atomic pools for some non-atomic contexts.
--- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- drivers/iommu/arm-smmu-v3.c | 2 +- drivers/iommu/arm-smmu.c | 2 +- drivers/iommu/io-pgtable-arm-v7s.c | 10 +++++----- drivers/iommu/io-pgtable-arm.c | 10 +++++----- drivers/iommu/ipmmu-vmsa.c | 2 +- drivers/iommu/msm_iommu.c | 2 +- drivers/iommu/mtk_iommu.c | 2 +- drivers/iommu/qcom_iommu.c | 2 +- include/linux/io-pgtable.h | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-)
drivers/gpu/drm/panfrost/panfrost_mmu.c +1 -1
@@ -262,7 +262,7 @@ static int mmu_map_sg(struct panfrost_device *pfdev, struct panfrost_mmu *mmu,while (len) {size_t pgsize =get_pgsize (iova | paddr, len); - ops->map (ops, iova, paddr, pgsize, prot); + ops->map (ops, iova, paddr, pgsize, prot,GFP_KERNEL ); iova += pgsize; paddr += pgsize; len -= pgsize;
drivers/iommu/arm-smmu-v3.c +1 -1
@@ -2845,7 +2845,7 @@ static int arm_smmu_map(struct iommu_domain *domain, unsigned long iova,if (!ops)return -ENODEV ; -return ops->map (ops, iova, paddr, size, prot); +return ops->map (ops, iova, paddr, size, prot, gfp); } static size_t arm_smmu_unmap(struct iommu_domain *domain, unsigned long iova,
drivers/iommu/arm-smmu.c +1 -1
@@ -1237,7 +1237,7 @@ static int arm_smmu_map(struct iommu_domain *domain, unsigned long iova,return -ENODEV ;arm_smmu_rpm_get (smmu); - ret = ops->map (ops, iova, paddr, size, prot); + ret = ops->map (ops, iova, paddr, size, prot, gfp);arm_smmu_rpm_put (smmu);return ret;
drivers/iommu/io-pgtable-arm-v7s.c +5 -5
@@ -470,7 +470,7 @@ static arm_v7s_iopte arm_v7s_install_table(arm_v7s_iopte *table,static int __arm_v7s_map (struct arm_v7s_io_pgtable *data,unsigned long iova,phys_addr_t paddr,size_t size,int prot, -int lvl,arm_v7s_iopte *ptep) +int lvl,arm_v7s_iopte *ptep,gfp_t gfp) {struct io_pgtable_cfg *cfg = &data->iop.cfg;arm_v7s_iopte pte, *cptep;
@@ -491,7 +491,7 @@ static int __arm_v7s_map(struct arm_v7s_io_pgtable *data, unsigned long iova,/* Grab a pointer to the next level */ pte =READ_ONCE (*ptep);if (!pte) { - cptep =__arm_v7s_alloc_table (lvl +1 ,GFP_ATOMIC , data); + cptep =__arm_v7s_alloc_table (lvl +1 , gfp, data);if (!cptep)return -ENOMEM ;
@@ -512,11 +512,11 @@ static int __arm_v7s_map(struct arm_v7s_io_pgtable *data, unsigned long iova, }/* Rinse, repeat */ -return __arm_v7s_map (data, iova, paddr, size, prot, lvl +1 , cptep); +return __arm_v7s_map (data, iova, paddr, size, prot, lvl +1 , cptep, gfp); }static int arm_v7s_map (struct io_pgtable_ops *ops,unsigned long iova, -phys_addr_t paddr,size_t size,int prot) +phys_addr_t paddr,size_t size,int prot,gfp_t gfp) {struct arm_v7s_io_pgtable *data =io_pgtable_ops_to_data (ops);struct io_pgtable *iop = &data->iop;
@@ -530,7 +530,7 @@ static int arm_v7s_map(struct io_pgtable_ops *ops, unsigned long iova, paddr >= (1ULL << data->iop.cfg.oas)))return -ERANGE ; - ret =__arm_v7s_map (data, iova, paddr, size, prot,1 , data->pgd); + ret =__arm_v7s_map (data, iova, paddr, size, prot,1 , data->pgd, gfp);/* * Synchronise all PTE updates for the new mapping before there's * a chance for anything to kick off a table walk for the new iova.
drivers/iommu/io-pgtable-arm.c +5 -5
@@ -355,7 +355,7 @@ static arm_lpae_iopte arm_lpae_install_table(arm_lpae_iopte *table,static int __arm_lpae_map (struct arm_lpae_io_pgtable *data,unsigned long iova,phys_addr_t paddr,size_t size,arm_lpae_iopte prot, -int lvl,arm_lpae_iopte *ptep) +int lvl,arm_lpae_iopte *ptep,gfp_t gfp) {arm_lpae_iopte *cptep, pte;size_t block_size =ARM_LPAE_BLOCK_SIZE (lvl, data);
@@ -376,7 +376,7 @@ static int __arm_lpae_map(struct arm_lpae_io_pgtable *data, unsigned long iova,/* Grab a pointer to the next level */ pte =READ_ONCE (*ptep);if (!pte) { - cptep =__arm_lpae_alloc_pages (tblsz,GFP_ATOMIC , cfg); + cptep =__arm_lpae_alloc_pages (tblsz, gfp, cfg);if (!cptep)return -ENOMEM ;
@@ -396,7 +396,7 @@ static int __arm_lpae_map(struct arm_lpae_io_pgtable *data, unsigned long iova, }/* Rinse, repeat */ -return __arm_lpae_map (data, iova, paddr, size, prot, lvl +1 , cptep); +return __arm_lpae_map (data, iova, paddr, size, prot, lvl +1 , cptep, gfp); } static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
@@ -461,7 +461,7 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data, }static int arm_lpae_map (struct io_pgtable_ops *ops,unsigned long iova, -phys_addr_t paddr,size_t size,int iommu_prot) +phys_addr_t paddr,size_t size,int iommu_prot,gfp_t gfp) {struct arm_lpae_io_pgtable *data =io_pgtable_ops_to_data (ops);struct io_pgtable_cfg *cfg = &data->iop.cfg;
@@ -483,7 +483,7 @@ static int arm_lpae_map(struct io_pgtable_ops *ops, unsigned long iova,return -ERANGE ; prot =arm_lpae_prot_to_pte (data, iommu_prot); - ret =__arm_lpae_map (data, iova, paddr, size, prot, lvl, ptep); + ret =__arm_lpae_map (data, iova, paddr, size, prot, lvl, ptep, gfp);/* * Synchronise all PTE updates for the new mapping before there's * a chance for anything to kick off a table walk for the new iova.
drivers/iommu/ipmmu-vmsa.c +1 -1
@@ -687,7 +687,7 @@ static int ipmmu_map(struct iommu_domain *io_domain, unsigned long iova,if (!domain)return -ENODEV ; -return domain->iop->map (domain->iop, iova, paddr, size, prot); +return domain->iop->map (domain->iop, iova, paddr, size, prot, gfp); } static size_t ipmmu_unmap(struct iommu_domain *io_domain, unsigned long iova,
drivers/iommu/msm_iommu.c +1 -1
@@ -511,7 +511,7 @@ static int msm_iommu_map(struct iommu_domain *domain, unsigned long iova,int ret;spin_lock_irqsave (&priv->pgtlock, flags); - ret = priv->iop->map (priv->iop, iova, pa, len, prot); + ret = priv->iop->map (priv->iop, iova, pa, len, prot,GFP_ATOMIC );spin_unlock_irqrestore (&priv->pgtlock, flags);return ret;
drivers/iommu/mtk_iommu.c +1 -1
@@ -397,7 +397,7 @@ static int mtk_iommu_map(struct iommu_domain *domain, unsigned long iova, paddr |=BIT_ULL (32 );/* Synchronize with the tlb_lock */ -return dom->iop->map (dom->iop, iova, paddr, size, prot); +return dom->iop->map (dom->iop, iova, paddr, size, prot, gfp); } static size_t mtk_iommu_unmap(struct iommu_domain *domain,
drivers/iommu/qcom_iommu.c +1 -1
@@ -441,7 +441,7 @@ static int qcom_iommu_map(struct iommu_domain *domain, unsigned long iova,return -ENODEV ;spin_lock_irqsave (&qcom_domain->pgtbl_lock, flags); - ret = ops->map (ops, iova, paddr, size, prot); + ret = ops->map (ops, iova, paddr, size, prot,GFP_ATOMIC );spin_unlock_irqrestore (&qcom_domain->pgtbl_lock, flags);return ret; }
include/linux/io-pgtable.h +1 -1
@@ -155,7 +155,7 @@ struct io_pgtable_cfg {*/ struct io_pgtable_ops {int (*map)(struct io_pgtable_ops *ops,unsigned long iova, -phys_addr_t paddr,size_t size,int prot); +phys_addr_t paddr,size_t size,int prot,gfp_t gfp);size_t (*unmap)(struct io_pgtable_ops *ops,unsigned long iova,size_t size,struct iommu_iotlb_gather *gather); phys_addr_t (*iova_to_phys)(struct io_pgtable_ops *ops,
Signature · 6 lines
1.8.3.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
kernel test robot
build botRe: [PATCH 2/2] iommu: Add gfp parameter to io_pgtable_ops->map()
I love your patch! Perhaps something to improve:
Hi Baolin,
I love your patch! Perhaps something to improve:
[auto build test WARNING on iommu/next]
[also build test WARNING on soc/for-next linus/master v5.7 next-20200605] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Baolin-Wang/Some-improvements-for-iommu/20200608-114141 base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago
config: x86_64-randconfig-s021-20200607 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-247-gcadbd124-dirty
# save the attached .config to linux build tree
make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'If you fix the issue, kindly add following tag as appropriate
sparse warnings: (new ones prefixed by >>)
>> drivers/iommu/io-pgtable-arm.c:1178:37: sparse: sparse: not enough arguments for function map
drivers/iommu/io-pgtable-arm.c:1185:38: sparse: sparse: not enough arguments for function map drivers/iommu/io-pgtable-arm.c:1201:29: sparse: sparse: not enough arguments for function map drivers/iommu/io-pgtable-arm.c:1219:37: sparse: sparse: not enough arguments for function map
# https://github.com/0day-ci/linux/commit/6047fa5558b1fdb8d2d52c9807fd960220478d3d
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 6047fa5558b1fdb8d2d52c9807fd960220478d3d
vim +1178 drivers/iommu/io-pgtable-arm.c
fe4b991dcd84e0 Will Deacon 2014-11-17 1135
fe4b991dcd84e0 Will Deacon 2014-11-17 1136 static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
fe4b991dcd84e0 Will Deacon 2014-11-17 1137 {
9062c1d0bedacf Christophe JAILLET 2019-09-09 1138 static const enum io_pgtable_fmt fmts[] __initconst = {
fe4b991dcd84e0 Will Deacon 2014-11-17 1139 ARM_64_LPAE_S1,
fe4b991dcd84e0 Will Deacon 2014-11-17 1140 ARM_64_LPAE_S2,
fe4b991dcd84e0 Will Deacon 2014-11-17 1141 };
fe4b991dcd84e0 Will Deacon 2014-11-17 1142
fe4b991dcd84e0 Will Deacon 2014-11-17 1143 int i, j;
fe4b991dcd84e0 Will Deacon 2014-11-17 1144 unsigned long iova;
fe4b991dcd84e0 Will Deacon 2014-11-17 1145 size_t size;
fe4b991dcd84e0 Will Deacon 2014-11-17 1146 struct io_pgtable_ops *ops;
fe4b991dcd84e0 Will Deacon 2014-11-17 1147
fe4b991dcd84e0 Will Deacon 2014-11-17 1148 selftest_running = true;
fe4b991dcd84e0 Will Deacon 2014-11-17 1149
fe4b991dcd84e0 Will Deacon 2014-11-17 1150 for (i = 0; i < ARRAY_SIZE(fmts); ++i) {
fe4b991dcd84e0 Will Deacon 2014-11-17 1151 cfg_cookie = cfg;
fe4b991dcd84e0 Will Deacon 2014-11-17 1152 ops = alloc_io_pgtable_ops(fmts[i], cfg, cfg);
fe4b991dcd84e0 Will Deacon 2014-11-17 1153 if (!ops) {
fe4b991dcd84e0 Will Deacon 2014-11-17 1154 pr_err("selftest: failed to allocate io pgtable ops\n");
fe4b991dcd84e0 Will Deacon 2014-11-17 1155 return -ENOMEM;
fe4b991dcd84e0 Will Deacon 2014-11-17 1156 }
fe4b991dcd84e0 Will Deacon 2014-11-17 1157
fe4b991dcd84e0 Will Deacon 2014-11-17 1158 /*
fe4b991dcd84e0 Will Deacon 2014-11-17 1159 * Initial sanity checks.
fe4b991dcd84e0 Will Deacon 2014-11-17 1160 * Empty page tables shouldn't provide any translations.
fe4b991dcd84e0 Will Deacon 2014-11-17 1161 */
fe4b991dcd84e0 Will Deacon 2014-11-17 1162 if (ops->iova_to_phys(ops, 42))
fe4b991dcd84e0 Will Deacon 2014-11-17 1163 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1164
fe4b991dcd84e0 Will Deacon 2014-11-17 1165 if (ops->iova_to_phys(ops, SZ_1G + 42))
fe4b991dcd84e0 Will Deacon 2014-11-17 1166 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1167
fe4b991dcd84e0 Will Deacon 2014-11-17 1168 if (ops->iova_to_phys(ops, SZ_2G + 42))
fe4b991dcd84e0 Will Deacon 2014-11-17 1169 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1170
fe4b991dcd84e0 Will Deacon 2014-11-17 1171 /*
fe4b991dcd84e0 Will Deacon 2014-11-17 1172 * Distinct mappings of different granule sizes.
fe4b991dcd84e0 Will Deacon 2014-11-17 1173 */
fe4b991dcd84e0 Will Deacon 2014-11-17 1174 iova = 0;
4ae8a5c528c0b1 Kefeng Wang 2016-09-21 1175 for_each_set_bit(j, &cfg->pgsize_bitmap, BITS_PER_LONG) {
fe4b991dcd84e0 Will Deacon 2014-11-17 1176 size = 1UL << j;
fe4b991dcd84e0 Will Deacon 2014-11-17 1177
fe4b991dcd84e0 Will Deacon 2014-11-17 @1178 if (ops->map(ops, iova, iova, size, IOMMU_READ |
fe4b991dcd84e0 Will Deacon 2014-11-17 1179 IOMMU_WRITE |
fe4b991dcd84e0 Will Deacon 2014-11-17 1180 IOMMU_NOEXEC |
fe4b991dcd84e0 Will Deacon 2014-11-17 1181 IOMMU_CACHE))
fe4b991dcd84e0 Will Deacon 2014-11-17 1182 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1183
fe4b991dcd84e0 Will Deacon 2014-11-17 1184 /* Overlapping mappings */
fe4b991dcd84e0 Will Deacon 2014-11-17 1185 if (!ops->map(ops, iova, iova + size, size,
fe4b991dcd84e0 Will Deacon 2014-11-17 1186 IOMMU_READ | IOMMU_NOEXEC))
fe4b991dcd84e0 Will Deacon 2014-11-17 1187 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1188
fe4b991dcd84e0 Will Deacon 2014-11-17 1189 if (ops->iova_to_phys(ops, iova + 42) != (iova + 42))
fe4b991dcd84e0 Will Deacon 2014-11-17 1190 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1191
fe4b991dcd84e0 Will Deacon 2014-11-17 1192 iova += SZ_1G;
fe4b991dcd84e0 Will Deacon 2014-11-17 1193 }
fe4b991dcd84e0 Will Deacon 2014-11-17 1194
fe4b991dcd84e0 Will Deacon 2014-11-17 1195 /* Partial unmap */
fe4b991dcd84e0 Will Deacon 2014-11-17 1196 size = 1UL << __ffs(cfg->pgsize_bitmap);
a2d3a382d6c682 Will Deacon 2019-07-02 1197 if (ops->unmap(ops, SZ_1G + size, size, NULL) != size)
fe4b991dcd84e0 Will Deacon 2014-11-17 1198 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1199
fe4b991dcd84e0 Will Deacon 2014-11-17 1200 /* Remap of partial unmap */
fe4b991dcd84e0 Will Deacon 2014-11-17 1201 if (ops->map(ops, SZ_1G + size, size, size, IOMMU_READ))
fe4b991dcd84e0 Will Deacon 2014-11-17 1202 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1203
fe4b991dcd84e0 Will Deacon 2014-11-17 1204 if (ops->iova_to_phys(ops, SZ_1G + size + 42) != (size + 42))
fe4b991dcd84e0 Will Deacon 2014-11-17 1205 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1206
fe4b991dcd84e0 Will Deacon 2014-11-17 1207 /* Full unmap */
fe4b991dcd84e0 Will Deacon 2014-11-17 1208 iova = 0;
f793b13ef0c9c1 YueHaibing 2018-04-26 1209 for_each_set_bit(j, &cfg->pgsize_bitmap, BITS_PER_LONG) {
fe4b991dcd84e0 Will Deacon 2014-11-17 1210 size = 1UL << j;
fe4b991dcd84e0 Will Deacon 2014-11-17 1211
a2d3a382d6c682 Will Deacon 2019-07-02 1212 if (ops->unmap(ops, iova, size, NULL) != size)
fe4b991dcd84e0 Will Deacon 2014-11-17 1213 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1214
fe4b991dcd84e0 Will Deacon 2014-11-17 1215 if (ops->iova_to_phys(ops, iova + 42))
fe4b991dcd84e0 Will Deacon 2014-11-17 1216 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1217
fe4b991dcd84e0 Will Deacon 2014-11-17 1218 /* Remap full block */
fe4b991dcd84e0 Will Deacon 2014-11-17 1219 if (ops->map(ops, iova, iova, size, IOMMU_WRITE))
fe4b991dcd84e0 Will Deacon 2014-11-17 1220 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1221
fe4b991dcd84e0 Will Deacon 2014-11-17 1222 if (ops->iova_to_phys(ops, iova + 42) != (iova + 42))
fe4b991dcd84e0 Will Deacon 2014-11-17 1223 return __FAIL(ops, i);
fe4b991dcd84e0 Will Deacon 2014-11-17 1224
fe4b991dcd84e0 Will Deacon 2014-11-17 1225 iova += SZ_1G;
fe4b991dcd84e0 Will Deacon 2014-11-17 1226 }
fe4b991dcd84e0 Will Deacon 2014-11-17 1227
fe4b991dcd84e0 Will Deacon 2014-11-17 1228 free_io_pgtable_ops(ops);
fe4b991dcd84e0 Will Deacon 2014-11-17 1229 }
fe4b991dcd84e0 Will Deacon 2014-11-17 1230
fe4b991dcd84e0 Will Deacon 2014-11-17 1231 selftest_running = false;
fe4b991dcd84e0 Will Deacon 2014-11-17 1232 return 0;
fe4b991dcd84e0 Will Deacon 2014-11-17 1233 }
fe4b991dcd84e0 Will Deacon 2014-11-17 1234 :::::: The code at line 1178 was first introduced by commit
:::::: fe4b991dcd84e0104cf2e29223a819335ed048a7 iommu: add self-consistency tests to ARM LPAE IO page table allocator
:::::: TO: Will Deacon <[email protected]>
:::::: CC: Will Deacon <[email protected]>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [PATCH 2/2] iommu: Add gfp parameter to io_pgtable_ops->map()
In reply to Baolin WangI love your patch! Perhaps something to improve:
Hi Baolin,
I love your patch! Perhaps something to improve:
[auto build test WARNING on iommu/next]
[also build test WARNING on soc/for-next linus/master v5.7 next-20200605] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Baolin-Wang/Some-improvements-for-iommu/20200608-114141 base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago
config: i386-randconfig-s001-20200608 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-247-gcadbd124-dirty
# save the attached .config to linux build tree
make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'If you fix the issue, kindly add following tag as appropriate
sparse warnings: (new ones prefixed by >>)
>> drivers/iommu/io-pgtable-arm-v7s.c:922:29: sparse: sparse: not enough arguments for function map
drivers/iommu/io-pgtable-arm-v7s.c:929:30: sparse: sparse: not enough arguments for function map drivers/iommu/io-pgtable-arm-v7s.c:949:29: sparse: sparse: not enough arguments for function map drivers/iommu/io-pgtable-arm-v7s.c:970:29: sparse: sparse: not enough arguments for function map
# https://github.com/0day-ci/linux/commit/6047fa5558b1fdb8d2d52c9807fd960220478d3d
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 6047fa5558b1fdb8d2d52c9807fd960220478d3d
vim +922 drivers/iommu/io-pgtable-arm-v7s.c
e5fc9753b1a831 Robin Murphy 2016-01-26 878
e5fc9753b1a831 Robin Murphy 2016-01-26 879 static int __init arm_v7s_do_selftests(void)
e5fc9753b1a831 Robin Murphy 2016-01-26 880 {
e5fc9753b1a831 Robin Murphy 2016-01-26 881 struct io_pgtable_ops *ops;
e5fc9753b1a831 Robin Murphy 2016-01-26 882 struct io_pgtable_cfg cfg = {
e5fc9753b1a831 Robin Murphy 2016-01-26 883 .tlb = &dummy_tlb_ops,
e5fc9753b1a831 Robin Murphy 2016-01-26 884 .oas = 32,
e5fc9753b1a831 Robin Murphy 2016-01-26 885 .ias = 32,
4f41845b340783 Will Deacon 2019-06-25 886 .coherent_walk = true,
4f41845b340783 Will Deacon 2019-06-25 887 .quirks = IO_PGTABLE_QUIRK_ARM_NS,
e5fc9753b1a831 Robin Murphy 2016-01-26 888 .pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M,
e5fc9753b1a831 Robin Murphy 2016-01-26 889 };
e5fc9753b1a831 Robin Murphy 2016-01-26 890 unsigned int iova, size, iova_start;
e5fc9753b1a831 Robin Murphy 2016-01-26 891 unsigned int i, loopnr = 0;
e5fc9753b1a831 Robin Murphy 2016-01-26 892
e5fc9753b1a831 Robin Murphy 2016-01-26 893 selftest_running = true;
e5fc9753b1a831 Robin Murphy 2016-01-26 894
e5fc9753b1a831 Robin Murphy 2016-01-26 895 cfg_cookie = &cfg;
e5fc9753b1a831 Robin Murphy 2016-01-26 896
e5fc9753b1a831 Robin Murphy 2016-01-26 897 ops = alloc_io_pgtable_ops(ARM_V7S, &cfg, &cfg);
e5fc9753b1a831 Robin Murphy 2016-01-26 898 if (!ops) {
e5fc9753b1a831 Robin Murphy 2016-01-26 899 pr_err("selftest: failed to allocate io pgtable ops\n");
e5fc9753b1a831 Robin Murphy 2016-01-26 900 return -EINVAL;
e5fc9753b1a831 Robin Murphy 2016-01-26 901 }
e5fc9753b1a831 Robin Murphy 2016-01-26 902
e5fc9753b1a831 Robin Murphy 2016-01-26 903 /*
e5fc9753b1a831 Robin Murphy 2016-01-26 904 * Initial sanity checks.
e5fc9753b1a831 Robin Murphy 2016-01-26 905 * Empty page tables shouldn't provide any translations.
e5fc9753b1a831 Robin Murphy 2016-01-26 906 */
e5fc9753b1a831 Robin Murphy 2016-01-26 907 if (ops->iova_to_phys(ops, 42))
e5fc9753b1a831 Robin Murphy 2016-01-26 908 return __FAIL(ops);
e5fc9753b1a831 Robin Murphy 2016-01-26 909
e5fc9753b1a831 Robin Murphy 2016-01-26 910 if (ops->iova_to_phys(ops, SZ_1G + 42))
e5fc9753b1a831 Robin Murphy 2016-01-26 911 return __FAIL(ops);
e5fc9753b1a831 Robin Murphy 2016-01-26 912
e5fc9753b1a831 Robin Murphy 2016-01-26 913 if (ops->iova_to_phys(ops, SZ_2G + 42))
e5fc9753b1a831 Robin Murphy 2016-01-26 914 return __FAIL(ops);
e5fc9753b1a831 Robin Murphy 2016-01-26 915
e5fc9753b1a831 Robin Murphy 2016-01-26 916 /*
e5fc9753b1a831 Robin Murphy 2016-01-26 917 * Distinct mappings of different granule sizes.
e5fc9753b1a831 Robin Murphy 2016-01-26 918 */
e5fc9753b1a831 Robin Murphy 2016-01-26 919 iova = 0;
4ae8a5c528c0b1 Kefeng Wang 2016-09-21 920 for_each_set_bit(i, &cfg.pgsize_bitmap, BITS_PER_LONG) {
e5fc9753b1a831 Robin Murphy 2016-01-26 921 size = 1UL << i;e5fc9753b1a831 Robin Murphy 2016-01-26 @922 if (ops->map(ops, iova, iova, size, IOMMU_READ |
:::::: The code at line 922 was first introduced by commit
:::::: e5fc9753b1a831466be9b45d0bf926eeaa8b84a0 iommu/io-pgtable: Add ARMv7 short descriptor support
:::::: TO: Robin Murphy <[email protected]>
:::::: CC: Will Deacon <[email protected]>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [PATCH 2/2] iommu: Add gfp parameter to io_pgtable_ops->map()
In reply to Baolin WangI love your patch! Yet something to improve:
Hi Baolin,
I love your patch! Yet something to improve:
[auto build test ERROR on iommu/next]
[also build test ERROR on soc/for-next linus/master v5.7 next-20200605] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Baolin-Wang/Some-improvements-for-iommu/20200608-114141 base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next config: x86_64-allyesconfig (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project e429cffd4f228f70c1d9df0e5d77c08590dd9766)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/iommu/io-pgtable-arm-v7s.c:925:22: error: too few arguments to function call, expected 6, have 5
IOMMU_CACHE))
^drivers/iommu/io-pgtable-arm-v7s.c:930:35: error: too few arguments to function call, expected 6, have 5 IOMMU_READ | IOMMU_NOEXEC))
^drivers/iommu/io-pgtable-arm-v7s.c:949:62: error: too few arguments to function call, expected 6, have 5 if (ops->map(ops, iova_start + size, size, size, IOMMU_READ))
~~~~~~~~ ^drivers/iommu/io-pgtable-arm-v7s.c:970:50: error: too few arguments to function call, expected 6, have 5 if (ops->map(ops, iova, iova, size, IOMMU_WRITE))
~~~~~~~~ ^
4 errors generated.
--
>> drivers/iommu/io-pgtable-arm.c:1181:23: error: too few arguments to function call, expected 6, have 5
IOMMU_CACHE))
^drivers/iommu/io-pgtable-arm.c:1186:36: error: too few arguments to function call, expected 6, have 5 IOMMU_READ | IOMMU_NOEXEC))
^drivers/iommu/io-pgtable-arm.c:1201:57: error: too few arguments to function call, expected 6, have 5 if (ops->map(ops, SZ_1G + size, size, size, IOMMU_READ))
~~~~~~~~ ^drivers/iommu/io-pgtable-arm.c:1219:51: error: too few arguments to function call, expected 6, have 5 if (ops->map(ops, iova, iova, size, IOMMU_WRITE))
~~~~~~~~ ^
4 errors generated.
vim +925 drivers/iommu/io-pgtable-arm-v7s.c
e5fc9753b1a831 Robin Murphy 2016-01-26 878
e5fc9753b1a831 Robin Murphy 2016-01-26 879 static int __init arm_v7s_do_selftests(void)
e5fc9753b1a831 Robin Murphy 2016-01-26 880 {
e5fc9753b1a831 Robin Murphy 2016-01-26 881 struct io_pgtable_ops *ops;
e5fc9753b1a831 Robin Murphy 2016-01-26 882 struct io_pgtable_cfg cfg = {
e5fc9753b1a831 Robin Murphy 2016-01-26 883 .tlb = &dummy_tlb_ops,
e5fc9753b1a831 Robin Murphy 2016-01-26 884 .oas = 32,
e5fc9753b1a831 Robin Murphy 2016-01-26 885 .ias = 32,
4f41845b340783 Will Deacon 2019-06-25 886 .coherent_walk = true,
4f41845b340783 Will Deacon 2019-06-25 887 .quirks = IO_PGTABLE_QUIRK_ARM_NS,
e5fc9753b1a831 Robin Murphy 2016-01-26 888 .pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M,
e5fc9753b1a831 Robin Murphy 2016-01-26 889 };
e5fc9753b1a831 Robin Murphy 2016-01-26 890 unsigned int iova, size, iova_start;
e5fc9753b1a831 Robin Murphy 2016-01-26 891 unsigned int i, loopnr = 0;
e5fc9753b1a831 Robin Murphy 2016-01-26 892
e5fc9753b1a831 Robin Murphy 2016-01-26 893 selftest_running = true;
e5fc9753b1a831 Robin Murphy 2016-01-26 894
e5fc9753b1a831 Robin Murphy 2016-01-26 895 cfg_cookie = &cfg;
e5fc9753b1a831 Robin Murphy 2016-01-26 896
e5fc9753b1a831 Robin Murphy 2016-01-26 897 ops = alloc_io_pgtable_ops(ARM_V7S, &cfg, &cfg);
e5fc9753b1a831 Robin Murphy 2016-01-26 898 if (!ops) {
e5fc9753b1a831 Robin Murphy 2016-01-26 899 pr_err("selftest: failed to allocate io pgtable ops\n");
e5fc9753b1a831 Robin Murphy 2016-01-26 900 return -EINVAL;
e5fc9753b1a831 Robin Murphy 2016-01-26 901 }
e5fc9753b1a831 Robin Murphy 2016-01-26 902
e5fc9753b1a831 Robin Murphy 2016-01-26 903 /*
e5fc9753b1a831 Robin Murphy 2016-01-26 904 * Initial sanity checks.
e5fc9753b1a831 Robin Murphy 2016-01-26 905 * Empty page tables shouldn't provide any translations.
e5fc9753b1a831 Robin Murphy 2016-01-26 906 */
e5fc9753b1a831 Robin Murphy 2016-01-26 907 if (ops->iova_to_phys(ops, 42))
e5fc9753b1a831 Robin Murphy 2016-01-26 908 return __FAIL(ops);
e5fc9753b1a831 Robin Murphy 2016-01-26 909
e5fc9753b1a831 Robin Murphy 2016-01-26 910 if (ops->iova_to_phys(ops, SZ_1G + 42))
e5fc9753b1a831 Robin Murphy 2016-01-26 911 return __FAIL(ops);
e5fc9753b1a831 Robin Murphy 2016-01-26 912
e5fc9753b1a831 Robin Murphy 2016-01-26 913 if (ops->iova_to_phys(ops, SZ_2G + 42))
e5fc9753b1a831 Robin Murphy 2016-01-26 914 return __FAIL(ops);
e5fc9753b1a831 Robin Murphy 2016-01-26 915
e5fc9753b1a831 Robin Murphy 2016-01-26 916 /*
e5fc9753b1a831 Robin Murphy 2016-01-26 917 * Distinct mappings of different granule sizes.
e5fc9753b1a831 Robin Murphy 2016-01-26 918 */
e5fc9753b1a831 Robin Murphy 2016-01-26 919 iova = 0;
4ae8a5c528c0b1 Kefeng Wang 2016-09-21 920 for_each_set_bit(i, &cfg.pgsize_bitmap, BITS_PER_LONG) {
e5fc9753b1a831 Robin Murphy 2016-01-26 921 size = 1UL << i;
e5fc9753b1a831 Robin Murphy 2016-01-26 922 if (ops->map(ops, iova, iova, size, IOMMU_READ |
e5fc9753b1a831 Robin Murphy 2016-01-26 923 IOMMU_WRITE |
e5fc9753b1a831 Robin Murphy 2016-01-26 924 IOMMU_NOEXEC |e5fc9753b1a831 Robin Murphy 2016-01-26 @925 IOMMU_CACHE))
:::::: The code at line 925 was first introduced by commit
:::::: e5fc9753b1a831466be9b45d0bf926eeaa8b84a0 iommu/io-pgtable: Add ARMv7 short descriptor support
:::::: TO: Robin Murphy <[email protected]>
:::::: CC: Will Deacon <[email protected]>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [PATCH 2/2] iommu: Add gfp parameter to io_pgtable_ops->map()
In reply to Baolin WangI love your patch! Yet something to improve:
Hi Baolin,
I love your patch! Yet something to improve:
[auto build test ERROR on iommu/next]
[also build test ERROR on soc/for-next linus/master v5.7 next-20200605] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Baolin-Wang/Some-improvements-for-iommu/20200608-114141 base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next config: arm-allyesconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/iommu/io-pgtable-arm.c: In function 'arm_lpae_run_tests':
>> drivers/iommu/io-pgtable-arm.c:1178:8: error: too few arguments to function 'ops->map'
1178 | if (ops->map(ops, iova, iova, size, IOMMU_READ |
| ^~~drivers/iommu/io-pgtable-arm.c:1185:9: error: too few arguments to function 'ops->map'
1185 | if (!ops->map(ops, iova, iova + size, size,
| ^~~drivers/iommu/io-pgtable-arm.c:1201:7: error: too few arguments to function 'ops->map'
1201 | if (ops->map(ops, SZ_1G + size, size, size, IOMMU_READ))
| ^~~drivers/iommu/io-pgtable-arm.c:1219:8: error: too few arguments to function 'ops->map'
1219 | if (ops->map(ops, iova, iova, size, IOMMU_WRITE))
| ^~~
vim +1178 drivers/iommu/io-pgtable-arm.c
fe4b991dcd84e01 Will Deacon 2014-11-17 1135
fe4b991dcd84e01 Will Deacon 2014-11-17 1136 static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
fe4b991dcd84e01 Will Deacon 2014-11-17 1137 {
9062c1d0bedacf6 Christophe JAILLET 2019-09-09 1138 static const enum io_pgtable_fmt fmts[] __initconst = {
fe4b991dcd84e01 Will Deacon 2014-11-17 1139 ARM_64_LPAE_S1,
fe4b991dcd84e01 Will Deacon 2014-11-17 1140 ARM_64_LPAE_S2,
fe4b991dcd84e01 Will Deacon 2014-11-17 1141 };
fe4b991dcd84e01 Will Deacon 2014-11-17 1142
fe4b991dcd84e01 Will Deacon 2014-11-17 1143 int i, j;
fe4b991dcd84e01 Will Deacon 2014-11-17 1144 unsigned long iova;
fe4b991dcd84e01 Will Deacon 2014-11-17 1145 size_t size;
fe4b991dcd84e01 Will Deacon 2014-11-17 1146 struct io_pgtable_ops *ops;
fe4b991dcd84e01 Will Deacon 2014-11-17 1147
fe4b991dcd84e01 Will Deacon 2014-11-17 1148 selftest_running = true;
fe4b991dcd84e01 Will Deacon 2014-11-17 1149
fe4b991dcd84e01 Will Deacon 2014-11-17 1150 for (i = 0; i < ARRAY_SIZE(fmts); ++i) {
fe4b991dcd84e01 Will Deacon 2014-11-17 1151 cfg_cookie = cfg;
fe4b991dcd84e01 Will Deacon 2014-11-17 1152 ops = alloc_io_pgtable_ops(fmts[i], cfg, cfg);
fe4b991dcd84e01 Will Deacon 2014-11-17 1153 if (!ops) {
fe4b991dcd84e01 Will Deacon 2014-11-17 1154 pr_err("selftest: failed to allocate io pgtable ops\n");
fe4b991dcd84e01 Will Deacon 2014-11-17 1155 return -ENOMEM;
fe4b991dcd84e01 Will Deacon 2014-11-17 1156 }
fe4b991dcd84e01 Will Deacon 2014-11-17 1157
fe4b991dcd84e01 Will Deacon 2014-11-17 1158 /*
fe4b991dcd84e01 Will Deacon 2014-11-17 1159 * Initial sanity checks.
fe4b991dcd84e01 Will Deacon 2014-11-17 1160 * Empty page tables shouldn't provide any translations.
fe4b991dcd84e01 Will Deacon 2014-11-17 1161 */
fe4b991dcd84e01 Will Deacon 2014-11-17 1162 if (ops->iova_to_phys(ops, 42))
fe4b991dcd84e01 Will Deacon 2014-11-17 1163 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1164
fe4b991dcd84e01 Will Deacon 2014-11-17 1165 if (ops->iova_to_phys(ops, SZ_1G + 42))
fe4b991dcd84e01 Will Deacon 2014-11-17 1166 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1167
fe4b991dcd84e01 Will Deacon 2014-11-17 1168 if (ops->iova_to_phys(ops, SZ_2G + 42))
fe4b991dcd84e01 Will Deacon 2014-11-17 1169 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1170
fe4b991dcd84e01 Will Deacon 2014-11-17 1171 /*
fe4b991dcd84e01 Will Deacon 2014-11-17 1172 * Distinct mappings of different granule sizes.
fe4b991dcd84e01 Will Deacon 2014-11-17 1173 */
fe4b991dcd84e01 Will Deacon 2014-11-17 1174 iova = 0;
4ae8a5c528c0b1e Kefeng Wang 2016-09-21 1175 for_each_set_bit(j, &cfg->pgsize_bitmap, BITS_PER_LONG) {
fe4b991dcd84e01 Will Deacon 2014-11-17 1176 size = 1UL << j;
fe4b991dcd84e01 Will Deacon 2014-11-17 1177
fe4b991dcd84e01 Will Deacon 2014-11-17 @1178 if (ops->map(ops, iova, iova, size, IOMMU_READ |
fe4b991dcd84e01 Will Deacon 2014-11-17 1179 IOMMU_WRITE |
fe4b991dcd84e01 Will Deacon 2014-11-17 1180 IOMMU_NOEXEC |
fe4b991dcd84e01 Will Deacon 2014-11-17 1181 IOMMU_CACHE))
fe4b991dcd84e01 Will Deacon 2014-11-17 1182 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1183
fe4b991dcd84e01 Will Deacon 2014-11-17 1184 /* Overlapping mappings */
fe4b991dcd84e01 Will Deacon 2014-11-17 1185 if (!ops->map(ops, iova, iova + size, size,
fe4b991dcd84e01 Will Deacon 2014-11-17 1186 IOMMU_READ | IOMMU_NOEXEC))
fe4b991dcd84e01 Will Deacon 2014-11-17 1187 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1188
fe4b991dcd84e01 Will Deacon 2014-11-17 1189 if (ops->iova_to_phys(ops, iova + 42) != (iova + 42))
fe4b991dcd84e01 Will Deacon 2014-11-17 1190 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1191
fe4b991dcd84e01 Will Deacon 2014-11-17 1192 iova += SZ_1G;
fe4b991dcd84e01 Will Deacon 2014-11-17 1193 }
fe4b991dcd84e01 Will Deacon 2014-11-17 1194
fe4b991dcd84e01 Will Deacon 2014-11-17 1195 /* Partial unmap */
fe4b991dcd84e01 Will Deacon 2014-11-17 1196 size = 1UL << __ffs(cfg->pgsize_bitmap);
a2d3a382d6c682e Will Deacon 2019-07-02 1197 if (ops->unmap(ops, SZ_1G + size, size, NULL) != size)
fe4b991dcd84e01 Will Deacon 2014-11-17 1198 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1199
fe4b991dcd84e01 Will Deacon 2014-11-17 1200 /* Remap of partial unmap */
fe4b991dcd84e01 Will Deacon 2014-11-17 1201 if (ops->map(ops, SZ_1G + size, size, size, IOMMU_READ))
fe4b991dcd84e01 Will Deacon 2014-11-17 1202 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1203
fe4b991dcd84e01 Will Deacon 2014-11-17 1204 if (ops->iova_to_phys(ops, SZ_1G + size + 42) != (size + 42))
fe4b991dcd84e01 Will Deacon 2014-11-17 1205 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1206
fe4b991dcd84e01 Will Deacon 2014-11-17 1207 /* Full unmap */
fe4b991dcd84e01 Will Deacon 2014-11-17 1208 iova = 0;
f793b13ef0c9c11 YueHaibing 2018-04-26 1209 for_each_set_bit(j, &cfg->pgsize_bitmap, BITS_PER_LONG) {
fe4b991dcd84e01 Will Deacon 2014-11-17 1210 size = 1UL << j;
fe4b991dcd84e01 Will Deacon 2014-11-17 1211
a2d3a382d6c682e Will Deacon 2019-07-02 1212 if (ops->unmap(ops, iova, size, NULL) != size)
fe4b991dcd84e01 Will Deacon 2014-11-17 1213 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1214
fe4b991dcd84e01 Will Deacon 2014-11-17 1215 if (ops->iova_to_phys(ops, iova + 42))
fe4b991dcd84e01 Will Deacon 2014-11-17 1216 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1217
fe4b991dcd84e01 Will Deacon 2014-11-17 1218 /* Remap full block */
fe4b991dcd84e01 Will Deacon 2014-11-17 1219 if (ops->map(ops, iova, iova, size, IOMMU_WRITE))
fe4b991dcd84e01 Will Deacon 2014-11-17 1220 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1221
fe4b991dcd84e01 Will Deacon 2014-11-17 1222 if (ops->iova_to_phys(ops, iova + 42) != (iova + 42))
fe4b991dcd84e01 Will Deacon 2014-11-17 1223 return __FAIL(ops, i);
fe4b991dcd84e01 Will Deacon 2014-11-17 1224
fe4b991dcd84e01 Will Deacon 2014-11-17 1225 iova += SZ_1G;
fe4b991dcd84e01 Will Deacon 2014-11-17 1226 }
fe4b991dcd84e01 Will Deacon 2014-11-17 1227
fe4b991dcd84e01 Will Deacon 2014-11-17 1228 free_io_pgtable_ops(ops);
fe4b991dcd84e01 Will Deacon 2014-11-17 1229 }
fe4b991dcd84e01 Will Deacon 2014-11-17 1230
fe4b991dcd84e01 Will Deacon 2014-11-17 1231 selftest_running = false;
fe4b991dcd84e01 Will Deacon 2014-11-17 1232 return 0;
fe4b991dcd84e01 Will Deacon 2014-11-17 1233 }
fe4b991dcd84e01 Will Deacon 2014-11-17 1234 :::::: The code at line 1178 was first introduced by commit
:::::: fe4b991dcd84e0104cf2e29223a819335ed048a7 iommu: add self-consistency tests to ARM LPAE IO page table allocator
:::::: TO: Will Deacon <[email protected]>
:::::: CC: Will Deacon <[email protected]>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org