Message ID | 20250327162946.11347-1-Ashish.Kalra@amd.com (mailing list archive) |
---|---|
State | Rejected |
Delegated to: | Bjorn Helgaas |
Headers | show |
Series | [RESEND,v2] PCI/MSI: Fix x86 VMs crash due to dereferencing NULL MSI domain | expand |
On Thu, Mar 27, 2025 at 04:29:46PM +0000, Ashish Kalra wrote: > From: Ashish Kalra <ashish.kalra@amd.com> > > Moving pci_msi_ignore_mask to per MSI domain flag is causing a panic > with SEV-SNP VMs under KVM while booting and initializing virtio-scsi > driver as below : Isn't it already fixed (in current Linus' master branch?
On Thu, Mar 27 2025 at 19:46, Andy Shevchenko wrote: > On Thu, Mar 27, 2025 at 04:29:46PM +0000, Ashish Kalra wrote: >> From: Ashish Kalra <ashish.kalra@amd.com> >> >> Moving pci_msi_ignore_mask to per MSI domain flag is causing a panic >> with SEV-SNP VMs under KVM while booting and initializing virtio-scsi >> driver as below : > > Isn't it already fixed (in current Linus' master branch? Yes it is. 3ece3e8e5976 ("PCI/MSI: Handle the NOMASK flag correctly for all PCI/MSI backends") And it is fixed so that it takes _all_ potential PCI/MSI backends into account and not only papers over the problem at hand as pointed out in the thread leading up to the above commit. Thanks, tglx
diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c index d74162880d83..05c651be93cc 100644 --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -297,7 +297,7 @@ static int msi_setup_msi_desc(struct pci_dev *dev, int nvec, /* Lies, damned lies, and MSIs */ if (dev->dev_flags & PCI_DEV_FLAGS_HAS_MSI_MASKING) control |= PCI_MSI_FLAGS_MASKBIT; - if (info->flags & MSI_FLAG_NO_MASK) + if (info && info->flags & MSI_FLAG_NO_MASK) control &= ~PCI_MSI_FLAGS_MASKBIT; desc.nvec_used = nvec; @@ -612,7 +612,8 @@ void msix_prepare_msi_desc(struct pci_dev *dev, struct msi_desc *desc) desc->pci.msi_attrib.is_64 = 1; desc->pci.msi_attrib.default_irq = dev->irq; desc->pci.mask_base = dev->msix_base; - desc->pci.msi_attrib.can_mask = !(info->flags & MSI_FLAG_NO_MASK) && + desc->pci.msi_attrib.can_mask = info ? !(info->flags & MSI_FLAG_NO_MASK) && + !desc->pci.msi_attrib.is_virtual : !desc->pci.msi_attrib.is_virtual; if (desc->pci.msi_attrib.can_mask) { @@ -747,7 +748,7 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries, /* Disable INTX */ pci_intx_for_msi(dev, 0); - if (!(info->flags & MSI_FLAG_NO_MASK)) { + if (!info || !(info->flags & MSI_FLAG_NO_MASK)) { /* * Ensure that all table entries are masked to prevent * stale entries from firing in a crash kernel.