[PATCH 12/26] kernel/configs: Register dynamic information into meminspect

Eugen Hristev posted 26 patches 2 months, 2 weeks ago
[PATCH 12/26] kernel/configs: Register dynamic information into meminspect
Posted by Eugen Hristev 2 months, 2 weeks ago
Register kernel_config_data information into inspection table.
Debugging tools look for the start and end markers, so we need to capture
those as well into the region.

Signed-off-by: Eugen Hristev <eugen.hristev@linaro.org>
---
 kernel/configs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/configs.c b/kernel/configs.c
index a28c79c5f713..139ecc74bcee 100644
--- a/kernel/configs.c
+++ b/kernel/configs.c
@@ -15,6 +15,7 @@
 #include <linux/seq_file.h>
 #include <linux/init.h>
 #include <linux/uaccess.h>
+#include <linux/meminspect.h>
 
 /*
  * "IKCFG_ST" and "IKCFG_ED" are used to extract the config data from
@@ -64,6 +65,11 @@ static int __init ikconfig_init(void)
 
 	proc_set_size(entry, &kernel_config_data_end - &kernel_config_data);
 
+	/* Register 8 bytes before and after, to catch the marker too */
+	meminspect_lock_register_id_va(MEMINSPECT_ID_CONFIG,
+			     (void *)&kernel_config_data - 8,
+			     &kernel_config_data_end - &kernel_config_data + 16);
+
 	return 0;
 }
 
-- 
2.43.0
Re: [PATCH 12/26] kernel/configs: Register dynamic information into meminspect
Posted by kernel test robot 2 months, 2 weeks ago
Hi Eugen,

kernel test robot noticed the following build errors:

[auto build test ERROR on rppt-memblock/fixes]
[also build test ERROR on linus/master v6.18-rc6]
[cannot apply to akpm-mm/mm-everything rppt-memblock/for-next next-20251121]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Eugen-Hristev/kernel-Introduce-meminspect/20251119-235912
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git fixes
patch link:    https://lore.kernel.org/r/20251119154427.1033475-13-eugen.hristev%40linaro.org
patch subject: [PATCH 12/26] kernel/configs: Register dynamic information into meminspect
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20251122/202511220511.nMJSuw8H-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251122/202511220511.nMJSuw8H-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/202511220511.nMJSuw8H-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from kernel/configs.c:18:
   kernel/configs.c: In function 'ikconfig_init':
>> include/linux/meminspect.h:144:39: error: implicit declaration of function 'virt_to_phys'; did you mean 'virt_to_page'? [-Wimplicit-function-declaration]
     144 |         meminspect_register_id_pa(id, virt_to_phys(va), size, MEMINSPECT_TYPE_REGULAR)
         |                                       ^~~~~~~~~~~~
   include/linux/meminspect.h:170:17: note: in expansion of macro 'meminspect_register_id_va'
     170 |                 meminspect_register_id_va(__VA_ARGS__); \
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/configs.c:69:9: note: in expansion of macro 'meminspect_lock_register_id_va'
      69 |         meminspect_lock_register_id_va(MEMINSPECT_ID_CONFIG,
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +144 include/linux/meminspect.h

184ddf27f54a0b Eugen Hristev 2025-11-19  139  
184ddf27f54a0b Eugen Hristev 2025-11-19  140  #define meminspect_register_pa(...) \
184ddf27f54a0b Eugen Hristev 2025-11-19  141  	meminspect_register_id_pa(MEMINSPECT_ID_DYNAMIC, __VA_ARGS__, MEMINSPECT_TYPE_REGULAR)
184ddf27f54a0b Eugen Hristev 2025-11-19  142  
184ddf27f54a0b Eugen Hristev 2025-11-19  143  #define meminspect_register_id_va(id, va, size) \
184ddf27f54a0b Eugen Hristev 2025-11-19 @144  	meminspect_register_id_pa(id, virt_to_phys(va), size, MEMINSPECT_TYPE_REGULAR)
184ddf27f54a0b Eugen Hristev 2025-11-19  145  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki