[Qemu-devel] [PATCH 0/4] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests
This series of patches add support for FWNMI in PowerKVM guests. Memory error such as bit flips that cannot be corrected by hardware is passed on to the kernel for handling by raising machine check exception (an NMI). Upon such machine check exception, if the address in error belongs to guest then KVM causes a guest exit with KVM_EXIT_NMI exit reason [1]. This patch series adds functionality to pass on such machine check exception to the guest kernel by suitably handling KVM_EXIT_NMI exit and building the error log. This patch series explores the alternate design discussed in the QEMU mailing list [2], [3]. In earlier design [2] KVM invoked guest's NMI interrupt vector 0x200 upon machine check exception, while QEMU patched 0x200 vector to issue hcall to facilitate building and copying of error log into RTAS space. The new design simplifies couple of things. Thanks to David Gibson for the suggestion: - Eliminates patching of 0x200 interrupt vector from QEMU, hence, trampoline not required - Avoids introducing a new private hcall to be called from guest's 0x200 vector to enable QEMU to build error log - Simplifies re-trying by other processors when one of the processor is consuming/processing the error log. [1] http://marc.info/?l=kvm-ppc&m=144726114408289 [2] https://lists.nongnu.org/archive/html/qemu-devel/2014-11/msg00813.html [3] https://lists.nongnu.org/archive/html/qemu-devel/2015-08/msg00898.html --- Aravinda Prasad (4): spapr: Extend rtas-blob spapr: Register and handle HCALL to receive updated RTAS region spapr: Handle "ibm,nmi-register" and "ibm,nmi-interlock" RTAS calls target-ppc: Handle NMI guest exit hw/ppc/spapr.c |4 ++ hw/ppc/spapr_hcall.c |8 + hw/ppc/spapr_rtas.c| 29 + include/hw/ppc/spapr.h | 11 +-- target-ppc/kvm.c | 69 + target-ppc/kvm_ppc.h | 81 6 files changed, 200 insertions(+), 2 deletions(-) -- Aravinda Prasad
Re: [Qemu-devel] [PATCH 0/4] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests
On Wed, Nov 11, 2015 at 10:45:00PM +0530, Aravinda Prasad wrote: > This series of patches add support for FWNMI in PowerKVM guests. > > Memory error such as bit flips that cannot be corrected > by hardware is passed on to the kernel for handling > by raising machine check exception (an NMI). Upon such > machine check exception, if the address in error belongs > to guest then KVM causes a guest exit with KVM_EXIT_NMI > exit reason [1]. > > This patch series adds functionality to pass on such > machine check exception to the guest kernel by suitably > handling KVM_EXIT_NMI exit and building the error log. > This patch series explores the alternate design > discussed in the QEMU mailing list [2], [3]. > > In earlier design [2] KVM invoked guest's NMI interrupt > vector 0x200 upon machine check exception, while QEMU > patched 0x200 vector to issue hcall to facilitate > building and copying of error log into RTAS space. > > The new design simplifies couple of things. Thanks to > David Gibson for the suggestion: > > - Eliminates patching of 0x200 interrupt vector from > QEMU, hence, trampoline not required > - Avoids introducing a new private hcall to be called > from guest's 0x200 vector to enable QEMU to build > error log > - Simplifies re-trying by other processors when one > of the processor is consuming/processing the error > log. > > [1] http://marc.info/?l=kvm-ppc&m=144726114408289 > [2] https://lists.nongnu.org/archive/html/qemu-devel/2014-11/msg00813.html > [3] > https://lists.nongnu.org/archive/html/qemu-devel/2015-08/msg00898.html This looks basically good, although I have some concerns noted in replies to patches 3 & 4. We can't merge this, though, until the prerequisite kernel and SLOF patches are merged, so this won't make it into 2.5 (hard freeze today). -- 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