public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Alexander Graf <agraf@suse.de>
Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 1/5] KVM: PPC: Book3S HV: Handle guest-caused machine checks on POWER7 without panicking
Date: Tue, 27 Nov 2012 10:11:42 +1100	[thread overview]
Message-ID: <20121126231142.GC3370@bloggs.ozlabs.ibm.com> (raw)
In-Reply-To: <C0AFE5E1-DB02-4DBB-B219-62EE4C9705F0@suse.de>

On Mon, Nov 26, 2012 at 11:03:48PM +0100, Alexander Graf wrote:
> 
> On 26.11.2012, at 22:55, Alexander Graf wrote:
> 
> > 
> > On 26.11.2012, at 22:33, Paul Mackerras wrote:
> > 
> >> On Mon, Nov 26, 2012 at 02:15:16PM +0100, Alexander Graf wrote:
> >>> 
> >>> On 23.11.2012, at 22:42, Paul Mackerras wrote:
> >>> 
> >>>> On Fri, Nov 23, 2012 at 03:13:09PM +0100, Alexander Graf wrote:
> >>>>> 
> >>>>> On 22.11.2012, at 10:25, Paul Mackerras wrote:
> >>>>> 
> >>>>>> +	/* Do they have an SLB shadow buffer registered? */
> >>>>>> +	slb = vcpu->arch.slb_shadow.pinned_addr;
> >>>>>> +	if (!slb)
> >>>>>> +		return;
> >>>>> 
> >>>>> Mind to explain this case? What happens here? Do we leave the guest with an empty SLB? Why would this ever happen? What happens next as soon as we go back into the guest?
> >>>> 
> >>>> Yes, we leave the guest with an empty SLB, the access gets retried and
> >>>> this time the guest gets an SLB miss interrupt, which it can hopefully
> >>>> handle using an SLB miss handler that runs entirely in real mode.
> >>>> This could happen for instance while the guest is in SLOF or yaboot or
> >>>> some other code that runs basically in real mode but occasionally
> >>>> turns the MMU on for some accesses, and happens to have a bug where it
> >>>> creates a duplicate SLB entry.
> >>> 
> >>> Is this what pHyp does? Also, is this what we want? Why don't we populate an #MC into the guest so it knows it did something wrong?
> >> 
> >> Yes, yes and we do.  Anytime we get a machine check while in the guest
> >> we give the guest a machine check interrupt.
> >> 
> >> Ultimately we want to implement the "FWNMI" (Firmware-assisted NMI)
> >> thing defined in PAPR which makes the handling of system reset and
> >> machine check slightly nicer for the guest, but that's for later.  It
> >> will build on top of the stuff in this patch.
> > 
> > So why would the function return 1 then which means "MC is handled, forget about it" rather than 0, which means "inject MC into the guest"?
> 
> Oh wait - 1 means "have the host handle it". Let me check up the code again.

1 means "the problem is fixed, now give the guest a machine check
interrupt".

0 means "exit the guest, have the host's MC handler look at it, then
give the guest a machine check".  In this case the delivery of the MC
to the guest happens in kvmppc_handle_exit().

Paul.

  reply	other threads:[~2012-11-26 23:11 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22  9:24 [PATCH 0/5] KVM: PPC: Fix various bugs and vulnerabilities in HV KVM Paul Mackerras
2012-11-22  9:25 ` [PATCH 1/5] KVM: PPC: Book3S HV: Handle guest-caused machine checks on POWER7 without panicking Paul Mackerras
2012-11-23 14:13   ` Alexander Graf
2012-11-23 21:42     ` Paul Mackerras
2012-11-26 13:15       ` Alexander Graf
2012-11-26 21:33         ` Paul Mackerras
2012-11-26 21:55           ` Alexander Graf
2012-11-26 22:03             ` Alexander Graf
2012-11-26 23:11               ` Paul Mackerras [this message]
2012-11-24  8:37     ` [PATCH v2] " Paul Mackerras
2012-11-26 23:16       ` Alexander Graf
2012-11-26 23:18         ` Paul Mackerras
2012-11-26 23:20           ` Alexander Graf
2012-11-27  0:20             ` Paul Mackerras
2012-12-22 14:09       ` [PATCH] KVM: PPC: Book3S HV: Fix compilation without CONFIG_PPC_POWERNV Andreas Schwab
2013-01-06 13:05         ` Alexander Graf
2012-11-22  9:27 ` [PATCH 2/5] KVM: PPC: Book3S HV: Reset reverse-map chains when resetting the HPT Paul Mackerras
2012-11-22  9:28 ` [PATCH 3/5] KVM: PPC: Book3S HV: Improve handling of local vs. global TLB invalidations Paul Mackerras
2012-11-23 15:43   ` Alexander Graf
2012-11-23 22:07     ` Paul Mackerras
2012-11-26 13:10       ` Alexander Graf
2012-11-26 21:48         ` Paul Mackerras
2012-11-26 22:03           ` Alexander Graf
2012-11-26 23:16             ` Paul Mackerras
2012-11-26 23:18               ` Alexander Graf
2012-11-22  9:28 ` [PATCH 4/5] KVM: PPC: Book3S HV: Don't give the guest RW access to RO pages Paul Mackerras
2012-11-23 15:47   ` Alexander Graf
2012-11-23 22:13     ` Paul Mackerras
2012-11-24  9:05       ` Alexander Graf
2012-11-24  9:32         ` Paul Mackerras
2012-11-26 13:09           ` Alexander Graf
2012-11-22  9:29 ` [PATCH 5/5] KVM: PPC: Book3S HV: Report correct HPT entry index when reading HPT Paul Mackerras
2012-11-23 15:48 ` [PATCH 0/5] KVM: PPC: Fix various bugs and vulnerabilities in HV KVM Alexander Graf

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=20121126231142.GC3370@bloggs.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox