提交 402e172a 编写于 作者: B Breno Leitao 提交者: Michael Ellerman

powerpc/xmon: Check before calling xive functions

Currently xmon could call XIVE functions from OPAL even if the XIVE is
disabled or does not exist in the system, as in POWER8 machines. This
causes the following exception:

 1:mon> dx
 cpu 0x1: Vector: 700 (Program Check) at [c000000423c93450]
     pc: c00000000009cfa4: opal_xive_dump+0x50/0x68
     lr: c0000000000997b8: opal_return+0x0/0x50

This patch simply checks if XIVE is enabled before calling XIVE
functions.

Fixes: 243e2511 ("powerpc/xive: Native exploitation of the XIVE interrupt controller")
Suggested-by: NGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: NBreno Leitao <leitao@debian.org>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 1cafc629
...@@ -2508,6 +2508,11 @@ static void dump_xives(void) ...@@ -2508,6 +2508,11 @@ static void dump_xives(void)
unsigned long num; unsigned long num;
int c; int c;
if (!xive_enabled()) {
printf("Xive disabled on this system\n");
return;
}
c = inchar(); c = inchar();
if (c == 'a') { if (c == 'a') {
dump_all_xives(); dump_all_xives();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册