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]
Date:   Sat, 25 Jun 2022 10:58:14 +0800
From:   kernel test robot <lkp@...el.com>
To:     Yuri Nudelman <ynudelman@...ana.ai>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Oded Gabbay <ogabbay@...nel.org>
Subject: [ogabbay:gaudi2 30/36]
 drivers/misc/habanalabs/gaudi/gaudi.c:5778:33: sparse: sparse: incorrect
 type in assignment (different base types)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git gaudi2
head:   5bb2e42792471d81bfca831170896f13eefdadf6
commit: 08180539d730624c2b788d63fc6bd04fc02b15a4 [30/36] habanalabs/gaudi: fix a race condition causing DMAR error
config: i386-randconfig-s001
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-31-g4880bd19-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git/commit/?id=08180539d730624c2b788d63fc6bd04fc02b15a4
        git remote add ogabbay https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git
        git fetch --no-tags ogabbay gaudi2
        git checkout 08180539d730624c2b788d63fc6bd04fc02b15a4
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> drivers/misc/habanalabs/gaudi/gaudi.c:5778:33: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] ctl @@     got int @@
   drivers/misc/habanalabs/gaudi/gaudi.c:5778:33: sparse:     expected restricted __le32 [usertype] ctl
   drivers/misc/habanalabs/gaudi/gaudi.c:5778:33: sparse:     got int

vim +5778 drivers/misc/habanalabs/gaudi/gaudi.c

  5763	
  5764	static void gaudi_add_end_of_cb_packets(struct hl_device *hdev, void *kernel_address,
  5765					u32 len, u32 original_len, u64 cq_addr, u32 cq_val,
  5766					u32 msi_vec, bool eb)
  5767	{
  5768		struct gaudi_device *gaudi = hdev->asic_specific;
  5769		struct packet_msg_prot *cq_pkt;
  5770		struct packet_nop *cq_padding;
  5771		u64 msi_addr;
  5772		u32 tmp;
  5773	
  5774		cq_padding = kernel_address + original_len;
  5775		cq_pkt = kernel_address + len - (sizeof(struct packet_msg_prot) * 2);
  5776	
  5777		while ((void *)cq_padding < (void *)cq_pkt) {
> 5778			cq_padding->ctl = FIELD_PREP(GAUDI_PKT_CTL_OPCODE_MASK, PACKET_NOP);
  5779			cq_padding++;
  5780		}
  5781	
  5782		tmp = FIELD_PREP(GAUDI_PKT_CTL_OPCODE_MASK, PACKET_MSG_PROT);
  5783		tmp |= FIELD_PREP(GAUDI_PKT_CTL_MB_MASK, 1);
  5784	
  5785		if (eb)
  5786			tmp |= FIELD_PREP(GAUDI_PKT_CTL_EB_MASK, 1);
  5787	
  5788		cq_pkt->ctl = cpu_to_le32(tmp);
  5789		cq_pkt->value = cpu_to_le32(cq_val);
  5790		cq_pkt->addr = cpu_to_le64(cq_addr);
  5791	
  5792		cq_pkt++;
  5793	
  5794		tmp = FIELD_PREP(GAUDI_PKT_CTL_OPCODE_MASK, PACKET_MSG_PROT);
  5795		tmp |= FIELD_PREP(GAUDI_PKT_CTL_MB_MASK, 1);
  5796		cq_pkt->ctl = cpu_to_le32(tmp);
  5797		cq_pkt->value = cpu_to_le32(1);
  5798	
  5799		if (gaudi->multi_msi_mode)
  5800			msi_addr = mmPCIE_MSI_INTR_0 + msi_vec * 4;
  5801		else
  5802			msi_addr = mmPCIE_CORE_MSI_REQ;
  5803	
  5804		cq_pkt->addr = cpu_to_le64(CFG_BASE + msi_addr);
  5805	}
  5806	

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ