CC: [email protected]
CC: [email protected]
TO: Christophe Leroy <[email protected]>
CC: Michael Ellerman <[email protected]>

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 <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

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/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to