linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@au1.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
	Breno Leitao <leitao@debian.org>,
	linuxppc-dev@lists.ozlabs.org
Cc: Stewart Smith <stewart@linux.vnet.ibm.com>
Subject: Re: [PATCH] powerpc/xmon: check before calling xive functions
Date: Thu, 19 Oct 2017 09:10:46 +0200	[thread overview]
Message-ID: <1508397046.25065.313.camel@au1.ibm.com> (raw)
In-Reply-To: <87vajchamw.fsf@concordia.ellerman.id.au>

On Thu, 2017-10-19 at 00:02 +1100, Michael Ellerman wrote:
> Breno Leitao <leitao@debian.org> writes:
> 
> > 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.
> 
> Thanks. I'll merge this.
> 
> But we should also fix it in skiboot.

No that's wrong. xive_enabled() is only set if Linux is using native
xive mode but some of those xmon functions dump the emulated state.

We should fix the actual cause of the crash.

Cheers,
Ben.

> cheers
> 
> > Suggested-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
> > Signed-off-by: Breno Leitao <leitao@debian.org>
> > ---
> >  arch/powerpc/xmon/xmon.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> > index 4679aeb84767..b34976c4a6ba 100644
> > --- a/arch/powerpc/xmon/xmon.c
> > +++ b/arch/powerpc/xmon/xmon.c
> > @@ -2508,6 +2508,12 @@ static void dump_xives(void)
> >  	unsigned long num;
> >  	int c;
> >  
> > +	if (!xive_enabled()) {
> > +		printf("Xive disabled on this system\n");
> > +
> > +		return;
> > +	}
> > +
> >  	c = inchar();
> >  	if (c == 'a') {
> >  		dump_all_xives();
> > -- 
> > 2.14.2

  reply	other threads:[~2017-10-19  7:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 18:20 [PATCH] powerpc/xmon: check before calling xive functions Breno Leitao
2017-10-18 13:02 ` Michael Ellerman
2017-10-19  7:10   ` Benjamin Herrenschmidt [this message]
2017-10-19 13:09     ` Cédric Le Goater
     [not found]     ` <OF2FDAF97B.BDA3E74C-ON002581BE.004846E4@notes.na.collabserv.com>
2017-10-19 15:21       ` Benjamin Herrenschmidt
2017-10-24  8:09 ` Michael Ellerman

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=1508397046.25065.313.camel@au1.ibm.com \
    --to=benh@au1.ibm.com \
    --cc=leitao@debian.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=stewart@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).