From patchwork Fri Mar 22 06:33:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aravinda Prasad X-Patchwork-Id: 10865039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCAD515AC for ; Fri, 22 Mar 2019 06:42:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9A992A4E4 for ; Fri, 22 Mar 2019 06:42:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E1162A4E9; Fri, 22 Mar 2019 06:42:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 20E992A4E4 for ; Fri, 22 Mar 2019 06:42:44 +0000 (UTC) Received: from localhost ([127.0.0.1]:52734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7Dt5-0001Vw-Hc for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Mar 2019 02:42:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7Dkq-0003Ld-DR for qemu-devel@nongnu.org; Fri, 22 Mar 2019 02:34:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7DkO-0000XC-LI for qemu-devel@nongnu.org; Fri, 22 Mar 2019 02:33:45 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53614) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h7DkO-0000Tt-3L for qemu-devel@nongnu.org; Fri, 22 Mar 2019 02:33:44 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2M6TF3p027314 for ; Fri, 22 Mar 2019 02:33:40 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rctbc0dgr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 22 Mar 2019 02:33:40 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Mar 2019 06:33:37 -0000 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 22 Mar 2019 06:33:34 -0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x2M6XYEL19791898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Mar 2019 06:33:34 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 881B4112062; Fri, 22 Mar 2019 06:33:34 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3498C112061; Fri, 22 Mar 2019 06:33:32 +0000 (GMT) Received: from [127.0.1.1] (unknown [9.85.69.175]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 22 Mar 2019 06:33:31 +0000 (GMT) From: Aravinda Prasad To: aik@au1.ibm.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, david@gibson.dropbear.id.au Date: Fri, 22 Mar 2019 12:03:30 +0530 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19032206-0072-0000-0000-0000040ED0F0 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010793; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000281; SDB=6.01177898; UDB=6.00616221; IPR=6.00958596; MB=3.00026104; MTD=3.00000008; XFM=3.00000015; UTC=2019-03-22 06:33:35 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19032206-0073-0000-0000-00004B917D73 Message-Id: <155323635511.18748.18133954505098138975.stgit@aravinda> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-22_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=478 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903220049 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v7 0/6] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: paulus@ozlabs.org, aravinda@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch set adds support for FWNMI in PowerKVM guests. System errors such as SLB multihit and memory errors 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 exceptions, if the address in error belongs to guest then KVM invokes guests' 0x200 interrupt vector if the guest is not FWNMI capable. For FWNMI capable guest KVM passes the control to QEMU by exiting the guest. This patch series adds functionality to QEMU to pass on such machine check exceptions to the FWNMI capable guest kernel by building an error log and invoking the guest registered machine check handling routine. The KVM changes are now part of the upstream kernel (commit e20bbd3d). This series contain QEMU changes. Change Log v7: - Rebased to 4.1 Change Log v6: - Fetches rtas_addr from fdt - Handles all error conditions (earlier it was only UEs) Change Log v5: - Handled VM migrations by including rtas_addr in VMSTATE. - Migration is blocked while a machine check is in progress. --- Aravinda Prasad (6): ppc: spapr: Handle "ibm,nmi-register" and "ibm,nmi-interlock" RTAS calls Wrapper function to wait on condition for the main loop mutex target/ppc: Handle NMI guest exit target/ppc: Build rtas error log ppc: spapr: Enable FWNMI capability migration: Block migration while handling machine check cpus.c | 5 + hw/ppc/spapr.c | 29 +++++ hw/ppc/spapr_events.c | 286 ++++++++++++++++++++++++++++++++++++++++++++++ hw/ppc/spapr_rtas.c | 55 +++++++++ include/hw/ppc/spapr.h | 23 ++++ include/qemu/main-loop.h | 8 + target/ppc/kvm.c | 30 +++++ target/ppc/kvm_ppc.h | 8 + 8 files changed, 443 insertions(+), 1 deletion(-) -- Aravinda Prasad