Re: [PATCH] iommu/vt-d: Handle hotplug devices' default identity mapping setting

From: Lu Baolu
Date: Fri Feb 22 2019 - 02:47:08 EST

Hi James,

On 2/22/19 2:38 PM, James Dong wrote:

Tried this patch, and the same DMAR fault message came out.

Guess it is because of the iommu code path for hotplug devices. If a hotplug
device is rescanned after removal, iommu_bus_notifier will be called as part
of the notifier chains to handle BUS_NOTIFY_ADD_DEVICE event. Along the code
path, intel_iommu_ops->add_device() created an iommu group for this hotplug
device, but failed to create an iommu domain because of the default domain
type IOMMU_DOMAIN_IDENTITY imposed by current IOMMU command line option got
declined by intel_iommu_ops->domain_alloc().

In your patch, function find_or_alloc_domain() is not even in the code path
of BUS_NOTIFY_ADD_DEVICE event notifier chain.

Please let us know if your have more concerns and suggestions.

Can I reproduce this with a local machine? If so, how should I do?

Best Regards,

Best regards,
Lu Baolu