Hi Swathi,
FYI, the error/warning still remains.
tree:
https://android.googlesource.com/kernel/common android-4.19-stable
head: f69cc0ed2fca72b2388037e10daac94b0473739c
commit: 27de1978c331d4e7571a5d0187ef1802d65dbf65 [9069/9999] ANDROID: GKI:
iommu/io-pgtable-arm: LPAE related updates by vendor
config: x86_64-randconfig-a016-20200622 (attached as .config)
compiler: clang version 11.0.0 (
https://github.com/llvm/llvm-project
1d4c87335d5236ea1f35937e1014980ba961ae34)
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
git checkout 27de1978c331d4e7571a5d0187ef1802d65dbf65
# 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
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/iommu/io-pgtable-arm.c:312:16: error: implicit declaration of function
'io_pgtable_alloc_pages_exact' [-Werror,-Wimplicit-function-declaration]
void *pages = io_pgtable_alloc_pages_exact(cfg, cookie, size,
^
drivers/iommu/io-pgtable-arm.c:312:8: warning: incompatible integer to pointer
conversion initializing 'void *' with an expression of type 'int'
[-Wint-conversion]
void *pages = io_pgtable_alloc_pages_exact(cfg, cookie, size,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iommu/io-pgtable-arm.c:337:2: error: implicit declaration of function
'io_pgtable_free_pages_exact' [-Werror,-Wimplicit-function-declaration]
io_pgtable_free_pages_exact(cfg, cookie, pages, size);
^
drivers/iommu/io-pgtable-arm.c:337:2: note: did you mean
'io_pgtable_alloc_pages_exact'?
drivers/iommu/io-pgtable-arm.c:312:16: note: 'io_pgtable_alloc_pages_exact'
declared here
void *pages = io_pgtable_alloc_pages_exact(cfg, cookie, size,
^
drivers/iommu/io-pgtable-arm.c:347:2: error: implicit declaration of function
'io_pgtable_free_pages_exact' [-Werror,-Wimplicit-function-declaration]
io_pgtable_free_pages_exact(cfg, cookie, pages, size);
^
drivers/iommu/io-pgtable-arm.c:572:19: error: use of undeclared identifier
'IOMMU_USE_UPSTREAM_HINT'
else if (prot & IOMMU_USE_UPSTREAM_HINT)
^
drivers/iommu/io-pgtable-arm.c:575:19: error: use of undeclared identifier
'IOMMU_USE_LLC_NWA'
else if (prot & IOMMU_USE_LLC_NWA)
^
> drivers/iommu/io-pgtable-arm.c:666:20: error: implicit
declaration of function 'iommu_pgsize' [-Werror,-Wimplicit-function-declaration]
size_t pgsize = iommu_pgsize(
^
drivers/iommu/io-pgtable-arm.c:767:9: error: implicit declaration of function
'iommu_pgsize' [-Werror,-Wimplicit-function-declaration]
size = iommu_pgsize(data->iop.cfg.pgsize_bitmap, iova, size);
^
drivers/iommu/io-pgtable-arm.c:901:19: error: implicit declaration of function
'iommu_pgsize' [-Werror,-Wimplicit-function-declaration]
size_to_unmap = iommu_pgsize(data->iop.cfg.pgsize_bitmap, iova,
^
drivers/iommu/io-pgtable-arm.c:1095:4: error: field designator 'map_sg' does
not refer to any field in type 'struct io_pgtable_ops'
.map_sg = arm_lpae_map_sg,
^
drivers/iommu/io-pgtable-arm.c:1098:4: error: field designator
'is_iova_coherent' does not refer to any field in type 'struct
io_pgtable_ops'
.is_iova_coherent = arm_lpae_is_iova_coherent,
^
drivers/iommu/io-pgtable-arm.c:1099:4: error: field designator 'iova_to_pte'
does not refer to any field in type 'struct io_pgtable_ops'; did you mean
'iova_to_phys'?
.iova_to_pte = arm_lpae_iova_get_pte,
^~~~~~~~~~~
iova_to_phys
include/linux/io-pgtable.h:132:16: note: 'iova_to_phys' declared here
phys_addr_t (*iova_to_phys)(struct io_pgtable_ops *ops,
^
drivers/iommu/io-pgtable-arm.c:1113:8: error: use of undeclared identifier
'IO_PGTABLE_QUIRK_QCOM_USE_UPSTREAM_HINT'
| IO_PGTABLE_QUIRK_QCOM_USE_UPSTREAM_HINT
^
drivers/iommu/io-pgtable-arm.c:1114:8: error: use of undeclared identifier
'IO_PGTABLE_QUIRK_QSMMUV500_NON_SHAREABLE'
| IO_PGTABLE_QUIRK_QSMMUV500_NON_SHAREABLE
^
drivers/iommu/io-pgtable-arm.c:1115:8: error: use of undeclared identifier
'IO_PGTABLE_QUIRK_QCOM_USE_LLC_NWA'
| IO_PGTABLE_QUIRK_QCOM_USE_LLC_NWA))
^
drivers/iommu/io-pgtable-arm.c:1127:26: error: use of undeclared identifier
'IO_PGTABLE_QUIRK_QCOM_USE_UPSTREAM_HINT'
else if ((cfg->quirks & IO_PGTABLE_QUIRK_QCOM_USE_UPSTREAM_HINT)
&&
^
drivers/iommu/io-pgtable-arm.c:1128:18: error: use of undeclared identifier
'IO_PGTABLE_QUIRK_QSMMUV500_NON_SHAREABLE'
(cfg->quirks & IO_PGTABLE_QUIRK_QSMMUV500_NON_SHAREABLE))
^
drivers/iommu/io-pgtable-arm.c:1132:25: error: use of undeclared identifier
'IO_PGTABLE_QUIRK_QCOM_USE_UPSTREAM_HINT'
else if (cfg->quirks & IO_PGTABLE_QUIRK_QCOM_USE_UPSTREAM_HINT)
^
drivers/iommu/io-pgtable-arm.c:1136:26: error: use of undeclared identifier
'IO_PGTABLE_QUIRK_QCOM_USE_LLC_NWA'
else if ((cfg->quirks & IO_PGTABLE_QUIRK_QCOM_USE_LLC_NWA) &&
^
drivers/iommu/io-pgtable-arm.c:1137:18: error: use of undeclared identifier
'IO_PGTABLE_QUIRK_QSMMUV500_NON_SHAREABLE'
(cfg->quirks & IO_PGTABLE_QUIRK_QSMMUV500_NON_SHAREABLE))
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
vim +/iommu_pgsize +666 drivers/iommu/io-pgtable-arm.c
625
626 static int arm_lpae_map_sg(struct io_pgtable_ops *ops, unsigned long iova,
627 struct scatterlist *sg, unsigned int nents,
628 int iommu_prot, size_t *size)
629 {
630 struct arm_lpae_io_pgtable *data = io_pgtable_ops_to_data(ops);
631 arm_lpae_iopte *ptep = data->pgd;
632 int lvl = ARM_LPAE_START_LVL(data);
633 arm_lpae_iopte prot;
634 struct scatterlist *s;
635 size_t mapped = 0;
636 int i;
637 int ret = -EINVAL;
638 unsigned int min_pagesz;
639 struct io_pgtable_cfg *cfg = &data->iop.cfg;
640 struct map_state ms;
641
642 /* If no access, then nothing to do */
643 if (!(iommu_prot & (IOMMU_READ | IOMMU_WRITE)))
644 goto out_err;
645
646 prot = arm_lpae_prot_to_pte(data, iommu_prot);
647
648 min_pagesz = 1 << __ffs(cfg->pgsize_bitmap);
649
650 memset(&ms, 0, sizeof(ms));
651
652 for_each_sg(sg, s, nents, i) {
653 phys_addr_t phys = page_to_phys(sg_page(s)) + s->offset;
654 size_t size = s->length;
655
656 /*
657 * We are mapping on IOMMU page boundaries, so offset within
658 * the page must be 0. However, the IOMMU may support pages
659 * smaller than PAGE_SIZE, so s->offset may still represent
660 * an offset of that boundary within the CPU page.
661 */
662 if (!IS_ALIGNED(s->offset, min_pagesz))
663 goto out_err;
664
665 while (size) {
666 size_t pgsize = iommu_pgsize(
667 cfg->pgsize_bitmap, iova | phys, size);
668
669 if (ms.pgtable && (iova < ms.iova_end)) {
670 arm_lpae_iopte *ptep = ms.pgtable +
671 ARM_LPAE_LVL_IDX(iova, MAP_STATE_LVL,
672 data);
673 arm_lpae_init_pte(
674 data, iova, phys, prot, MAP_STATE_LVL,
675 ptep, ms.prev_pgtable, false);
676 ms.num_pte++;
677 } else {
678 ret = __arm_lpae_map(data, iova, phys, pgsize,
679 prot, lvl, ptep, NULL, &ms);
680 if (ret)
681 goto out_err;
682 }
683
684 iova += pgsize;
685 mapped += pgsize;
686 phys += pgsize;
687 size -= pgsize;
688 }
689 }
690
691 if (ms.pgtable)
692 pgtable_dma_sync_single_for_device(cfg,
693 __arm_lpae_dma_addr(ms.pte_start),
694 ms.num_pte * sizeof(*ms.pte_start),
695 DMA_TO_DEVICE);
696
697 /*
698 * Synchronise all PTE updates for the new mapping before there's
699 * a chance for anything to kick off a table walk for the new iova.
700 */
701 wmb();
702
703 return mapped;
704
705 out_err:
706 /* Return the size of the partial mapping so that they can be undone */
707 *size = mapped;
708 return ret;
709 }
710
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org