From: Greg Kurz <groug@kaod.org>
To: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: David Gibson <david@gibson.dropbear.id.au>,
paulus@ozlabs.org, qemu-ppc@nongnu.org, aik@au1.ibm.com,
qemu-devel@nongnu.org, mahesh@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v7 3/6] target/ppc: Handle NMI guest exit
Date: Thu, 4 Apr 2019 11:35:44 +0200 [thread overview]
Message-ID: <20190404113544.16026757@bahia.lan> (raw)
In-Reply-To: <1fdde5df-408a-f81d-d9ac-eb9636324b54@linux.vnet.ibm.com>
On Thu, 4 Apr 2019 14:40:45 +0530
Aravinda Prasad <aravinda@linux.vnet.ibm.com> wrote:
> On Monday 25 March 2019 11:52 AM, David Gibson wrote:
> > On Fri, Mar 22, 2019 at 12:03:58PM +0530, Aravinda Prasad wrote:
> >> Memory error such as bit flips that cannot be corrected
> >> by hardware are passed on to the kernel for handling.
> >> If the memory address in error belongs to guest then
> >> the guest kernel is responsible for taking suitable action.
> >> Patch [1] enhances KVM to exit guest with exit reason
> >> set to KVM_EXIT_NMI in such cases. This patch handles
> >> KVM_EXIT_NMI exit.
> >>
> >> [1] https://www.spinics.net/lists/kvm-ppc/msg12637.html
> >> (e20bbd3d and related commits)
> >>
> >> Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
> >> ---
> >> hw/ppc/spapr_events.c | 22 ++++++++++++++++++++++
> >> include/hw/ppc/spapr.h | 1 +
> >> target/ppc/kvm.c | 16 ++++++++++++++++
> >> target/ppc/kvm_ppc.h | 2 ++
> >> 4 files changed, 41 insertions(+)
> >>
>
> [...]
>
> >> diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
> >> index 2427c8e..a593448 100644
> >> --- a/target/ppc/kvm.c
> >> +++ b/target/ppc/kvm.c
> >> @@ -1738,6 +1738,11 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
> >> ret = 0;
> >> break;
> >>
> >> + case KVM_EXIT_NMI:
> >> + DPRINTF("handle NMI exception\n");
> >
> > tracepoints are generally preferred to new DPRINTFs.
>
> I see DPRINTFs used in all other exit reasons in this function. Do you
> want me to change this particular exit case to tracepoints? I think it
> is better to keep this DPRINTF as of now and change all the DPRINTFs to
> tracepoints in a separate patch set.
>
git grep shows that all DPRINTFs (25 of them) are in target/ppc/kvm.c. I guess
this can be addressed with a single, mechanical and easy to review preparatory
patch.
> Regards,
> Aravinda
>
> >
> >> + ret = kvm_handle_nmi(cpu, run);
> >> + break;
> >> +
> >> default:
> >> fprintf(stderr, "KVM: unknown exit reason %d\n", run->exit_reason);
> >> ret = -1;
> >> @@ -2803,6 +2808,17 @@ int kvm_arch_msi_data_to_gsi(uint32_t data)
> >> return data & 0xffff;
> >> }
> >>
> >> +int kvm_handle_nmi(PowerPCCPU *cpu, struct kvm_run *run)
> >> +{
> >> + bool recovered = run->flags & KVM_RUN_PPC_NMI_DISP_FULLY_RECOV;
> >> +
> >> + cpu_synchronize_state(CPU(cpu));
> >> +
> >> + spapr_mce_req_event(cpu, recovered);
> >> +
> >> + return 0;
> >> +}
> >> +
> >> int kvmppc_enable_hwrng(void)
> >> {
> >> if (!kvm_enabled() || !kvm_check_extension(kvm_state, KVM_CAP_PPC_HWRNG)) {
> >> diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
> >> index 2c2ea30..df5e85f 100644
> >> --- a/target/ppc/kvm_ppc.h
> >> +++ b/target/ppc/kvm_ppc.h
> >> @@ -80,6 +80,8 @@ bool kvmppc_hpt_needs_host_contiguous_pages(void);
> >> void kvm_check_mmu(PowerPCCPU *cpu, Error **errp);
> >> void kvmppc_set_reg_ppc_online(PowerPCCPU *cpu, unsigned int online);
> >>
> >> +int kvm_handle_nmi(PowerPCCPU *cpu, struct kvm_run *run);
> >> +
> >> #else
> >>
> >> static inline uint32_t kvmppc_get_tbfreq(void)
> >>
> >
>
next prev parent reply other threads:[~2019-04-04 9:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <155323635511.18748.18133954505098138975.stgit@aravinda>
[not found] ` <155323643836.18748.13006461397179281455.stgit@aravinda>
[not found] ` <20190325062256.GO29295@umbus>
2019-04-04 9:10 ` [Qemu-devel] [PATCH v7 3/6] target/ppc: Handle NMI guest exit Aravinda Prasad
2019-04-04 9:35 ` Greg Kurz [this message]
2019-04-04 23:17 ` David Gibson
2019-04-04 23:17 ` David Gibson
2019-04-05 5:04 ` Alexey Kardashevskiy
2019-04-05 5:04 ` Alexey Kardashevskiy
2019-04-05 8:18 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2019-04-05 8:18 ` Greg Kurz
[not found] ` <155323645659.18748.12592305605497011547.stgit@aravinda>
2019-04-04 20:44 ` [Qemu-devel] [PATCH v7 5/6] ppc: spapr: Enable FWNMI capability Fabiano Rosas
[not found] ` <20190325063205.GQ29295@umbus>
[not found] ` <9da8a51d-106c-410e-fa88-d37dceb0c9e1@linux.vnet.ibm.com>
[not found] ` <20190325233319.GD9393@umbus.fritz.box>
2019-04-15 10:12 ` [Qemu-devel] [Qemu-ppc] " Aravinda Prasad
2019-04-15 10:12 ` Aravinda Prasad
2019-04-17 2:09 ` David Gibson
2019-04-17 2:09 ` David Gibson
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=20190404113544.16026757@bahia.lan \
--to=groug@kaod.org \
--cc=aik@au1.ibm.com \
--cc=aravinda@linux.vnet.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=mahesh@linux.vnet.ibm.com \
--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).