From patchwork Wed Mar 20 06:20:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 10860875 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 A1DA3139A for ; Wed, 20 Mar 2019 06:21:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88AC9299D4 for ; Wed, 20 Mar 2019 06:21:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D092299D7; Wed, 20 Mar 2019 06:21:12 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CE4D299D4 for ; Wed, 20 Mar 2019 06:21:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727361AbfCTGVJ (ORCPT ); Wed, 20 Mar 2019 02:21:09 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:39679 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726749AbfCTGVJ (ORCPT ); Wed, 20 Mar 2019 02:21:09 -0400 Received: by mail-oi1-f195.google.com with SMTP id b4so904784oif.6 for ; Tue, 19 Mar 2019 23:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=08Aen4qx1IDz6+IFTgt+8jgU0Ybee3/5cpwjbS7ne6M=; b=l9O0TAIxyYgqvGDnX+Vv7OfLMrT98SeSJMM2PyYjG3BEwzm/dvcsAevh91lemim1z2 YuIXyCcmtDsP9aWcwf5MQkNfCj3oDB0tUkLhXhtQOyzWKkJ07ehtv8AiGqh6Ei3Z7fVo xrW4R3hPFdxGhgkJpkVUFSQRSqBMzhUiqzjtKBXEluv9Z3lelJd3XoxAtGrERiS0nB0A 1XJyaBsLBHrjVWCcohlP4I7lNj/0nPjdxkTa44s4gXriOnBk2+swhB4z4wxku6Z8rx7o 3S86lRqs3vIYuMndieVX5Vk7F5FgPkjhM3ySMo1TDs9h0FYSxYqtJHf7sovvoNmNu54W jJ6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=08Aen4qx1IDz6+IFTgt+8jgU0Ybee3/5cpwjbS7ne6M=; b=LgSpDiZdP8jbx5SJqdQxWHCQe+x15OvApxYhBYkmiBZgi96Fw8EENns2LQ0+Pvqo9B eLuKfi88KsNEY/sVOE/wyNSyDFEj3Fs88+MwZqNKedfEzuAW8+gS/FtX4HOD0iQuX5Hx H96RZLFIadJLnv8KL/rRFiAMB8JYAvBqQqQNehOgftSwcZmSr4MFgvuE0+SHzeTYrsjr 3VyzZsitNN7PWF8UT/H0ywLuTEehSnnts6GEk0VKB42BJYYrBS2nCz5cI37D2AM30wr2 3agrEFx5nEC4GcTDSuWoVBvgJmms0kBwk1qjBGqs4KP23DBMrRPGTXUpDEMk1WDPKKdg /7fQ== X-Gm-Message-State: APjAAAUXmvY2wMO8yE/9+dcDCFYHOO9iW2nlOxHlHX2wCdcsoikGn/Tv SeyH9ENQty36SAmSCTBvsnIeG77EGJU= X-Google-Smtp-Source: APXvYqx8PN6YGyhoU0LsihIpAHcrqJ4Hr2QIyexozf/ucz5Fs/5EfGCS1uJdSRhJtPYoiMiZRREmmw== X-Received: by 2002:aca:4405:: with SMTP id r5mr3919148oia.171.1553062868695; Tue, 19 Mar 2019 23:21:08 -0700 (PDT) Received: from localhost.localdomain (li808-42.members.linode.com. [104.237.132.42]) by smtp.gmail.com with ESMTPSA id e186sm401517oia.44.2019.03.19.23.21.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Mar 2019 23:21:06 -0700 (PDT) From: Leo Yan To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Will Deacon , Marc Zyngier , Jean-Philippe Brucker , Eric Auger , Robin Murphy Cc: Leo Yan Subject: [PATCH kvmtool v2 0/3] vfio-pci: Support INTx mode re-enabling Date: Wed, 20 Mar 2019 14:20:43 +0800 Message-Id: <20190320062046.3895-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; 0001/0002 patches are only minor fixing up for eventfd releasing and remove useless FDs reservation for INTx. 0003 patch is the core patch for supporting 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. Leo Yan (3): vfio-pci: Release INTx's unmask eventfd properly vfio-pci: Remove useless FDs reservation in vfio_pci_enable_intx() vfio-pci: Re-enable INTx mode when disable MSI/MSIX include/kvm/vfio.h | 1 + vfio/pci.c | 61 +++++++++++++++++++++++++++++++++++++--------- 2 files changed, 50 insertions(+), 12 deletions(-)