lkml.org 
[lkml]   [2019]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRE: [PATCH] iommu/vt-d: Handle hotplug devices' default identity mapping setting
From
Baolu:

Yes, it is a generic issue for hotplug devices with current Intel IOMMU driver,
as reported in this thread as well.

The patch you provided does the job in our case. Please update this thread once
your patch is merged. Thanks.

Best Regards,
James

On 2/23/19 12:56 AM, Lu Baolu wrote
>
> @@ -4807,16 +4807,19 @@ static int device_notifier(struct notifier_block *nb,
> if (iommu_dummy(dev))
> return 0;
>
>- if (action != BUS_NOTIFY_REMOVED_DEVICE)
>- return 0;
>-
>- domain = find_domain(dev);
>- if (!domain)
>- return 0;
>+ if (action == BUS_NOTIFY_REMOVED_DEVICE) {
>+ domain = find_domain(dev);
>+ if (!domain)
>+ return 0;
>
>- dmar_remove_one_dev_info(dev);
>- if (!domain_type_is_vm_or_si(domain) && list_empty(&domain->devices))
>- domain_exit(domain);
>+ dmar_remove_one_dev_info(dev);
>+ if (!domain_type_is_vm_or_si(domain) &&
>+ list_empty(&domain->devices))
>+ domain_exit(domain);
>+ } else if (action == BUS_NOTIFY_ADD_DEVICE) {
>+ if (iommu_should_identity_map(dev, 1))
>+ domain_add_dev_info(si_domain, dev);
>+ }


\
 
 \ /
  Last update: 2019-02-24 17:11    [W:0.046 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site