tree:
https://github.com/jimc/linux.git dd-diet-6
head: 02405228312e180cda1d5c7a5c784bef1540197e
commit: 272e0af356f3c076132cffeb729b5435387d82bd [36/37] dyndbg: try to release unneeded
memory (panics)
config: powerpc-randconfig-r026-20210613 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
d2012d965d60c3258b3a69d024491698f8aec386)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
#
https://github.com/jimc/linux/commit/272e0af356f3c076132cffeb729b5435387d...
git remote add jimc
https://github.com/jimc/linux.git
git fetch --no-tags jimc dd-diet-6
git checkout 272e0af356f3c076132cffeb729b5435387d82bd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:45:1: note: expanded from here
__do_insb
^
arch/powerpc/include/asm/io.h:556:56: note: expanded from macro '__do_insb'
#define __do_insb(p, b, n) readsb((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:47:1: note: expanded from here
__do_insw
^
arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:49:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:51:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:53:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:55:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
> lib/dynamic_debug.c:1319:34: warning: unknown attribute
'optimize' ignored [-Wunknown-attributes]
static int __init
__attribute__((optimize(0)))
^~~~~~~~~~~
lib/dynamic_debug.c:1332:21: warning: unused variable 'addr'
[-Wunused-variable]
unsigned long pfn, addr;
^
9 warnings generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for HOTPLUG_CPU
Depends on SMP && (PPC_PSERIES || PPC_PMAC || PPC_POWERNV || FSL_SOC_BOOKE
Selected by
- PM_SLEEP_SMP && SMP && (ARCH_SUSPEND_POSSIBLE ||
ARCH_HIBERNATION_POSSIBLE && PM_SLEEP
vim +/optimize +1319 lib/dynamic_debug.c
1318
1319 static int __init __attribute__((optimize(0)))
1320 dynamic_debug_init(void)
1321 {
1322 struct _ddebug *iter, *iter_mod_start;
1323 struct _ddebug_site *site, *site_mod_start;
1324
1325 const char *modname = NULL;
1326 char *cmdline;
1327 int ret = 0;
1328 int i, site_ct = 0, modct = 0, mod_index = 0;
1329 unsigned int site_base;
1330 // volatile
1331 struct page *pg;
1332 unsigned long pfn, addr;
1333
1334 if (&__start___dyndbg == &__stop___dyndbg) {
1335 if (IS_ENABLED(CONFIG_DYNAMIC_DEBUG)) {
1336 pr_warn("_ddebug table is empty in a CONFIG_DYNAMIC_DEBUG build\n");
1337 return 1;
1338 }
1339 pr_info("Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE
build\n");
1340 ddebug_init_success = 1;
1341 return 0;
1342 }
1343
1344 iter = iter_mod_start = __start___dyndbg;
1345 site = site_mod_start = __start___dyndbg_sites;
1346 modname = site->modname;
1347
1348 for (site_base = i = 0; iter < __stop___dyndbg; iter++, site++, i++) {
1349
1350 SITE_CHK_(BUG_ON(site != iter->site));
1351
1352 if (strcmp(modname, site->modname)) {
1353 modct++;
1354
1355 ret = __ddebug_add_module(iter_mod_start, site_mod_start,
1356 site_ct, mod_index, modname,
1357 __start___dyndbg_sites, &site_base);
1358 if (ret)
1359 goto out_err;
1360
1361 modname = site->modname;
1362 iter_mod_start = iter;
1363 site_mod_start = site;
1364 mod_index += site_ct;
1365 site_ct = 0;
1366 }
1367 site_ct++;
1368 }
1369 ret = __ddebug_add_module(iter_mod_start, site_mod_start,
1370 site_ct, mod_index, modname,
1371 __start___dyndbg_sites, &site_base);
1372 if (ret)
1373 goto out_err;
1374
1375 vpr_info("page: %px %px, %px %px, %px %px %d/%d\n",
1376 virt_to_page(__start___dyndbg_sites), __start___dyndbg_sites,
1377 virt_to_page(site), site,
1378 virt_to_page(__stop___dyndbg_sites), __stop___dyndbg_sites,
1379 site_base, i);
1380
1381 pg = virt_to_page(__start___dyndbg_sites);
1382 vpr_info("page: %px\n", pg);
1383
1384 pg = virt_to_page(site);
1385 vpr_info("page: %px\n", pg);
1386
1387 pg = virt_to_page(__stop___dyndbg_sites);
1388 vpr_info("page: %px\n", pg);
1389
1390 pg = virt_to_page(__stop___dyndbg_sites - PAGE_SIZE);
1391 vpr_info("page: %px\n", pg);
1392 /*
1393 for (addr = site; addr < __stop___dyndbg_sites; addr += PAGE_SIZE) {
1394 pg = pfn_to_page(addr >> PAGE_SHIFT);
1395 vpr_info("freeing page: %px\n", pg);
1396 free_reserved_page(pg);
1397 }
1398 */
1399 for (pfn = PFN_UP((long)site);
1400 pfn < PFN_DOWN((long)__stop___dyndbg_sites); pfn++) {
1401 struct page *page = pfn_to_page(pfn);
1402 vpr_info("freeing page: %px %ld\n", page, pfn);
1403 free_reserved_page(page);
1404 }
1405 /*
1406 for (pg = virt_to_page(__stop___dyndbg_sites - PAGE_SIZE);
1407 pg > virt_to_page(site);
1408 pg = virt_to_page(site - PAGE_SIZE)) {
1409 vpr_info("freeing page: %px\n", pg);
1410 free_reserved_page(pg);
1411 }
1412 */
1413 ddebug_init_success = 1;
1414 vpr_info("%d prdebugs in %d modules, %d KiB in ddebug tables, %d KiB in
__dyndbg section, %d KiB in __dyndbg_sites section\n",
1415 i, modct, (int)((modct * sizeof(struct ddebug_table)) >> 10),
1416 (int)((i * sizeof(struct _ddebug)) >> 10),
1417 (int)((i * sizeof(struct _ddebug_site)) >> 10));
1418
1419 /* apply ddebug_query boot param, dont unload tables on err */
1420 if (ddebug_setup_string[0] != '\0') {
1421 pr_warn("ddebug_query param name is deprecated, change it to
dyndbg\n");
1422 ret = ddebug_exec_queries(ddebug_setup_string, NULL);
1423 if (ret < 0)
1424 pr_warn("Invalid ddebug boot param %s\n",
1425 ddebug_setup_string);
1426 else
1427 pr_info("%d changes by ddebug_query\n", ret);
1428 }
1429 /* now that ddebug tables are loaded, process all boot args
1430 * again to find and activate queries given in dyndbg params.
1431 * While this has already been done for known boot params, it
1432 * ignored the unknown ones (dyndbg in particular). Reusing
1433 * parse_args avoids ad-hoc parsing. This will also attempt
1434 * to activate queries for not-yet-loaded modules, which is
1435 * slightly noisy if verbose, but harmless.
1436 */
1437 cmdline = kstrdup(saved_command_line, GFP_KERNEL);
1438 parse_args("dyndbg params", cmdline, NULL,
1439 0, 0, 0, NULL, &ddebug_dyndbg_boot_param_cb);
1440 kfree(cmdline);
1441 return 0;
1442
1443 out_err:
1444 ddebug_remove_all_tables();
1445 return 0;
1446 }
1447 /* Allow early initialization for boot messages via boot param */
1448 early_initcall(dynamic_debug_init);
1449
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org