Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [jgunthorpe:iommu_pt_all 48/62] drivers/iommu/generic_pt/fmt/../iommu_pt.h:1407:15: warning: result of comparison of constant 18446744073709551615 with expression of type 'pt_vaddr_t' (aka 'unsigned int') is always false
@ 2025-06-17 10:22 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-06-17 10:22 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/jgunthorpe/linux iommu_pt_all
head:   95229c50e3ce2b6ecb8126b5f765996c1b73f4c1
commit: b5ab032ccb1dde4c53ef839f2260e48a1b701ec8 [48/62] iommupt: Add the 32 bit ARMv7s page table format
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250617/202506171801.prNmVQ9a-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250617/202506171801.prNmVQ9a-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506171801.prNmVQ9a-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/iommu/generic_pt/fmt/iommu_armv7s.c:11:
   In file included from drivers/iommu/generic_pt/fmt/iommu_template.h:40:
>> drivers/iommu/generic_pt/fmt/../iommu_pt.h:1407:15: warning: result of comparison of constant 18446744073709551615 with expression of type 'pt_vaddr_t' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
    1407 |             range.va > ULONG_MAX)
         |             ~~~~~~~~ ^ ~~~~~~~~~
   1 warning generated.


vim +1407 drivers/iommu/generic_pt/fmt/../iommu_pt.h

c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1383  
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1384  static int pt_iommu_init_domain(struct pt_iommu *iommu_table,
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1385  				struct iommu_domain *domain)
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1386  {
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1387  	struct pt_common *common = common_from_iommu(iommu_table);
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1388  	struct pt_iommu_info info;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1389  	struct pt_range range;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1390  
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1391  	NS(get_info)(iommu_table, &info);
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1392  
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1393  	domain->type = __IOMMU_DOMAIN_PAGING;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1394  	domain->pgsize_bitmap = info.pgsize_bitmap;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1395  
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1396  	if (pt_feature(common, PT_FEAT_DYNAMIC_TOP))
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1397  		range = _pt_top_range(common,
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1398  				      _pt_top_set(NULL, PT_MAX_TOP_LEVEL));
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1399  	else
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1400  		range = pt_top_range(common);
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1401  
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1402  	/*
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1403  	 * A 64 bit high address space table on a 32 bit system cannot work.
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1404  	 */
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1405  	domain->geometry.aperture_start = (unsigned long)range.va;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1406  	if ((pt_vaddr_t)domain->geometry.aperture_start != range.va ||
c4cba9b274fd58 Jason Gunthorpe 2025-02-04 @1407  	    range.va > ULONG_MAX)
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1408  		return -EOVERFLOW;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1409  
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1410  	/*
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1411  	 * The aperture is limited to what the API can do after considering all
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1412  	 * the different types dma_addr_t/unsigned long/pt_vaddr_t that are used
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1413  	 * to store a VA. Set the aperture to something that is valid for all
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1414  	 * cases. Saturate instead of truncate the end if the types are smaller
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1415  	 * than the top range. aperture_end is a last.
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1416  	 */
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1417  	domain->geometry.aperture_end = (unsigned long)range.last_va;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1418  	if ((pt_vaddr_t)domain->geometry.aperture_end != range.last_va) {
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1419  		domain->geometry.aperture_end = ULONG_MAX;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1420  		domain->pgsize_bitmap &= ULONG_MAX;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1421  	}
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1422  	domain->geometry.force_aperture = true;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1423  
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1424  	return 0;
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1425  }
c4cba9b274fd58 Jason Gunthorpe 2025-02-04  1426  

:::::: The code at line 1407 was first introduced by commit
:::::: c4cba9b274fd586da4c847940a5498bd78d10443 iommupt: Add the basic structure of the iommu implementation

:::::: TO: Jason Gunthorpe <jgg@nvidia.com>
:::::: CC: Jason Gunthorpe <jgg@nvidia.com>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-06-17 10:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-17 10:22 [jgunthorpe:iommu_pt_all 48/62] drivers/iommu/generic_pt/fmt/../iommu_pt.h:1407:15: warning: result of comparison of constant 18446744073709551615 with expression of type 'pt_vaddr_t' (aka 'unsigned int') is always false kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox