All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/powerpc/kernel/traps.c:1631 ____alignment_exception() warn: bitwise AND condition is false here
@ 2021-07-28 20:15 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-07-28 20:15 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nicholas Piggin <npiggin@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4010a528219e01dd02e768b22168f7f0e78365ce
commit: 3a96570ffceb15c6ed9cc6f990f172dcdc8ac279 powerpc: convert interrupt handlers to use wrappers
date:   6 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 6 months ago
config: powerpc64-randconfig-m031-20210722 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 10.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/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 <jniethe5@gmail.com>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

---
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: 17937 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* arch/powerpc/kernel/traps.c:1631 ____alignment_exception() warn: bitwise AND condition is false here
@ 2021-11-19  7:52 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-19  7:52 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nicholas Piggin <npiggin@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4c388a8e740d3235a194f330c8ef327deef710f6
commit: 3a96570ffceb15c6ed9cc6f990f172dcdc8ac279 powerpc: convert interrupt handlers to use wrappers
date:   9 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 9 months ago
config: powerpc-randconfig-m031-20211104 (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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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 <jniethe5@gmail.com>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

---
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: 33840 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* arch/powerpc/kernel/traps.c:1631 ____alignment_exception() warn: bitwise AND condition is false here
@ 2021-11-13 19:43 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-13 19:43 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nicholas Piggin <npiggin@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>

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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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 <jniethe5@gmail.com>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

---
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: 37562 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* arch/powerpc/kernel/traps.c:1631 ____alignment_exception() warn: bitwise AND condition is false here
@ 2021-11-11  6:13 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-11  6:13 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nicholas Piggin <npiggin@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   debe436e77c72fcee804fb867f275e6d31aa999c
commit: 3a96570ffceb15c6ed9cc6f990f172dcdc8ac279 powerpc: convert interrupt handlers to use wrappers
date:   9 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 9 months ago
config: powerpc-randconfig-m031-20211104 (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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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 <jniethe5@gmail.com>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

---
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: 33840 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* arch/powerpc/kernel/traps.c:1631 ____alignment_exception() warn: bitwise AND condition is false here
@ 2021-11-04 10:08 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-04 10:08 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nicholas Piggin <npiggin@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7ddb58cb0ecae8e8b6181d736a87667cc9ab8389
commit: 3a96570ffceb15c6ed9cc6f990f172dcdc8ac279 powerpc: convert interrupt handlers to use wrappers
date:   9 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 9 months ago
config: powerpc-randconfig-m031-20211104 (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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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 <jniethe5@gmail.com>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

---
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: 33840 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* arch/powerpc/kernel/traps.c:1631 ____alignment_exception() warn: bitwise AND condition is false here
@ 2021-05-04 21:35 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-05-04 21:35 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nicholas Piggin <npiggin@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e4adffb8daf476a01e7b4a55f586dc8c26e81392
commit: 3a96570ffceb15c6ed9cc6f990f172dcdc8ac279 powerpc: convert interrupt handlers to use wrappers
date:   3 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 3 months ago
config: powerpc64-randconfig-m031-20210504 (attached as .config)
compiler: powerpc64-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>

smatch warnings:
arch/powerpc/kernel/traps.c:1631 ____alignment_exception() 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 <jniethe5@gmail.com>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

---
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: 32142 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-19  7:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28 20:15 arch/powerpc/kernel/traps.c:1631 ____alignment_exception() warn: bitwise AND condition is false here kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-11-19  7:52 kernel test robot
2021-11-13 19:43 kernel test robot
2021-11-11  6:13 kernel test robot
2021-11-04 10:08 kernel test robot
2021-05-04 21:35 kernel test robot

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.