All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: arch/powerpc/include/asm/mmu.h:230 early_mmu_has_feature() warn: bitwise AND condition is false here
Date: Mon, 26 Apr 2021 00:40:29 +0800	[thread overview]
Message-ID: <202104260024.sL70zMlm-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 5320 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Christophe Leroy <christophe.leroy@csgroup.eu>
CC: Michael Ellerman <mpe@ellerman.id.au>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2a1d7946fa53cea2083e5981ff55a8176ab2be6b
commit: f9158d58a4e1d91f21741e4e8ebe67f770b84e12 powerpc/mm: Add mask of always present MMU features
date:   5 months ago
:::::: branch date: 24 hours ago
:::::: commit date: 5 months ago
config: powerpc-randconfig-m031-20210425 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
arch/powerpc/include/asm/mmu.h:230 early_mmu_has_feature() warn: bitwise AND condition is false here
arch/powerpc/include/asm/mmu.h:261 mmu_has_feature() warn: bitwise AND condition is false here
arch/powerpc/include/asm/mmu.h:230 early_mmu_has_feature() warn: bitwise AND condition is false here
arch/powerpc/include/asm/mmu.h:230 early_mmu_has_feature() warn: bitwise AND condition is false here
arch/powerpc/include/asm/mmu.h:261 mmu_has_feature() warn: bitwise AND condition is false here
arch/powerpc/include/asm/mmu.h:230 early_mmu_has_feature() warn: bitwise AND condition is false here

Old smatch warnings:
arch/powerpc/kernel/paca.c:225 initialise_paca() warn: '65535' 65535 can't fit into 32767 'new_paca->hw_cpu_id'
arch/powerpc/kernel/process.c:446 giveup_all() warn: bitwise AND condition is false here
arch/powerpc/kernel/process.c:588 save_all() warn: bitwise AND condition is false here

vim +230 arch/powerpc/include/asm/mmu.h

f9158d58a4e1d9 Christophe Leroy       2020-10-22  227  
a141cca3892bb3 Michael Ellerman       2016-07-27  228  static inline bool early_mmu_has_feature(unsigned long feature)
7c03d653cd2577 Benjamin Herrenschmidt 2008-12-18  229  {
f9158d58a4e1d9 Christophe Leroy       2020-10-22 @230  	if (MMU_FTRS_ALWAYS & feature)
f9158d58a4e1d9 Christophe Leroy       2020-10-22  231  		return true;
f9158d58a4e1d9 Christophe Leroy       2020-10-22  232  
a81dc9d9957354 Michael Ellerman       2016-07-27  233  	return !!(MMU_FTRS_POSSIBLE & cur_cpu_spec->mmu_features & feature);
7c03d653cd2577 Benjamin Herrenschmidt 2008-12-18  234  }
7c03d653cd2577 Benjamin Herrenschmidt 2008-12-18  235  
c12e6f24d41378 Kevin Hao              2016-07-23  236  #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECKS
c12e6f24d41378 Kevin Hao              2016-07-23  237  #include <linux/jump_label.h>
c12e6f24d41378 Kevin Hao              2016-07-23  238  
c12e6f24d41378 Kevin Hao              2016-07-23  239  #define NUM_MMU_FTR_KEYS	32
c12e6f24d41378 Kevin Hao              2016-07-23  240  
c12e6f24d41378 Kevin Hao              2016-07-23  241  extern struct static_key_true mmu_feature_keys[NUM_MMU_FTR_KEYS];
c12e6f24d41378 Kevin Hao              2016-07-23  242  
c12e6f24d41378 Kevin Hao              2016-07-23  243  extern void mmu_feature_keys_init(void);
c12e6f24d41378 Kevin Hao              2016-07-23  244  
c12e6f24d41378 Kevin Hao              2016-07-23  245  static __always_inline bool mmu_has_feature(unsigned long feature)
c12e6f24d41378 Kevin Hao              2016-07-23  246  {
c12e6f24d41378 Kevin Hao              2016-07-23  247  	int i;
c12e6f24d41378 Kevin Hao              2016-07-23  248  
b5fa0f7f88edcd Michael Ellerman       2017-01-24  249  #ifndef __clang__ /* clang can't cope with this */
c12e6f24d41378 Kevin Hao              2016-07-23  250  	BUILD_BUG_ON(!__builtin_constant_p(feature));
b5fa0f7f88edcd Michael Ellerman       2017-01-24  251  #endif
c12e6f24d41378 Kevin Hao              2016-07-23  252  
c812c7d8f1470a Aneesh Kumar K.V       2016-07-23  253  #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG
c812c7d8f1470a Aneesh Kumar K.V       2016-07-23  254  	if (!static_key_initialized) {
c812c7d8f1470a Aneesh Kumar K.V       2016-07-23  255  		printk("Warning! mmu_has_feature() used prior to jump label init!\n");
c812c7d8f1470a Aneesh Kumar K.V       2016-07-23  256  		dump_stack();
c812c7d8f1470a Aneesh Kumar K.V       2016-07-23  257  		return early_mmu_has_feature(feature);
c812c7d8f1470a Aneesh Kumar K.V       2016-07-23  258  	}
c812c7d8f1470a Aneesh Kumar K.V       2016-07-23  259  #endif
c812c7d8f1470a Aneesh Kumar K.V       2016-07-23  260  
f9158d58a4e1d9 Christophe Leroy       2020-10-22 @261  	if (MMU_FTRS_ALWAYS & feature)
f9158d58a4e1d9 Christophe Leroy       2020-10-22  262  		return true;
f9158d58a4e1d9 Christophe Leroy       2020-10-22  263  
c12e6f24d41378 Kevin Hao              2016-07-23  264  	if (!(MMU_FTRS_POSSIBLE & feature))
c12e6f24d41378 Kevin Hao              2016-07-23  265  		return false;
c12e6f24d41378 Kevin Hao              2016-07-23  266  
c12e6f24d41378 Kevin Hao              2016-07-23  267  	i = __builtin_ctzl(feature);
c12e6f24d41378 Kevin Hao              2016-07-23  268  	return static_branch_likely(&mmu_feature_keys[i]);
c12e6f24d41378 Kevin Hao              2016-07-23  269  }
c12e6f24d41378 Kevin Hao              2016-07-23  270  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35832 bytes --]

             reply	other threads:[~2021-04-25 16:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-25 16:40 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-17 14:23 arch/powerpc/include/asm/mmu.h:230 early_mmu_has_feature() warn: bitwise AND condition is false here kernel test robot
2021-11-14  3:50 kernel test robot
2021-11-13  3:17 kernel test robot
2021-06-22 15:39 kernel test robot
2021-02-20 13:23 kernel test robot
2021-01-06 12:46 kernel test robot

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=202104260024.sL70zMlm-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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.