public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Heiko Carstens <hca@linux.ibm.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Miguel Ojeda <ojeda@kernel.org>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Juergen Christ <jchrist@linux.ibm.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	Sven Schnelle <svens@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>
Subject: Re: [PATCH 2/3] s390/bitops: Limit return value range of __flogr()
Date: Thu, 11 Sep 2025 21:24:22 +0800	[thread overview]
Message-ID: <202509112018.eZI47cSy-lkp@intel.com> (raw)
In-Reply-To: <20250910151216.646600-3-hca@linux.ibm.com>

Hi Heiko,

kernel test robot noticed the following build errors:

[auto build test ERROR on s390/features]
[also build test ERROR on next-20250911]
[cannot apply to linus/master v6.17-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Heiko-Carstens/Compiler-Attributes-Add-__assume-macro/20250910-231949
base:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
patch link:    https://lore.kernel.org/r/20250910151216.646600-3-hca%40linux.ibm.com
patch subject: [PATCH 2/3] s390/bitops: Limit return value range of __flogr()
config: s390-randconfig-002-20250911 (https://download.01.org/0day-ci/archive/20250911/202509112018.eZI47cSy-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250911/202509112018.eZI47cSy-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/202509112018.eZI47cSy-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from kernel/bounds.c:13:
   In file included from include/linux/log2.h:12:
   In file included from include/linux/bitops.h:67:
>> arch/s390/include/asm/bitops.h:174:3: error: '__assume__' attribute cannot be applied to a statement
                   __assume(bit <= 64);
                   ^                  ~
   include/linux/compiler_attributes.h:68:56: note: expanded from macro '__assume'
   # define __assume(expr)                 __attribute__((__assume__(expr)))
                                                          ^
   1 error generated.
   make[3]: *** [scripts/Makefile.build:182: kernel/bounds.s] Error 1 shuffle=1723937077
   make[3]: Target 'prepare' not remade because of errors.
   make[2]: *** [Makefile:1282: prepare0] Error 2 shuffle=1723937077
   make[2]: Target 'prepare' not remade because of errors.
   make[1]: *** [Makefile:248: __sub-make] Error 2 shuffle=1723937077
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:248: __sub-make] Error 2 shuffle=1723937077
   make: Target 'prepare' not remade because of errors.


vim +/__assume__ +174 arch/s390/include/asm/bitops.h

   124	
   125	/**
   126	 * __flogr - find leftmost one
   127	 * @word - The word to search
   128	 *
   129	 * Returns the bit number of the most significant bit set,
   130	 * where the most significant bit has bit number 0.
   131	 * If no bit is set this function returns 64.
   132	 */
   133	static __always_inline __attribute_const__ unsigned long __flogr(unsigned long word)
   134	{
   135		unsigned long bit;
   136	
   137		if (__builtin_constant_p(word)) {
   138			bit = 0;
   139			if (!word)
   140				return 64;
   141			if (!(word & 0xffffffff00000000UL)) {
   142				word <<= 32;
   143				bit += 32;
   144			}
   145			if (!(word & 0xffff000000000000UL)) {
   146				word <<= 16;
   147				bit += 16;
   148			}
   149			if (!(word & 0xff00000000000000UL)) {
   150				word <<= 8;
   151				bit += 8;
   152			}
   153			if (!(word & 0xf000000000000000UL)) {
   154				word <<= 4;
   155				bit += 4;
   156			}
   157			if (!(word & 0xc000000000000000UL)) {
   158				word <<= 2;
   159				bit += 2;
   160			}
   161			if (!(word & 0x8000000000000000UL)) {
   162				word <<= 1;
   163				bit += 1;
   164			}
   165			return bit;
   166		} else {
   167			union register_pair rp __uninitialized;
   168	
   169			rp.even = word;
   170			asm volatile(
   171				"       flogr   %[rp],%[rp]\n"
   172				: [rp] "+d" (rp.pair) : : "cc");
   173			bit = rp.even;
 > 174			__assume(bit <= 64);
   175			return bit & 127;
   176		}
   177	}
   178	

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

  parent reply	other threads:[~2025-09-11 13:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 15:12 [PATCH 0/3] s390: Fix and optimize __flogr() inline assembly Heiko Carstens
2025-09-10 15:12 ` [PATCH 1/3] Compiler Attributes: Add __assume macro Heiko Carstens
2025-09-11  1:32   ` Nathan Chancellor
2025-09-11 14:56     ` Heiko Carstens
2025-09-11 18:44       ` Nathan Chancellor
2025-09-11 19:04         ` Miguel Ojeda
2025-09-11 20:42           ` Nathan Chancellor
2025-09-11 18:56     ` Miguel Ojeda
2025-09-11 18:59   ` Miguel Ojeda
2025-09-12 10:25     ` Heiko Carstens
2025-09-10 15:12 ` [PATCH 2/3] s390/bitops: Limit return value range of __flogr() Heiko Carstens
2025-09-11  7:44   ` Juergen Christ
2025-09-11 13:24   ` kernel test robot [this message]
2025-09-10 15:12 ` [PATCH 3/3] s390/bitops: Remove volatile qualifier from flogr() inline assembly Heiko Carstens
2025-09-11  7:45   ` Juergen Christ

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=202509112018.eZI47cSy-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=jchrist@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=svens@linux.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox