Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-02-14 Thread Joerg Roedel
Hi Jacob, On Wed, Feb 09, 2022 at 01:52:49PM -0800, Jacob Pan wrote: > Another option Ashok and I discussed is that we can make DMAR cache persist > (which should be for explicitly listed devices in each DRHD) across PCI > remove-rescan cycle, then we don't need the DMAR PCI bus notifier at all.

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-02-09 Thread Jacob Pan
Hi Joerg, On Thu, 3 Feb 2022 09:25:58 +0100, Joerg Roedel wrote: > On Tue, Feb 01, 2022 at 11:19:18AM -0800, Jacob Pan wrote: > > Do you mean having an IRQ remapping notifier regardless IOMMU-API is > > enabled, right? > > It make sense, I will give it a try. > > Yeah, that would be best. I

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-02-03 Thread Joerg Roedel
On Tue, Feb 01, 2022 at 11:19:18AM -0800, Jacob Pan wrote: > Do you mean having an IRQ remapping notifier regardless IOMMU-API is > enabled, right? > It make sense, I will give it a try. Yeah, that would be best. I really don't like to use two notifiers just to work around ordering issues.

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-02-01 Thread Jacob Pan
Hi Joerg, On Mon, 31 Jan 2022 16:52:10 +0100, Joerg Roedel wrote: > On Mon, Jan 31, 2022 at 01:53:06PM +, Robin Murphy wrote: > > Indeed I very nearly asked whether we couldn't just call these from > > intel_iommu_{probe,release}_device() directly, but it looks like they > > also interact

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-02-01 Thread Jacob Pan
Hi Joerg, On Sun, 30 Jan 2022 08:43:19 +0100, Joerg Roedel wrote: > Hi Jacob, Baolu, > > On Fri, Jan 28, 2022 at 11:10:01AM +0800, Lu Baolu wrote: > > During PCI bus rescan, adding new devices involve two notifiers. > > 1. dmar_pci_bus_notifier() > > 2. iommu_bus_notifier() > > The current

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-01-31 Thread Joerg Roedel
On Mon, Jan 31, 2022 at 01:53:06PM +, Robin Murphy wrote: > Indeed I very nearly asked whether we couldn't just call these from > intel_iommu_{probe,release}_device() directly, but it looks like they also > interact with the interrupt remapping stuff which can be built independently > of the

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-01-31 Thread Robin Murphy
On 2022-01-30 07:43, Joerg Roedel wrote: Hi Jacob, Baolu, On Fri, Jan 28, 2022 at 11:10:01AM +0800, Lu Baolu wrote: During PCI bus rescan, adding new devices involve two notifiers. 1. dmar_pci_bus_notifier() 2. iommu_bus_notifier() The current code sets #1 as low priority (INT_MIN) which

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-01-29 Thread Joerg Roedel
Hi Jacob, Baolu, On Fri, Jan 28, 2022 at 11:10:01AM +0800, Lu Baolu wrote: > During PCI bus rescan, adding new devices involve two notifiers. > 1. dmar_pci_bus_notifier() > 2. iommu_bus_notifier() > The current code sets #1 as low priority (INT_MIN) which resulted in #2 > being invoked first. The

[PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-01-27 Thread Lu Baolu
From: Jacob Pan During PCI bus rescan, adding new devices involve two notifiers. 1. dmar_pci_bus_notifier() 2. iommu_bus_notifier() The current code sets #1 as low priority (INT_MIN) which resulted in #2 being invoked first. The result is that struct device pointer cannot be found in DRHD search