RE: [PATCH 1/1] iommu/vt-d: Serialize IOMMU GCMD register modifications

2020-08-25 Thread Tian, Kevin
> From: Lu Baolu > Sent: Wednesday, August 26, 2020 10:58 AM > > The VT-d spec requires (10.4.4 Global Command Register, GCMD_REG > General > Description) that: > > If multiple control fields in this register need to be modified, software > must serialize the modifications through multiple

[PATCH 1/1] iommu/vt-d: Serialize IOMMU GCMD register modifications

2020-08-25 Thread Lu Baolu
The VT-d spec requires (10.4.4 Global Command Register, GCMD_REG General Description) that: If multiple control fields in this register need to be modified, software must serialize the modifications through multiple writes to this register. However, in irq_remapping.c, modifications of IRE and

Re: [PATCH] iommu/vt-d:Add support for detecting ACPI device in RMRR

2020-08-25 Thread Lu Baolu
Hi Felix, On 8/18/20 10:44 AM, FelixCuioc wrote: Some ACPI devices need to issue dma requests to access the reserved memory area.BIOS uses the device scope type ACPI_NAMESPACE_DEVICE in RMRR to report these ACPI devices. This patch add support for detecting ACPI devices in RMRR. If you are

Re: [PATCH] iommu: Add support to filter non-strict/lazy mode based on device names

2020-08-25 Thread Rob Clark
On Tue, Aug 25, 2020 at 5:24 PM Doug Anderson wrote: > > Hi, > > On Tue, Aug 25, 2020 at 3:54 PM Rob Clark wrote: > > > > On Tue, Aug 25, 2020 at 3:23 PM Doug Anderson wrote: > > > > > > Hi, > > > > > > On Tue, Aug 25, 2020 at 12:01 PM Sai Prakash Ranjan > > > wrote: > > > > > > > > Hi, > > >

Re: [PATCH] iommu: Add support to filter non-strict/lazy mode based on device names

2020-08-25 Thread Doug Anderson
Hi, On Tue, Aug 25, 2020 at 3:54 PM Rob Clark wrote: > > On Tue, Aug 25, 2020 at 3:23 PM Doug Anderson wrote: > > > > Hi, > > > > On Tue, Aug 25, 2020 at 12:01 PM Sai Prakash Ranjan > > wrote: > > > > > > Hi, > > > > > > On 2020-08-25 21:40, Doug Anderson wrote: > > > > Hi, > > > > > > > > On

Re: [PATCH] iommu: Add support to filter non-strict/lazy mode based on device names

2020-08-25 Thread Rob Clark
On Tue, Aug 25, 2020 at 3:23 PM Doug Anderson wrote: > > Hi, > > On Tue, Aug 25, 2020 at 12:01 PM Sai Prakash Ranjan > wrote: > > > > Hi, > > > > On 2020-08-25 21:40, Doug Anderson wrote: > > > Hi, > > > > > > On Tue, Aug 25, 2020 at 8:43 AM Sai Prakash Ranjan > > > wrote: > > >> > > >>

Re: [PATCH] iommu: Add support to filter non-strict/lazy mode based on device names

2020-08-25 Thread Doug Anderson
Hi, On Tue, Aug 25, 2020 at 12:01 PM Sai Prakash Ranjan wrote: > > Hi, > > On 2020-08-25 21:40, Doug Anderson wrote: > > Hi, > > > > On Tue, Aug 25, 2020 at 8:43 AM Sai Prakash Ranjan > > wrote: > >> > >> Currently the non-strict or lazy mode of TLB invalidation can only be > >> set > >> for

Re: [patch RFC 30/38] PCI/MSI: Allow to disable arch fallbacks

2020-08-25 Thread Thomas Gleixner
On Tue, Aug 25 2020 at 23:40, Thomas Gleixner wrote: > On Tue, Aug 25 2020 at 16:35, Bjorn Helgaas wrote: >> On Tue, Aug 25, 2020 at 11:28:30PM +0200, Thomas Gleixner wrote: >>> >>> Or did you just mean that those architectures should select >>> CONFIG_I_WANT_THE CRUFT instead of opting out on

Re: [patch RFC 34/38] x86/msi: Let pci_msi_prepare() handle non-PCI MSI

2020-08-25 Thread Bjorn Helgaas
On Tue, Aug 25, 2020 at 11:30:41PM +0200, Thomas Gleixner wrote: > On Tue, Aug 25 2020 at 15:24, Bjorn Helgaas wrote: > > On Fri, Aug 21, 2020 at 02:24:58AM +0200, Thomas Gleixner wrote: > >> Rename it to x86_msi_prepare() and handle the allocation type setup > >> depending on the device type. > >

Re: [patch RFC 30/38] PCI/MSI: Allow to disable arch fallbacks

2020-08-25 Thread Thomas Gleixner
On Tue, Aug 25 2020 at 16:35, Bjorn Helgaas wrote: > On Tue, Aug 25, 2020 at 11:28:30PM +0200, Thomas Gleixner wrote: >> >> Or did you just mean that those architectures should select >> CONFIG_I_WANT_THE CRUFT instead of opting out on the fully irq domain >> based ones? > > Yes, that was my real

Re: [patch RFC 30/38] PCI/MSI: Allow to disable arch fallbacks

2020-08-25 Thread Bjorn Helgaas
On Tue, Aug 25, 2020 at 11:28:30PM +0200, Thomas Gleixner wrote: > On Tue, Aug 25 2020 at 15:07, Bjorn Helgaas wrote: > >> + * The arch hooks to setup up msi irqs. Default functions are implemented > >> + * as weak symbols so that they /can/ be overriden by architecture > >> specific > >> + *

Re: [patch RFC 34/38] x86/msi: Let pci_msi_prepare() handle non-PCI MSI

2020-08-25 Thread Thomas Gleixner
On Tue, Aug 25 2020 at 15:24, Bjorn Helgaas wrote: > On Fri, Aug 21, 2020 at 02:24:58AM +0200, Thomas Gleixner wrote: >> Rename it to x86_msi_prepare() and handle the allocation type setup >> depending on the device type. > > I see what you're doing, but the subject reads a little strangely Yes

Re: [patch RFC 30/38] PCI/MSI: Allow to disable arch fallbacks

2020-08-25 Thread Thomas Gleixner
On Tue, Aug 25 2020 at 15:07, Bjorn Helgaas wrote: >> + * The arch hooks to setup up msi irqs. Default functions are implemented >> + * as weak symbols so that they /can/ be overriden by architecture specific >> + * code if needed. >> + * >> + * They can be replaced by stubs with warnings via >> +

Re: [patch RFC 13/38] PCI: MSI: Rework pci_msi_domain_calc_hwirq()

2020-08-25 Thread Thomas Gleixner
On Tue, Aug 25 2020 at 15:03, Bjorn Helgaas wrote: > On Fri, Aug 21, 2020 at 02:24:37AM +0200, Thomas Gleixner wrote: >> Retrieve the PCI device from the msi descriptor instead of doing so at the >> call sites. > > I'd like it *better* with "PCI/MSI: " in the subject (to match history Duh, yes.

Re: [patch RFC 34/38] x86/msi: Let pci_msi_prepare() handle non-PCI MSI

2020-08-25 Thread Bjorn Helgaas
On Fri, Aug 21, 2020 at 02:24:58AM +0200, Thomas Gleixner wrote: > Rename it to x86_msi_prepare() and handle the allocation type setup > depending on the device type. I see what you're doing, but the subject reads a little strangely ("pci_msi_prepare() handling non-PCI" stuff) since it doesn't

Re: [patch RFC 17/38] x86/pci: Reducde #ifdeffery in PCI init code

2020-08-25 Thread Bjorn Helgaas
s/Reducde/Reduce/ (in subject) On Fri, Aug 21, 2020 at 02:24:41AM +0200, Thomas Gleixner wrote: > Adding a function call before the first #ifdef in arch_pci_init() triggers > a 'mixed declarations and code' warning if PCI_DIRECT is enabled. > > Use stub functions and move the #ifdeffery to the

Re: [patch RFC 21/38] PCI: MSI: Provide pci_dev_has_special_msi_domain() helper

2020-08-25 Thread Bjorn Helgaas
On Fri, Aug 21, 2020 at 02:24:45AM +0200, Thomas Gleixner wrote: > Provide a helper function to check whether a PCI device is handled by a > non-standard PCI/MSI domain. This will be used to exclude such devices > which hang of a special bus, e.g. VMD, to be excluded from the irq domain > override

Re: [patch RFC 30/38] PCI/MSI: Allow to disable arch fallbacks

2020-08-25 Thread Bjorn Helgaas
On Fri, Aug 21, 2020 at 02:24:54AM +0200, Thomas Gleixner wrote: > If an architecture does not require the MSI setup/teardown fallback > functions, then allow them to be replaced by stub functions which emit a > warning. > > Signed-off-by: Thomas Gleixner > Cc: Bjorn Helgaas > Cc:

Re: [patch RFC 20/38] PCI: vmd: Mark VMD irqdomain with DOMAIN_BUS_VMD_MSI

2020-08-25 Thread Bjorn Helgaas
On Fri, Aug 21, 2020 at 02:24:44AM +0200, Thomas Gleixner wrote: > Devices on the VMD bus use their own MSI irq domain, but it is not > distinguishable from regular PCI/MSI irq domains. This is required > to exclude VMD devices from getting the irq domain pointer set by > interrupt remapping. > >

Re: [patch RFC 13/38] PCI: MSI: Rework pci_msi_domain_calc_hwirq()

2020-08-25 Thread Bjorn Helgaas
On Fri, Aug 21, 2020 at 02:24:37AM +0200, Thomas Gleixner wrote: > Retrieve the PCI device from the msi descriptor instead of doing so at the > call sites. I'd like it *better* with "PCI/MSI: " in the subject (to match history and other patches in this series) and "MSI" here in the commit log,

Re: [PATCH] iommu: Add support to filter non-strict/lazy mode based on device names

2020-08-25 Thread Sai Prakash Ranjan
Hi, On 2020-08-25 21:40, Doug Anderson wrote: Hi, On Tue, Aug 25, 2020 at 8:43 AM Sai Prakash Ranjan wrote: Currently the non-strict or lazy mode of TLB invalidation can only be set for all or no domains. This works well for development platforms where setting to non-strict/lazy mode is

Re: [PATCH v11 00/11] PCI: brcmstb: enable PCIe for STB chips

2020-08-25 Thread Florian Fainelli
Hi, On 8/24/2020 12:30 PM, Jim Quinlan wrote: Patchset Summary: Enhance a PCIe host controller driver. Because of its unusual design we are foced to change dev->dma_pfn_offset into a more general role allowing multiple offsets. See the 'v1' notes below for more info. We are

Re: [PATCH] iommu: Add support to filter non-strict/lazy mode based on device names

2020-08-25 Thread Doug Anderson
Hi, On Tue, Aug 25, 2020 at 8:43 AM Sai Prakash Ranjan wrote: > > Currently the non-strict or lazy mode of TLB invalidation can only be set > for all or no domains. This works well for development platforms where > setting to non-strict/lazy mode is fine for performance reasons but on >

[PATCH] iommu: Add support to filter non-strict/lazy mode based on device names

2020-08-25 Thread Sai Prakash Ranjan
Currently the non-strict or lazy mode of TLB invalidation can only be set for all or no domains. This works well for development platforms where setting to non-strict/lazy mode is fine for performance reasons but on production devices, we need a more fine grained control to allow only certain

Re: [PATCH v11 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-08-25 Thread Jim Quinlan via iommu
Hi Andy, On Tue, Aug 25, 2020 at 5:54 AM Andy Shevchenko wrote: > > On Mon, Aug 24, 2020 at 03:30:20PM -0400, Jim Quinlan wrote: > > The new field 'dma_range_map' in struct device is used to facilitate the > > use of single or multiple offsets between mapping regions of cpu addrs and > > dma

[PATCH 1/2] dt-bindings: iommu: renesas, ipmmu-vmsa: Add r8a7742 support

2020-08-25 Thread Lad Prabhakar
Document RZ/G1H (R8A7742) SoC bindings. No driver change is needed due to the fallback compatible value "renesas,ipmmu-vmsa". Signed-off-by: Lad Prabhakar Reviewed-by: Chris Paterson --- Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml | 1 + 1 file changed, 1 insertion(+)

[PATCH 2/2] ARM: dts: r8a7742: Add IPMMU DT nodes

2020-08-25 Thread Lad Prabhakar
Add the five IPMMU instances found in the r8a7742 to DT with a disabled status. Signed-off-by: Lad Prabhakar Reviewed-by: Chris Paterson --- arch/arm/boot/dts/r8a7742.dtsi | 48 ++ 1 file changed, 48 insertions(+) diff --git a/arch/arm/boot/dts/r8a7742.dtsi

[PATCH 0/2] r8a7742 SoC add IPMMU support

2020-08-25 Thread Lad Prabhakar
Hi All, This patch series adds IPMMU support to R8A7742 (RZ/G1H) SoC dtsi. Cheers, Prabhakar Lad Prabhakar (2): dt-bindings: iommu: renesas,ipmmu-vmsa: Add r8a7742 support ARM: dts: r8a7742: Add IPMMU DT nodes .../bindings/iommu/renesas,ipmmu-vmsa.yaml| 1 +

Re: a saner API for allocating DMA addressable pages

2020-08-25 Thread Christoph Hellwig
On Tue, Aug 25, 2020 at 01:30:41PM +0200, Marek Szyprowski wrote: > I really wonder what is the difference between this new API and > alloc_pages(GFP_DMA, n). Is this API really needed? I thought that this > is legacy thing to be removed one day... The difference is that the pages returned are

Re: a saner API for allocating DMA addressable pages

2020-08-25 Thread Marek Szyprowski
Hi Christoph, On 19.08.2020 08:55, Christoph Hellwig wrote: > this series replaced the DMA_ATTR_NON_CONSISTENT flag to dma_alloc_attrs > with a separate new dma_alloc_pages API, which is available on all > platforms. In addition to cleaning up the convoluted code path, this > ensures that other

Re: [PATCH v2 6/9] iommu/ioasid: Introduce notification APIs

2020-08-25 Thread Jean-Philippe Brucker
On Fri, Aug 21, 2020 at 09:35:15PM -0700, Jacob Pan wrote: > Relations among IOASID users largely follow a publisher-subscriber > pattern. E.g. to support guest SVA on Intel Scalable I/O Virtualization > (SIOV) enabled platforms, VFIO, IOMMU, device drivers, KVM are all users > of IOASIDs. When a

Re: [PATCH v2 5/9] iommu/ioasid: Introduce ioasid_set private ID

2020-08-25 Thread Jean-Philippe Brucker
On Fri, Aug 21, 2020 at 09:35:14PM -0700, Jacob Pan wrote: > When an IOASID set is used for guest SVA, each VM will acquire its > ioasid_set for IOASID allocations. IOASIDs within the VM must have a > host/physical IOASID backing, mapping between guest and host IOASIDs can > be non-identical.

Re: [PATCH v2 4/9] iommu/ioasid: Add reference couting functions

2020-08-25 Thread Jean-Philippe Brucker
On Mon, Aug 24, 2020 at 10:26:55AM +0800, Lu Baolu wrote: > Hi Jacob, > > On 8/22/20 12:35 PM, Jacob Pan wrote: > > There can be multiple users of an IOASID, each user could have hardware > > contexts associated with the IOASID. In order to align lifecycles, > > reference counting is introduced

Re: [PATCH v2 4/9] iommu/ioasid: Add reference couting functions

2020-08-25 Thread Jean-Philippe Brucker
On Fri, Aug 21, 2020 at 09:35:13PM -0700, Jacob Pan wrote: > There can be multiple users of an IOASID, each user could have hardware > contexts associated with the IOASID. In order to align lifecycles, > reference counting is introduced in this patch. It is expected that when > an IOASID is being

Re: [PATCH v11 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-08-25 Thread Andy Shevchenko
On Mon, Aug 24, 2020 at 03:30:20PM -0400, Jim Quinlan wrote: > The new field 'dma_range_map' in struct device is used to facilitate the > use of single or multiple offsets between mapping regions of cpu addrs and > dma addrs. It subsumes the role of "dev->dma_pfn_offset" which was only > capable

Re: [patch RFC 24/38] x86/xen: Consolidate XEN-MSI init

2020-08-25 Thread Thomas Gleixner
On Tue, Aug 25 2020 at 06:21, Jürgen Groß wrote: > On 24.08.20 23:21, Thomas Gleixner wrote: >> I still think it does the right thing depending on the place it is >> called from, but even if so, it's completely unreadable gunk. I'll fix >> that proper. > > The main issue is that

Re: [patch RFC 26/38] x86/xen: Wrap XEN MSI management into irqdomain

2020-08-25 Thread Thomas Gleixner
On Mon, Aug 24 2020 at 08:21, Jürgen Groß wrote: > On 21.08.20 02:24, Thomas Gleixner wrote: > > Looking into https://www.kernel.org/doc/Documentation/IRQ-domain.txt (is > this still valid?) It's halfways correct. Emphasis on halfways. > I believe Xen should be able to use the "No Map" approach,

[PATCH 2/2] iommu/vt-d:Add support for probing ACPI device in RMRR

2020-08-25 Thread FelixCuioc
In the probe_acpi_namespace_devices function,when the physical node of the acpi device is NULL,the unlock function is missing. Add mutex_unlock(>physical_node_lock). Reported-by: Dan Carpenter Signed-off-by: FelixCuioc --- drivers/iommu/intel/iommu.c | 1 + 1 file changed, 1 insertion(+) diff

Re: [PATCH] MAINTAINERS: update QUALCOMM IOMMU after Arm SSMU drivers move

2020-08-25 Thread Lukas Bulwahn
On Fri, 21 Aug 2020, Will Deacon wrote: > On Sun, Aug 02, 2020 at 08:53:20AM +0200, Lukas Bulwahn wrote: > > Commit e86d1aa8b60f ("iommu/arm-smmu: Move Arm SMMU drivers into their own > > subdirectory") moved drivers/iommu/qcom_iommu.c to > > drivers/iommu/arm/arm-smmu/qcom_iommu.c amongst