linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
Cc: Aravinda Prasad <aravinda@linux.vnet.ibm.com>,
	gleb@kernel.org, agraf@suse.de, kvm-ppc@vger.kernel.org,
	linuxppc-dev@ozlabs.org, pbonzini@redhat.com, mpe@ellerman.id.au,
	bsingharora@gmail.com, kvm@vger.kernel.org,
	david@gibson.dropbear.id.au
Subject: Re: [PATCH v5 2/2] KVM: PPC: Exit guest upon MCE when FWNMI capability is enabled
Date: Fri, 27 Jan 2017 14:14:49 +1100	[thread overview]
Message-ID: <20170127031449.kecknhpwjzmnpvbo@oak.ozlabs.ibm.com> (raw)
In-Reply-To: <fc415f1b-fdb0-a763-0eba-5fb10176844f@linux.vnet.ibm.com>

On Wed, Jan 18, 2017 at 11:19:26AM +0530, Mahesh Jagannath Salgaonkar wrote:
> On 01/16/2017 10:05 AM, Paul Mackerras wrote:
> > On Fri, Jan 13, 2017 at 04:51:45PM +0530, Aravinda Prasad wrote:

[snip]

> >>  	case BOOK3S_INTERRUPT_MACHINE_CHECK:
> >> +		/* Exit to guest with KVM_EXIT_NMI as exit reason */
> >> +		run->exit_reason = KVM_EXIT_NMI;
> >> +		r = RESUME_HOST;
> >>  		/*
> >> -		 * Deliver a machine check interrupt to the guest.
> >> -		 * We have to do this, even if the host has handled the
> >> -		 * machine check, because machine checks use SRR0/1 and
> >> -		 * the interrupt might have trashed guest state in them.
> >> +		 * Invoke host-kernel handler to perform any host-side
> >> +		 * handling before exiting the guest.
> >>  		 */
> >> -		kvmppc_book3s_queue_irqprio(vcpu,
> >> -					    BOOK3S_INTERRUPT_MACHINE_CHECK);
> >> -		r = RESUME_GUEST;
> >> +		kvmppc_machine_check_hook();
> > 
> > Note that this won't necessarily be called on the same CPU that
> > received the machine check.  This will be called on thread 0 of the
> > core (or subcore), whereas the machine check could have occurred on
> > some other thread.  Are you sure that the machine check handling code
> > will be OK with that?
> 
> That will have only one problem. get_mce_event() from
> opal_machine_check() may not be able to pull mce event for error on
> non-zero thread. We should hook the mce event into vcpu structure during
> kvmppc_realmode_machine_check() and then pass it to
> ppc_md.machine_check_exception() as an additional argument.

To move things along...

Mahesh, how would we get hold of the mce event from real-mode assembly
code?  What function would we need to call to get the event?  Could
you write some code (or at least some pseudo-code) to illustrate how
it would be done?

Thanks,
Paul.

  reply	other threads:[~2017-01-27  3:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 11:21 [PATCH v5 0/2] KVM: PPC: Add FWNMI support for KVM guests on POWER Aravinda Prasad
2017-01-13 11:21 ` [PATCH v5 1/2] KVM: PPC: Add new capability to control MCE behaviour Aravinda Prasad
2017-01-13 11:21 ` [PATCH v5 2/2] KVM: PPC: Exit guest upon MCE when FWNMI capability is enabled Aravinda Prasad
2017-01-16  4:35   ` Paul Mackerras
2017-01-18  5:49     ` Mahesh Jagannath Salgaonkar
2017-01-27  3:14       ` Paul Mackerras [this message]
2017-01-30 10:13         ` Mahesh J Salgaonkar

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=20170127031449.kecknhpwjzmnpvbo@oak.ozlabs.ibm.com \
    --to=paulus@ozlabs.org \
    --cc=agraf@suse.de \
    --cc=aravinda@linux.vnet.ibm.com \
    --cc=bsingharora@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=gleb@kernel.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=pbonzini@redhat.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).