All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [jgunthorpe:iommu_pt 2/10] drivers/iommu/generic_pt/pt_alloc.c:56:42: error: use of undeclared identifier 'NR_IOMMU_PAGES'
Date: Sat, 13 Jul 2024 07:07:36 +0800	[thread overview]
Message-ID: <202407130736.0MFZvTRI-lkp@intel.com> (raw)

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

                 reply	other threads:[~2024-07-12 23:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202407130736.0MFZvTRI-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jgg@nvidia.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.