From patchwork Wed Sep 18 08:12:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aravinda Prasad X-Patchwork-Id: 11149855 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF073912 for ; Wed, 18 Sep 2019 08:20:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF54620640 for ; Wed, 18 Sep 2019 08:20:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF54620640 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:55652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAVCK-000331-UI for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Sep 2019 04:20:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45814) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAV6h-0005EJ-MD for qemu-devel@nongnu.org; Wed, 18 Sep 2019 04:14:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAV6g-00034p-AB for qemu-devel@nongnu.org; Wed, 18 Sep 2019 04:14:35 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:63390) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iAV6d-00033Y-IP; Wed, 18 Sep 2019 04:14:31 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8I8E4dB123177; Wed, 18 Sep 2019 04:14:17 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v3gqt882j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Sep 2019 04:14:15 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8I8AOdi012434; Wed, 18 Sep 2019 08:12:05 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma01wdc.us.ibm.com with ESMTP id 2v37jvknwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Sep 2019 08:12:05 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8I8C3VQ52232638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Sep 2019 08:12:04 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D9933BE04F; Wed, 18 Sep 2019 08:12:03 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 65CB3BE053; Wed, 18 Sep 2019 08:12:01 +0000 (GMT) Received: from [127.0.1.1] (unknown [9.199.61.50]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 18 Sep 2019 08:12:01 +0000 (GMT) From: Aravinda Prasad To: aik@ozlabs.ru, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, david@gibson.dropbear.id.au Date: Wed, 18 Sep 2019 13:42:00 +0530 Message-ID: <156879398718.18368.17640174821710157715.stgit@aravinda> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-09-18_06:, , 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=558 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909180085 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v14 0/7] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: paulus@ozlabs.org, aravinda@linux.vnet.ibm.com, groug@kaod.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 v14: - Feature activation moved to a separate patch - Fixed issues with migration blocker Change Log v13: - Minor fixes (mostly nits) - Moved FWNMI guest registration check from patch 4 to 3. Change Log v12: - Rebased to latest ppc-for-4.2 (SHA b1e8156743) Change Log v11: - Moved FWNMI SPAPR cap defaults to 4.2 class option - Fixed issues with handling fwnmi KVM capability Change Log v10: - Reshuffled the patch sequence + minor fixes Change Log v9: - Fixed kvm cap and spapr cap issues Change Log v8: - Added functionality to check FWNMI capability during VM migration --- Aravinda Prasad (7): Wrapper function to wait on condition for the main loop mutex ppc: spapr: Introduce FWNMI capability target/ppc: Handle NMI guest exit target/ppc: Build rtas error log upon an MCE ppc: spapr: Handle "ibm,nmi-register" and "ibm,nmi-interlock" RTAS calls migration: Include migration support for machine check handling ppc: spapr: Activate the FWNMI functionality cpus.c | 5 + hw/ppc/spapr.c | 95 ++++++++++++++++ hw/ppc/spapr_caps.c | 29 +++++ hw/ppc/spapr_events.c | 271 ++++++++++++++++++++++++++++++++++++++++++++++ hw/ppc/spapr_rtas.c | 85 ++++++++++++++ include/hw/ppc/spapr.h | 25 ++++ include/qemu/main-loop.h | 8 + target/ppc/kvm.c | 42 +++++++ target/ppc/kvm_ppc.h | 14 ++ target/ppc/trace-events | 1 10 files changed, 573 insertions(+), 2 deletions(-) -- Aravinda Prasad