public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Asahi Lina <lina@asahilina.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH] soc: apple: rtkit: Add register dump decoding to crashlog
Date: Sat, 21 Jan 2023 20:13:36 +0800	[thread overview]
Message-ID: <202301212059.d4SZVT2X-lkp@intel.com> (raw)
In-Reply-To: <20230121073741.3807-1-lina@asahilina.net>

Hi Asahi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on soc/for-next]
[also build test WARNING on linus/master v6.2-rc4]
[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/Asahi-Lina/soc-apple-rtkit-Add-register-dump-decoding-to-crashlog/20230121-153927
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link:    https://lore.kernel.org/r/20230121073741.3807-1-lina%40asahilina.net
patch subject: [PATCH] soc: apple: rtkit: Add register dump decoding to crashlog
config: hexagon-randconfig-r041-20230119 (https://download.01.org/0day-ci/archive/20230121/202301212059.d4SZVT2X-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 4196ca3278f78c6e19246e54ab0ecb364e37d66a)
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
        # https://github.com/intel-lab-lkp/linux/commit/91f957dc74ca87a8e0e90a39acac9a4fed0af526
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Asahi-Lina/soc-apple-rtkit-Add-register-dump-decoding-to-crashlog/20230121-153927
        git checkout 91f957dc74ca87a8e0e90a39acac9a4fed0af526
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/soc/apple/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from drivers/soc/apple/rtkit-crashlog.c:6:
   In file included from drivers/soc/apple/rtkit-internal.h:14:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                                                     ^
   In file included from drivers/soc/apple/rtkit-crashlog.c:6:
   In file included from drivers/soc/apple/rtkit-internal.h:14:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                                                     ^
   In file included from drivers/soc/apple/rtkit-crashlog.c:6:
   In file included from drivers/soc/apple/rtkit-internal.h:14:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
>> drivers/soc/apple/rtkit-crashlog.c:124:62: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
                   dev_warn(rtk->dev, "RTKit: Regs section too small: 0x%lx", size);
                                                                        ~~~   ^~~~
                                                                        %zx
   include/linux/dev_printk.h:146:70: note: expanded from macro 'dev_warn'
           dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
                                                                       ~~~     ^~~~~~~~~~~
   include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
                   _p_func(dev, fmt, ##__VA_ARGS__);                       \
                                ~~~    ^~~~~~~~~~~
   drivers/soc/apple/rtkit-crashlog.c:130:21: error: use of undeclared identifier 'PSR_MODE_MASK'
           switch (regs.psr & PSR_MODE_MASK) {
                              ^
   drivers/soc/apple/rtkit-crashlog.c:131:7: error: use of undeclared identifier 'PSR_MODE_EL0t'
           case PSR_MODE_EL0t:
                ^
   drivers/soc/apple/rtkit-crashlog.c:134:7: error: use of undeclared identifier 'PSR_MODE_EL1t'
           case PSR_MODE_EL1t:
                ^
   drivers/soc/apple/rtkit-crashlog.c:137:7: error: use of undeclared identifier 'PSR_MODE_EL1h'
           case PSR_MODE_EL1h:
                ^
   drivers/soc/apple/rtkit-crashlog.c:140:7: error: use of undeclared identifier 'PSR_MODE_EL2t'
           case PSR_MODE_EL2t:
                ^
   drivers/soc/apple/rtkit-crashlog.c:143:7: error: use of undeclared identifier 'PSR_MODE_EL2h'
           case PSR_MODE_EL2h:
                ^
   7 warnings and 6 errors generated.


vim +124 drivers/soc/apple/rtkit-crashlog.c

   115	
   116	static void apple_rtkit_crashlog_dump_regs(struct apple_rtkit *rtk, u8 *bfr,
   117						   size_t size)
   118	{
   119		struct apple_rtkit_crashlog_regs regs;
   120		const char *el;
   121		int i;
   122	
   123		if (size < sizeof(regs)) {
 > 124			dev_warn(rtk->dev, "RTKit: Regs section too small: 0x%lx", size);
   125			return;
   126		}
   127	
   128		memcpy(&regs, bfr, sizeof(regs));
   129	
   130		switch (regs.psr & PSR_MODE_MASK) {
   131		case PSR_MODE_EL0t:
   132			el = "EL0t";
   133			break;
   134		case PSR_MODE_EL1t:
   135			el = "EL1t";
   136			break;
   137		case PSR_MODE_EL1h:
   138			el = "EL1h";
   139			break;
   140		case PSR_MODE_EL2t:
   141			el = "EL2t";
   142			break;
   143		case PSR_MODE_EL2h:
   144			el = "EL2h";
   145			break;
   146		default:
   147			el = "unknown";
   148			break;
   149		}
   150	
   151		dev_warn(rtk->dev, "RTKit: Exception dump:");
   152		dev_warn(rtk->dev, "  == Exception taken from %s ==", el);
   153		dev_warn(rtk->dev, "  PSR    = 0x%llx", regs.psr);
   154		dev_warn(rtk->dev, "  PC     = 0x%llx\n", regs.pc);
   155		dev_warn(rtk->dev, "  ESR    = 0x%llx\n", regs.esr);
   156		dev_warn(rtk->dev, "  FAR    = 0x%llx\n", regs.far);
   157		dev_warn(rtk->dev, "  SP     = 0x%llx\n", regs.sp);
   158		dev_warn(rtk->dev, "\n");
   159	
   160		for (i = 0; i < 31; i += 4) {
   161			if (i < 28)
   162				dev_warn(rtk->dev,
   163						 "  x%02d-x%02d = %016llx %016llx %016llx %016llx\n",
   164						 i, i + 3,
   165						 regs.regs[i], regs.regs[i + 1],
   166						 regs.regs[i + 2], regs.regs[i + 3]);
   167			else
   168				dev_warn(rtk->dev,
   169						 "  x%02d-x%02d = %016llx %016llx %016llx\n", i, i + 3,
   170						 regs.regs[i], regs.regs[i + 1], regs.regs[i + 2]);
   171		}
   172	
   173		dev_warn(rtk->dev, "\n");
   174	}
   175	

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

           reply	other threads:[~2023-01-21 12:14 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20230121073741.3807-1-lina@asahilina.net>]

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=202301212059.d4SZVT2X-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=lina@asahilina.net \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox