All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [jgunthorpe:iommu_pt_all 51/68] drivers/iommu/generic_pt/fmt/../kunit_generic_pt.h:447:20: warning: result of comparison of constant 280375465082880 with expression of type 'pt_vaddr_t' (aka 'unsigned int') is always true
Date: Thu, 1 May 2025 12:14:56 +0800	[thread overview]
Message-ID: <202505011237.MVSM07S7-lkp@intel.com> (raw)

tree:   https://github.com/jgunthorpe/linux iommu_pt_all
head:   e09ae4f9b47677554bf952d7c55a9e2c6ade90f8
commit: b7940ba758888328030d3a1338bf11836b963f3f [51/68] iommupt: Add the 32 bit ARMv7s page table format
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250501/202505011237.MVSM07S7-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/20250501/202505011237.MVSM07S7-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/202505011237.MVSM07S7-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:46:
>> drivers/iommu/generic_pt/fmt/../kunit_generic_pt.h:447:20: warning: result of comparison of constant 280375465082880 with expression of type 'pt_vaddr_t' (aka 'unsigned int') is always true [-Wtautological-constant-out-of-range-compare]
     447 |         if (pgsize_bitmap != 0xff0000000000 ||
         |             ~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
   1 warning generated.


vim +447 drivers/iommu/generic_pt/fmt/../kunit_generic_pt.h

4c3d5787e1c95a Jason Gunthorpe 2024-06-28  425  
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  426  static void test_lvl_possible_sizes(struct kunit *test, struct pt_state *pts,
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  427  				    void *arg)
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  428  {
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  429  	unsigned int num_items_lg2 = safe_pt_num_items_lg2(pts);
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  430  	pt_vaddr_t pgsize_bitmap = pt_possible_sizes(pts);
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  431  	unsigned int isz_lg2 = pt_table_item_lg2sz(pts);
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  432  
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  433  	if (!pt_can_have_leaf(pts)) {
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  434  		KUNIT_ASSERT_EQ(test, pgsize_bitmap, 0);
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  435  		return;
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  436  	}
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  437  
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  438  	/* No bits for sizes that would be outside this table */
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  439  	KUNIT_ASSERT_EQ(test, log2_mod(pgsize_bitmap, isz_lg2), 0);
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  440  	KUNIT_ASSERT_EQ(
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  441  		test, fvalog2_div(pgsize_bitmap, num_items_lg2 + isz_lg2), 0);
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  442  
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  443  	/*
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  444  	 * Non contiguous must be supported. AMDv1 has a HW bug where it does
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  445  	 * not support it on one of the levels.
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  446  	 */
4c3d5787e1c95a Jason Gunthorpe 2024-06-28 @447  	if (pgsize_bitmap != 0xff0000000000 ||
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  448  	    strcmp(__stringify(PTPFX_RAW), "amdv1") != 0)
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  449  		KUNIT_ASSERT_TRUE(test, pgsize_bitmap & log2_to_int(isz_lg2));
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  450  	else
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  451  		KUNIT_ASSERT_NE(test, pgsize_bitmap, 0);
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  452  
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  453  	/* A contiguous entry should not span the whole table */
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  454  	if (num_items_lg2 + isz_lg2 != PT_VADDR_MAX_LG2)
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  455  		KUNIT_ASSERT_FALSE(
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  456  			test,
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  457  			pgsize_bitmap & log2_to_int(num_items_lg2 + isz_lg2));
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  458  }
4c3d5787e1c95a Jason Gunthorpe 2024-06-28  459  

:::::: The code at line 447 was first introduced by commit
:::::: 4c3d5787e1c95a17df00e741ab31c913ad08433e iommupt: Add a kunit test for Generic Page Table

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

                 reply	other threads:[~2025-05-01  4:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202505011237.MVSM07S7-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jgg@nvidia.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@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.