[linux-next:master] BUILD REGRESSION 088b9c375534d905a4d337c78db3b3bfbb52c4a0

2022-07-06 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master branch HEAD: 088b9c375534d905a4d337c78db3b3bfbb52c4a0 Add linux-next specific files for 20220706 Error/Warning reports: https://lore.kernel.org/linux-doc/202207070644.x48xoovs-...@intel.com Error/Warning

Re: [PATCHv2] iommu/arm-smmu-qcom: Add debug support for TLB sync timeouts

2022-07-06 Thread Sai Prakash Ranjan
On 7/6/2022 5:26 PM, Will Deacon wrote: On Thu, May 26, 2022 at 09:44:03AM +0530, Sai Prakash Ranjan wrote: TLB sync timeouts can be due to various reasons such as TBU power down or pending TCU/TBU invalidation/sync and so on. Debugging these often require dumping of some implementation defined

Re: [RFC PATCH 2/2] dma-direct: Fix dma_direct_{alloc,free}() for Hyperv-V IVMs

2022-07-06 Thread Christoph Hellwig
On Wed, Jul 06, 2022 at 09:50:27PM +0200, Andrea Parri (Microsoft) wrote: > @@ -305,6 +306,21 @@ void *dma_direct_alloc(struct device *dev, size_t size, > ret = page_address(page); > if (dma_set_decrypted(dev, ret, size)) > goto out_free_pages; > +#

Re: fully convert arm to use dma-direct v3

2022-07-06 Thread Christoph Hellwig
On Wed, Jun 29, 2022 at 08:41:32AM +0200, Greg Kroah-Hartman wrote: > On Wed, Jun 29, 2022 at 08:28:37AM +0200, Christoph Hellwig wrote: > > Any comments or additional testing? It would be really great to get > > this off the table. > > For the USB bits: > > Acked-by: Greg Kroah-Hartman So giv

RE: [PATCH v4 02/11] iommu/vt-d: Remove clearing translation data in disable_dmar_iommu()

2022-07-06 Thread Tian, Kevin
> From: Lu Baolu > Sent: Wednesday, July 6, 2022 10:55 AM > > The disable_dmar_iommu() is called when IOMMU initialization fails or > the IOMMU is hot-removed from the system. In both cases, there is no > need to clear the IOMMU translation data structures for devices. > > On the initialization

Re: [PATCH v2 3/6] iommu/vt-d: Refactor iommu information of each domain

2022-07-06 Thread Baolu Lu
On 2022/7/7 09:01, Tian, Kevin wrote: From: Lu Baolu Sent: Saturday, July 2, 2022 9:56 AM -out_unlock: + set_bit(num, iommu->domain_ids); + info->refcnt = 1; + info->did= num; + info->iommu = iommu; + domain->nid = iommu->node; One nit. this line should be

RE: [PATCH v3 02/11] iommu/vt-d: Remove clearing translation data in disable_dmar_iommu()

2022-07-06 Thread Tian, Kevin
> From: Baolu Lu > Sent: Sunday, July 3, 2022 12:34 PM > > On 2022/7/1 15:58, Tian, Kevin wrote: > >> From: Lu Baolu Sent: Wednesday, June 29, > >> 2022 3:47 PM > >> > >> The disable_dmar_iommu() is called when IOMMU initialization fails > >> or the IOMMU is hot-removed from the system. In both

RE: [PATCH v2 4/6] iommu/vt-d: Remove unnecessary check in intel_iommu_add()

2022-07-06 Thread Tian, Kevin
> From: Lu Baolu > Sent: Saturday, July 2, 2022 9:56 AM > > The Intel IOMMU hot-add process starts from dmar_device_hotplug(). It > uses the global dmar_global_lock to synchronize all the hot-add and > hot-remove paths. In the hot-add path, the new IOMMU data structures > are allocated firstly by

RE: [PATCH v2 3/6] iommu/vt-d: Refactor iommu information of each domain

2022-07-06 Thread Tian, Kevin
> From: Lu Baolu > Sent: Saturday, July 2, 2022 9:56 AM > > -out_unlock: > + set_bit(num, iommu->domain_ids); > + info->refcnt= 1; > + info->did = num; > + info->iommu = iommu; > + domain->nid = iommu->node; One nit. this line should be removed as it's incor

RE: [PATCH v2 2/6] iommu/vt-d: Use IDA interface to manage iommu sequence id

2022-07-06 Thread Tian, Kevin
> From: Lu Baolu > Sent: Saturday, July 2, 2022 9:56 AM > > Switch dmar unit sequence id allocation and release from bitmap to IDA > interface. > > Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian ___ iommu mailing list iommu@lists.linux-foundation.o

[RFC PATCH 1/2] swiotlb, dma-direct: Move swiotlb_unencrypted_base to direct.c

2022-07-06 Thread Andrea Parri (Microsoft)
The variable will come in handy to enable dma_direct_{alloc,free}() for Hyper-V AMD SEV-SNP Isolated VMs. Rename swiotlb_unencrypted_base to dma_unencrypted_base to indicate that the notion is not restricted to SWIOTLB. No functional change. Suggested-by: Michael Kelley Signed-off-by: Andrea Pa

[RFC PATCH 2/2] dma-direct: Fix dma_direct_{alloc, free}() for Hyperv-V IVMs

2022-07-06 Thread Andrea Parri (Microsoft)
In Hyper-V AMD SEV-SNP Isolated VMs, the virtual address returned by dma_direct_alloc() must map above dma_unencrypted_base because the memory is shared with the hardware device and must not be encrypted. Modify dma_direct_alloc() to do the necessary remapping. In dma_direct_free(), use the (unmo

[RFC PATCH 0/2] dma_direct_{alloc,free}() for Hyper-V IVMs

2022-07-06 Thread Andrea Parri (Microsoft)
Through swiotlb_unencrypted_base. P.S. I'm on vacation for the next couple of weeks starting next Monday; Dexuan/Michael should be able to address review feedback in that period. Andrea Parri (Microsoft) (2): swiotlb,dma-direct: Move swiotlb_unencrypted_base to direct.c dma-direct: Fix dma_d

Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem()

2022-07-06 Thread Logan Gunthorpe
On 2022-07-06 01:04, Greg Kroah-Hartman wrote: > On Wed, Jul 06, 2022 at 08:51:27AM +0200, Christoph Hellwig wrote: >> On Tue, Jul 05, 2022 at 12:16:45PM -0600, Logan Gunthorpe wrote: >>> The current version does it through a char device, but that requires >>> creating a simple_fs and anon_inode

Re: [PATCH v1 0/6] iommu/vt-d: Reset DMAR_UNITS_SUPPORTED

2022-07-06 Thread Steve Wahl
On Sat, Jun 25, 2022 at 08:51:58PM +0800, Lu Baolu wrote: > Hi folks, > > This is a follow-up series of changes proposed by this patch: > > https://lore.kernel.org/linux-iommu/20220615183650.32075-1-steve.w...@hpe.com/ > > It removes several static arrays of size DMAR_UNITS_SUPPORTED and sets >

Re: [PATCH v9 7/8] docs: trace: Add HiSilicon PTT device driver documentation

2022-07-06 Thread Mathieu Poirier
Hi, I have started looking at this set. On Mon, Jun 06, 2022 at 07:55:54PM +0800, Yicong Yang wrote: > Document the introduction and usage of HiSilicon PTT device driver. > > Signed-off-by: Yicong Yang > Reviewed-by: Jonathan Cameron > --- > Documentation/trace/hisi-ptt.rst | 307

Re: [PATCH 1/2] iommu: arm-smmu-impl: Add 8250 display compatible to the client list.

2022-07-06 Thread Will Deacon
On Tue, 14 Jun 2022 16:01:35 -0700, Emma Anholt wrote: > Required for turning on per-process page tables for the GPU. > > Applied to will (for-joerg/arm-smmu/updates), thanks! [1/2] iommu: arm-smmu-impl: Add 8250 display compatible to the client list. https://git.kernel.org/will/c/3482c0b

Re: [PATCHv2] iommu/arm-smmu-qcom: Add debug support for TLB sync timeouts

2022-07-06 Thread Robin Murphy
On 2022-05-26 05:14, Sai Prakash Ranjan wrote: TLB sync timeouts can be due to various reasons such as TBU power down or pending TCU/TBU invalidation/sync and so on. Debugging these often require dumping of some implementation defined registers to know the status of TBU/TCU operations and some of

Re: [PATCH v1 08/16] arm64: dts: mt8195: Add power domains controller

2022-07-06 Thread Krzysztof Kozlowski
On 06/07/2022 14:00, Tinghan Shen wrote: > Hi Krzysztof, > > After discussing your message with our power team, > we realized that we need your help to ensure we fully understand you. > > On Mon, 2022-07-04 at 14:38 +0200, Krzysztof Kozlowski wrote: >> On 04/07/2022 12:00, Tinghan Shen wrote: >>

Re: [PATCH v1 02/16] dt-bindings: memory: mediatek: Update condition for mt8195 smi node

2022-07-06 Thread Krzysztof Kozlowski
On 06/07/2022 15:48, Matthias Brugger wrote: > > > On 04/07/2022 14:36, Krzysztof Kozlowski wrote: >> On 04/07/2022 12:00, Tinghan Shen wrote: >>> The max clock items for the dts node with compatible >>> 'mediatek,mt8195-smi-sub-common' should be 3. >>> >>> However, the dtbs_check of such node wi

Re: [PATCH v1 08/16] arm64: dts: mt8195: Add power domains controller

2022-07-06 Thread Krzysztof Kozlowski
On 06/07/2022 15:41, Matthias Brugger wrote: > > > On 04/07/2022 14:38, Krzysztof Kozlowski wrote: >> On 04/07/2022 12:00, Tinghan Shen wrote: >>> Add power domains controller node for mt8195. >>> >>> Signed-off-by: Weiyi Lu >>> Signed-off-by: Tinghan Shen >>> --- >>> arch/arm64/boot/dts/medi

Re: [PATCH 0/4] iommu/exynos: Add basic support for SysMMU v7

2022-07-06 Thread Sam Protsenko
On Sun, 3 Jul 2022 at 13:47, David Virag wrote: > > On Sun, 2022-07-03 at 00:48 +0300, Sam Protsenko wrote: > [...] > > Hi Marek, > > > > As I understand, you have some board with SysMMU v7, which is not VM > > capable (judging from the patches you shared earlier). Could you > > please somehow ver

Re: [PATCH v1 02/16] dt-bindings: memory: mediatek: Update condition for mt8195 smi node

2022-07-06 Thread Matthias Brugger
On 04/07/2022 14:36, Krzysztof Kozlowski wrote: On 04/07/2022 12:00, Tinghan Shen wrote: The max clock items for the dts node with compatible 'mediatek,mt8195-smi-sub-common' should be 3. However, the dtbs_check of such node will get following message, arch/arm64/boot/dts/mediatek/mt8195-evb

Re: [PATCH v5 0/5] DMA mapping changes for SCSI core

2022-07-06 Thread Christoph Hellwig
On Wed, Jul 06, 2022 at 02:40:44PM +0100, John Garry wrote: > On 30/06/2022 13:08, John Garry wrote: > > Hi Christoph, > > Can you please consider picking up this series? A few things to note > beforehand: > > - I changed to only apply the mapping limit to SAS hosts in this version. I > would nee

Re: [PATCH v1 08/16] arm64: dts: mt8195: Add power domains controller

2022-07-06 Thread Matthias Brugger
On 04/07/2022 14:38, Krzysztof Kozlowski wrote: On 04/07/2022 12:00, Tinghan Shen wrote: Add power domains controller node for mt8195. Signed-off-by: Weiyi Lu Signed-off-by: Tinghan Shen --- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 327 +++ 1 file changed, 327 inse

Re: [PATCH v5 0/5] DMA mapping changes for SCSI core

2022-07-06 Thread John Garry via iommu
On 30/06/2022 13:08, John Garry wrote: Hi Christoph, Can you please consider picking up this series? A few things to note beforehand: - I changed to only apply the mapping limit to SAS hosts in this version. I would need a fresh ack from Martin for those SCSI parts, but wanted to make sure

Re: Re: Re: Re: [PATCH v2 1/9] PM: domains: Delete usage of driver_deferred_probe_check_state()

2022-07-06 Thread Alexander Stein
t results in the identical error message. > > My guess is that the probe attempt of blk-ctrl is delayed now till gpc > probes (because of the device links getting created with the > fwnode_dev_initialized() fix), but by the time gpc probe finishes, the > power domains aren't regi

Re: [PATCH RESEND v5 1/5] iommu: Refactor iommu_group_store_type()

2022-07-06 Thread Will Deacon
On Wed, Jul 06, 2022 at 01:03:44PM +0100, John Garry wrote: > On 06/07/2022 13:00, Will Deacon wrote: > > On Mon, Apr 04, 2022 at 07:27:10PM +0800, John Garry wrote: > > > Function iommu_group_store_type() supports changing the default domain > > > of an IOMMU group. > > > > > > Many conditions ne

Re: [PATCH RESEND v5 2/5] iova: Allow rcache range upper limit to be flexible

2022-07-06 Thread Will Deacon
On Thu, Apr 07, 2022 at 03:52:53PM +0800, Leizhen (ThunderTown) wrote: > On 2022/4/4 19:27, John Garry wrote: > > Some low-level drivers may request DMA mappings whose IOVA length exceeds > > that of the current rcache upper limit. > > > > This means that allocations for those IOVAs will never be

Re: [PATCH RESEND v5 2/5] iova: Allow rcache range upper limit to be flexible

2022-07-06 Thread Will Deacon
On Mon, Apr 04, 2022 at 07:27:11PM +0800, John Garry wrote: > Some low-level drivers may request DMA mappings whose IOVA length exceeds > that of the current rcache upper limit. > > This means that allocations for those IOVAs will never be cached, and > always must be allocated and freed from the

Re: [PATCH RESEND v5 1/5] iommu: Refactor iommu_group_store_type()

2022-07-06 Thread John Garry via iommu
On 06/07/2022 13:00, Will Deacon wrote: On Mon, Apr 04, 2022 at 07:27:10PM +0800, John Garry wrote: Function iommu_group_store_type() supports changing the default domain of an IOMMU group. Many conditions need to be satisfied and steps taken for this action to be successful. Satisfying these

Re: [PATCH RESEND v5 1/5] iommu: Refactor iommu_group_store_type()

2022-07-06 Thread Will Deacon
On Mon, Apr 04, 2022 at 07:27:10PM +0800, John Garry wrote: > Function iommu_group_store_type() supports changing the default domain > of an IOMMU group. > > Many conditions need to be satisfied and steps taken for this action to be > successful. > > Satisfying these conditions and steps will be

Re: [PATCH v1 08/16] arm64: dts: mt8195: Add power domains controller

2022-07-06 Thread Tinghan Shen via iommu
Hi Krzysztof, After discussing your message with our power team, we realized that we need your help to ensure we fully understand you. On Mon, 2022-07-04 at 14:38 +0200, Krzysztof Kozlowski wrote: > On 04/07/2022 12:00, Tinghan Shen wrote: > > Add power domains controller node for mt8195. > > >

Re: [PATCHv2] iommu/arm-smmu-qcom: Add debug support for TLB sync timeouts

2022-07-06 Thread Will Deacon
On Thu, May 26, 2022 at 09:44:03AM +0530, Sai Prakash Ranjan wrote: > TLB sync timeouts can be due to various reasons such as TBU power down > or pending TCU/TBU invalidation/sync and so on. Debugging these often > require dumping of some implementation defined registers to know the > status of TBU

[PATCH v3 RESEND 35/35] iommu/amd: Update amd_iommu_fault structure to include PCI seg ID

2022-07-06 Thread Vasant Hegde via iommu
Rename 'device_id' as 'sbdf' and extend it to 32bit so that we can pass PCI segment ID to ppr_notifier(). Also pass PCI segment ID to pci_get_domain_bus_and_slot() instead of default value. Signed-off-by: Vasant Hegde --- drivers/iommu/amd/amd_iommu_types.h | 2 +- drivers/iommu/amd/iommu.c

[PATCH v3 RESEND 34/35] iommu/amd: Update device_state structure to include PCI seg ID

2022-07-06 Thread Vasant Hegde via iommu
Rename struct device_state.devid variable to struct device_state.sbdf and extend it to 32-bit to include the 16-bit PCI segment ID via the helper function get_pci_sbdf_id(). Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iomm

[PATCH v3 RESEND 33/35] iommu/amd: Print PCI segment ID in error log messages

2022-07-06 Thread Vasant Hegde via iommu
Print pci segment ID along with bdf. Useful for debugging. Co-developed-by: Suravee Suthikulpaint Signed-off-by: Suravee Suthikulpaint Signed-off-by: Vasant Hegde --- drivers/iommu/amd/init.c | 10 +- drivers/iommu/amd/iommu.c | 36 ++-- 2 files changed

[PATCH v3 RESEND 32/35] iommu/amd: Add PCI segment support for ivrs_[ioapic/hpet/acpihid] commands

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit By default, PCI segment is zero and can be omitted. To support system with non-zero PCI segment ID, modify the parsing functions to allow PCI segment ID. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit --- .../admin-g

Re: [PATCH v12 0/2] iommu/mediatek: TTBR up to 35bit support

2022-07-06 Thread Will Deacon
On Thu, Jun 30, 2022 at 05:29:24PM +0800, yf.w...@mediatek.com wrote: > This patchset adds MediaTek TTBR up to 35bit support for single normal zone. > > Changes in v12: > - Update [PATCH 1/2]: remove GENMASK(31, 7) > - Update [PATCH 2/2]: remove MMU_PT_ADDR_MASK definition. For both patches: Ack

[PATCH v3 RESEND 31/35] iommu/amd: Specify PCI segment ID when getting pci device

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Upcoming AMD systems can have multiple PCI segments. Hence pass PCI segment ID to pci_get_domain_bus_and_slot() instead of '0'. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd/init.c | 6 --

[PATCH v3 RESEND 30/35] iommu/amd: Include PCI segment ID when initialize IOMMU

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Extend current device ID variables to 32-bit to include the 16-bit segment ID when parsing device information from IVRS table to initialize each IOMMU. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit --- drivers/iommu

[PATCH v3 RESEND 29/35] iommu/amd: Introduce get_device_sbdf_id() helper function

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Current get_device_id() only provide 16-bit PCI device ID (i.e. BDF). With multiple PCI segment support, we need to extend the helper function to include PCI segment ID. So, introduce a new helper function get_device_sbdf_id() to replace the current get_pci_device_id(

[PATCH v3 RESEND 28/35] iommu/amd: Flush upto last_bdf only

2022-07-06 Thread Vasant Hegde via iommu
Fix amd_iommu_flush_dte_all() and amd_iommu_flush_tlb_all() to flush upto last_bdf only. Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/iommu.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --

[PATCH v3 RESEND 27/35] iommu/amd: Remove global amd_iommu_[dev_table/alias_table/last_bdf]

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Replace them with per PCI segment device table. Also remove dev_table_size, alias_table_size, amd_iommu_last_bdf variables. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd/amd_iommu_types.h | 15

[PATCH v3 RESEND 26/35] iommu/amd: Update set_dev_entry_bit() and get_dev_entry_bit()

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit To include a pointer to per PCI segment device table. Also include struct amd_iommu as one of the function parameter to amd_iommu_apply_erratum_63() since it is needed when setting up DTE. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Sur

[PATCH v3 RESEND 25/35] iommu/amd: Update (un)init_device_table_dma()

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Include struct amd_iommu_pci_seg as a function parameter since we need to access per PCI segment device table. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd/init.c | 27

[PATCH v3 RESEND 24/35] iommu/amd: Update set_dte_irq_entry

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Start using per PCI segment device table instead of global device table. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/iommu.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/a

[PATCH v3 RESEND 23/35] iommu/amd: Update dump_dte_entry

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Start using per PCI segment device table instead of global device table. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/iommu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/amd/iom

[PATCH v3 RESEND 22/35] iommu/amd: Update iommu_ignore_device

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Start using per PCI segment device table instead of global device table. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/amd/iommu

[PATCH v3 RESEND 21/35] iommu/amd: Update set_dte_entry and clear_dte_entry

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Start using per PCI segment data structures instead of global data structures. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/iommu.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dr

[PATCH v3 RESEND 20/35] iommu/amd: Convert to use per PCI segment rlookup_table

2022-07-06 Thread Vasant Hegde via iommu
Then, remove the global amd_iommu_rlookup_table and rlookup_table_size. Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/amd_iommu_types.h | 5 - drivers/iommu/amd/init.c| 23 ++-

[PATCH v3 RESEND 19/35] iommu/amd: Update alloc_irq_table and alloc_irq_index

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Pass amd_iommu structure as one of the parameter to these functions as its needed to retrieve variable tables inside these functions. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd/iommu.c | 26

[PATCH v3 RESEND 18/35] iommu/amd: Update amd_irte_ops functions

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Pass amd_iommu structure as one of the parameter to amd_irte_ops functions since its needed to activate/deactivate the iommu. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/amd_iommu_types.h | 6 ++-- drivers/iommu/amd/iommu

[PATCH v3 RESEND 17/35] iommu/amd: Introduce struct amd_ir_data.iommu

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Add a pointer to struct amd_iommu to amd_ir_data structure, which can be used to correlate interrupt remapping data to a per-PCI-segment interrupt remapping table. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit --- d

[PATCH v3 RESEND 16/35] iommu/amd: Update irq_remapping_alloc to use IOMMU lookup helper function

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit To allow IOMMU rlookup using both PCI segment and device ID. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd/iommu.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff -

[PATCH v3 RESEND 15/35] iommu/amd: Convert to use rlookup_amd_iommu helper function

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Use rlookup_amd_iommu() helper function which will give per PCI segment rlookup_table. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/iommu.c | 64 +++ 1 file changed, 38 insertions(+), 26

[PATCH v3 RESEND 14/35] iommu/amd: Convert to use per PCI segment irq_lookup_table

2022-07-06 Thread Vasant Hegde via iommu
Then, remove the global irq_lookup_table. Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/amd_iommu_types.h | 2 -- drivers/iommu/amd/init.c| 19 --- drivers/iommu/amd/iommu.c | 36

[PATCH v3 RESEND 13/35] iommu/amd: Introduce per PCI segment rlookup table size

2022-07-06 Thread Vasant Hegde via iommu
It will replace global "rlookup_table_size" variable. Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/amd_iommu_types.h | 3 +++ drivers/iommu/amd/init.c| 11 ++- 2 files changed, 9 insertions(+)

Re: [PATCH v2 1/4] dt-bindings: qcom-iommu: Add Qualcomm MSM8953 compatible

2022-07-06 Thread Will Deacon
On Sun, Jun 12, 2022 at 11:22:13AM +0200, Luca Weiss wrote: > Document the compatible used for IOMMU on the msm8953 SoC. > > Signed-off-by: Luca Weiss > --- > Changes from v1: > - new patch > > Documentation/devicetree/bindings/iommu/qcom,iommu.txt | 1 + > 1 file changed, 1 insertion(+) > > d

[PATCH v3 RESEND 12/35] iommu/amd: Introduce per PCI segment alias table size

2022-07-06 Thread Vasant Hegde via iommu
It will replace global "alias_table_size" variable. Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/amd_iommu_types.h | 3 +++ drivers/iommu/amd/init.c| 5 +++-- 2 files changed, 6 insertions(+), 2 deleti

[PATCH v3 RESEND 11/35] iommu/amd: Introduce per PCI segment device table size

2022-07-06 Thread Vasant Hegde via iommu
With multiple pci segment support, number of BDF supported by each segment may differ. Hence introduce per segment device table size which depends on last_bdf. This will replace global "device_table_size" variable. Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signe

[PATCH v3 RESEND 10/35] iommu/amd: Introduce per PCI segment last_bdf

2022-07-06 Thread Vasant Hegde via iommu
Current code uses global "amd_iommu_last_bdf" to track the last bdf supported by the system. This value is used for various memory allocation, device data flushing, etc. Introduce per PCI segment last_bdf which will be used to track last bdf supported by the given PCI segment and use this value fo

[PATCH v3 RESEND 09/35] iommu/amd: Introduce per PCI segment unity map list

2022-07-06 Thread Vasant Hegde via iommu
Newer AMD systems can support multiple PCI segments. In order to support multiple PCI segments IVMD table in IVRS structure is enhanced to include pci segment id. Update ivmd_header structure to include "pci_seg". Also introduce per PCI segment unity map list. It will replace global amd_iommu_unit

[PATCH v3 RESEND 08/35] iommu/amd: Introduce per PCI segment alias_table

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit This will replace global alias table (amd_iommu_alias_table). Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd/amd_iommu_types.h | 7 + drivers/iommu/amd/init.c| 41 ++

[PATCH v3 RESEND 07/35] iommu/amd: Introduce per PCI segment old_dev_tbl_cpy

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit It will remove global old_dev_tbl_cpy. Also update copy_device_table() copy device table for all PCI segments. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd/amd_iommu_types.h | 6 ++ drivers/

[PATCH v3 RESEND 06/35] iommu/amd: Introduce per PCI segment dev_data_list

2022-07-06 Thread Vasant Hegde via iommu
This will replace global dev_data_list. Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/amd_iommu_types.h | 3 +++ drivers/iommu/amd/init.c| 1 + drivers/iommu/amd/iommu.c | 21 ++-

[PATCH v3 RESEND 05/35] iommu/amd: Introduce per PCI segment irq_lookup_table

2022-07-06 Thread Vasant Hegde via iommu
This will replace global irq lookup table (irq_lookup_table). Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde --- drivers/iommu/amd/amd_iommu_types.h | 6 ++ drivers/iommu/amd/init.c| 27 +++ 2 fil

[PATCH v3 RESEND 04/35] iommu/amd: Introduce per PCI segment rlookup table

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit This will replace global rlookup table (amd_iommu_rlookup_table). Add helper functions to set/get rlookup table for the given device. Also add macros to get seg/devid from sbdf. Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthiku

[PATCH v3 RESEND 03/35] iommu/amd: Introduce per PCI segment device table

2022-07-06 Thread Vasant Hegde via iommu
From: Suravee Suthikulpanit Introduce per PCI segment device table. All IOMMUs within the segment will share this device table. This will replace global device table i.e. amd_iommu_dev_table. Also introduce helper function to get the device table for the given IOMMU. Co-developed-by: Vasant Heg

[PATCH v3 RESEND 02/35] iommu/amd: Introduce pci segment structure

2022-07-06 Thread Vasant Hegde via iommu
Newer AMD systems can support multiple PCI segments, where each segment contains one or more IOMMU instances. However, an IOMMU instance can only support a single PCI segment. Current code assumes that system contains only one pci segment (segment 0) and creates global data structures such as devi

[PATCH v3 RESEND 01/35] iommu/amd: Update struct iommu_dev_data definition

2022-07-06 Thread Vasant Hegde via iommu
struct iommu_dev_data contains member "pdev" to point to pci_dev. This is valid for only PCI devices and for other devices this will be NULL. This causes unnecessary "pdev != NULL" check at various places. Replace "struct pci_dev" member with "struct device" and use to_pci_dev() to get pci device

[PATCH v3 RESEND 00/35] iommu/amd: Add multiple PCI segments support

2022-07-06 Thread Vasant Hegde via iommu
Hi Joerg, As discussed in other thread, I have updated "From:" tag and resending patchset. No changes in the actual patch content. This patchset is based on top on "iommu/x86/amd" branch. Base commit : 0d10fe75911787 ("iommu/amd: Use try_cmpxchg64 in ") Newer AMD systems can suppor

Re: [PATCH] iommu/amd: Handle return of iommu_device_sysfs_add

2022-07-06 Thread Joerg Roedel
On Fri, Jul 01, 2022 at 02:20:08AM -0400, Bo Liu wrote: > As iommu_device_sysfs_add() can fail, we should check the return value. > > Signed-off-by: Bo Liu > --- > drivers/iommu/amd/init.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) Applied, thanks.

Re: [PATCH v2] iommu/iova: change IOVA_MAG_SIZE to 127 to save memory

2022-07-06 Thread Joerg Roedel
On Sun, Jul 03, 2022 at 07:44:50PM +0800, Feng Tang wrote: > kmalloc will round up the request size to power of 2, and current > iova_magazine's size is 1032 (1024+8) bytes, so each instance > allocated will get 2048 bytes from kmalloc, causing around 1KB > waste. > > Change IOVA_MAG_SIZE from 128

Re: [PATCH 0/1] iommu/vt-d: Fixes for v5.19-rc4

2022-07-06 Thread Joerg Roedel
On Sat, Jun 25, 2022 at 09:34:29PM +0800, Lu Baolu wrote: > Hi Joerg, > > One fix is queued for v5.19. It aims to fix: > > - RID2PASID setup/teardown failures for pci alias devices > > Please consider it for the iommu/fix branch. > > Best regards, > Lu Baolu > > Lu Baolu (1): > iommu/vt-d: F

Re: [PATCH] iommu/exynos: Make driver independent of the system page size

2022-07-06 Thread Joerg Roedel
On Thu, Jun 23, 2022 at 11:36:29AM +0200, Marek Szyprowski wrote: > drivers/iommu/exynos-iommu.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfou

Re: [PATCH 0/3] iommu: More internal ops cleanup

2022-07-06 Thread Joerg Roedel
On Tue, Jun 21, 2022 at 04:14:24PM +0100, Robin Murphy wrote: > Robin Murphy (3): > iommu: Use dev_iommu_ops() for probe_finalize > iommu: Make .release_device optional > iommu: Clean up release_device checks Applied to core branch, thanks. ___ iom

Re: [PATCH v2 09/14] iommu/ipmmu-vmsa: Clean up bus_set_iommu()

2022-07-06 Thread Robin Murphy
On 2022-07-06 09:38, Alexey Kardashevskiy wrote: On 28/04/2022 23:18, Robin Murphy wrote: Stop calling bus_set_iommu() since it's now unnecessary. This also leaves the custom initcall effectively doing nothing but register the driver, which no longer needs to happen early either, so convert it

Re: [PATCH v13 0/9] ACPI/IORT: Support for IORT RMR node

2022-07-06 Thread j...@8bytes.org
On Tue, Jun 28, 2022 at 07:59:39AM +, Shameerali Kolothum Thodi wrote: > Now that we have all the required acks, could you please pick this series via > IOMMU tree? Applied to core branch, thanks. ___ iommu mailing list iommu@lists.linux-foundation.o

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

2022-07-06 Thread Joerg Roedel
On Fri, Jun 24, 2022 at 02:12:28PM +0800, Baolu Lu wrote: > It makes sense as far as I am aware. By putting IOMMUs in pass-through > mode, there will be no run-time costs and things could be simplified a > lot. > > Besides the refactoring efforts, we still need this quick fix so that > the fix cou

[PATCH] MAINTAINERS: Remove iommu@lists.linux-foundation.org

2022-07-06 Thread Joerg Roedel
From: Joerg Roedel The IOMMU mailing list has moved to io...@lists.linux.dev and the old list should bounce by now. Remove it from the MAINTAINERS file. Signed-off-by: Joerg Roedel --- MAINTAINERS | 11 --- 1 file changed, 11 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 6

Re: [PATCH 2/2] x86/ACPI: Set swiotlb area according to the number of lapic entry in MADT

2022-07-06 Thread Tianyu Lan
On 7/6/2022 5:02 PM, Christoph Hellwig wrote: On Wed, Jul 06, 2022 at 04:57:33PM +0800, Tianyu Lan wrote: Swiotlb_init() is called in the mem_init() of different architects and memblock free pages are released to the buddy allocator just after calling swiotlb_init() via memblock_free_all(). Ye

Re: [PATCH v1 0/7] iommu/amd: Add Generic IO Page Table Framework Support for v2 Page Table

2022-07-06 Thread Joerg Roedel
On Tue, Jun 28, 2022 at 02:35:51PM +0530, Vasant Hegde wrote: > Sorry. I didn't get last statement ("device identity maps DMA requests > without PASID"). > Can you please elaborate? When using v1 page-tables, each device supporting ATS/PRI/PASID needs to be direct-mapped, because the v1 page-tabl

Re: [PATCH v1 7/7] iommu/amd: Introduce amd_iommu_pgtable command-line option

2022-07-06 Thread Joerg Roedel
On Tue, Jun 28, 2022 at 01:23:52PM +0530, Vasant Hegde wrote: > I think it will complicate the parsing logic. We do have `amd_iommu=off` > option. > How are we going to handle `amd_iommu=off,[pgtable_v1/v2]` ? In that case everything except 'off' will be ignored. The driver might set its interna

Re: [PATCH 2/2] x86/ACPI: Set swiotlb area according to the number of lapic entry in MADT

2022-07-06 Thread Christoph Hellwig
On Wed, Jul 06, 2022 at 04:57:33PM +0800, Tianyu Lan wrote: > Swiotlb_init() is called in the mem_init() of different architects and > memblock free pages are released to the buddy allocator just after > calling swiotlb_init() via memblock_free_all(). Yes. > The mem_init() is called before smp_in

Re: [PATCH 2/2] x86/ACPI: Set swiotlb area according to the number of lapic entry in MADT

2022-07-06 Thread Tianyu Lan
On 7/6/2022 4:00 PM, Christoph Hellwig wrote: On Fri, Jul 01, 2022 at 01:02:21AM +0800, Tianyu Lan wrote: Can we reorder that initialization? Because I really hate having to have an arch hook in every architecture. How about using "flags" parameter of swiotlb_init() to pass area number or add

Re: [PATCH v2 09/14] iommu/ipmmu-vmsa: Clean up bus_set_iommu()

2022-07-06 Thread Alexey Kardashevskiy
On 28/04/2022 23:18, Robin Murphy wrote: Stop calling bus_set_iommu() since it's now unnecessary. This also leaves the custom initcall effectively doing nothing but register the driver, which no longer needs to happen early either, so convert it to builtin_platform_driver(). Signed-off-by: Ro

Re: [PATCH 2/2] x86/ACPI: Set swiotlb area according to the number of lapic entry in MADT

2022-07-06 Thread Christoph Hellwig
On Fri, Jul 01, 2022 at 01:02:21AM +0800, Tianyu Lan wrote: > > Can we reorder that initialization? Because I really hate having > > to have an arch hook in every architecture. > > How about using "flags" parameter of swiotlb_init() to pass area number > or add new parameter for area number? > >

Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem()

2022-07-06 Thread Greg Kroah-Hartman
On Wed, Jul 06, 2022 at 08:51:27AM +0200, Christoph Hellwig wrote: > On Tue, Jul 05, 2022 at 12:16:45PM -0600, Logan Gunthorpe wrote: > > The current version does it through a char device, but that requires > > creating a simple_fs and anon_inode for teardown on driver removal, plus > > a bunch of