From patchwork Thu Jun 13 16:44:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 10993559 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 10C79924 for ; Thu, 13 Jun 2019 19:03:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3F2B22B27 for ; Thu, 13 Jun 2019 19:03:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E80D723201; Thu, 13 Jun 2019 19:03:39 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 98C4422B27 for ; Thu, 13 Jun 2019 19:03:39 +0000 (UTC) Received: from localhost ([::1]:44154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbV0c-0007EH-Bi for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Jun 2019 15:03:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55561) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbSqS-0001DJ-19 for qemu-devel@nongnu.org; Thu, 13 Jun 2019 12:45:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbSqQ-0006ll-Ct for qemu-devel@nongnu.org; Thu, 13 Jun 2019 12:44:59 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44524 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbSqQ-0006dW-0t for qemu-devel@nongnu.org; Thu, 13 Jun 2019 12:44:58 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5DGgVIj074586 for ; Thu, 13 Jun 2019 12:44:55 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2t3q921e6s-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Jun 2019 12:44:54 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Jun 2019 17:44:53 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 13 Jun 2019 17:44:50 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5DGin1N49938622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2019 16:44:49 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E040A404D; Thu, 13 Jun 2019 16:44:49 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA8AAA4053; Thu, 13 Jun 2019 16:44:48 +0000 (GMT) Received: from bahia.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.41]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 13 Jun 2019 16:44:48 +0000 (GMT) From: Greg Kurz To: David Gibson Date: Thu, 13 Jun 2019 18:44:48 +0200 User-Agent: StGit/unknown-version MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19061316-0008-0000-0000-000002F38422 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061316-0009-0000-0000-000022608B47 Message-Id: <156044428869.125694.13827513253200184549.stgit@bahia.lab.toulouse-stg.fr.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-13_11:, , 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=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=491 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906130122 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 0/3] xics/kvm: Fix issues with older KVMs on POWER9 hosts 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: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , Greg Kurz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This series fixes various issues that can happen when running a spapr machine on a POWER9 host and KVM doesn't have proper support to destroy XICS-on-XIVE devices (ie, without the changes at [1]). Patch 1 and 2 fix a QEMU crash that happens with the default settings, ie. ic-mode=dual and kernel-irqchip is unspecified (ie, emulated fallback is allowed). Patch 3 allows to detect the same KVM limitation when passing kernel-irqchip=on, and to error out early instead of exiting at the next guest reboot. --- Greg [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5422e95103cf9663bc86cf1056a3ea44c2e2f09e --- Greg Kurz (3): xics/spapr: Prevent RTAS/hypercalls emulation to be used by in-kernel XICS xics/spapr: Register RTAS/hypercalls once at machine init xics/spapr: Detect old KVM XICS on POWER9 hosts docs/specs/ppc-spapr-xive.rst | 4 ++- hw/intc/xics_kvm.c | 49 +++++++++++++++++++++++-------------- hw/intc/xics_spapr.c | 54 +++++++++++++++++++++++++++++++++++------ hw/ppc/spapr_irq.c | 16 +++++++++++- include/hw/ppc/spapr.h | 4 --- include/hw/ppc/xics.h | 1 - include/hw/ppc/xics_spapr.h | 2 ++ 7 files changed, 95 insertions(+), 35 deletions(-)