* [jgunthorpe:iommu_pt 2/10] drivers/iommu/generic_pt/pt_alloc.c:56:42: error: use of undeclared identifier 'NR_IOMMU_PAGES'
@ 2024-07-12 23:07 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-07-12 23:07 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: llvm, oe-kbuild-all
tree: https://github.com/jgunthorpe/linux iommu_pt
head: 262ff230b5cf17a8a573be8dbee522de7a36a87a
commit: 5082473c62fd387bdbf136fb1eef8c78b0dc1633 [2/10] genpt: Add an allocator for page table levels
config: um-randconfig-002-20240713 (https://download.01.org/0day-ci/archive/20240713/202407130736.0MFZvTRI-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project a0c6b8aef853eedaa0980f07c0a502a5a8a9740e)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240713/202407130736.0MFZvTRI-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407130736.0MFZvTRI-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/iommu/generic_pt/pt_alloc.c:5:
In file included from drivers/iommu/generic_pt/pt_alloc.h:9:
In file included from include/linux/mm.h:2258:
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> drivers/iommu/generic_pt/pt_alloc.c:56:42: error: use of undeclared identifier 'NR_IOMMU_PAGES'
56 | mod_node_page_state(folio_pgdat(folio), NR_IOMMU_PAGES, 1UL << order);
| ^
drivers/iommu/generic_pt/pt_alloc.c:72:43: error: use of undeclared identifier 'NR_IOMMU_PAGES'
72 | mod_node_page_state(folio_pgdat(folio), NR_IOMMU_PAGES, -pgcnt);
| ^
1 warning and 2 errors generated.
vim +/NR_IOMMU_PAGES +56 drivers/iommu/generic_pt/pt_alloc.c
> 5 #include "pt_alloc.h"
6
7 #include <linux/mm.h>
8
9 #define RADIX_MATCH(pg, rl) \
10 static_assert(offsetof(struct page, pg) == \
11 offsetof(struct pt_radix_meta, rl))
12 RADIX_MATCH(flags, __page_flags);
13 RADIX_MATCH(rcu_head, rcu_head); /* Ensure bit 0 is clear */
14 RADIX_MATCH(mapping, __page_mapping);
15 RADIX_MATCH(private, free_next);
16 RADIX_MATCH(page_type, __page_type);
17 RADIX_MATCH(_refcount, __page_refcount);
18 #ifdef CONFIG_MEMCG
19 RADIX_MATCH(memcg_data, memcg_data);
20 #endif
21 #undef RADIX_MATCH
22 static_assert(sizeof(struct pt_radix_meta) <= sizeof(struct page));
23
24 static inline struct folio *meta_to_folio(struct pt_radix_meta *meta)
25 {
26 return (struct folio *)meta;
27 }
28
29 void *pt_radix_alloc(struct pt_common *owner, int nid, size_t log2size,
30 gfp_t gfp)
31 {
32 struct pt_radix_meta *meta;
33 unsigned int order = log2size - PAGE_SHIFT;
34 struct folio *folio;
35
36 /*
37 * FIXME we need to support sub page size tables, eg to allow a 4K table
38 * on a 64K kernel. This should be done by allocating extra memory
39 * per page and placing the pointer in the meta. The extra memory can
40 * contain the additional list heads and rcu's required.
41 */
42 if (log2size < PAGE_SHIFT)
43 order = 0;
44
45 nid = NUMA_NO_NODE; // FIXME
46 folio = (struct folio *)alloc_pages_node(
47 nid, gfp | __GFP_ZERO | __GFP_COMP, order);
48 if (!folio)
49 return ERR_PTR(-ENOMEM);
50
51 meta = folio_to_meta(folio);
52 meta->owner = owner;
53 meta->free_next = NULL;
54 meta->log2size = log2size;
55
> 56 mod_node_page_state(folio_pgdat(folio), NR_IOMMU_PAGES, 1UL << order);
57 lruvec_stat_mod_folio(folio, NR_SECONDARY_PAGETABLE, 1UL << order);
58
59 return folio_address(folio);
60 }
61 EXPORT_SYMBOL_NS_GPL(pt_radix_alloc, GENERIC_PT);
62
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-07-12 23:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12 23:07 [jgunthorpe:iommu_pt 2/10] drivers/iommu/generic_pt/pt_alloc.c:56:42: error: use of undeclared identifier 'NR_IOMMU_PAGES' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.