qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: aik@ozlabs.ru, qemu-devel@nongnu.org, groug@kaod.org,
	paulus@ozlabs.org, qemu-ppc@nongnu.org, ganeshgr@linux.ibm.com
Subject: Re: [PATCH v14 4/7] target/ppc: Build rtas error log upon an MCE
Date: Wed, 25 Sep 2019 16:48:37 +1000	[thread overview]
Message-ID: <20190925064837.GM17405@umbus> (raw)
In-Reply-To: <3282d800-46d5-d270-542c-bcf8bd937944@linux.vnet.ibm.com>

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

On Wed, Sep 25, 2019 at 11:31:30AM +0530, Aravinda Prasad wrote:
> 
> 
> On Wednesday 25 September 2019 07:00 AM, David Gibson wrote:
> > On Wed, Sep 18, 2019 at 01:42:34PM +0530, Aravinda Prasad wrote:
> >> Upon a machine check exception (MCE) in a guest address space,
> >> KVM causes a guest exit to enable QEMU to build and pass the
> >> error to the guest in the PAPR defined rtas error log format.
> >>
> >> This patch builds the rtas error log, copies it to the rtas_addr
> >> and then invokes the guest registered machine check handler. The
> >> handler in the guest takes suitable action(s) depending on the type
> >> and criticality of the error. For example, if an error is
> >> unrecoverable memory corruption in an application inside the
> >> guest, then the guest kernel sends a SIGBUS to the application.
> >> For recoverable errors, the guest performs recovery actions and
> >> logs the error.
> >>
> >> Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
> >> ---
> >>  hw/ppc/spapr.c         |   13 +++
> >>  hw/ppc/spapr_events.c  |  222 ++++++++++++++++++++++++++++++++++++++++++++++++
> >>  hw/ppc/spapr_rtas.c    |   26 ++++++
> >>  include/hw/ppc/spapr.h |    6 +
> >>  target/ppc/kvm.c       |    4 +
> >>  5 files changed, 268 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> >> index 76ed988..9f2e5d2 100644
> >> --- a/hw/ppc/spapr.c
> >> +++ b/hw/ppc/spapr.c
> >> @@ -2930,6 +2930,19 @@ static void spapr_machine_init(MachineState *machine)
> >>          error_report("Could not get size of LPAR rtas '%s'", filename);
> >>          exit(1);
> >>      }
> >> +
> >> +    if (spapr_get_cap(spapr, SPAPR_CAP_FWNMI_MCE) == SPAPR_CAP_ON) {
> >> +        /*
> >> +         * Ensure that the rtas image size is less than RTAS_ERROR_LOG_OFFSET
> >> +         * or else the rtas image will be overwritten with the rtas error log
> >> +         * when a machine check exception is encountered.
> >> +         */
> >> +        g_assert(spapr->rtas_size < RTAS_ERROR_LOG_OFFSET);
> >> +
> >> +        /* Resize rtas blob to accommodate error log */
> >> +        spapr->rtas_size = RTAS_ERROR_LOG_MAX;
> >> +    }
> >> +
> > 
> > I've recently merged into ppc-for-4.2 the change to have SLOF supply
> > the RTAS blob, rather than qemu.  So this code will need to be updated
> > accordingly.
> 
> Sure. Will modify it to check if rtas_size is set to RTAS_ERROR_LOG_MAX
> instead of the assignment.

There is no rtas_size variable now.  You'll need to just trust that
SLOF has allocated enough room.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2019-09-25  7:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  8:12 [Qemu-devel] [PATCH v14 0/7] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests Aravinda Prasad
2019-09-18  8:12 ` [Qemu-devel] [PATCH v14 1/7] Wrapper function to wait on condition for the main loop mutex Aravinda Prasad
2019-09-18  8:12 ` [Qemu-devel] [PATCH v14 2/7] ppc: spapr: Introduce FWNMI capability Aravinda Prasad
2019-09-25  1:12   ` David Gibson
2019-09-25  5:42     ` Aravinda Prasad
2019-09-18  8:12 ` [Qemu-devel] [PATCH v14 3/7] target/ppc: Handle NMI guest exit Aravinda Prasad
2019-09-18  8:12 ` [Qemu-devel] [PATCH v14 4/7] target/ppc: Build rtas error log upon an MCE Aravinda Prasad
2019-09-25  1:30   ` David Gibson
2019-09-25  6:01     ` Aravinda Prasad
2019-09-25  6:16       ` Greg Kurz
2019-09-25  6:48       ` David Gibson [this message]
2019-09-18  8:12 ` [Qemu-devel] [PATCH v14 5/7] ppc: spapr: Handle "ibm, nmi-register" and "ibm, nmi-interlock" RTAS calls Aravinda Prasad
2019-09-25  1:33   ` David Gibson
2019-09-25  6:04     ` Aravinda Prasad
2019-09-18  8:12 ` [Qemu-devel] [PATCH v14 6/7] migration: Include migration support for machine check handling Aravinda Prasad
2019-09-25  1:39   ` David Gibson
2019-09-25  6:12     ` Aravinda Prasad
2019-09-18  8:13 ` [Qemu-devel] [PATCH v14 7/7] ppc: spapr: Activate the FWNMI functionality Aravinda Prasad

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=20190925064837.GM17405@umbus \
    --to=david@gibson.dropbear.id.au \
    --cc=aik@ozlabs.ru \
    --cc=aravinda@linux.vnet.ibm.com \
    --cc=ganeshgr@linux.ibm.com \
    --cc=groug@kaod.org \
    --cc=paulus@ozlabs.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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;
as well as URLs for NNTP newsgroup(s).