From: kernel test robot <lkp@intel.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [davidhildenbrand:b4/bootmem_info 2/11] arch/x86/mm/init_64.c:1132:39: error: use of undeclared identifier 'altmap'
Date: Thu, 30 Apr 2026 09:43:00 +0800 [thread overview]
Message-ID: <202604300949.kKgTppRd-lkp@intel.com> (raw)
tree: https://github.com/davidhildenbrand/linux b4/bootmem_info
head: 80cd9eaf52f7ea07b36881a937059d7075ac110a
commit: fe143d8e7106022f9b66e9c6db02af801fd277f4 [2/11] x86/mm: fix freeing of PMD-sized vmemmap pages
config: x86_64-randconfig-073-20260430 (https://download.01.org/0day-ci/archive/20260430/202604300949.kKgTppRd-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260430/202604300949.kKgTppRd-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/202604300949.kKgTppRd-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/x86/mm/init_64.c:1132:39: error: use of undeclared identifier 'altmap'
1132 | free_vmemmap_pages(pte_page(*pte), altmap, 0);
| ^
>> arch/x86/mm/init_64.c:1168:11: error: incompatible pointer to integer conversion passing 'struct vmem_altmap *' to parameter of type 'unsigned int' [-Wint-conversion]
1168 | altmap, PMD_ORDER);
| ^~~~~~
arch/x86/mm/init_64.c:1031:74: note: passing argument to parameter 'order' here
1031 | static void __meminit free_vmemmap_pages(struct page *page, unsigned int order,
| ^
>> arch/x86/mm/init_64.c:1168:19: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'struct vmem_altmap *' [-Wint-conversion]
1168 | altmap, PMD_ORDER);
| ^~~~~~~~~
include/linux/pgtable.h:8:19: note: expanded from macro 'PMD_ORDER'
8 | #define PMD_ORDER (PMD_SHIFT - PAGE_SHIFT)
| ^~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/mm/init_64.c:1032:23: note: passing argument to parameter 'altmap' here
1032 | struct vmem_altmap *altmap)
| ^
arch/x86/mm/init_64.c:1176:11: error: incompatible pointer to integer conversion passing 'struct vmem_altmap *' to parameter of type 'unsigned int' [-Wint-conversion]
1176 | altmap, PMD_ORDER);
| ^~~~~~
arch/x86/mm/init_64.c:1031:74: note: passing argument to parameter 'order' here
1031 | static void __meminit free_vmemmap_pages(struct page *page, unsigned int order,
| ^
arch/x86/mm/init_64.c:1176:19: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'struct vmem_altmap *' [-Wint-conversion]
1176 | altmap, PMD_ORDER);
| ^~~~~~~~~
include/linux/pgtable.h:8:19: note: expanded from macro 'PMD_ORDER'
8 | #define PMD_ORDER (PMD_SHIFT - PAGE_SHIFT)
| ^~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/mm/init_64.c:1032:23: note: passing argument to parameter 'altmap' here
1032 | struct vmem_altmap *altmap)
| ^
>> arch/x86/mm/init_64.c:1185:50: error: too many arguments to function call, expected 4, have 5
1185 | remove_pte_table(pte_base, addr, next, direct, altmap);
| ~~~~~~~~~~~~~~~~ ^~~~~~
arch/x86/mm/init_64.c:1106:1: note: 'remove_pte_table' declared here
1106 | remove_pte_table(pte_t *pte_start, unsigned long addr, unsigned long end,
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1107 | bool direct)
| ~~~~~~~~~~~
6 errors generated.
vim +/altmap +1132 arch/x86/mm/init_64.c
1104
1105 static void __meminit
1106 remove_pte_table(pte_t *pte_start, unsigned long addr, unsigned long end,
1107 bool direct)
1108 {
1109 unsigned long next, pages = 0;
1110 pte_t *pte;
1111 phys_addr_t phys_addr;
1112
1113 pte = pte_start + pte_index(addr);
1114 for (; addr < end; addr = next, pte++) {
1115 next = (addr + PAGE_SIZE) & PAGE_MASK;
1116 if (next > end)
1117 next = end;
1118
1119 if (!pte_present(*pte))
1120 continue;
1121
1122 /*
1123 * We mapped [0,1G) memory as identity mapping when
1124 * initializing, in arch/x86/kernel/head_64.S. These
1125 * pagetables cannot be removed.
1126 */
1127 phys_addr = pte_val(*pte) + (addr & PAGE_MASK);
1128 if (phys_addr < (phys_addr_t)0x40000000)
1129 return;
1130
1131 if (!direct)
> 1132 free_vmemmap_pages(pte_page(*pte), altmap, 0);
1133
1134 spin_lock(&init_mm.page_table_lock);
1135 pte_clear(&init_mm, addr, pte);
1136 spin_unlock(&init_mm.page_table_lock);
1137
1138 /* For non-direct mapping, pages means nothing. */
1139 pages++;
1140 }
1141
1142 /* Call free_pte_table() in remove_pmd_table(). */
1143 flush_tlb_all();
1144 if (direct)
1145 update_page_count(PG_LEVEL_4K, -pages);
1146 }
1147
1148 static void __meminit
1149 remove_pmd_table(pmd_t *pmd_start, unsigned long addr, unsigned long end,
1150 bool direct, struct vmem_altmap *altmap)
1151 {
1152 unsigned long next, pages = 0;
1153 pte_t *pte_base;
1154 pmd_t *pmd;
1155
1156 pmd = pmd_start + pmd_index(addr);
1157 for (; addr < end; addr = next, pmd++) {
1158 next = pmd_addr_end(addr, end);
1159
1160 if (!pmd_present(*pmd))
1161 continue;
1162
1163 if (pmd_leaf(*pmd)) {
1164 if (IS_ALIGNED(addr, PMD_SIZE) &&
1165 IS_ALIGNED(next, PMD_SIZE)) {
1166 if (!direct)
1167 free_vmemmap_pages(pmd_page(*pmd),
> 1168 altmap, PMD_ORDER);
1169
1170 spin_lock(&init_mm.page_table_lock);
1171 pmd_clear(pmd);
1172 spin_unlock(&init_mm.page_table_lock);
1173 pages++;
1174 } else if (vmemmap_pmd_is_unused(addr, next)) {
1175 free_vmemmap_pages(pmd_page(*pmd),
1176 altmap, PMD_ORDER);
1177 spin_lock(&init_mm.page_table_lock);
1178 pmd_clear(pmd);
1179 spin_unlock(&init_mm.page_table_lock);
1180 }
1181 continue;
1182 }
1183
1184 pte_base = (pte_t *)pmd_page_vaddr(*pmd);
> 1185 remove_pte_table(pte_base, addr, next, direct, altmap);
1186 free_pte_table(pte_base, pmd);
1187 }
1188
1189 /* Call free_pmd_table() in remove_pud_table(). */
1190 if (direct)
1191 update_page_count(PG_LEVEL_2M, -pages);
1192 }
1193
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-04-30 1:43 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=202604300949.kKgTppRd-lkp@intel.com \
--to=lkp@intel.com \
--cc=david@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox