From: kernel test robot <lkp@intel.com>
To: Dave Hansen <dave.hansen@linux.intel.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [daveh-devel:kpte 2/6] include/asm-generic/pgalloc.h:144:21: warning: variable 'ptdesc' is uninitialized when used here
Date: Fri, 29 Aug 2025 23:52:42 +0800 [thread overview]
Message-ID: <202508292320.plYGOdi2-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git kpte
head: d5eaa925a3150c716e8ec564c51069fbdd303fbc
commit: ccbd04de39826d130b67374e68599e128b53acab [2/6] mm: Actually mark kernel page table pages
config: x86_64-buildonly-randconfig-004-20250829 (https://download.01.org/0day-ci/archive/20250829/202508292320.plYGOdi2-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/20250829/202508292320.plYGOdi2-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/202508292320.plYGOdi2-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from kernel/fork.c:110:
In file included from arch/x86/include/asm/pgalloc.h:13:
>> include/asm-generic/pgalloc.h:144:21: warning: variable 'ptdesc' is uninitialized when used here [-Wuninitialized]
144 | ptdesc_set_kernel(ptdesc);
| ^~~~~~
include/asm-generic/pgalloc.h:139:23: note: initialize the variable 'ptdesc' to silence this warning
139 | struct ptdesc *ptdesc;
| ^
| = NULL
include/asm-generic/pgalloc.h:179:21: warning: variable 'ptdesc' is uninitialized when used here [-Wuninitialized]
179 | ptdesc_set_kernel(ptdesc);
| ^~~~~~
include/asm-generic/pgalloc.h:175:23: note: initialize the variable 'ptdesc' to silence this warning
175 | struct ptdesc *ptdesc;
| ^
| = NULL
include/asm-generic/pgalloc.h:235:21: warning: variable 'ptdesc' is uninitialized when used here [-Wuninitialized]
235 | ptdesc_set_kernel(ptdesc);
| ^~~~~~
include/asm-generic/pgalloc.h:231:23: note: initialize the variable 'ptdesc' to silence this warning
231 | struct ptdesc *ptdesc;
| ^
| = NULL
include/asm-generic/pgalloc.h:281:21: warning: variable 'ptdesc' is uninitialized when used here [-Wuninitialized]
281 | ptdesc_set_kernel(ptdesc);
| ^~~~~~
include/asm-generic/pgalloc.h:277:23: note: initialize the variable 'ptdesc' to silence this warning
277 | struct ptdesc *ptdesc;
| ^
| = NULL
4 warnings generated.
vim +/ptdesc +144 include/asm-generic/pgalloc.h
124
125 #ifndef __HAVE_ARCH_PMD_ALLOC_ONE
126 /**
127 * pmd_alloc_one - allocate memory for a PMD-level page table
128 * @mm: the mm_struct of the current context
129 *
130 * Allocate memory for a page table and ptdesc and runs pagetable_pmd_ctor().
131 *
132 * Allocations use %GFP_PGTABLE_USER in user context and
133 * %GFP_PGTABLE_KERNEL in kernel context.
134 *
135 * Return: pointer to the allocated memory or %NULL on error
136 */
137 static inline pmd_t *pmd_alloc_one_noprof(struct mm_struct *mm, unsigned long addr)
138 {
139 struct ptdesc *ptdesc;
140 gfp_t gfp = GFP_PGTABLE_USER;
141
142 if (mm == &init_mm) {
143 gfp = GFP_PGTABLE_KERNEL;
> 144 ptdesc_set_kernel(ptdesc);
145 }
146 ptdesc = pagetable_alloc_noprof(gfp, 0);
147 if (!ptdesc)
148 return NULL;
149 if (!pagetable_pmd_ctor(mm, ptdesc)) {
150 pagetable_free(ptdesc);
151 return NULL;
152 }
153 return ptdesc_address(ptdesc);
154 }
155 #define pmd_alloc_one(...) alloc_hooks(pmd_alloc_one_noprof(__VA_ARGS__))
156 #endif
157
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-08-29 15:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 15:52 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-08-29 16:33 [daveh-devel:kpte 2/6] include/asm-generic/pgalloc.h:144:21: warning: variable 'ptdesc' is uninitialized when used here kernel test robot
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=202508292320.plYGOdi2-lkp@intel.com \
--to=lkp@intel.com \
--cc=dave.hansen@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).