linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Noa Osherovich <noaos@mellanox.com>
Cc: gwshan@linux.vnet.ibm.com, helgaas@kernel.org,
	linux-pci@vger.kernel.org, majd@mellanox.com,
	alex.williamson@redhat.com, amir@vadai.me
Subject: Re: [PATCH] PCI: Refine broken INTx masking for Mellanox devices
Date: Fri, 11 Nov 2016 10:22:28 +1100	[thread overview]
Message-ID: <20161110232228.GA6798@gwshan> (raw)
In-Reply-To: <08e3aa80-1d13-7a6e-9133-87a149741993@mellanox.com>

On Thu, Nov 10, 2016 at 05:56:50PM +0200, Noa Osherovich wrote:

.../...

>>>> As a result, the VFIO driver fails to start when more than one device
>>>> function is passed-through to a VM if both have the same INTx pin.
>>>>
>> I don't see how the issue is related to the patch. INTx pin can be shared
>> by multiple functions and it's not going to be changed by the patch. When
>> the functions aren't claimed for capability to mask INTx from device side,
>> the shared INTx (or hardware IRQ) has to be masked from host (IRQ controller)
>> side. It does affect multiple VMs who are sharing thise INTx pin. I'm not
>> sure if it's the problem you have?
>
>VFIO reads the broken_intx_masking field when it's used on the host (VFIO uses a
>variable named pci_2_3). During vfio_intx_set_signal it sets the irqflags
>variable to 0 if the pci_2_3 is 0. When the first function is assigned to the
>guest, everything is OK.
>When a second function with the same INT-x pin is assigned, VFIO checks that they
>can share the IRQ.
>The irqflags variable is then checked to see if IRQF_SHARED is set. If not, which
>is the case here, VFIO fails to request IRQ thus failing and the guest can't start.
>

Noa, Thanks for the explanation. It makes sense.

Thanks,
Gavin

  reply	other threads:[~2016-11-10 23:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-01 14:47 [PATCH] PCI: Refine broken INTx masking for Mellanox devices Noa Osherovich
2016-11-09 18:22 ` Bjorn Helgaas
2016-11-10  3:46   ` Gavin Shan
2016-11-10 15:00     ` Bjorn Helgaas
2016-11-10 15:58       ` Noa Osherovich
2016-11-10 15:56     ` Noa Osherovich
2016-11-10 23:22       ` Gavin Shan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-04-19 16:33 Majd Dibbiny
2016-04-19 19:04 ` Alex Williamson
2016-04-21  7:12   ` Majd Dibbiny
2016-04-25 12:45     ` Majd Dibbiny
2016-04-25 13:55       ` Alex Williamson
     [not found]         ` <5720CFA1.6030200@mellanox.com>
2016-04-28  7:55           ` Majd Dibbiny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161110232228.GA6798@gwshan \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=amir@vadai.me \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=majd@mellanox.com \
    --cc=noaos@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).