lkml.org 
[lkml]   [2024]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v13 3/3] iommu/vt-d: improve ITE fault handling if target device isn't valid
On Tue, Feb 27, 2024 at 04:00:33AM +0800, Ethan Zhao wrote:
> > + if (!dev || !dev_is_pci(dev))
> > + return -ETIMEDOUT;
> > + pdev = to_pci_dev(dev);
> > + if (!pci_device_is_present(pdev) &&
> > + ite_sid == pci_dev_id(pci_physfn(pdev)))
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > Unless the device_rbtree_find() is returning garbage then these things
> > must be true.
> >
> > + return -ETIMEDOUT;
> >
> > I tried to double check how we were storing devices into the rbtree,
> > but then I discovered that the device_rbtree_find() doesn't exist in
> > linux-next and this patch breaks the build.
> >
> > This is very frustrating thing. But let's say a buggy BIOS could mess
> > up the rbtree. In that situation, we would still want to change the &&
> > to an ||. If the divice is not present and^W or the rbtree is corrupted
>
> Maybe you meant
> + if (!pci_device_is_present(pdev) ||
> + ite_sid != pci_dev_id(pci_physfn(pdev)))

Yep, that's what I was asking.

>
> Unfortunately, the ite_sid we got from the "Invalidation Queue Error Record Register" is the *PCI Requester-id* of faulty device, that could be different
> BDF as the sid in the ATS invalidation request for devices:
>
> 1. behind the PCIe to PCI bridges.
> 2. behindConventional PCI Bridges 3.PCI Express* Devices Using Phantom
> Functions 4.Intel® Scalable I/O Virtualization Capable Devices (e.g. ADI)
> 5. devices with ARI function.
> 6. behind root port without ACS enabled.
> ... ...

Fair enough... Thanks.

regards,
dan carpenter


\
 
 \ /
  Last update: 2024-05-27 15:24    [W:0.080 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site