CC: [email protected]
CC: [email protected]
TO: Nicholas Piggin <[email protected]>
CC: Michael Ellerman <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   66f4beaa6c1d28161f534471484b2daa2de1dce0
commit: 3a96570ffceb15c6ed9cc6f990f172dcdc8ac279 powerpc: convert interrupt 
handlers to use wrappers
date:   9 months ago
:::::: branch date: 23 hours ago
:::::: commit date: 9 months ago
config: powerpc-randconfig-m031-20211016 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 11.2.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/kernel/traps.c:1631 ____alignment_exception() warn: bitwise AND 
condition is false here

Old smatch warnings:
arch/powerpc/kernel/traps.c:1254 emulate_string_inst() warn: bitwise AND 
condition is false here

vim +1631 arch/powerpc/kernel/traps.c

bf593907f7236e Paul Mackerras         2013-06-14  1618  
3a96570ffceb15 Nicholas Piggin        2021-01-30  1619  
DEFINE_INTERRUPT_HANDLER(alignment_exception)
14cf11af6cf608 Paul Mackerras         2005-09-26  1620  {
ba12eedee321ee Li Zhong               2013-05-13  1621          enum ctx_state 
prev_state = exception_enter();
4393c4f6788cee Benjamin Herrenschmidt 2006-11-01  1622          int sig, code, 
fixed = 0;
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1623          unsigned long  
reason;
14cf11af6cf608 Paul Mackerras         2005-09-26  1624  
a3512b2dd57cb6 Benjamin Herrenschmidt 2012-05-08  1625          /* We restore 
the interrupt state now */
a3512b2dd57cb6 Benjamin Herrenschmidt 2012-05-08  1626          if 
(!arch_irq_disabled_regs(regs))
a3512b2dd57cb6 Benjamin Herrenschmidt 2012-05-08  1627                  
local_irq_enable();
a3512b2dd57cb6 Benjamin Herrenschmidt 2012-05-08  1628  
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1629          reason = 
get_reason(regs);
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1630  
9409d2f9dad2f0 Jordan Niethe          2020-05-06 @1631          if (reason & 
REASON_BOUNDARY) {
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1632                  sig = 
SIGBUS;
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1633                  code = 
BUS_ADRALN;
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1634                  goto 
bad;
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1635          }
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1636  
6ce6c629fd8254 Michael Neuling        2013-05-26  1637          if 
(tm_abort_check(regs, TM_CAUSE_ALIGNMENT | TM_CAUSE_PERSISTENT))
6ce6c629fd8254 Michael Neuling        2013-05-26  1638                  goto 
bail;
6ce6c629fd8254 Michael Neuling        2013-05-26  1639  
e9370ae15dc2f8 Paul Mackerras         2006-06-07  1640          /* we don't 
implement logging of alignment exceptions */
e9370ae15dc2f8 Paul Mackerras         2006-06-07  1641          if 
(!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
14cf11af6cf608 Paul Mackerras         2005-09-26  1642                  fixed = 
fix_alignment(regs);
14cf11af6cf608 Paul Mackerras         2005-09-26  1643  
14cf11af6cf608 Paul Mackerras         2005-09-26  1644          if (fixed == 1) 
{
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1645                  /* skip 
over emulated instruction */
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1646                  
regs->nip += inst_length(reason);
14cf11af6cf608 Paul Mackerras         2005-09-26  1647                  
emulate_single_step(regs);
ba12eedee321ee Li Zhong               2013-05-13  1648                  goto 
bail;
14cf11af6cf608 Paul Mackerras         2005-09-26  1649          }
14cf11af6cf608 Paul Mackerras         2005-09-26  1650  
14cf11af6cf608 Paul Mackerras         2005-09-26  1651          /* Operand 
address was bad */
14cf11af6cf608 Paul Mackerras         2005-09-26  1652          if (fixed == 
-EFAULT) {
4393c4f6788cee Benjamin Herrenschmidt 2006-11-01  1653                  sig = 
SIGSEGV;
4393c4f6788cee Benjamin Herrenschmidt 2006-11-01  1654                  code = 
SEGV_ACCERR;
4393c4f6788cee Benjamin Herrenschmidt 2006-11-01  1655          } else {
4393c4f6788cee Benjamin Herrenschmidt 2006-11-01  1656                  sig = 
SIGBUS;
4393c4f6788cee Benjamin Herrenschmidt 2006-11-01  1657                  code = 
BUS_ADRALN;
4393c4f6788cee Benjamin Herrenschmidt 2006-11-01  1658          }
9409d2f9dad2f0 Jordan Niethe          2020-05-06  1659  bad:
14cf11af6cf608 Paul Mackerras         2005-09-26  1660          if 
(user_mode(regs))
4393c4f6788cee Benjamin Herrenschmidt 2006-11-01  1661                  
_exception(sig, regs, code, regs->dar);
14cf11af6cf608 Paul Mackerras         2005-09-26  1662          else
8458c628a53ba4 Nicholas Piggin        2021-01-30  1663                  
bad_page_fault(regs, sig);
ba12eedee321ee Li Zhong               2013-05-13  1664  
ba12eedee321ee Li Zhong               2013-05-13  1665  bail:
ba12eedee321ee Li Zhong               2013-05-13  1666          
exception_exit(prev_state);
14cf11af6cf608 Paul Mackerras         2005-09-26  1667  }
14cf11af6cf608 Paul Mackerras         2005-09-26  1668  

:::::: The code at line 1631 was first introduced by commit
:::::: 9409d2f9dad2f0679d67dc24d8116dd3e837b035 powerpc: Support prefixed 
instructions in alignment handler

:::::: TO: Jordan Niethe <[email protected]>
:::::: CC: Michael Ellerman <[email protected]>

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