[hnaz-linux-mm:master 476/523] arch/powerpc/xmon/xmon.c:3138:16: warning: variable 'pgdir' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://github.com/hnaz/linux-mm master
head:   2bbf0589bfeb27800c730b76eacf34528eee5418
commit: 47dde7dbc279f3698c76a7b92ac0d0f1913539af [476/523] powerpc: add support for folded p4d page tables
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 47dde7dbc279f3698c76a7b92ac0d0f1913539af
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

arch/powerpc/xmon/xmon.c: In function 'show_pte':
>> arch/powerpc/xmon/xmon.c:3138:16: warning: variable 'pgdir' set but not used [-Wunused-but-set-variable]
3138 |  pgd_t *pgdp, *pgdir;
|                ^~~~~
arch/powerpc/xmon/xmon.c: At top level:
arch/powerpc/xmon/xmon.c:4122:1: warning: no previous prototype for 'spu_inst_dump' [-Wmissing-prototypes]
4122 | spu_inst_dump(unsigned long adr, long count, int praddr)
| ^~~~~~~~~~~~~
arch/powerpc/xmon/xmon.c: In function 'xmon_print_symbol':
arch/powerpc/xmon/xmon.c:3557:14: warning: variable 'name' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
3557 |  const char *name = NULL;
|              ^~~~
arch/powerpc/xmon/xmon.c: In function 'stop_spus':
arch/powerpc/xmon/xmon.c:3990:6: warning: variable 'i' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
3990 |  int i;
|      ^
arch/powerpc/xmon/xmon.c: In function 'restart_spus':
arch/powerpc/xmon/xmon.c:4031:6: warning: variable 'i' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
4031 |  int i;
|      ^
arch/powerpc/xmon/xmon.c: In function 'dump_opal_msglog':
arch/powerpc/xmon/xmon.c:2937:9: warning: variable 'pos' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
2937 |  loff_t pos = 0;
|         ^~~
arch/powerpc/xmon/xmon.c: In function 'show_pte':
arch/powerpc/xmon/xmon.c:3136:22: warning: variable 'tsk' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
3136 |  struct task_struct *tsk = NULL;
|                      ^~~
arch/powerpc/xmon/xmon.c: In function 'show_tasks':
arch/powerpc/xmon/xmon.c:3234:22: warning: variable 'tsk' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
3234 |  struct task_struct *tsk = NULL;
|                      ^~~
arch/powerpc/xmon/xmon.c: In function 'xmon_core':
arch/powerpc/xmon/xmon.c:490:6: warning: variable 'cmd' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
490 |  int cmd = 0;
|      ^~~
arch/powerpc/xmon/xmon.c:849:14: warning: variable 'bp' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
849 |  struct bpt *bp;
|              ^~
arch/powerpc/xmon/xmon.c:849:14: warning: variable 'bp' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
arch/powerpc/xmon/xmon.c:488:48: warning: argument 'fromipi' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
488 | static int xmon_core(struct pt_regs *regs, int fromipi)
|                                            ~~~~^~~~~~~

vim +/pgdir +3138 arch/powerpc/xmon/xmon.c

80eff6c4847997 Balbir Singh      2017-10-30  3132  
80eff6c4847997 Balbir Singh      2017-10-30  3133  static void show_pte(unsigned long addr)
80eff6c4847997 Balbir Singh      2017-10-30  3134  {
80eff6c4847997 Balbir Singh      2017-10-30  3135  	unsigned long tskv = 0;
80eff6c4847997 Balbir Singh      2017-10-30  3136  	struct task_struct *tsk = NULL;
80eff6c4847997 Balbir Singh      2017-10-30  3137  	struct mm_struct *mm;
80eff6c4847997 Balbir Singh      2017-10-30 @3138  	pgd_t *pgdp, *pgdir;
47dde7dbc279f3 Mike Rapoport     2020-05-16  3139  	p4d_t *p4dp;
80eff6c4847997 Balbir Singh      2017-10-30  3140  	pud_t *pudp;
80eff6c4847997 Balbir Singh      2017-10-30  3141  	pmd_t *pmdp;
80eff6c4847997 Balbir Singh      2017-10-30  3142  	pte_t *ptep;
80eff6c4847997 Balbir Singh      2017-10-30  3143  
80eff6c4847997 Balbir Singh      2017-10-30  3144  	if (!scanhex(&tskv))
80eff6c4847997 Balbir Singh      2017-10-30  3145  		mm = &init_mm;
80eff6c4847997 Balbir Singh      2017-10-30  3146  	else
80eff6c4847997 Balbir Singh      2017-10-30  3147  		tsk = (struct task_struct *)tskv;
80eff6c4847997 Balbir Singh      2017-10-30  3148  
80eff6c4847997 Balbir Singh      2017-10-30  3149  	if (tsk == NULL)
80eff6c4847997 Balbir Singh      2017-10-30  3150  		mm = &init_mm;
80eff6c4847997 Balbir Singh      2017-10-30  3151  	else
80eff6c4847997 Balbir Singh      2017-10-30  3152  		mm = tsk->active_mm;
80eff6c4847997 Balbir Singh      2017-10-30  3153  
80eff6c4847997 Balbir Singh      2017-10-30  3154  	if (setjmp(bus_error_jmp) != 0) {
80eff6c4847997 Balbir Singh      2017-10-30  3155  		catch_memory_errors = 0;
d8104182087319 Michael Ellerman  2017-12-06  3156  		printf("*** Error dumping pte for task %px\n", tsk);
80eff6c4847997 Balbir Singh      2017-10-30  3157  		return;
80eff6c4847997 Balbir Singh      2017-10-30  3158  	}
80eff6c4847997 Balbir Singh      2017-10-30  3159  
80eff6c4847997 Balbir Singh      2017-10-30  3160  	catch_memory_errors = 1;
80eff6c4847997 Balbir Singh      2017-10-30  3161  	sync();
80eff6c4847997 Balbir Singh      2017-10-30  3162  
80eff6c4847997 Balbir Singh      2017-10-30  3163  	if (mm == &init_mm) {
80eff6c4847997 Balbir Singh      2017-10-30  3164  		pgdp = pgd_offset_k(addr);
80eff6c4847997 Balbir Singh      2017-10-30  3165  		pgdir = pgd_offset_k(0);
80eff6c4847997 Balbir Singh      2017-10-30  3166  	} else {
80eff6c4847997 Balbir Singh      2017-10-30  3167  		pgdp = pgd_offset(mm, addr);
80eff6c4847997 Balbir Singh      2017-10-30  3168  		pgdir = pgd_offset(mm, 0);
80eff6c4847997 Balbir Singh      2017-10-30  3169  	}
80eff6c4847997 Balbir Singh      2017-10-30  3170  
47dde7dbc279f3 Mike Rapoport     2020-05-16  3171  	p4dp = p4d_offset(pgdp, addr);
47dde7dbc279f3 Mike Rapoport     2020-05-16  3172  
47dde7dbc279f3 Mike Rapoport     2020-05-16  3173  	if (p4d_none(*p4dp)) {
47dde7dbc279f3 Mike Rapoport     2020-05-16  3174  		printf("No valid P4D\n");
80eff6c4847997 Balbir Singh      2017-10-30  3175  		return;
80eff6c4847997 Balbir Singh      2017-10-30  3176  	}
80eff6c4847997 Balbir Singh      2017-10-30  3177  
47dde7dbc279f3 Mike Rapoport     2020-05-16  3178  	if (p4d_is_leaf(*p4dp)) {
47dde7dbc279f3 Mike Rapoport     2020-05-16  3179  		format_pte(p4dp, p4d_val(*p4dp));
80eff6c4847997 Balbir Singh      2017-10-30  3180  		return;
80eff6c4847997 Balbir Singh      2017-10-30  3181  	}
80eff6c4847997 Balbir Singh      2017-10-30  3182  
47dde7dbc279f3 Mike Rapoport     2020-05-16  3183  	printf("p4dp @ 0x%px = 0x%016lx\n", p4dp, p4d_val(*p4dp));
47dde7dbc279f3 Mike Rapoport     2020-05-16  3184  
47dde7dbc279f3 Mike Rapoport     2020-05-16  3185  	pudp = pud_offset(p4dp, addr);
80eff6c4847997 Balbir Singh      2017-10-30  3186  
80eff6c4847997 Balbir Singh      2017-10-30  3187  	if (pud_none(*pudp)) {
80eff6c4847997 Balbir Singh      2017-10-30  3188  		printf("No valid PUD\n");
80eff6c4847997 Balbir Singh      2017-10-30  3189  		return;
80eff6c4847997 Balbir Singh      2017-10-30  3190  	}
80eff6c4847997 Balbir Singh      2017-10-30  3191  
d6eacedd1f0ebf Aneesh Kumar K.V  2019-05-14  3192  	if (pud_is_leaf(*pudp)) {
80eff6c4847997 Balbir Singh      2017-10-30  3193  		format_pte(pudp, pud_val(*pudp));
80eff6c4847997 Balbir Singh      2017-10-30  3194  		return;
80eff6c4847997 Balbir Singh      2017-10-30  3195  	}
80eff6c4847997 Balbir Singh      2017-10-30  3196  
e70d8f55268ba9 Mathieu Malaterre 2018-03-25  3197  	printf("pudp @ 0x%px = 0x%016lx\n", pudp, pud_val(*pudp));
80eff6c4847997 Balbir Singh      2017-10-30  3198  
80eff6c4847997 Balbir Singh      2017-10-30  3199  	pmdp = pmd_offset(pudp, addr);
80eff6c4847997 Balbir Singh      2017-10-30  3200  
80eff6c4847997 Balbir Singh      2017-10-30  3201  	if (pmd_none(*pmdp)) {
80eff6c4847997 Balbir Singh      2017-10-30  3202  		printf("No valid PMD\n");
80eff6c4847997 Balbir Singh      2017-10-30  3203  		return;
80eff6c4847997 Balbir Singh      2017-10-30  3204  	}
80eff6c4847997 Balbir Singh      2017-10-30  3205  
d6eacedd1f0ebf Aneesh Kumar K.V  2019-05-14  3206  	if (pmd_is_leaf(*pmdp)) {
80eff6c4847997 Balbir Singh      2017-10-30  3207  		format_pte(pmdp, pmd_val(*pmdp));
80eff6c4847997 Balbir Singh      2017-10-30  3208  		return;
80eff6c4847997 Balbir Singh      2017-10-30  3209  	}
e70d8f55268ba9 Mathieu Malaterre 2018-03-25  3210  	printf("pmdp @ 0x%px = 0x%016lx\n", pmdp, pmd_val(*pmdp));
80eff6c4847997 Balbir Singh      2017-10-30  3211  
80eff6c4847997 Balbir Singh      2017-10-30  3212  	ptep = pte_offset_map(pmdp, addr);
80eff6c4847997 Balbir Singh      2017-10-30  3213  	if (pte_none(*ptep)) {
80eff6c4847997 Balbir Singh      2017-10-30  3214  		printf("no valid PTE\n");
80eff6c4847997 Balbir Singh      2017-10-30  3215  		return;
80eff6c4847997 Balbir Singh      2017-10-30  3216  	}
80eff6c4847997 Balbir Singh      2017-10-30  3217  
80eff6c4847997 Balbir Singh      2017-10-30  3218  	format_pte(ptep, pte_val(*ptep));
80eff6c4847997 Balbir Singh      2017-10-30  3219  
80eff6c4847997 Balbir Singh      2017-10-30  3220  	sync();
80eff6c4847997 Balbir Singh      2017-10-30  3221  	__delay(200);
80eff6c4847997 Balbir Singh      2017-10-30  3222  	catch_memory_errors = 0;
80eff6c4847997 Balbir Singh      2017-10-30  3223  }
80eff6c4847997 Balbir Singh      2017-10-30  3224  #else
80eff6c4847997 Balbir Singh      2017-10-30  3225  static void show_pte(unsigned long addr)
80eff6c4847997 Balbir Singh      2017-10-30  3226  {
80eff6c4847997 Balbir Singh      2017-10-30  3227  	printf("show_pte not yet implemented\n");
80eff6c4847997 Balbir Singh      2017-10-30  3228  }
80eff6c4847997 Balbir Singh      2017-10-30  3229  #endif /* CONFIG_PPC_BOOK3S_64 */
80eff6c4847997 Balbir Singh      2017-10-30  3230  

:::::: The code at line 3138 was first introduced by commit
:::::: 80eff6c484799722736471d15ff9cc86b64cae7a powerpc/xmon: Support dumping software pagetables

:::::: TO: Balbir Singh <bsingharora@xxxxxxxxx>
:::::: CC: Michael Ellerman <mpe@xxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux