From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT 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 54FDDC10F11 for ; Wed, 24 Apr 2019 14:21:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BE5F218FC for ; Wed, 24 Apr 2019 14:21:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sAm5MXiR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727769AbfDXOVi (ORCPT ); Wed, 24 Apr 2019 10:21:38 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:46559 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbfDXOVi (ORCPT ); Wed, 24 Apr 2019 10:21:38 -0400 Received: by mail-yb1-f196.google.com with SMTP id m5so7153187ybk.13 for ; Wed, 24 Apr 2019 07:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XFgiOU+IFpTLzIbSG0pRnLvcmQ+HnbdvSe0p2WFb6Ns=; b=sAm5MXiR2N3H1OAr87W5AlZDl/Yr4NBX+L+1U376zVnxPVkaXe9AxIMLZGzcAV3M4R aBoOrcLMPh8JL7DTJ7Nre1QpDAodLJaR7MbWjuM7ImeBXypmWV0zDwQu65F+vCtfJKVt SqFIdbbiDA/O8tElyJ0mDI04FEkJbUYSZSoRME5bx6yOep9/qAP5S8HyXipjsB2/Xya9 0WCpQrgMtZLP7k7V7nNX/nwFJi1665ddjbky3zocbqJPOVKkrlVoLDk153ECc/ATIW9u V5PjU5EjXAfQRHZ/HzGXUSDhBybaQRXttaeZi3/z/Do33fs0Bwt/ZE64k9vB54blZ4lL J2JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XFgiOU+IFpTLzIbSG0pRnLvcmQ+HnbdvSe0p2WFb6Ns=; b=p/Kd2S1dpaTXX8xmUNJSAGndk+KF4QMHz4NBCHRKWfdAOZ+AYLdzGCqKHarmTHnwSu DApcXXn6JLf3Aid6ouOjZWjD3TV9euz7OOXfANgTtzqRAloPH6+kvlSpaR2LtKrbfrAo LOnPtjdgM4wd6/aSqsU2xMxzKnOAtRdokIinkWHKo6AhUDdkj9tNemJtPVpdPaSPHSP2 CtGt0ofvq6j6ak33R0e+9aip+ZAaoEWGL26W4ctfZgMjwdFYxbylqfO+apNYMVcqxWk1 zu3bDrBeM84c5wA2ocOv1QaOAlyM3kUSroFu3tQSIMDi/YWcZt7VHA3EcoEBOTrAAzlo XcuA== X-Gm-Message-State: APjAAAWipSMMLgxvDdH0jmocQC04FdbL7eyXlNXx6Z+yAocTa9gj1IQS ndtQc9yCC+L7Cim1tO+jQkSdOA9hz+LxiQ== X-Google-Smtp-Source: APXvYqxGuKXBAiAT1SL0myPL/oP9LsFU39gRc6j4K6UaBr3+N14QlWP3EnW3UZK0nc1I7RrhKZySkQ== X-Received: by 2002:a25:3745:: with SMTP id e66mr2043860yba.521.1556115696815; Wed, 24 Apr 2019 07:21:36 -0700 (PDT) Received: from leoy-ThinkPad-X240s (li931-65.members.linode.com. [45.56.113.65]) by smtp.gmail.com with ESMTPSA id b131sm7213247ywb.103.2019.04.24.07.21.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2019 07:21:35 -0700 (PDT) Date: Wed, 24 Apr 2019 22:21:27 +0800 From: Leo Yan To: "kvm@vger.kernel.org" , "kvmarm@lists.cs.columbia.edu" , Will Deacon , Jean-Philippe Brucker , Marc Zyngier , Eric Auger , Robin Murphy Subject: Re: [PATCH v4 0/3] vfio-pci: Support INTx mode re-enabling Message-ID: <20190424142127.GC8948@leoy-ThinkPad-X240s> References: <20190408012719.16158-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190408012719.16158-1-leo.yan@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Will, On Mon, Apr 08, 2019 at 09:27:16AM +0800, Leo Yan wrote: > When enable vfio-pci mode for NIC driver on Juno board, the IRQ is > failed to forward properly from host to guest, finally root caused this > issue is related with kvmtool cannot re-enable INTx mode properly. > > So the basic working flow to reproduce this issue is as below: > > Host Guest > ------------- -------------------- > INTx mode > MSI enable failed in NIC driver > MSI disable in NIC driver > Switch back to INTx mode --> kvmtool doesn't support > > So this patch is to support INTx mode re-enabling; patch 0001 is one > minor fixing up for eventfd releasing; patch 0002 introduces a new > function vfio_pci_init_intx() which is used to finish INTx one-time > initialisation; patch 0003 is the core patch for support INTx mode > re-enabling, when kvmtool detects MSI is disabled it rollbacks to INTx > mode. > > This patch set has been tested on Juno-r2 board. > > == Changes for V4 == > * Removed the unnecessary comments in patch 0003 (Jean-Philippe). > * Added Jean-Philippe's review tags. Could you pick up these 3 patches and merge into kvmtool? All of them has been received reviewing tag from Jean-Philippe. Thanks. > == Changes for V3 == > * Add new function vfio_pci_init_intx() for one-time initialisation. > * Simplized INTx re-enabling (don't change irq_line anymore at the > runtime). > > > Leo Yan (3): > vfio-pci: Release INTx's unmask eventfd properly > vfio-pci: Add new function for INTx one-time initialisation > vfio-pci: Re-enable INTx mode when disable MSI/MSIX > > include/kvm/vfio.h | 1 + > vfio/pci.c | 95 ++++++++++++++++++++++++++++++---------------- > 2 files changed, 64 insertions(+), 32 deletions(-) > > -- > 2.19.1 >