[asahilinux:dart/t6000 5/5] drivers/iommu/io-pgtable-arm.c:180:31: error: implicit declaration of function 'FIELD_PREP'

From: kernel test robot
Date: Mon Nov 01 2021 - 21:04:24 EST


tree: https://github.com/AsahiLinux/linux dart/t6000
head: 1dad0d5a8322c5c6edc88ad0cc0d6ec98bda766d
commit: 1dad0d5a8322c5c6edc88ad0cc0d6ec98bda766d [5/5] iommu/io-pgtable: Add APPLE_DART support for the T6000 variant
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.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
# https://github.com/AsahiLinux/linux/commit/1dad0d5a8322c5c6edc88ad0cc0d6ec98bda766d
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux dart/t6000
git checkout 1dad0d5a8322c5c6edc88ad0cc0d6ec98bda766d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arc

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

drivers/iommu/io-pgtable-arm.c: In function 'paddr_to_iopte':
>> drivers/iommu/io-pgtable-arm.c:180:31: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
180 | pte = FIELD_PREP(APPLE_DART_T6000_PTE_ADDR_MASK, paddr);
| ^~~~~~~~~~
drivers/iommu/io-pgtable-arm.c: In function 'iopte_to_paddr':
>> drivers/iommu/io-pgtable-arm.c:200:33: error: implicit declaration of function 'FIELD_GET'; did you mean 'FOLL_GET'? [-Werror=implicit-function-declaration]
200 | paddr = FIELD_GET(APPLE_DART_T6000_PTE_ADDR_MASK, paddr);
| ^~~~~~~~~
| FOLL_GET
In file included from include/linux/atomic.h:80,
from drivers/iommu/io-pgtable-arm.c:12:
drivers/iommu/io-pgtable-arm.c: In function 'arm_lpae_install_table':
include/linux/atomic/atomic-arch-fallback.h:60:32: error: implicit declaration of function 'arch_cmpxchg64'; did you mean 'arch_cmpxchg'? [-Werror=implicit-function-declaration]
60 | #define arch_cmpxchg64_relaxed arch_cmpxchg64
| ^~~~~~~~~~~~~~
include/linux/atomic/atomic-instrumented.h:1839:9: note: in expansion of macro 'arch_cmpxchg64_relaxed'
1839 | arch_cmpxchg64_relaxed(__ai_ptr, __VA_ARGS__); \
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/iommu/io-pgtable-arm.c:361:15: note: in expansion of macro 'cmpxchg64_relaxed'
361 | old = cmpxchg64_relaxed(ptep, curr, new);
| ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors


vim +/FIELD_PREP +180 drivers/iommu/io-pgtable-arm.c

170
171 static arm_lpae_iopte paddr_to_iopte(phys_addr_t paddr,
172 struct arm_lpae_io_pgtable *data)
173 {
174 arm_lpae_iopte pte = paddr;
175
176 if (data->iop.fmt == APPLE_DART) {
177 paddr >>= APPLE_DART_PADDR_SHIFT;
178
179 if (data->iop.cfg.oas > 40)
> 180 pte = FIELD_PREP(APPLE_DART_T6000_PTE_ADDR_MASK, paddr);
181 else
182 pte = FIELD_PREP(APPLE_DART_T8103_PTE_ADDR_MASK, paddr);
183
184 pte |= FIELD_PREP(APPLE_DART_PTE_SUBPAGE_START, 0);
185 pte |= FIELD_PREP(APPLE_DART_PTE_SUBPAGE_END, 0xfff);
186 return pte;
187 }
188
189 /* Of the bits which overlap, either 51:48 or 15:12 are always RES0 */
190 return (pte | (pte >> (48 - 12))) & ARM_LPAE_PTE_ADDR_MASK;
191 }
192
193 static phys_addr_t iopte_to_paddr(arm_lpae_iopte pte,
194 struct arm_lpae_io_pgtable *data)
195 {
196 u64 paddr = pte & ARM_LPAE_PTE_ADDR_MASK;
197
198 if (data->iop.fmt == APPLE_DART) {
199 if (data->iop.cfg.oas > 40)
> 200 paddr = FIELD_GET(APPLE_DART_T6000_PTE_ADDR_MASK, paddr);
201 else
202 paddr = FIELD_GET(APPLE_DART_T8103_PTE_ADDR_MASK, paddr);
203
204 return paddr << APPLE_DART_PADDR_SHIFT;
205 }
206
207 if (ARM_LPAE_GRANULE(data) < SZ_64K)
208 return paddr;
209
210 /* Rotate the packed high-order bits back to the top */
211 return (paddr | (paddr << (48 - 12))) & (ARM_LPAE_PTE_ADDR_MASK << 4);
212 }
213

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip