From nobody Tue Feb 10 04:08:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1574749335; cv=none; d=zohomail.com; s=zohoarc; b=lFZ5o7H9WhHS96j4iQMBH/WXr6MmrkKYvc4fK1vFQt+tzNHY7j7S69Th7GMHkRcZB96XrcuLEKUyMEC9FkJ6J92igG0xcksUU7UG0h0703iEgP+GyOfE/Uxqp6Z/FOAETVZqjUX093i7SxZh2FyFOwxRtw89vKgCRTJGECA8ob4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574749335; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yBede6MeeAkUMInJfT8r3yxtKLJwKG49v0dNSredQTQ=; b=WRLsBuToE+zVXxrDdbRZz5x/SGpFrdhlMHeBeG4xfOS3hkfJs19RuEnviBncs22OUVIF6o8PJoUvErjLBNeKxn8IH6YvuCwpxFsOfhRMMu6SM0W9rwc1S5Ci1+GSVK8JdGvH6MdkDvd/S3wnvDNupJkfGOmcBEoe1tiKBNmRH3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574749335058500.6113865808527; Mon, 25 Nov 2019 22:22:15 -0800 (PST) Received: from localhost ([::1]:50470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZUEn-0005rU-Sp for importer@patchew.org; Tue, 26 Nov 2019 01:22:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59804) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZU8y-0007Jf-Sd for qemu-devel@nongnu.org; Tue, 26 Nov 2019 01:16:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZTvI-0004PC-Un for qemu-devel@nongnu.org; Tue, 26 Nov 2019 01:02:06 -0500 Received: from bilbo.ozlabs.org ([203.11.71.1]:38781 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iZTvI-0004NP-JN; Tue, 26 Nov 2019 01:02:04 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 47MYFd3L5gz9sRG; Tue, 26 Nov 2019 17:01:56 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1574748117; bh=/Lv46GlVbuezd+dx9seCW3M8TgeG6tuTmE2nbMPiE+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RxoooOJCcQDnZLrDegDqBMfk7mb0FiKoGGjECSSrqvo9+edcGaeEiVyi0L0kcCEeU /kOnzJCMnJJ57QVgflOq3eVPoRlNWnmUx00mdCdBac+YFpwpvOgNmUzaRwNV2TJYFN 4/lll/+ry+7sGu3D28KW8aTErtGWOFSVsQv0jmAM= From: David Gibson To: peter.maydell@linaro.org Subject: [PULL 6/8] spapr: Work around spurious warnings from vfio INTx initialization Date: Tue, 26 Nov 2019 17:01:49 +1100 Message-Id: <20191126060151.729845-7-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191126060151.729845-1-david@gibson.dropbear.id.au> References: <20191126060151.729845-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 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: lvivier@redhat.com, Alexey Kardashevskiy , qemu-devel@nongnu.org, groug@kaod.org, Alex Williamson , qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Traditional PCI INTx for vfio devices can only perform well if using an in-kernel irqchip. Therefore, vfio_intx_update() issues a warning if an in kernel irqchip is not available. We usually do have an in-kernel irqchip available for pseries machines on POWER hosts. However, because the platform allows feature negotiation of what interrupt controller model to use, we don't currently initialize it until machine reset. vfio_intx_update() is called (first) from vfio_realize() before that, so it can issue a spurious warning, even if we will have an in kernel irqchip by the time we need it. To workaround this, make a call to spapr_irq_update_active_intc() from spapr_irq_init() which is called at machine realize time, before the vfio realize. This call will be pretty much obsoleted by the later call at reset time, but it serves to suppress the spurious warning from VFIO. Cc: Alex Williamson Cc: Alexey Kardashevskiy Signed-off-by: David Gibson Reviewed-by: C=C3=A9dric Le Goater Tested-by: Alex Williamson Reviewed-by: Alex Williamson Reviewed-by: Greg Kurz Acked-by: Alex Williamson --- hw/ppc/spapr_irq.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index 1d27034962..d6bb7fd2d6 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -373,6 +373,14 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **= errp) =20 spapr->qirqs =3D qemu_allocate_irqs(spapr_set_irq, spapr, smc->nr_xirqs + SPAPR_XIRQ_BASE); + + /* + * Mostly we don't actually need this until reset, except that not + * having this set up can cause VFIO devices to issue a + * false-positive warning during realize(), because they don't yet + * have an in-kernel irq chip. + */ + spapr_irq_update_active_intc(spapr); } =20 int spapr_irq_claim(SpaprMachineState *spapr, int irq, bool lsi, Error **e= rrp) @@ -528,7 +536,8 @@ void spapr_irq_update_active_intc(SpaprMachineState *sp= apr) * this. */ new_intc =3D SPAPR_INTC(spapr->xive); - } else if (spapr_ovec_test(spapr->ov5_cas, OV5_XIVE_EXPLOIT)) { + } else if (spapr->ov5_cas + && spapr_ovec_test(spapr->ov5_cas, OV5_XIVE_EXPLOIT)) { new_intc =3D SPAPR_INTC(spapr->xive); } else { new_intc =3D SPAPR_INTC(spapr->ics); --=20 2.23.0