From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a95G4-0001PQ-Vh for qemu-devel@nongnu.org; Wed, 16 Dec 2015 01:08:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a95G2-00062e-D3 for qemu-devel@nongnu.org; Wed, 16 Dec 2015 01:08:16 -0500 Received: from e19.ny.us.ibm.com ([129.33.205.209]:51788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a95G2-00062P-9H for qemu-devel@nongnu.org; Wed, 16 Dec 2015 01:08:14 -0500 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 16 Dec 2015 01:08:12 -0500 From: Aravinda Prasad Date: Wed, 16 Dec 2015 11:38:04 +0530 Message-ID: <20151216060551.10636.77403.stgit@aravindap> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v2 0/4] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org Cc: benh@au1.ibm.com, aik@ozlabs.ru, paulus@samba.org, sam.bobroff@au1.ibm.com, david@gibson.dropbear.id.au 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. Change Log v2: - Added KVM capability - Serialized multiple NMIs with a conditional wait [1] http://marc.info/?l=kvm&m=145024538523497 [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: 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 spapr: Introduce FWNMI KVM capability cpus.c | 5 +++ hw/ppc/spapr.c | 6 +++ hw/ppc/spapr_hcall.c | 8 ++++ hw/ppc/spapr_rtas.c | 53 +++++++++++++++++++++++++++ include/hw/ppc/spapr.h | 13 ++++++- include/qemu/main-loop.h | 8 ++++ linux-headers/linux/kvm.h | 1 + target-ppc/kvm.c | 88 +++++++++++++++++++++++++++++++++++++++++++++ target-ppc/kvm_ppc.h | 81 +++++++++++++++++++++++++++++++++++++++++ 9 files changed, 261 insertions(+), 2 deletions(-) -- Aravinda Prasad