All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: alison.schofield@intel.com
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [PATCH v3 2/3] cxl/acpi: Support CXL XOR Interleave Math (CXIMS)
Date: Fri, 16 Sep 2022 13:13:02 +0800	[thread overview]
Message-ID: <202209161334.7i460KDI-lkp@intel.com> (raw)
In-Reply-To: <6cbe113e3aebc732d10cb77a316f547b581f22fa.1663291370.git.alison.schofield@intel.com>

Hi,

I love your patch! Perhaps something to improve:

[auto build test WARNING on 1cd8a2537eb07751d405ab7e2223f20338a90506]

url:    https://github.com/intel-lab-lkp/linux/commits/alison-schofield-intel-com/CXL-XOR-Interleave-Arithmetic/20220916-093308
base:   1cd8a2537eb07751d405ab7e2223f20338a90506
config: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20220916/202209161334.7i460KDI-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/52526703ddd3faa831e99eb2d778d5692aac43ee
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review alison-schofield-intel-com/CXL-XOR-Interleave-Arithmetic/20220916-093308
        git checkout 52526703ddd3faa831e99eb2d778d5692aac43ee
        # 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=i386 SHELL=/bin/bash drivers/cxl/

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 >>):

>> drivers/cxl/acpi.c:56:10: warning: shift count is negative [-Wshift-count-negative]
                   mask = GENMASK(51, eiw + ig);
                          ^~~~~~~~~~~~~~~~~~~~~
   include/linux/bits.h:38:31: note: expanded from macro 'GENMASK'
           (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
                                        ^~~~~~~~~~~~~~~
   include/linux/bits.h:36:11: note: expanded from macro '__GENMASK'
            (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
                    ^  ~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +56 drivers/cxl/acpi.c

    16	
    17	/*
    18	 * Find a targets entry (n) in the host bridge interleave list.
    19	 * CXL Specfication 3.0 Table 9-22
    20	 */
    21	static struct cxl_dport *cxl_hb_xor(struct cxl_root_decoder *cxlrd, int pos)
    22	{
    23		struct cxl_switch_decoder *cxlsd = &cxlrd->cxlsd;
    24		struct cxims_data *cximsd = cxlrd->platform_data;
    25		struct cxl_decoder *cxld = &cxlsd->cxld;
    26		int ig = cxld->interleave_granularity;
    27		int iw = cxld->interleave_ways;
    28		int i, eiw, n = 0;
    29		u64 hpa, mask;
    30	
    31		if (dev_WARN_ONCE(&cxld->dev,
    32				  cxld->interleave_ways != cxlsd->nr_targets,
    33				  "misconfigured root decoder\n"))
    34			return NULL;
    35	
    36		if (iw == 1)
    37			/* Entry is always 0 for no interleave */
    38			return cxlrd->cxlsd.target[0];
    39	
    40		hpa = cxlrd->res->start + pos * ig;
    41	
    42		if (iw == 3) {
    43			/* Initialize 'i' for the modulo calc */
    44			i = 0;
    45			goto no_map;
    46		}
    47	
    48		/* IW: 2,4,6,8,12,16 begin building 'n' using xormaps */
    49		for (i = 0; i < cximsd->nr_maps; i++)
    50			n |= (hweight64(hpa & cximsd->xormaps[i]) & 1) << i;
    51	
    52	no_map:
    53		/* IW: 3,6,12 add a modulo calculation to 'n' */
    54		if (!is_power_of_2(iw)) {
    55			eiw = ilog2(iw / 3) + 8;
  > 56			mask = GENMASK(51, eiw + ig);
    57			n |= (hpa & mask) % 3 << i;
    58		}
    59	
    60		return cxlrd->cxlsd.target[n];
    61	}
    62	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

  reply	other threads:[~2022-09-16  5:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  1:30 [PATCH v3 0/3] CXL XOR Interleave Arithmetic alison.schofield
2022-09-16  1:30 ` [PATCH v3 1/3] For ACPICA: Add the CXIMS structure definition to the CEDT table alison.schofield
2022-09-16  1:30 ` [PATCH v3 2/3] cxl/acpi: Support CXL XOR Interleave Math (CXIMS) alison.schofield
2022-09-16  5:13   ` kernel test robot [this message]
2022-09-16 16:26   ` Alison Schofield
2022-09-16  1:30 ` [PATCH v3 3/3] tools/testing/cxl: Add XOR math support alison.schofield

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=202209161334.7i460KDI-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=llvm@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 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.