Re: [PATCH RFC 11/12] iommufd: vfio container FD ioctl compatibility

2022-05-10 Thread David Gibson
On Mon, May 09, 2022 at 11:00:41AM -0300, Jason Gunthorpe wrote: > On Mon, May 09, 2022 at 04:01:52PM +1000, David Gibson wrote: > > > > The default iommu_domain that the iommu driver creates will be used > > > here, it is up to the iommu driver to choose something reasonable for > > > use by appl

RE: [PATCH v12 0/9] ACPI/IORT: Support for IORT RMR node

2022-05-10 Thread Shameerali Kolothum Thodi via iommu
Hi Joerg/Robin, I think this series is now ready to be merged. Could you please let me know if there is anything missing. Thanks, Shameer > -Original Message- > From: Guohanjun (Hanjun Guo) > Sent: 05 May 2022 02:24 > To: Shameerali Kolothum Thodi ; > linux-arm-ker...@lists.infradead.org

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

2022-05-10 Thread Robin Murphy
On 2022-05-10 08:23, Shameerali Kolothum Thodi wrote: Hi Joerg/Robin, I think this series is now ready to be merged. Could you please let me know if there is anything missing. Fine by me - these patches have had enough review and testing now that even if anything else did come up, I think it

[PATCH] iommu/arm-smmu: Force identity domains for legacy binding

2022-05-10 Thread Robin Murphy
When using the legacy "mmu-masters" DT binding, we reject DMA domains since we have no guarantee of driver probe order and thus can't rely on client drivers getting the correct DMA ops. However, we can do better than fall back to the old no-default-domain behaviour now, by forcing an identity defau

Re: [PATCH v6 20/29] init/main: Delay initialization of the lockup detector after smp_init()

2022-05-10 Thread Nicholas Piggin
Excerpts from Ricardo Neri's message of May 6, 2022 9:59 am: > Certain implementations of the hardlockup detector require support for > Inter-Processor Interrupt shorthands. On x86, support for these can only > be determined after all the possible CPUs have booted once (in > smp_init()). Other arch

Re: [PATCH v6 24/29] watchdog/hardlockup: Use parse_option_str() to handle "nmi_watchdog"

2022-05-10 Thread Nicholas Piggin
Excerpts from Ricardo Neri's message of May 6, 2022 10:00 am: > Prepare hardlockup_panic_setup() to handle a comma-separated list of > options. Thus, it can continue parsing its own command-line options while > ignoring parameters that are relevant only to specific implementations of > the hardlock

Re: [PATCH v6 28/29] x86/tsc: Restart NMI watchdog after refining tsc_khz

2022-05-10 Thread Nicholas Piggin
Excerpts from Ricardo Neri's message of May 6, 2022 10:00 am: > The HPET hardlockup detector relies on tsc_khz to estimate the value of > that the TSC will have when its HPET channel fires. A refined tsc_khz > helps to estimate better the expected TSC value. > > Using the early value of tsc_khz ma

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-10 Thread Yicong Yang via iommu
On 2022/5/10 17:46, James Clark wrote: > > > On 07/04/2022 13:58, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated >> Endpoint(RCiEP) device, providing the capability to dynamically monitor and >> tune the PCIe traffic, and trace the TLP headers. >

Re: [PATCH v7 1/7] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-05-10 Thread Will Deacon
On Thu, Apr 07, 2022 at 08:58:35PM +0800, Yicong Yang wrote: > The DMA operations of HiSilicon PTT device can only work properly with > identical mappings. So add a quirk for the device to force the domain > as passthrough. > > Signed-off-by: Yicong Yang > --- > drivers/iommu/arm/arm-smmu-v3/arm

Re: [PATCH] iommu/arm-smmu: Force identity domains for legacy binding

2022-05-10 Thread Will Deacon
On Tue, 10 May 2022 09:38:58 +0100, Robin Murphy wrote: > When using the legacy "mmu-masters" DT binding, we reject DMA domains > since we have no guarantee of driver probe order and thus can't rely on > client drivers getting the correct DMA ops. However, we can do better > than fall back to the o

Re: [PATCH v6 28/29] x86/tsc: Restart NMI watchdog after refining tsc_khz

2022-05-10 Thread Thomas Gleixner
On Tue, May 10 2022 at 21:16, Nicholas Piggin wrote: > Excerpts from Ricardo Neri's message of May 6, 2022 10:00 am: >> +/* >> + * If in use, the HPET hardlockup detector relies on tsc_khz. >> + * Reconfigure it to make use of the refined tsc_khz. >> + */ >> +lockup_detector_rec

Re: [PATCH RFC 00/19] IOMMUFD Dirty Tracking

2022-05-10 Thread Joao Martins
On 5/10/22 02:38, Tian, Kevin wrote: >> From: Jason Gunthorpe >> Sent: Friday, May 6, 2022 7:46 PM >> >> On Fri, May 06, 2022 at 03:51:40AM +, Tian, Kevin wrote: From: Jason Gunthorpe Sent: Thursday, May 5, 2022 10:08 PM On Thu, May 05, 2022 at 07:40:37AM +, Tian, Kevi

Re: [PATCH v6 29/29] x86/tsc: Switch to perf-based hardlockup detector if TSC become unstable

2022-05-10 Thread Nicholas Piggin
Excerpts from Ricardo Neri's message of May 6, 2022 10:00 am: > The HPET-based hardlockup detector relies on the TSC to determine if an > observed NMI interrupt was originated by HPET timer. Hence, this detector > can no longer be used with an unstable TSC. > > In such case, permanently stop the H

Re: [PATCH v7 1/7] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-05-10 Thread Yicong Yang via iommu
On 2022/5/10 19:23, Will Deacon wrote: > On Thu, Apr 07, 2022 at 08:58:35PM +0800, Yicong Yang wrote: >> The DMA operations of HiSilicon PTT device can only work properly with >> identical mappings. So add a quirk for the device to force the domain >> as passthrough. >> >> Signed-off-by: Yicong Yan

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-10 Thread Yicong Yang via iommu
On 2022/5/10 20:54, James Clark wrote: > > > On 10/05/2022 12:18, Yicong Yang wrote: >> On 2022/5/10 17:46, James Clark wrote: >>> >>> >>> On 07/04/2022 13:58, Yicong Yang wrote: HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providin

Re: [PATCH RFC 00/19] IOMMUFD Dirty Tracking

2022-05-10 Thread Jason Gunthorpe via iommu
On Tue, May 10, 2022 at 01:38:26AM +, Tian, Kevin wrote: > > However, tt costs nothing to have dirty tracking as long as all iommus > > support it in the system - which seems to be the normal case today. > > > > We should just always turn it on at this point. > > Then still need a way to rep

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-10 Thread James Clark
On 07/04/2022 13:58, Yicong Yang wrote: > HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated > Endpoint(RCiEP) device, providing the capability to dynamically monitor and > tune the PCIe traffic, and trace the TLP headers. > > Add the driver for the device to enable the

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-10 Thread James Clark
On 10/05/2022 12:18, Yicong Yang wrote: > On 2022/5/10 17:46, James Clark wrote: >> >> >> On 07/04/2022 13:58, Yicong Yang wrote: >>> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated >>> Endpoint(RCiEP) device, providing the capability to dynamically monitor and >>> tu

Re: [PATCH v7 5/7] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-05-10 Thread James Clark
On 07/04/2022 13:58, Yicong Yang wrote: > From: Qi Liu > > 'perf record' and 'perf report --dump-raw-trace' supported in this > patch. > > Example usage: > > Output will contain raw PTT data and its textual representation, such > as: > > 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x4

Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-10 Thread Jason Gunthorpe via iommu
On Tue, May 10, 2022 at 02:17:29PM +0800, Lu Baolu wrote: > This adds a pair of common domain ops for this purpose and adds helpers > to attach/detach a domain to/from a {device, PASID}. I wonder if this should not have a detach op - after discussing with Robin we can see that detach_dev is not

[PATCH] swiotlb: Max mapping size takes min align mask into account

2022-05-10 Thread Tianyu Lan
From: Tianyu Lan swiotlb_find_slots() skips slots according to io tlb aligned mask calculated from min aligned mask and original physical address offset. This affects max mapping size. The mapping size can't achieve the IO_TLB_SEGSIZE * IO_TLB_SIZE when original offset is non-zero. This will caus

Re: [PATCH v6 02/12] iommu: Add pasid_bits field in struct dev_iommu

2022-05-10 Thread Jason Gunthorpe via iommu
On Tue, May 10, 2022 at 02:17:28PM +0800, Lu Baolu wrote: > int iommu_device_register(struct iommu_device *iommu, > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > index 627a3ed5ee8f..afc63fce6107 100644 > +++ b/drivers/iommu/arm/arm-smm

Re: [PATCH v6 05/12] iommu/vt-d: Remove SVM_FLAG_SUPERVISOR_MODE support

2022-05-10 Thread Jason Gunthorpe via iommu
On Tue, May 10, 2022 at 02:17:31PM +0800, Lu Baolu wrote: > The current kernel DMA with PASID support is based on the SVA with a flag > SVM_FLAG_SUPERVISOR_MODE. The IOMMU driver binds the kernel memory address > space to a PASID of the device. The device driver programs the device with > kernel vi

Re: [PATCH v6 08/12] iommu/sva: Use attach/detach_pasid_dev in SVA interfaces

2022-05-10 Thread Jason Gunthorpe via iommu
On Tue, May 10, 2022 at 02:17:34PM +0800, Lu Baolu wrote: > +/** > + * iommu_sva_bind_device() - Bind a process address space to a device > + * @dev: the device > + * @mm: the mm to bind, caller must hold a reference to mm_users > + * @drvdata: opaque data pointer to pass to bind callback > + * >

[PATCH AUTOSEL 5.17 04/21] iommu: arm-smmu: disable large page mappings for Nvidia arm-smmu

2022-05-10 Thread Sasha Levin
From: Ashish Mhetre [ Upstream commit 4a25f2ea0e030b2fc852c4059a50181bfc5b2f57 ] Tegra194 and Tegra234 SoCs have the erratum that causes walk cache entries to not be invalidated correctly. The problem is that the walk cache index generated for IOVA is not same across translation and invalidation

[PATCH AUTOSEL 5.15 03/19] iommu: arm-smmu: disable large page mappings for Nvidia arm-smmu

2022-05-10 Thread Sasha Levin
From: Ashish Mhetre [ Upstream commit 4a25f2ea0e030b2fc852c4059a50181bfc5b2f57 ] Tegra194 and Tegra234 SoCs have the erratum that causes walk cache entries to not be invalidated correctly. The problem is that the walk cache index generated for IOVA is not same across translation and invalidation

[GIT PULL] iommu/arm-smmu: Updates for 5.19

2022-05-10 Thread Will Deacon
Hi Joerg, Please pull these Arm SMMU updates for 5.19. The bulk of it is just adding new device-tree compatible strings for the existing drivers, but there are some non-critical fixes in here as well. Please see the tag for more details. I used the previous fixes pull as a base for this so that y

Re: [PATCH] swiotlb: Max mapping size takes min align mask into account

2022-05-10 Thread Robin Murphy
On 2022-05-10 15:21, Tianyu Lan wrote: From: Tianyu Lan swiotlb_find_slots() skips slots according to io tlb aligned mask calculated from min aligned mask and original physical address offset. This affects max mapping size. The mapping size can't achieve the IO_TLB_SEGSIZE * IO_TLB_SIZE when or

[PATCH] vfio: Remove VFIO_TYPE1_NESTING_IOMMU

2022-05-10 Thread Jason Gunthorpe via iommu
This control causes the ARM SMMU drivers to choose a stage 2 implementation for the IO pagetable (vs the stage 1 usual default), however this choice has no visible impact to the VFIO user. Further qemu never implemented this and no other userspace user is known. The original description in commit

[PATCH] dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC

2022-05-10 Thread Mikulas Patocka
We observed the error "cacheline tracking ENOMEM, dma-debug disabled" during a light system load (copying some files). The reason for this error is that the dma_active_cacheline radix tree uses GFP_NOWAIT allocation - so it can't access the emergency memory reserves and it fails as soon as anybody

Re: [PATCH] vfio: Remove VFIO_TYPE1_NESTING_IOMMU

2022-05-10 Thread Robin Murphy
On 2022-05-10 17:55, Jason Gunthorpe via iommu wrote: This control causes the ARM SMMU drivers to choose a stage 2 implementation for the IO pagetable (vs the stage 1 usual default), however this choice has no visible impact to the VFIO user. Further qemu never implemented this and no other users

Re: [PATCH] vfio: Remove VFIO_TYPE1_NESTING_IOMMU

2022-05-10 Thread Jason Gunthorpe via iommu
On Tue, May 10, 2022 at 06:52:06PM +0100, Robin Murphy wrote: > On 2022-05-10 17:55, Jason Gunthorpe via iommu wrote: > > This control causes the ARM SMMU drivers to choose a stage 2 > > implementation for the IO pagetable (vs the stage 1 usual default), > > however this choice has no visible impac

RE: [PATCH] swiotlb: Max mapping size takes min align mask into account

2022-05-10 Thread Michael Kelley (LINUX) via iommu
From: Robin Murphy Sent: Tuesday, May 10, 2022 9:34 AM > > On 2022-05-10 15:21, Tianyu Lan wrote: > > From: Tianyu Lan > > > > swiotlb_find_slots() skips slots according to io tlb aligned mask > > calculated from min aligned mask and original physical address > > offset. This affects max mapping

Re: [PATCH] vfio: Remove VFIO_TYPE1_NESTING_IOMMU

2022-05-10 Thread Nicolin Chen via iommu
On Tue, May 10, 2022 at 01:55:24PM -0300, Jason Gunthorpe wrote: > This control causes the ARM SMMU drivers to choose a stage 2 > implementation for the IO pagetable (vs the stage 1 usual default), > however this choice has no visible impact to the VFIO user. Further qemu > never implemented this a

Re: [PATCH RFC 11/12] iommufd: vfio container FD ioctl compatibility

2022-05-10 Thread Jason Gunthorpe via iommu
On Tue, May 10, 2022 at 05:12:04PM +1000, David Gibson wrote: > On Mon, May 09, 2022 at 11:00:41AM -0300, Jason Gunthorpe wrote: > > On Mon, May 09, 2022 at 04:01:52PM +1000, David Gibson wrote: > > > > > > The default iommu_domain that the iommu driver creates will be used > > > > here, it is up

Re: [PATCH] iommu/vt-d: Increase DMAR_UNITS_SUPPORTED

2022-05-10 Thread Steve Wahl
On Tue, May 10, 2022 at 01:16:26AM +, Tian, Kevin wrote: > > From: Steve Wahl > > Sent: Friday, May 6, 2022 11:26 PM > > > > On Fri, May 06, 2022 at 08:12:11AM +, Tian, Kevin wrote: > > > > From: David Woodhouse > > > > Sent: Friday, May 6, 2022 3:17 PM > > > > > > > > On Fri, 2022-05-06

[PATCH v3 0/4] Enable PASID for DMA API users

2022-05-10 Thread Jacob Pan
Some modern accelerators such as Intel's Data Streaming Accelerator (DSA) require PASID in DMA requests to be operational. Specifically, the work submissions with ENQCMD on shared work queues require PASIDs. The use cases include both user DMA with shared virtual addressing (SVA) and in-kernel DMA

[PATCH v3 3/4] dmaengine: idxd: Use DMA API for in-kernel DMA with PASID

2022-05-10 Thread Jacob Pan
The current in-kernel supervisor PASID support is based on the SVM/SVA machinery in SVA lib. The binding between a kernel PASID and kernel mapping has many flaws. See discussions in the link below. This patch enables in-kernel DMA by switching from SVA lib to the standard DMA mapping APIs. Since b

[PATCH v3 2/4] iommu: Add PASID support for DMA mapping API users

2022-05-10 Thread Jacob Pan
DMA mapping API is the de facto standard for in-kernel DMA. It operates on a per device/RID basis which is not PASID-aware. Some modern devices such as Intel Data Streaming Accelerator, PASID is required for certain work submissions. To allow such devices use DMA mapping API, we need the following

[PATCH v3 1/4] iommu/vt-d: Implement domain ops for attach_dev_pasid

2022-05-10 Thread Jacob Pan
On VT-d platforms with scalable mode enabled, devices issue DMA requests with PASID need to attach PASIDs to given IOMMU domains. The attach operation involves the following: - Programming the PASID into the device's PASID table - Tracking device domain and the PASID relationship - Managing IOTLB a

[PATCH v3 4/4] iommu/vt-d: Delete unused SVM flag

2022-05-10 Thread Jacob Pan
Supervisor PASID for SVA/SVM is no longer supported, delete the unused flag. Signed-off-by: Jacob Pan --- drivers/iommu/intel/svm.c | 2 +- include/linux/intel-svm.h | 13 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/inte

Re: [PATCH v3 1/4] iommu/vt-d: Implement domain ops for attach_dev_pasid

2022-05-10 Thread Jason Gunthorpe via iommu
On Tue, May 10, 2022 at 02:07:01PM -0700, Jacob Pan wrote: > +static int intel_iommu_attach_dev_pasid(struct iommu_domain *domain, > + struct device *dev, > + ioasid_t pasid) > +{ > + struct device_domain_info *info = dev_i

Re: [PATCH v3 2/4] iommu: Add PASID support for DMA mapping API users

2022-05-10 Thread Jason Gunthorpe via iommu
On Tue, May 10, 2022 at 02:07:02PM -0700, Jacob Pan wrote: > DMA mapping API is the de facto standard for in-kernel DMA. It operates > on a per device/RID basis which is not PASID-aware. > > Some modern devices such as Intel Data Streaming Accelerator, PASID is > required for certain work submissi

Re: [PATCH v3 1/4] iommu/vt-d: Implement domain ops for attach_dev_pasid

2022-05-10 Thread Jacob Pan
Hi Jason, On Tue, 10 May 2022 20:21:21 -0300, Jason Gunthorpe wrote: > On Tue, May 10, 2022 at 02:07:01PM -0700, Jacob Pan wrote: > > +static int intel_iommu_attach_dev_pasid(struct iommu_domain *domain, > > + struct device *dev, > > +

Re: [PATCH v3 2/4] iommu: Add PASID support for DMA mapping API users

2022-05-10 Thread Jacob Pan
Hi Jason, On Tue, 10 May 2022 20:28:04 -0300, Jason Gunthorpe wrote: > On Tue, May 10, 2022 at 02:07:02PM -0700, Jacob Pan wrote: > > DMA mapping API is the de facto standard for in-kernel DMA. It operates > > on a per device/RID basis which is not PASID-aware. > > > > Some modern devices such

RE: [PATCH RFC 00/19] IOMMUFD Dirty Tracking

2022-05-10 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, May 10, 2022 9:47 PM > > On Tue, May 10, 2022 at 01:38:26AM +, Tian, Kevin wrote: > > > > However, tt costs nothing to have dirty tracking as long as all iommus > > > support it in the system - which seems to be the normal case today. > > > > > > We s

RE: [PATCH RFC 00/19] IOMMUFD Dirty Tracking

2022-05-10 Thread Tian, Kevin
> From: Joao Martins > Sent: Tuesday, May 10, 2022 7:51 PM > > On 5/10/22 02:38, Tian, Kevin wrote: > >> From: Jason Gunthorpe > >> Sent: Friday, May 6, 2022 7:46 PM > >> > >> On Fri, May 06, 2022 at 03:51:40AM +, Tian, Kevin wrote: > From: Jason Gunthorpe > Sent: Thursday, May 5,

Re: [PATCH v7 5/7] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-05-10 Thread liuqi (BA) via iommu
Hi James, On 2022/5/10 18:14, James Clark wrote: On 07/04/2022 13:58, Yicong Yang wrote: From: Qi Liu [...] struct auxtrace_record *auxtrace_record__init(struct evlist *evlist, int *err) { @@ -57,8 +112,12 @@ struct auxtrace_record struct evsel *evsel; bool found_e

Re: [PATCH v6 02/12] iommu: Add pasid_bits field in struct dev_iommu

2022-05-10 Thread Baolu Lu
On 2022/5/10 22:34, Jason Gunthorpe wrote: On Tue, May 10, 2022 at 02:17:28PM +0800, Lu Baolu wrote: int iommu_device_register(struct iommu_device *iommu, diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 627a3ed5ee8f..afc63fce6107 1

Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-10 Thread Baolu Lu
On 2022/5/10 22:02, Jason Gunthorpe wrote: On Tue, May 10, 2022 at 02:17:29PM +0800, Lu Baolu wrote: This adds a pair of common domain ops for this purpose and adds helpers to attach/detach a domain to/from a {device, PASID}. I wonder if this should not have a detach op - after discussing wit

RE: [PATCH RFC 11/12] iommufd: vfio container FD ioctl compatibility

2022-05-10 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Monday, May 9, 2022 10:01 PM > > On Mon, May 09, 2022 at 04:01:52PM +1000, David Gibson wrote: > > > Which is why I'm suggesting that the base address be an optional > > request. DPDK *will* care about the size of the range, so it just > > requests that and gets t

RE: [PATCH RFC 11/12] iommufd: vfio container FD ioctl compatibility

2022-05-10 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, May 11, 2022 3:00 AM > > On Tue, May 10, 2022 at 05:12:04PM +1000, David Gibson wrote: > > Ok... here's a revised version of my proposal which I think addresses > > your concerns and simplfies things. > > > > - No new operations, but IOAS_MAP gets some n

RE: [PATCH] iommu/vt-d: Increase DMAR_UNITS_SUPPORTED

2022-05-10 Thread Tian, Kevin
> From: Steve Wahl > Sent: Wednesday, May 11, 2022 3:07 AM > > On Tue, May 10, 2022 at 01:16:26AM +, Tian, Kevin wrote: > > > From: Steve Wahl > > > Sent: Friday, May 6, 2022 11:26 PM > > > > > > On Fri, May 06, 2022 at 08:12:11AM +, Tian, Kevin wrote: > > > > > From: David Woodhouse >

RE: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-10 Thread Tian, Kevin
> From: Baolu Lu > Sent: Wednesday, May 11, 2022 10:32 AM > > On 2022/5/10 22:02, Jason Gunthorpe wrote: > > On Tue, May 10, 2022 at 02:17:29PM +0800, Lu Baolu wrote: > > > >> This adds a pair of common domain ops for this purpose and adds > helpers > >> to attach/detach a domain to/from a {devic

Re: [PATCH RFC 11/12] iommufd: vfio container FD ioctl compatibility

2022-05-10 Thread David Gibson
On Tue, May 10, 2022 at 04:00:09PM -0300, Jason Gunthorpe wrote: > On Tue, May 10, 2022 at 05:12:04PM +1000, David Gibson wrote: > > On Mon, May 09, 2022 at 11:00:41AM -0300, Jason Gunthorpe wrote: > > > On Mon, May 09, 2022 at 04:01:52PM +1000, David Gibson wrote: > > > > > > > > The default iomm

Re: [PATCH] swiotlb: Max mapping size takes min align mask into account

2022-05-10 Thread h...@lst.de
On Tue, May 10, 2022 at 06:26:55PM +, Michael Kelley (LINUX) wrote: > > Hmm, this seems a bit pessimistic - the offset can vary per mapping, so > > it feels to me like it should really be the caller's responsibility to > > account for it if they're already involved enough to care about both > >

[PATCH 0/4] iommu/mediatek: Improve safety from dts

2022-05-10 Thread Yong Wu via iommu
his: https://lore.kernel.org/linux-mediatek/20211210205704.1664928-1-li...@roeck-us.net/ Base on linux-next-20220510. Guenter Roeck (1): iommu/mediatek: Validate number of phandles associated with "mediatek,larbs" Yong Wu (3): iommu/mediatek: Use dev_err_probe to mute probe_defer err log

[PATCH 1/4] iommu/mediatek: Use dev_err_probe to mute probe_defer err log

2022-05-10 Thread Yong Wu via iommu
Mute the probe defer log: [2.654806] mtk-iommu 14018000.iommu: mm dts parse fail(-517). [2.656168] mtk-iommu 1c01f000.iommu: mm dts parse fail(-517). Fixes: d2e9a1102cfc ("iommu/mediatek: Contain MM IOMMU flow with the MM TYPE") Signed-off-by: Yong Wu --- The Fixes tag commit-id is from

[PATCH 2/4] iommu/mediatek: Add error path for loop of mm_dts_parse

2022-05-10 Thread Yong Wu via iommu
The mtk_iommu_mm_dts_parse will parse the smi larbs nodes. if the i+1 larb is parsed fail(return -EINVAL), we should of_node_put for the 0..i larbs. Fixes: d2e9a1102cfc ("iommu/mediatek: Contain MM IOMMU flow with the MM TYPE") Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 21 ++

[PATCH 3/4] iommu/mediatek: Validate number of phandles associated with "mediatek, larbs"

2022-05-10 Thread Yong Wu via iommu
From: Guenter Roeck Fix the smatch warnings: drivers/iommu/mtk_iommu.c:878 mtk_iommu_mm_dts_parse() error: uninitialized symbol 'larbnode'. If someone abuse the dtsi node(Don't follow the definition of dt-binding), for example "mediatek,larbs" is provided as boolean property, the code may crash.

[PATCH 4/4] iommu/mediatek: Improve safety for mediatek, smi property in larb nodes

2022-05-10 Thread Yong Wu via iommu
No functional change. Just improve safety from dts. All the larbs that connect to one IOMMU must connect with the same smi-common. This patch checks all the mediatek,smi property for each larb, If their mediatek,smi are different, it will return fails. Also avoid there is no available smi-larb nod