[PATCH 7/7] iommu/vt-d: Move include/linux/intel_iommu.h under iommu

2022-05-13 Thread Lu Baolu
This header file is private to the Intel IOMMU driver. Move it to the driver folder. Signed-off-by: Lu Baolu --- include/linux/intel-iommu.h => drivers/iommu/intel/iommu.h | 0 drivers/iommu/intel/trace.h| 3 ++- drivers/iommu/intel/cap_audit.c

[PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU

2022-05-13 Thread Lu Baolu
tboot_force_iommu() is only called by the Intel IOMMU driver. Move the helper into that driver. No functional change intended. Signed-off-by: Lu Baolu --- include/linux/tboot.h | 2 -- arch/x86/kernel/tboot.c | 15 --- drivers/iommu/intel/iommu.c | 14 ++ 3 fil

[PATCH 5/7] KVM: x86: Remove unnecessary include

2022-05-13 Thread Lu Baolu
intel-iommu.h is not needed in kvm/x86 anymore. Remove its include. Signed-off-by: Lu Baolu --- arch/x86/kvm/x86.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4790f0d7d40b..fdf6ce5855d9 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c

[PATCH 4/7] drm/i915: Remove unnecessary include

2022-05-13 Thread Lu Baolu
intel-iommu.h is not needed in drm/i915 anymore. Remove its include. Signed-off-by: Lu Baolu --- drivers/gpu/drm/i915/i915_drv.h| 1 - drivers/gpu/drm/i915/display/intel_display.c | 1 - drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 - 3 files changed, 3 deletions(-) diff

[PATCH 3/7] iommu/vt-d: Remove unnecessary exported symbol

2022-05-13 Thread Lu Baolu
The exported symbol intel_iommu_gfx_mapped is not used anywhere in the tree. Remove it to avoid dead code. Signed-off-by: Lu Baolu --- include/linux/intel-iommu.h | 1 - drivers/iommu/intel/iommu.c | 6 -- 2 files changed, 7 deletions(-) diff --git a/include/linux/intel-iommu.h b/include/li

[PATCH 1/7] iommu/vt-d: Move trace/events/intel_iommu.h under iommu

2022-05-13 Thread Lu Baolu
This header file is private to the Intel IOMMU driver. Move it to the driver folder. Signed-off-by: Lu Baolu --- .../trace/events/intel_iommu.h => drivers/iommu/intel/trace.h | 4 drivers/iommu/intel/dmar.c| 2 +- drivers/iommu/intel/svm.c

[PATCH 2/7] agp/intel: Use per device iommu check

2022-05-13 Thread Lu Baolu
The IOMMU subsystem has already provided an interface to query whether the IOMMU hardware is enabled for a specific device. This changes the check from Intel specific intel_iommu_gfx_mapped (globally exported by the Intel IOMMU driver) to probing the presence of IOMMU on a specific device using the

[PATCH 0/7] iommu/vt-d: Make intel-iommu.h private

2022-05-13 Thread Lu Baolu
Hi folks, The include/linux/intel-iommu.h should be private to the Intel IOMMU driver. Other drivers or components should interact with the IOMMU drivers through the kAPIs provided by the iommu core. This series cleanups all includes of intel-iommu.h outside of the Intel IOMMU driver and move thi

Re: [PATCH v6 05/29] x86/apic/vector: Do not allocate vectors for NMIs

2022-05-13 Thread Ricardo Neri
On Fri, May 13, 2022 at 10:50:09PM +0200, Thomas Gleixner wrote: > On Fri, May 13 2022 at 11:03, Ricardo Neri wrote: > > On Fri, May 06, 2022 at 11:12:20PM +0200, Thomas Gleixner wrote: > >> Why would a NMI ever end up in this code? There is no vector management > >> required and this find cpu exer

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

2022-05-13 Thread Ricardo Neri
On Tue, May 10, 2022 at 08:46:41PM +1000, Nicholas Piggin wrote: > 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 parame

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

2022-05-13 Thread Ricardo Neri
On Tue, May 10, 2022 at 08:38:22PM +1000, Nicholas Piggin wrote: > 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 a

Re: [PATCH v6 22/29] x86/watchdog/hardlockup: Add an HPET-based hardlockup detector

2022-05-13 Thread Ricardo Neri
On Mon, May 09, 2022 at 04:03:39PM +0200, Thomas Gleixner wrote: > On Thu, May 05 2022 at 17:00, Ricardo Neri wrote: > > + if (is_hpet_hld_interrupt(hdata)) { > > + /* > > +* Kick the timer first. If the HPET channel is periodic, it > > +* helps to reduce the del

Re: [PATCH v6 15/29] x86/hpet: Add helper function hpet_set_comparator_periodic()

2022-05-13 Thread Ricardo Neri
On Fri, May 06, 2022 at 11:51:52PM +0200, Thomas Gleixner wrote: > On Fri, May 06 2022 at 23:41, Thomas Gleixner wrote: > > On Thu, May 05 2022 at 16:59, Ricardo Neri wrote: > >> Programming an HPET channel as periodic requires setting the > >> HPET_TN_SETVAL bit in the channel configuration. Plus,

Re: [PATCH v6 15/29] x86/hpet: Add helper function hpet_set_comparator_periodic()

2022-05-13 Thread Ricardo Neri
On Fri, May 06, 2022 at 11:41:13PM +0200, Thomas Gleixner wrote: > On Thu, May 05 2022 at 16:59, Ricardo Neri wrote: > > Programming an HPET channel as periodic requires setting the > > HPET_TN_SETVAL bit in the channel configuration. Plus, the comparator > > register must be written twice (once fo

Re: [PATCH v6 05/29] x86/apic/vector: Do not allocate vectors for NMIs

2022-05-13 Thread Thomas Gleixner
On Fri, May 13 2022 at 11:03, Ricardo Neri wrote: > On Fri, May 06, 2022 at 11:12:20PM +0200, Thomas Gleixner wrote: >> Why would a NMI ever end up in this code? There is no vector management >> required and this find cpu exercise is pointless. > > But even if the NMI has a fixed vector, it is stil

Re: [RESEND PATCH v8 00/11] Fix BUG_ON in vfio_iommu_group_notifier()

2022-05-13 Thread Jason Gunthorpe via iommu
On Fri, May 13, 2022 at 10:25:48AM -0600, Alex Williamson wrote: > On Fri, 13 May 2022 17:49:44 +0200 > Joerg Roedel wrote: > > > Hi Alex, > > > > On Wed, May 04, 2022 at 10:29:56AM -0600, Alex Williamson wrote: > > > Done, and thanks for the heads-up. Please try to cc me when the > > > vfio-no

Re: [PATCH v6 13/29] iommu/amd: Compose MSI messages for NMI irqs in non-IR format

2022-05-13 Thread Ricardo Neri
On Fri, May 06, 2022 at 11:31:56PM +0200, Thomas Gleixner wrote: > On Thu, May 05 2022 at 16:59, Ricardo Neri wrote: > > +* > > +* Also, NMIs do not have an associated vector. No need for cleanup. > > They have a vector and what the heck is this cleanup comment for here? > There is nothing

Re: [PATCH v6 12/29] iommu/amd: Enable NMIPass when allocating an NMI irq

2022-05-13 Thread Ricardo Neri
On Fri, May 06, 2022 at 11:26:22PM +0200, Thomas Gleixner wrote: > On Thu, May 05 2022 at 16:59, Ricardo Neri wrote: > > > > + if (info->flags & X86_IRQ_ALLOC_AS_NMI) { > > + /* Only one IRQ per NMI */ > > + if (nr_irqs != 1) > > + return -EINVAL; > > See

Re: [PATCH v6 10/29] iommu/vt-d: Implement minor tweaks for NMI irqs

2022-05-13 Thread Ricardo Neri
On Fri, May 06, 2022 at 11:23:23PM +0200, Thomas Gleixner wrote: > On Thu, May 05 2022 at 16:59, Ricardo Neri wrote: > > The Intel IOMMU interrupt remapping driver already programs correctly the > > delivery mode of individual irqs as per their irq_data. Improve handling > > of NMIs. Allow only one

Re: [PATCH v6 05/29] x86/apic/vector: Do not allocate vectors for NMIs

2022-05-13 Thread Ricardo Neri
On Fri, May 06, 2022 at 11:12:20PM +0200, Thomas Gleixner wrote: > On Thu, May 05 2022 at 16:59, Ricardo Neri wrote: > > Vectors are meaningless when allocating IRQs with NMI as the delivery > > mode. > > Vectors are not meaningless. NMI has a fixed vector. > > The point is that for a fixed vecto

Re: [PATCH v1] driver core: Extend deferred probe timeout on driver registration

2022-05-13 Thread Saravana Kannan via iommu
On Fri, May 13, 2022 at 6:58 AM Rob Herring wrote: > > On Fri, Apr 29, 2022 at 5:09 PM Saravana Kannan wrote: > > > > The deferred probe timer that's used for this currently starts at > > late_initcall and runs for driver_deferred_probe_timeout seconds. The > > assumption being that all available

Re: [PATCH] iommu/vt-d: Try info->iommu in device_to_iommu()

2022-05-13 Thread Nicolin Chen via iommu
On Fri, May 13, 2022 at 08:50:32AM -0300, Jason Gunthorpe wrote: > > Perhaps, we can make device_to_iommu() only for probe_device() where the > > per-device info data is not initialized yet. After probe_device(), iommu > > and sid are retrieved through other helpers by looking up the device > > in

Re: [RESEND PATCH v8 00/11] Fix BUG_ON in vfio_iommu_group_notifier()

2022-05-13 Thread Alex Williamson
On Fri, 13 May 2022 17:49:44 +0200 Joerg Roedel wrote: > Hi Alex, > > On Wed, May 04, 2022 at 10:29:56AM -0600, Alex Williamson wrote: > > Done, and thanks for the heads-up. Please try to cc me when the > > vfio-notifier-fix branch is merged back into your next branch. Thanks, > > This has

Re: [RESEND PATCH v8 00/11] Fix BUG_ON in vfio_iommu_group_notifier()

2022-05-13 Thread Joerg Roedel
Hi Alex, On Wed, May 04, 2022 at 10:29:56AM -0600, Alex Williamson wrote: > Done, and thanks for the heads-up. Please try to cc me when the > vfio-notifier-fix branch is merged back into your next branch. Thanks, This has happened now, the vfio-notifier-fix branch got the fix and is merged back

[PATCH] iommu/dma: Fix check for error return from iommu_map_sg_atomic()

2022-05-13 Thread Niklas Schnelle
In __iommu_dma_alloc_noncontiguous() the value returned by iommu_map_sg_atomic() is checked for being smaller than size. Before commit ad8f36e4b6b1 ("iommu: return full error code from iommu_map_sg[_atomic]()") this simply checked if the requested size was successfully mapped. After that commit io

[PATCH 2/2] iommu: mtk_iommu: Add support for MT6795 Helio X10 M4Us

2022-05-13 Thread AngeloGioacchino Del Regno
Add support for the M4Us found in the MT6795 Helio X10 SoC. Signed-off-by: AngeloGioacchino Del Regno --- drivers/iommu/mtk_iommu.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 71b2ace74cd6..

[PATCH 1/2] dt-bindings: mediatek: Add bindings for MT6795 M4U

2022-05-13 Thread AngeloGioacchino Del Regno
Add bindings for the MediaTek Helio X10 (MT6795) IOMMU/M4U. Signed-off-by: AngeloGioacchino Del Regno --- .../bindings/iommu/mediatek,iommu.yaml| 3 + include/dt-bindings/memory/mt6795-larb-port.h | 96 +++ 2 files changed, 99 insertions(+) create mode 100644 include/d

[PATCH 0/2] MediaTek Helio X10 MT6795 - M4U/IOMMU Support

2022-05-13 Thread AngeloGioacchino Del Regno
In an effort to give some love to the apparently forgotten MT6795 SoC, I am upstreaming more components that are necessary to support platforms powered by this one apart from a simple boot to serial console. This series introduces support for the IOMMUs found on this SoC. Tested on a MT6795 Sony

Re: [PATCH v1] driver core: Extend deferred probe timeout on driver registration

2022-05-13 Thread Rob Herring
On Fri, Apr 29, 2022 at 5:09 PM Saravana Kannan wrote: > > The deferred probe timer that's used for this currently starts at > late_initcall and runs for driver_deferred_probe_timeout seconds. The > assumption being that all available drivers would be loaded and > registered before the timer expir

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

2022-05-13 Thread Joerg Roedel
On Tue, May 10, 2022 at 05:01:06PM +0100, Will Deacon wrote: > git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git > tags/arm-smmu-updates Pulled, thanks Will. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfounda

Re: [PATCH 0/8] [PULL REQUEST] Intel IOMMU updates for Linux v5.19

2022-05-13 Thread Joerg Roedel
On Tue, May 10, 2022 at 10:33:59AM +0800, Lu Baolu wrote: > This includes patches queued for v5.19. It includes: > > - Domain force snooping improvement. > - Cleanups, no intentional functional changes. > > Please consider them for v5.19. > > [This series cannot be directly applied to vt-d bra

Re: [PATCH v2] iommu/dma: Explicitly sort PCI DMA windows

2022-05-13 Thread Joerg Roedel
On Mon, May 09, 2022 at 11:16:08AM +0100, Robin Murphy wrote: > drivers/iommu/dma-iommu.c | 13 - > drivers/pci/of.c | 8 +--- > 2 files changed, 13 insertions(+), 8 deletions(-) Applied, thanks. ___ iommu mailing list iommu@li

Re: [PATCH v2] iommu/amd: Set translation valid bit only when IO page tables are in used

2022-05-13 Thread Joerg Roedel
On Mon, May 09, 2022 at 02:48:15AM -0500, Suravee Suthikulpanit wrote: > On AMD system with SNP enabled, IOMMU hardware checks the host translation > valid (TV) and guest translation valid (GV) bits in the device > table entry (DTE) before accessing the corresponded page tables. > > However, curre

Re: [PATCH] iommu/dma: Fix iova map result check bug

2022-05-13 Thread Joerg Roedel
On Sat, May 07, 2022 at 04:52:03PM +0800, yf.w...@mediatek.com wrote: > drivers/iommu/dma-iommu.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linux

Re: [PATCH v3] iommu/mediatek: Fix NULL pointer dereference when printing dev_name

2022-05-13 Thread Joerg Roedel
On Thu, May 05, 2022 at 09:27:30PM +0800, Miles Chen wrote: > drivers/iommu/mtk_iommu.c| 6 ++ > drivers/iommu/mtk_iommu_v1.c | 7 +++ > 2 files changed, 13 insertions(+) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.o

Re: [PATCH v3] iommu: iommu_group_claim_dma_owner() must always assign a domain

2022-05-13 Thread Joerg Roedel
On Mon, May 09, 2022 at 01:19:19PM -0300, Jason Gunthorpe wrote: > drivers/iommu/iommu.c | 127 ++ > 1 file changed, 91 insertions(+), 36 deletions(-) Applied, thanks. Will back-merge the branch into next now. ___

Re: [PATCH v1] driver core: Extend deferred probe timeout on driver registration

2022-05-13 Thread Mark Brown
On Fri, Apr 29, 2022 at 03:09:32PM -0700, Saravana Kannan wrote: > The deferred probe timer that's used for this currently starts at > late_initcall and runs for driver_deferred_probe_timeout seconds. The > assumption being that all available drivers would be loaded and > registered before the time

Re: [PATCH 1/3] swiotlb: don't panic when the swiotlb buffer can't be allocated

2022-05-13 Thread Conor.Dooley--- via iommu
On 11/05/2022 13:58, Christoph Hellwig wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > For historical reasons the switlb code paniced when the metadata could > not be allocated, but just printed a warning when the actual main > swiotlb buf

Re: [PATCH v5 1/5] dt-bindings: reserved-memory: Document iommu-addresses

2022-05-13 Thread Rob Herring
On Thu, 12 May 2022 21:00:48 +0200, Thierry Reding wrote: > From: Thierry Reding > > This adds the "iommu-addresses" property to reserved-memory nodes, which > allow describing the interaction of memory regions with IOMMUs. Two use- > cases are supported: > > 1. Static mappings can be describe

Re: [PATCH] iommu/vt-d: Try info->iommu in device_to_iommu()

2022-05-13 Thread Jason Gunthorpe via iommu
On Fri, May 13, 2022 at 11:32:11AM +0800, Baolu Lu wrote: > On 2022/5/13 08:32, Nicolin Chen wrote: > > Local boot test and VFIO sanity test show that info->iommu can be > > used in device_to_iommu() as a fast path. So this patch adds it. > > > > Signed-off-by: Nicolin Chen > > drivers/iommu/in

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

2022-05-13 Thread Lorenzo Pieralisi
[with Christoph's correct email address] On Tue, May 10, 2022 at 09:07:00AM +0100, Robin Murphy wrote: > 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.

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

2022-05-13 Thread Lorenzo Pieralisi
On Tue, May 10, 2022 at 09:07:00AM +0100, Robin Murphy wrote: > 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 e

[PATCH] iommu: Remove unneeded NULL check in msm_iommu

2022-05-13 Thread Wan Jiabing via iommu
clk_disable() already uses IS_ERR_OR_NULL to check NULL pointer. Remove unneeded NULL check for iommu->clk here. Signed-off-by: Wan Jiabing --- drivers/iommu/msm_iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c in

[PATCH] iommu: Remove unneeded NULL check in sprd-iommu

2022-05-13 Thread Wan Jiabing via iommu
clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL. Remove unneeded NULL check for sdev->eb here. Signed-off-by: Wan Jiabing --- drivers/iommu/sprd-iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu

RE: [RESEND PATCH v8 00/11] Fix BUG_ON in vfio_iommu_group_notifier()

2022-05-13 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, May 10, 2022 2:33 AM > > On Wed, May 04, 2022 at 01:57:05PM +0200, Joerg Roedel wrote: > > On Wed, May 04, 2022 at 08:51:35AM -0300, Jason Gunthorpe wrote: > > > Nicolin and Eric have been testing with this series on ARM for a long > > > time now, it is not