Hi Christophe,

I love your patch! Perhaps something to improve:

[auto build test WARNING on powerpc/next]
[also build test WARNING on v5.8 next-20200806]
[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]

url:    
https://github.com/0day-ci/linux/commits/Christophe-Leroy/powerpc-mm-sanity_check_fault-should-work-for-all-not-only-BOOK3S/20200807-012433
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
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
        # 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: kernel test robot <l...@intel.com>

All warnings (new ones prefixed by >>):

>> arch/powerpc/mm/fault.c:567:6: warning: no previous prototype for 
>> '__bad_page_fault' [-Wmissing-prototypes]
     567 | void __bad_page_fault(struct pt_regs *regs, unsigned long address, 
int sig)
         |      ^~~~~~~~~~~~~~~~

vim +/__bad_page_fault +567 arch/powerpc/mm/fault.c

   561  
   562  /*
   563   * bad_page_fault is called when we have a bad access from the kernel.
   564   * It is called from the DSI and ISI handlers in head.S and from some
   565   * of the procedures in traps.c.
   566   */
 > 567  void __bad_page_fault(struct pt_regs *regs, unsigned long address, int 
 > sig)
   568  {
   569          int is_write = page_fault_is_write(regs->dsisr);
   570  
   571          /* kernel has accessed a bad area */
   572  
   573          switch (TRAP(regs)) {
   574          case 0x300:
   575          case 0x380:
   576          case 0xe00:
   577                  pr_alert("BUG: %s on %s at 0x%08lx\n",
   578                           regs->dar < PAGE_SIZE ? "Kernel NULL pointer 
dereference" :
   579                           "Unable to handle kernel data access",
   580                           is_write ? "write" : "read", regs->dar);
   581                  break;
   582          case 0x400:
   583          case 0x480:
   584                  pr_alert("BUG: Unable to handle kernel instruction 
fetch%s",
   585                           regs->nip < PAGE_SIZE ? " (NULL pointer?)\n" : 
"\n");
   586                  break;
   587          case 0x600:
   588                  pr_alert("BUG: Unable to handle kernel unaligned access 
at 0x%08lx\n",
   589                           regs->dar);
   590                  break;
   591          default:
   592                  pr_alert("BUG: Unable to handle unknown paging fault at 
0x%08lx\n",
   593                           regs->dar);
   594                  break;
   595          }
   596          printk(KERN_ALERT "Faulting instruction address: 0x%08lx\n",
   597                  regs->nip);
   598  
   599          if (task_stack_end_corrupted(current))
   600                  printk(KERN_ALERT "Thread overran stack, or stack 
corrupted\n");
   601  
   602          die("Kernel access of bad area", regs, sig);
   603  }
   604  

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

Attachment: .config.gz
Description: application/gzip

Reply via email to