From: Michael Ellerman <mpe@ellerman.id.au> To: Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>, gleb@kernel.org, agraf@suse.de, KVM-PPC <kvm-ppc@vger.kernel.org>, linuxppc-dev <linuxppc-dev@ozlabs.org>, Paul Mackerras <paulus@samba.org>, pbonzini@redhat.com Cc: KVM <kvm@vger.kernel.org>, david@gibson.dropbear.id.au Subject: Re: [PATCH v7 2/3] powerpc/powernv: Introduce a machine check hook for Guest MCEs. Date: Thu, 06 Apr 2017 15:53:53 +1000 [thread overview] Message-ID: <878tneuln2.fsf@concordia.ellerman.id.au> (raw) In-Reply-To: <149142524189.28284.14876788789820474952.stgit@jupiter.in.ibm.com> Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com> writes: > From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> > > This patch introduces a mce hook which is invoked at the time of guest > exit to facilitate the host-side handling of machine check exception > before the exception is passed on to the guest. This hook will be invoked > from host virtual mode from KVM (before exiting the guest with > KVM_EXIT_NMI reason) for machine check exception that occurs in the guest. Hi Mahesh, This patch doesn't meaningfully abstract anything. opal_machine_check_guest() doesn't call opal, or do anything opal specific. It just passes the evt struct back to code in mce.c, which is where the struct came from in the first place. > --- a/arch/powerpc/platforms/powernv/opal.c > +++ b/arch/powerpc/platforms/powernv/opal.c > @@ -479,6 +479,32 @@ int opal_machine_check(struct pt_regs *regs) > return 0; > } > > +#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE > +/* > + * opal_machine_check_guest() is a hook which is invoked at the time > + * of guest exit to facilitate the host-side handling of machine check > + * exception before the exception is passed on to the guest. This hook > + * is invoked from host virtual mode from KVM (before exiting the guest > + * with KVM_EXIT_NMI reason) for machine check exception that occurs in > + * the guest. > + * > + * Currently no action is performed in the host other than printing the > + * event information. The machine check exception is passed on to the > + * guest kernel and the guest kernel will attempt for recovery. > + */ > +int opal_machine_check_guest(struct machine_check_event *evt) > +{ > + /* Print things out */ > + if (evt->version != MCE_V1) { > + pr_err("Machine Check Exception, Unknown event version %d !\n", > + evt->version); > + return 0; > + } > + machine_check_print_event_info(evt); > + return 0; > +} > +#endif Called from kvmppc_handle_exit_hv(): + if (ppc_md.machine_check_exception_guest) + ppc_md.machine_check_exception_guest( + &vcpu->arch.mce_evt); break; Just call machine_check_print_event_info() directly from kvmppc_handle_exit_hv(). You'll need to export symbol it, but that's all AFAICS, I don't think it even needs any #ifdefs. If we ever want to do anything different we can change the code then. cheers
WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au> To: Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>, gleb@kernel.org, agraf@suse.de, KVM-PPC <kvm-ppc@vger.kernel.org>, linuxppc-dev <linuxppc-dev@ozlabs.org>, Paul Mackerras <paulus@samba.org>, pbonzini@redhat.com Cc: KVM <kvm@vger.kernel.org>, david@gibson.dropbear.id.au Subject: Re: [PATCH v7 2/3] powerpc/powernv: Introduce a machine check hook for Guest MCEs. Date: Thu, 06 Apr 2017 05:53:53 +0000 [thread overview] Message-ID: <878tneuln2.fsf@concordia.ellerman.id.au> (raw) In-Reply-To: <149142524189.28284.14876788789820474952.stgit@jupiter.in.ibm.com> Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com> writes: > From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> > > This patch introduces a mce hook which is invoked at the time of guest > exit to facilitate the host-side handling of machine check exception > before the exception is passed on to the guest. This hook will be invoked > from host virtual mode from KVM (before exiting the guest with > KVM_EXIT_NMI reason) for machine check exception that occurs in the guest. Hi Mahesh, This patch doesn't meaningfully abstract anything. opal_machine_check_guest() doesn't call opal, or do anything opal specific. It just passes the evt struct back to code in mce.c, which is where the struct came from in the first place. > --- a/arch/powerpc/platforms/powernv/opal.c > +++ b/arch/powerpc/platforms/powernv/opal.c > @@ -479,6 +479,32 @@ int opal_machine_check(struct pt_regs *regs) > return 0; > } > > +#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE > +/* > + * opal_machine_check_guest() is a hook which is invoked at the time > + * of guest exit to facilitate the host-side handling of machine check > + * exception before the exception is passed on to the guest. This hook > + * is invoked from host virtual mode from KVM (before exiting the guest > + * with KVM_EXIT_NMI reason) for machine check exception that occurs in > + * the guest. > + * > + * Currently no action is performed in the host other than printing the > + * event information. The machine check exception is passed on to the > + * guest kernel and the guest kernel will attempt for recovery. > + */ > +int opal_machine_check_guest(struct machine_check_event *evt) > +{ > + /* Print things out */ > + if (evt->version != MCE_V1) { > + pr_err("Machine Check Exception, Unknown event version %d !\n", > + evt->version); > + return 0; > + } > + machine_check_print_event_info(evt); > + return 0; > +} > +#endif Called from kvmppc_handle_exit_hv(): + if (ppc_md.machine_check_exception_guest) + ppc_md.machine_check_exception_guest( + &vcpu->arch.mce_evt); break; Just call machine_check_print_event_info() directly from kvmppc_handle_exit_hv(). You'll need to export symbol it, but that's all AFAICS, I don't think it even needs any #ifdefs. If we ever want to do anything different we can change the code then. cheers
next prev parent reply other threads:[~2017-04-06 5:53 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-04-05 20:46 [PATCH v7 0/3] KVM: PPC: Add FWNMI support for KVM guests on POWER Mahesh J Salgaonkar 2017-04-05 20:58 ` Mahesh J Salgaonkar 2017-04-05 20:47 ` [PATCH v7 1/3] KVM: PPC: Add new capability to control MCE behaviour Mahesh J Salgaonkar 2017-04-05 20:59 ` Mahesh J Salgaonkar 2017-04-05 20:47 ` [PATCH v7 2/3] powerpc/powernv: Introduce a machine check hook for Guest MCEs Mahesh J Salgaonkar 2017-04-05 20:59 ` Mahesh J Salgaonkar 2017-04-06 5:22 ` David Gibson 2017-04-06 5:22 ` David Gibson 2017-04-06 7:04 ` Mahesh Jagannath Salgaonkar 2017-04-06 7:16 ` Mahesh Jagannath Salgaonkar 2017-04-06 5:53 ` Michael Ellerman [this message] 2017-04-06 5:53 ` Michael Ellerman 2017-04-05 20:47 ` [PATCH v7 3/3] KVM: PPC: Exit guest upon MCE when FWNMI capability is enabled Mahesh J Salgaonkar 2017-04-05 20:59 ` 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=878tneuln2.fsf@concordia.ellerman.id.au \ --to=mpe@ellerman.id.au \ --cc=agraf@suse.de \ --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=paulus@samba.org \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.