Re: [PATCH 04/17] gpu: nova-core: allocate PCI MSI vector during probe
John Hubbard <[email protected]>
| Newsgroups | dev.linux.lists.nova-gpu,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 8/13/26 2:31 PM, Danilo Krummrich wrote:
> On Sat Aug 8, 2026 at 5:11 AM CEST, John Hubbard wrote:
>> Allocate a single PCI MSI interrupt vector in the probe path.
>>
>> Try MSI/MSI-X first. If that fails (possible in broken VFIO setups),
>> fall back to INTx with a dev_warn so the issue is visible in dmesg.
>> The allocation is devres-managed and automatically freed on unbind.
>
> [...]
>
>> +pub(crate) fn alloc_vector(pdev: &pci::Device<Bound>) -> Result<pci::IrqVector<'_>> {
>> + let msi_types = IrqTypes::default().with(IrqType::Msi).with(IrqType::MsiX);
>
> I was about to ask if we really need to bother with MSI and shouln't just go for
> MSI-X only.
I have an expensive, recent motherboard in my test machine, and it seems to only
expose MSI for my Turing, Ampere and Blackwell GPUs, in the non-SRIOV configuration.
So I'm thinking that MSI-X only would not work.
>
> But then saw that the commit message mentions broken VFIO setups; can you expand
> on this a bit? Which setups is the commit message referring to?
On Zhi Wang's Big Branch of Everything, he is able to run Windows guests in a
vGPU VM on top of nova-core. That system requires MSI-X. And I broke it with
an earlier internal version of this patchset.
That information probably leaked into my commit message here. I can remove
it. Because I don't think it is based on anything else.
>
>> +
>> + let irq_vectors = match pdev.alloc_irq_vectors(1, 1, msi_types) {
>> + Ok(vecs) => vecs,
>> + Err(_) => {
>> + dev_warn!(pdev.as_ref(), "MSI not available, falling back to INTx\n");
>> + pdev.alloc_irq_vectors(1, 1, IrqTypes::default().with(IrqType::Intx))?
>> + }
>> + };
>> +
>> + irq_vectors.vector(0)
>> +}
>
thanks,
--
John Hubbard