All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH 03/10] powerpc/powernv: Use OPAL_REPORT_TRAP to cope with trap interrupts from OPAL
Date: Sat, 02 May 2020 22:30:37 +0800	[thread overview]
Message-ID: <202005022225.5GPUG5PB%lkp@intel.com> (raw)
In-Reply-To: <20200502111914.166578-4-npiggin@gmail.com>

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

Hi Nicholas,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on powerpc/next]
[also build test ERROR on linus/master scottwood/next v5.7-rc3]
[cannot apply to next-20200501]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Nicholas-Piggin/OPAL-V4/20200502-195816
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-mpc866_ads_defconfig (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/powerpc/kernel/traps.c: In function 'program_check_exception':
>> arch/powerpc/kernel/traps.c:1509:11: error: implicit declaration of function 'opal_report_trap' [-Werror=implicit-function-declaration]
    1509 |     ret = opal_report_trap(regs->nip);
         |           ^~~~~~~~~~~~~~~~
>> arch/powerpc/kernel/traps.c:1510:16: error: 'OPAL_TRAP_WARN' undeclared (first use in this function)
    1510 |     if (ret == OPAL_TRAP_WARN) {
         |                ^~~~~~~~~~~~~~
   arch/powerpc/kernel/traps.c:1510:16: note: each undeclared identifier is reported only once for each function it appears in
   cc1: all warnings being treated as errors

vim +/opal_report_trap +1509 arch/powerpc/kernel/traps.c

  1460	
  1461	void program_check_exception(struct pt_regs *regs)
  1462	{
  1463		enum ctx_state prev_state = exception_enter();
  1464		unsigned int reason = get_reason(regs);
  1465	
  1466		/* We can now get here via a FP Unavailable exception if the core
  1467		 * has no FPU, in that case the reason flags will be 0 */
  1468	
  1469		if (reason & REASON_FP) {
  1470			/* IEEE FP exception */
  1471			parse_fpe(regs);
  1472			goto bail;
  1473		}
  1474		if (reason & REASON_TRAP) {
  1475			/* Debugger is first in line to stop recursive faults in
  1476			 * rcu_lock, notify_die, or atomic_notifier_call_chain */
  1477			if (debugger_bpt(regs))
  1478				goto bail;
  1479	
  1480			if (kprobe_handler(regs))
  1481				goto bail;
  1482	
  1483			/* trap exception */
  1484			if (notify_die(DIE_BPT, "breakpoint", regs, 5, 5, SIGTRAP)
  1485					== NOTIFY_STOP)
  1486				goto bail;
  1487	
  1488			if (!(regs->msr & MSR_PR)) { /* not user-mode */
  1489				unsigned long bugaddr;
  1490				enum bug_trap_type t;
  1491	
  1492				/*
  1493				 * Fixup bugaddr for BUG_ON() in real mode
  1494				 */
  1495				bugaddr = regs->nip;
  1496				if (!is_kernel_addr(bugaddr) && !(regs->msr & MSR_IR))
  1497					bugaddr += PAGE_OFFSET;
  1498				t = report_bug(bugaddr, regs);
  1499				if (t == BUG_TRAP_TYPE_WARN) {
  1500					regs->nip += 4;
  1501					goto bail;
  1502				}
  1503				if (t == BUG_TRAP_TYPE_BUG)
  1504					goto bug;
  1505	
  1506				if (firmware_has_feature(FW_FEATURE_OPAL)) {
  1507					int64_t ret;
  1508	
> 1509					ret = opal_report_trap(regs->nip);
> 1510					if (ret == OPAL_TRAP_WARN) {
  1511						regs->nip += 4;
  1512						goto bail;
  1513					}
  1514				}
  1515			}
  1516	bug:
  1517			_exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
  1518			goto bail;
  1519		}
  1520	#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
  1521		if (reason & REASON_TM) {
  1522			/* This is a TM "Bad Thing Exception" program check.
  1523			 * This occurs when:
  1524			 * -  An rfid/hrfid/mtmsrd attempts to cause an illegal
  1525			 *    transition in TM states.
  1526			 * -  A trechkpt is attempted when transactional.
  1527			 * -  A treclaim is attempted when non transactional.
  1528			 * -  A tend is illegally attempted.
  1529			 * -  writing a TM SPR when transactional.
  1530			 *
  1531			 * If usermode caused this, it's done something illegal and
  1532			 * gets a SIGILL slap on the wrist.  We call it an illegal
  1533			 * operand to distinguish from the instruction just being bad
  1534			 * (e.g. executing a 'tend' on a CPU without TM!); it's an
  1535			 * illegal /placement/ of a valid instruction.
  1536			 */
  1537			if (user_mode(regs)) {
  1538				_exception(SIGILL, regs, ILL_ILLOPN, regs->nip);
  1539				goto bail;
  1540			} else {
  1541				printk(KERN_EMERG "Unexpected TM Bad Thing exception "
  1542				       "at %lx (msr 0x%lx) tm_scratch=%llx\n",
  1543				       regs->nip, regs->msr, get_paca()->tm_scratch);
  1544				die("Unrecoverable exception", regs, SIGABRT);
  1545			}
  1546		}
  1547	#endif
  1548	
  1549		/*
  1550		 * If we took the program check in the kernel skip down to sending a
  1551		 * SIGILL. The subsequent cases all relate to emulating instructions
  1552		 * which we should only do for userspace. We also do not want to enable
  1553		 * interrupts for kernel faults because that might lead to further
  1554		 * faults, and loose the context of the original exception.
  1555		 */
  1556		if (!user_mode(regs))
  1557			goto sigill;
  1558	
  1559		/* We restore the interrupt state now */
  1560		if (!arch_irq_disabled_regs(regs))
  1561			local_irq_enable();
  1562	
  1563		/* (reason & REASON_ILLEGAL) would be the obvious thing here,
  1564		 * but there seems to be a hardware bug on the 405GP (RevD)
  1565		 * that means ESR is sometimes set incorrectly - either to
  1566		 * ESR_DST (!?) or 0.  In the process of chasing this with the
  1567		 * hardware people - not sure if it can happen on any illegal
  1568		 * instruction or only on FP instructions, whether there is a
  1569		 * pattern to occurrences etc. -dgibson 31/Mar/2003
  1570		 */
  1571		if (!emulate_math(regs))
  1572			goto bail;
  1573	
  1574		/* Try to emulate it if we should. */
  1575		if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
  1576			switch (emulate_instruction(regs)) {
  1577			case 0:
  1578				regs->nip += 4;
  1579				emulate_single_step(regs);
  1580				goto bail;
  1581			case -EFAULT:
  1582				_exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
  1583				goto bail;
  1584			}
  1585		}
  1586	
  1587	sigill:
  1588		if (reason & REASON_PRIVILEGED)
  1589			_exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
  1590		else
  1591			_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
  1592	
  1593	bail:
  1594		exception_exit(prev_state);
  1595	}
  1596	NOKPROBE_SYMBOL(program_check_exception);
  1597	

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

  reply	other threads:[~2020-05-02 14:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02 11:19 [RFC PATCH 00/10] OPAL V4 Nicholas Piggin
2020-05-02 11:19 ` [RFC PATCH 01/10] kallsyms: architecture specific symbol lookups Nicholas Piggin
2020-05-02 11:19 ` [RFC PATCH 02/10] powerpc/powernv: Wire up OPAL address lookups Nicholas Piggin
2020-05-02 11:19 ` [RFC PATCH 03/10] powerpc/powernv: Use OPAL_REPORT_TRAP to cope with trap interrupts from OPAL Nicholas Piggin
2020-05-02 14:30   ` kbuild test robot [this message]
2020-05-02 11:19 ` [RFC PATCH 04/10] powerpc/powernv: avoid polling in opal_get_chars Nicholas Piggin
2020-05-02 11:19 ` [RFC PATCH 05/10] powerpc/powernv: Don't translate kernel addresses to real addresses for OPAL Nicholas Piggin
2020-05-02 11:19 ` [RFC PATCH 06/10] powerpc/powernv: opal use new opal call entry point if it exists Nicholas Piggin
2020-05-02 16:25   ` kbuild test robot
2020-05-06  7:02   ` Gautham R Shenoy
2020-05-02 11:19 ` [RFC PATCH 07/10] powerpc/powernv: Add OPAL_FIND_VM_AREA API Nicholas Piggin
2020-05-02 11:19 ` [RFC PATCH 08/10] powerpc/powernv: Set up an mm context to call OPAL in Nicholas Piggin
2020-05-02 11:19 ` [RFC PATCH 09/10] powerpc/powernv: OPAL V4 OS services Nicholas Piggin
2020-05-02 11:19 ` [RFC PATCH 10/10] powerpc/powernv: OPAL V4 Implement vm_map/unmap service Nicholas Piggin

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=202005022225.5GPUG5PB%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@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.