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: <202203250727.JVrJokTk-lkp@intel.com>
Date:   Fri, 25 Mar 2022 07:41:21 +0800
From:   kernel test robot <lkp@...el.com>
To:     Ohad Sharabi <osharabi@...ana.ai>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Oded Gabbay <ogabbay@...nel.org>
Subject: [ogabbay:habanalabs-next 19/19]
 drivers/misc/habanalabs/common/firmware_if.c:860:28: sparse: sparse: cast to
 restricted __le32

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git habanalabs-next
head:   8893b113963d24b89844a072c968b042ae76aa46
commit: 8893b113963d24b89844a072c968b042ae76aa46 [19/19] habanalabs/gaudi: add debugfs to fetch internal sync status
config: i386-randconfig-s002 (https://download.01.org/0day-ci/archive/20220325/202203250727.JVrJokTk-lkp@intel.com/config)
compiler: gcc-9 (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git/commit/?id=8893b113963d24b89844a072c968b042ae76aa46
        git remote add ogabbay https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git
        git fetch --no-tags ogabbay habanalabs-next
        git checkout 8893b113963d24b89844a072c968b042ae76aa46
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/misc/

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


sparse warnings: (new ones prefixed by >>)
>> drivers/misc/habanalabs/common/firmware_if.c:860:28: sparse: sparse: cast to restricted __le32

vim +860 drivers/misc/habanalabs/common/firmware_if.c

   823	
   824	int hl_fw_get_monitor_dump(struct hl_device *hdev, void *data)
   825	{
   826		struct cpucp_monitor_dump *mon_dump_cpu_addr;
   827		dma_addr_t mon_dump_dma_addr;
   828		struct cpucp_packet pkt = {};
   829		u32 *src_ptr, *dst_ptr;
   830		size_t data_size;
   831		u64 result;
   832		int i, rc;
   833	
   834		data_size = sizeof(struct cpucp_monitor_dump);
   835		mon_dump_cpu_addr = hdev->asic_funcs->cpu_accessible_dma_pool_alloc(hdev, data_size,
   836											&mon_dump_dma_addr);
   837		if (!mon_dump_cpu_addr) {
   838			dev_err(hdev->dev,
   839				"Failed to allocate DMA memory for CPU-CP monitor-dump packet\n");
   840			return -ENOMEM;
   841		}
   842	
   843		memset(mon_dump_cpu_addr, 0, data_size);
   844	
   845		pkt.ctl = cpu_to_le32(CPUCP_PACKET_MONITOR_DUMP_GET << CPUCP_PKT_CTL_OPCODE_SHIFT);
   846		pkt.addr = cpu_to_le64(mon_dump_dma_addr);
   847		pkt.data_max_size = cpu_to_le32(data_size);
   848	
   849		rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
   850								HL_CPUCP_MON_DUMP_TIMEOUT_USEC, &result);
   851		if (rc) {
   852			dev_err(hdev->dev, "Failed to handle CPU-CP monitor-dump packet, error %d\n", rc);
   853			goto out;
   854		}
   855	
   856		/* result contains the actual size */
   857		src_ptr = (u32 *)mon_dump_cpu_addr;
   858		dst_ptr = data;
   859		for (i = 0; i < (data_size / sizeof(u32)); i++) {
 > 860			*dst_ptr = le32_to_cpu(*src_ptr);
   861			src_ptr++;
   862			dst_ptr++;
   863		}
   864	
   865	out:
   866		hdev->asic_funcs->cpu_accessible_dma_pool_free(hdev, data_size, mon_dump_cpu_addr);
   867	
   868		return rc;
   869	}
   870	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ