All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: arch/riscv/mm/ptdump.c:210 note_page() warn: should '(pte_pfn(($expr_0x7f0526438120(24)))) << (12)' be a 64 bit
Date: Wed, 13 Jan 2021 07:55:36 +0800	[thread overview]
Message-ID: <202101130728.Wg0QN66f-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4476 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Zong Li <zong.li@sifive.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>

Hi Zong,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e609571b5ffa3528bf85292de1ceaddac342bc1c
commit: b422d28b21773bbfc9e84dbb5579a8ce355279ca riscv: support DEBUG_WX
date:   7 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 7 months ago
config: riscv-randconfig-m031-20210112 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
arch/riscv/mm/ptdump.c:210 note_page() warn: should '(pte_pfn(($expr_0x7f0526438120(24)))) << (12)' be a 64 bit type?

vim +210 arch/riscv/mm/ptdump.c

59c4da8640ccf472 Zong Li      2020-03-12  205  
59c4da8640ccf472 Zong Li      2020-03-12  206  static void note_page(struct ptdump_state *pt_st, unsigned long addr,
99395ee3f7b4accc Steven Price 2020-06-01  207  		      int level, u64 val)
59c4da8640ccf472 Zong Li      2020-03-12  208  {
59c4da8640ccf472 Zong Li      2020-03-12  209  	struct pg_state *st = container_of(pt_st, struct pg_state, ptdump);
59c4da8640ccf472 Zong Li      2020-03-12 @210  	u64 pa = PFN_PHYS(pte_pfn(__pte(val)));
59c4da8640ccf472 Zong Li      2020-03-12  211  	u64 prot = 0;
59c4da8640ccf472 Zong Li      2020-03-12  212  
59c4da8640ccf472 Zong Li      2020-03-12  213  	if (level >= 0)
59c4da8640ccf472 Zong Li      2020-03-12  214  		prot = val & pg_level[level].mask;
59c4da8640ccf472 Zong Li      2020-03-12  215  
59c4da8640ccf472 Zong Li      2020-03-12  216  	if (st->level == -1) {
59c4da8640ccf472 Zong Li      2020-03-12  217  		st->level = level;
59c4da8640ccf472 Zong Li      2020-03-12  218  		st->current_prot = prot;
59c4da8640ccf472 Zong Li      2020-03-12  219  		st->start_address = addr;
59c4da8640ccf472 Zong Li      2020-03-12  220  		st->start_pa = pa;
59c4da8640ccf472 Zong Li      2020-03-12  221  		st->last_pa = pa;
59c4da8640ccf472 Zong Li      2020-03-12  222  		pt_dump_seq_printf(st->seq, "---[ %s ]---\n", st->marker->name);
59c4da8640ccf472 Zong Li      2020-03-12  223  	} else if (prot != st->current_prot ||
59c4da8640ccf472 Zong Li      2020-03-12  224  		   level != st->level || addr >= st->marker[1].start_address) {
59c4da8640ccf472 Zong Li      2020-03-12  225  		if (st->current_prot) {
59c4da8640ccf472 Zong Li      2020-03-12  226  			note_prot_wx(st, addr);
59c4da8640ccf472 Zong Li      2020-03-12  227  			dump_addr(st, addr);
59c4da8640ccf472 Zong Li      2020-03-12  228  			dump_prot(st);
59c4da8640ccf472 Zong Li      2020-03-12  229  			pt_dump_seq_puts(st->seq, "\n");
59c4da8640ccf472 Zong Li      2020-03-12  230  		}
59c4da8640ccf472 Zong Li      2020-03-12  231  
59c4da8640ccf472 Zong Li      2020-03-12  232  		while (addr >= st->marker[1].start_address) {
59c4da8640ccf472 Zong Li      2020-03-12  233  			st->marker++;
59c4da8640ccf472 Zong Li      2020-03-12  234  			pt_dump_seq_printf(st->seq, "---[ %s ]---\n",
59c4da8640ccf472 Zong Li      2020-03-12  235  					   st->marker->name);
59c4da8640ccf472 Zong Li      2020-03-12  236  		}
59c4da8640ccf472 Zong Li      2020-03-12  237  
59c4da8640ccf472 Zong Li      2020-03-12  238  		st->start_address = addr;
59c4da8640ccf472 Zong Li      2020-03-12  239  		st->start_pa = pa;
59c4da8640ccf472 Zong Li      2020-03-12  240  		st->last_pa = pa;
59c4da8640ccf472 Zong Li      2020-03-12  241  		st->current_prot = prot;
59c4da8640ccf472 Zong Li      2020-03-12  242  		st->level = level;
59c4da8640ccf472 Zong Li      2020-03-12  243  	} else {
59c4da8640ccf472 Zong Li      2020-03-12  244  		st->last_pa = pa;
59c4da8640ccf472 Zong Li      2020-03-12  245  	}
59c4da8640ccf472 Zong Li      2020-03-12  246  }
59c4da8640ccf472 Zong Li      2020-03-12  247  

:::::: The code at line 210 was first introduced by commit
:::::: 59c4da8640ccf4721d54d36835706f3eefb521a4 riscv: Add support to dump the kernel page tables

:::::: TO: Zong Li <zong.li@sifive.com>
:::::: CC: Palmer Dabbelt <palmerdabbelt@google.com>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 19428 bytes --]

                 reply	other threads:[~2021-01-12 23:55 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=202101130728.Wg0QN66f-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.