lkml.org 
[lkml]   [2014]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [Patch Part2 V1 11/14] iommu/vt-d, PCI: update DRHD/RMRR/ATSR device scope caches when PCI hotplug happens
    Hi Gerry,
    This is patch solution is better than mine, it's more reliable.
    I tested this patch in my huawei RH5885 platform, after applied it,
    the issue is gone. But I can not test it in the case that bus number changed
    after hotplug. Anyway, it's a good solution.

    Thanks!
    Yijing.

    On 2014/1/7 17:00, Jiang Liu wrote:
    > Current Intel DMAR/IOMMU driver assumes that all PCI devices associated
    > with DMAR/RMRR/ATSR device scope arrays are created at boot time and
    > won't change at runtime, so it caches pointers of associated PCI device
    > object. That assumption may be wrong now due to:
    > 1) introduction of PCI host bridge hotplug
    > 2) PCI device hotplug through sysfs interfaces.
    >

    > diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
    > index 31c72d5..15c9ce0 100644
    > --- a/drivers/iommu/dmar.c
    > +++ b/drivers/iommu/dmar.c
    > @@ -194,6 +194,209 @@ void dmar_free_dev_scope(struct pci_dev __rcu ***devices, int *cnt)
    > *cnt = 0;
    > }
    >
    > +/* Optimize out kzalloc()/kfree() for normal cases */
    > +static char dmar_pci_notify_info_buf[64];

    In my idea, pci device add/remove is not a frequent action, so maybe using kzalloc and kfree make
    code more simplified, this is just my personal opinion.

    > +
    > +static struct dmar_pci_notify_info *
    > +dmar_alloc_pci_notify_info(struct pci_dev *dev, unsigned long event)
    > +{
    > + int level = 0;
    > + size_t size;



    \
     
     \ /
      Last update: 2014-01-09 10:41    [W:5.498 / U:0.184 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site