[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v14 4/7] target/ppc: Build rtas error log upon an MCE
From: |
David Gibson |
Subject: |
Re: [PATCH v14 4/7] target/ppc: Build rtas error log upon an MCE |
Date: |
Wed, 25 Sep 2019 16:48:37 +1000 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
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 <address@hidden>
> >> ---
> >> 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
signature.asc
Description: PGP signature
- [Qemu-ppc] [PATCH v14 0/7] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests, Aravinda Prasad, 2019/09/18
- [Qemu-ppc] [PATCH v14 6/7] migration: Include migration support for machine check handling, Aravinda Prasad, 2019/09/18
- [Qemu-ppc] [PATCH v14 5/7] ppc: spapr: Handle "ibm, nmi-register" and "ibm, nmi-interlock" RTAS calls, Aravinda Prasad, 2019/09/18
- [Qemu-ppc] [PATCH v14 7/7] ppc: spapr: Activate the FWNMI functionality, Aravinda Prasad, 2019/09/18
- [Qemu-ppc] [PATCH v14 1/7] Wrapper function to wait on condition for the main loop mutex, Aravinda Prasad, 2019/09/18