Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BA17C4CECE for ; Thu, 17 Oct 2019 05:46:45 +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 CF8652067B for ; Thu, 17 Oct 2019 05:46:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b="d5nB3dZD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF8652067B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKycV-0005zk-TJ for qemu-devel@archiver.kernel.org; Thu, 17 Oct 2019 01:46:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44387) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKyYQ-00016k-IQ for qemu-devel@nongnu.org; Thu, 17 Oct 2019 01:42:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKyYP-0005Jd-JT for qemu-devel@nongnu.org; Thu, 17 Oct 2019 01:42:30 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:41887 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iKyYP-0005Ik-8L; Thu, 17 Oct 2019 01:42:29 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46tyjT6m1bz9sPc; Thu, 17 Oct 2019 16:42:21 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1571290941; bh=mGl9erpGvqOrf7exLX2jon0zItJbqLirNCGx+VikJ1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d5nB3dZDlhZ2E1yiltlu72vEEnyFQTnFOMKueOq5If+DHT610AyiIbx0xp6GywPVq Nw0biffJMmE99WBz9ZmvmJocd/aMljYjUcCciVF9ETpHJbZv8xbpOH6NxgSSVoXizq oV/cU57lGpwD5J5yTZYnXbH748sl/lMvtbUATjEo= From: David Gibson To: alex.williamson@redhat.com, clg@kaod.org, groug@kaod.org Subject: [RFC 4/5] spapr: Handle irq backend changes with VFIO PCI devices Date: Thu, 17 Oct 2019 16:42:17 +1100 Message-Id: <20191017054218.8876-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191017054218.8876-1-david@gibson.dropbear.id.au> References: <20191017054218.8876-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: aik@ozlabs.ru, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" pseries machine type can have one of two different interrupt controllers = in use depending on feature negotiation with the guest. Usually this is invisible to devices, because they route to a common set of qemu_irqs whi= ch in turn dispatch to the correct back end. VFIO passthrough devices, however, wire themselves up directly to the KVM irqchip for performance, which means they are affected by this change in interrupt controller. To get them to adjust correctly for the change in irqchip, we need to fire the kvm irqchip change notifier. Cc: Alex Williamson Cc: Alexey Kardashevskiy Signed-off-by: David Gibson --- hw/ppc/spapr_irq.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index 234d1073e5..45544b8976 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -480,6 +480,12 @@ static void set_active_intc(SpaprMachineState *spapr= , } =20 spapr->active_intc =3D new_intc; + + /* + * We've changed the kernel irqchip, let VFIO devices know they + * need to readjust. + */ + kvm_irqchip_change_notify(); } =20 void spapr_irq_update_active_intc(SpaprMachineState *spapr) --=20 2.21.0