lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210250836.t7VFu69x-lkp@intel.com>
Date:   Tue, 25 Oct 2022 08:56:26 +0800
From:   kernel test robot <lkp@...el.com>
To:     Dave Jiang <dave.jiang@...el.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [djiang:cxl-rch-robert 19/19] drivers/cxl/mem.c:94:30: warning:
 format '%llx' expects argument of type 'long long unsigned int', but
 argument 5 has type 'resource_size_t' {aka 'unsigned int'}

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djiang/linux.git cxl-rch-robert
head:   2e32c54b5df3415f98a8d4593a6ae0786748939f
commit: 2e32c54b5df3415f98a8d4593a6ae0786748939f [19/19] debug
config: parisc-allyesconfig
compiler: hppa-linux-gcc (GCC) 12.1.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
        # https://git.kernel.org/pub/scm/linux/kernel/git/djiang/linux.git/commit/?id=2e32c54b5df3415f98a8d4593a6ae0786748939f
        git remote add djiang https://git.kernel.org/pub/scm/linux/kernel/git/djiang/linux.git
        git fetch --no-tags djiang cxl-rch-robert
        git checkout 2e32c54b5df3415f98a8d4593a6ae0786748939f
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash drivers/

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/printk.h:566,
                    from include/linux/kernel.h:29,
                    from arch/parisc/include/asm/bug.h:5,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:13,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/parisc/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/spinlock.h:56,
                    from include/linux/wait.h:9,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from include/linux/debugfs.h:15,
                    from drivers/cxl/mem.c:3:
   drivers/cxl/mem.c: In function 'cxl_mem_probe':
>> drivers/cxl/mem.c:94:30: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
      94 |                 dev_dbg(dev, "dport %s rcrb_phys: %#llx\n",
         |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dynamic_debug.h:223:29: note: in definition of macro '__dynamic_func_call_cls'
     223 |                 func(&id, ##__VA_ARGS__);                       \
         |                             ^~~~~~~~~~~
   include/linux/dynamic_debug.h:249:9: note: in expansion of macro '_dynamic_func_call_cls'
     249 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
         |         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/dynamic_debug.h:272:9: note: in expansion of macro '_dynamic_func_call'
     272 |         _dynamic_func_call(fmt, __dynamic_dev_dbg,              \
         |         ^~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:155:9: note: in expansion of macro 'dynamic_dev_dbg'
     155 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~~~~~~~
   include/linux/dev_printk.h:155:30: note: in expansion of macro 'dev_fmt'
     155 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                              ^~~~~~~
   drivers/cxl/mem.c:94:17: note: in expansion of macro 'dev_dbg'
      94 |                 dev_dbg(dev, "dport %s rcrb_phys: %#llx\n",
         |                 ^~~~~~~
   drivers/cxl/mem.c:94:55: note: format string is defined here
      94 |                 dev_dbg(dev, "dport %s rcrb_phys: %#llx\n",
         |                                                   ~~~~^
         |                                                       |
         |                                                       long long unsigned int
         |                                                   %#x


vim +94 drivers/cxl/mem.c

    47	
    48	static int cxl_mem_probe(struct device *dev)
    49	{
    50		struct cxl_memdev *cxlmd = to_cxl_memdev(dev);
    51		struct cxl_dev_state *cxlds = cxlmd->cxlds;
    52		struct cxl_port *parent_port;
    53		struct cxl_dport *dport;
    54		struct dentry *dentry;
    55		int rc;
    56	
    57		/*
    58		 * Someone is trying to reattach this device after it lost its port
    59		 * connection (an endpoint port previously registered by this memdev was
    60		 * disabled). This racy check is ok because if the port is still gone,
    61		 * no harm done, and if the port hierarchy comes back it will re-trigger
    62		 * this probe. Port rescan and memdev detach work share the same
    63		 * single-threaded workqueue.
    64		 */
    65		if (work_pending(&cxlmd->detach_work))
    66			return -EBUSY;
    67	
    68		dentry = cxl_debugfs_create_dir(dev_name(dev));
    69		debugfs_create_devm_seqfile(dev, "dpamem", dentry, cxl_mem_dpa_show);
    70		rc = devm_add_action_or_reset(dev, remove_debugfs, dentry);
    71		if (rc)
    72			return rc;
    73	
    74		rc = devm_cxl_enumerate_ports(cxlmd);
    75		if (rc)
    76			return rc;
    77	
    78		parent_port = cxl_mem_find_port(cxlmd, &dport);
    79		if (!parent_port) {
    80			dev_err(dev, "CXL port topology not found\n");
    81			return -ENXIO;
    82		}
    83	
    84		device_lock(&parent_port->dev);
    85		if (!parent_port->dev.driver) {
    86			dev_err(dev, "CXL port topology %s not enabled\n",
    87				dev_name(&parent_port->dev));
    88			rc = -ENXIO;
    89			goto unlock;
    90		}
    91	
    92		if (cxlds->is_restricted) {
    93			dev_dbg(dev, "cxlds->is_restricted\n");
  > 94			dev_dbg(dev, "dport %s rcrb_phys: %#llx\n",
    95					dev_name(dport->dport), dport->restricted_rcrb_phys);
    96			dev_dbg(dev, "dport parent: %s\n", dev_name(dport->dport->parent));
    97			cxlds->component_reg_phys =
    98				cxl_get_rcrb_component_phys(&cxlmd->dev,
    99							    dport->restricted_rcrb_phys,
   100							    CXL_RCRB_SIZE, CXL_RRCRB_UPSTREAM);
   101		} else {
   102			dev_dbg(dev, "Why is device not restricted?\n");
   103		}
   104	
   105		rc = devm_cxl_add_endpoint(cxlmd, dport);
   106	unlock:
   107		device_unlock(&parent_port->dev);
   108		put_device(&parent_port->dev);
   109		if (rc)
   110			return rc;
   111	
   112		/*
   113		 * The kernel may be operating out of CXL memory on this device,
   114		 * there is no spec defined way to determine whether this device
   115		 * preserves contents over suspend, and there is no simple way
   116		 * to arrange for the suspend image to avoid CXL memory which
   117		 * would setup a circular dependency between PCI resume and save
   118		 * state restoration.
   119		 *
   120		 * TODO: support suspend when all the regions this device is
   121		 * hosting are locked and covered by the system address map,
   122		 * i.e. platform firmware owns restoring the HDM configuration
   123		 * that it locked.
   124		 */
   125		cxl_mem_active_inc();
   126		return devm_add_action_or_reset(dev, enable_suspend, NULL);
   127	}
   128	

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

View attachment "config" of type "text/plain" (315960 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ