From patchwork Thu Nov 21 00:56:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 11255097 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 5354E14C0 for ; Thu, 21 Nov 2019 00:58:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A8DE2089D for ; Thu, 21 Nov 2019 00:58:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b="GH/ey9I1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726701AbfKUA6s (ORCPT ); Wed, 20 Nov 2019 19:58:48 -0500 Received: from ozlabs.org ([203.11.71.1]:34531 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbfKUA6s (ORCPT ); Wed, 20 Nov 2019 19:58:48 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 47JLm44S9lz9sR2; Thu, 21 Nov 2019 11:58:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1574297924; bh=uy06rYtNsupoZ3y3vcdSdik4ZpqVFHNbtPoj6Ji6YFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GH/ey9I17WPcqhxnfntIjzp89v+GocZFviNoVj5tc/u1wRv9nZRm70g0d6H7E4huG Ko5wf/5H1AmADYpIy9Xxx7C+drHdYhuzBZcJJdM9B/L1KHZaBNVIE79jAeczsA/ns9 js14uu6SHHwCWZDkUy0PdzSRpEXyti5fXNxUYejc= From: David Gibson To: Alex Williamson , clg@kaod.org Cc: groug@kaod.org, philmd@redhat.com, qemu-ppc@nongnu.org, Paolo Bonzini , Jason Wang , Laurent Vivier , David Gibson , kvm@vger.kernel.org, qemu-devel@nongnu.org, Riku Voipio , =?utf-8?q?Marc-And?= =?utf-8?q?r=C3=A9_Lureau?= , Alexey Kardashevskiy Subject: [PATCH 4/5] spapr: Handle irq backend changes with VFIO PCI devices Date: Thu, 21 Nov 2019 11:56:06 +1100 Message-Id: <20191121005607.274347-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191121005607.274347-1-david@gibson.dropbear.id.au> References: <20191121005607.274347-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 which 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 Reviewed-by: Cédric Le Goater --- 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 168044be85..1d27034962 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -508,6 +508,12 @@ static void set_active_intc(SpaprMachineState *spapr, } spapr->active_intc = new_intc; + + /* + * We've changed the kernel irqchip, let VFIO devices know they + * need to readjust. + */ + kvm_irqchip_change_notify(); } void spapr_irq_update_active_intc(SpaprMachineState *spapr)