Re: [PATCH] iommu: check for the deferred attach when attaching a device

2021-01-04 Thread lijiang
在 2021年01月05日 11:55, lijiang 写道: > Hi, > > Also add Joerg to cc list. > Also add more people to cc list, Jerry Snitselaar and Tom Lendacky. Thanks. > Thanks. > Lianbo > 在 2020年12月26日 13:39, Lianbo Jiang 写道: >> Currently, because domain attach allows to be deferred from iommu >> driver to

[PATCH RESEND 4/7] iommu/arm-smmu-v3: Add dependency on io-pgtable-arm format module

2021-01-04 Thread Isaac J. Manjarres
The SMMUv3 driver depends on the availability of the ARM LPAE io-pgtable format code to work properly. In preparation for having the io-pgtable formats as modules, add a "pre" dependency with MODULE_SOFTDEP() to ensure that the io-pgtable-arm format module is loaded before loading the ARM SMMUv3

[PATCH RESEND 6/7] drm/panfrost: Add dependency on io-pgtable-arm format module

2021-01-04 Thread Isaac J. Manjarres
The Panfrost DRM driver depends on the availability of the ARM LPAE io-pgtable format code to work properly. In preparation for having the io-pgtable formats as modules, add a "pre" dependency with MODULE_SOFTDEP() to ensure that the io-pgtable-arm format module is loaded before loading the

[PATCH RESEND 7/7] iommu/io-pgtable-arm: Allow building modular io-pgtable formats

2021-01-04 Thread Isaac J. Manjarres
Now that everything is in place for modular io-pgtable formats, allow the ARM LPAE and ARMV7S io-pgtable formats to be built as modules, and allow the io-pgtable framework to be enabled, without having to explicitly enable an io-pgtable format. Signed-off-by: Isaac J. Manjarres ---

[PATCH RESEND 5/7] drm/msm: Add dependency on io-pgtable-arm format module

2021-01-04 Thread Isaac J. Manjarres
The MSM DRM driver depends on the availability of the ARM LPAE io-pgtable format code to work properly. In preparation for having the io-pgtable formats as modules, add a "pre" dependency with MODULE_SOFTDEP() to ensure that the io-pgtable-arm format module is loaded before loading the MSM DRM

[PATCH RESEND 2/7] iommu/io-pgtable: Add refcounting for io-pgtable format modules

2021-01-04 Thread Isaac J. Manjarres
In preparation for modularizing io-pgtable formats, add support for reference counting the io-pgtable format modules to ensure that the modules are not unloaded while they are in use. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 1 + drivers/iommu/io-pgtable-arm.c

[PATCH RESEND 1/7] iommu/io-pgtable: Introduce dynamic io-pgtable format registration

2021-01-04 Thread Isaac J. Manjarres
The io-pgtable code constructs an array of init functions for each page table format at compile time. This is not ideal, as it prevents io-pgtable formats from being built as kernel modules. In preparation for modularizing the io-pgtable formats, switch to a dynamic registration scheme, where

[PATCH RESEND 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

2021-01-04 Thread Isaac J. Manjarres
The SMMU driver depends on the availability of the ARM LPAE io-pgtable format code to work properly. In preparation for having the io-pgtable formats as modules, add a "pre" dependency with MODULE_SOFTDEP() to ensure that the ARM LPAE io-pgtable format module is loaded before loading the ARM SMMU

[PATCH RESEND 0/7] iommu: Permit modular builds of io-pgtable drivers

2021-01-04 Thread Isaac J. Manjarres
The goal of the Generic Kernel Image (GKI) effort is to have a common kernel image that works across multiple Android devices. This involves generating a kernel image that has core features integrated into it, while SoC specific functionality can be added to the kernel for the device as a module.

RE: [PATCH v3 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info

2021-01-04 Thread Liu, Yi L
Hi Baolu, > From: Lu Baolu > Sent: Tuesday, December 29, 2020 4:38 PM > > Hi Yi, > > On 2020/12/29 11:25, Liu Yi L wrote: > > In the existing code, loop all devices attached to a domain does not > > include sub-devices attached via iommu_aux_attach_device(). > > > > This was found by when I'm

RE: [PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2021-01-04 Thread Liu, Yi L
Hi Baolu, > From: Lu Baolu > Sent: Tuesday, December 29, 2020 4:42 PM > > Hi Yi, > > On 2020/12/29 11:25, Liu Yi L wrote: > > iommu_flush_dev_iotlb() is called to invalidate caches on device. It only > > loops the devices which are full-attached to the domain. For sub-devices, > > this is

[PATCH] [v2] iommu/intel: Fix memleak in intel_irq_remapping_alloc

2021-01-04 Thread Dinghao Liu
When irq_domain_get_irq_data() or irqd_cfg() fails at i == 0, data allocated by kzalloc() has not been freed before returning, which leads to memleak. Fixes: b106ee63abccb ("irq_remapping/vt-d: Enhance Intel IR driver to support hierarchical irqdomains") Signed-off-by: Dinghao Liu ---

Re: [PATCH] iommu: check for the deferred attach when attaching a device

2021-01-04 Thread lijiang
Hi, Also add Joerg to cc list. Thanks. Lianbo 在 2020年12月26日 13:39, Lianbo Jiang 写道: > Currently, because domain attach allows to be deferred from iommu > driver to device driver, and when iommu initializes, the devices > on the bus will be scanned and the default groups will be allocated. > >

Re: [EXTERNAL] PROBLEM: commit f36a74b9345a leads to not booting system with AMD 2990WX

2021-01-04 Thread Johnathan Smithinovic
On 05/01/2021 01:19, David Woodhouse wrote: > On Tue, 2021-01-05 at 00:05 +0100, Johnathan Smithinovic wrote: >> commit f36a74b9345a leads to not booting system with AMD 2990WX >> >> > > No problem, that was enough to reproduce it in qemu just by simulating > the same BIOS bug which causes it to

Re: Re: [PATCH] iommu/intel: Fix memleak in intel_irq_remapping_alloc

2021-01-04 Thread dinghao . liu
> On 1/3/21 2:22 PM, dinghao@zju.edu.cn wrote: > >> On 2021/1/3 12:08, dinghao@zju.edu.cn wrote: > Hi, > > On 2021/1/2 17:50, Dinghao Liu wrote: > > When irq_domain_get_irq_data() or irqd_cfg() fails > > meanwhile i == 0, data allocated by kzalloc() has not > >

Re: [PATCH] iommu/intel: Fix memleak in intel_irq_remapping_alloc

2021-01-04 Thread Lu Baolu
On 1/3/21 2:22 PM, dinghao@zju.edu.cn wrote: On 2021/1/3 12:08, dinghao@zju.edu.cn wrote: Hi, On 2021/1/2 17:50, Dinghao Liu wrote: When irq_domain_get_irq_data() or irqd_cfg() fails meanwhile i == 0, data allocated by kzalloc() has not been freed before returning, which leads to

[PATCH] iommu/amd: Stop irq_remapping_select() matching when remapping is disabled

2021-01-04 Thread David Woodhouse
From: David Woodhouse The AMD IOMMU initialisation registers the IRQ remapping domain for each IOMMU before doing the final sanity check that every I/OAPIC is covered. This means that the AMD irq_remapping_select() function gets invoked even when IRQ remapping has been disabled, eventually

[PATCH] iommu/amd: Set iommu->int_enabled consistently when interrupts are set up

2021-01-04 Thread David Woodhouse
From: David Woodhouse When I made the INTCAPXT support stop gratuitously pretending to be MSI, I missed the fact that iommu_setup_msi() also sets the ->int_enabled flag. I missed this in the iommu_setup_intcapxt() code path, which means that a resume from suspend will try to allocate the IRQ

Re: [EXTERNAL] PROBLEM: commit f36a74b9345a leads to not booting system with AMD 2990WX

2021-01-04 Thread David Woodhouse
On Tue, 2021-01-05 at 00:05 +0100, Johnathan Smithinovic wrote: > commit f36a74b9345a leads to not booting system with AMD 2990WX > > > When trying to boot 5.11-rc2 as usual the messages of the bootloader stay on > my > screen and not much appears to happen (fans run a bit slower than in GRUB,

Re: Interrupts enabled after amd_iommu_resume+0x0/0x40

2021-01-04 Thread David Woodhouse
On Tue, 2021-01-05 at 00:23 +0100, Borislav Petkov wrote: > On Mon, Jan 04, 2021 at 02:22:50PM +0100, Borislav Petkov wrote: > > Hi folks, > > > > syscore_resume() doesn't like when the AMD iommu driver enables > > interrupts in its ->resume hook when I resume the box from suspend to > > RAM. > >

Re: [PATCH] x86/iommu: Fix two minimal issues in check_iommu_entries()

2021-01-04 Thread Konrad Rzeszutek Wilk
On Wed, Dec 23, 2020 at 02:24:12PM +0800, Zhenzhong Duan wrote: > check_iommu_entries() checks for cyclic dependency in iommu entries > and fixes the cyclic dependency by setting x->depend to NULL. But > this repairing isn't correct if q is in front of p, there will be > "EXECUTION ORDER INVALID!"

Interrupts enabled after amd_iommu_resume+0x0/0x40

2021-01-04 Thread Borislav Petkov
Hi folks, syscore_resume() doesn't like when the AMD iommu driver enables interrupts in its ->resume hook when I resume the box from suspend to RAM. All kinds of warnings get triggered too: [ 17.386830] WARNING: CPU: 0 PID: 2 at kernel/time/timekeeping.c:824 ktime_get+0x8d/0xa0 [

Re: [PATCH v4 00/13] iommu/amd: Add Generic IO Page Table Framework Support

2021-01-04 Thread Suravee Suthikulpanit
Hi Joerg / Will, Happy New Year!! Just want to follow up on this series. Thanks, Suravee On 12/15/20 2:36 PM, Suravee Suthikulpanit wrote: The framework allows callable implementation of IO page table. This allows AMD IOMMU driver to switch between different types of AMD IOMMU page tables

Re: [RFC PATCH v2 0/8] ACPI/IORT: Support for IORT RMR node

2021-01-04 Thread Jon Nettleton
On Mon, Jan 4, 2021 at 9:55 AM Shameerali Kolothum Thodi wrote: > > > > > -Original Message- > > From: Jon Nettleton [mailto:j...@solid-run.com] > > Sent: 18 December 2020 10:53 > > To: Shameerali Kolothum Thodi > > Cc: Steven Price ; Robin Murphy > > ;

RE: [RFC PATCH v2 0/8] ACPI/IORT: Support for IORT RMR node

2021-01-04 Thread Shameerali Kolothum Thodi
> -Original Message- > From: Jon Nettleton [mailto:j...@solid-run.com] > Sent: 18 December 2020 10:53 > To: Shameerali Kolothum Thodi > Cc: Steven Price ; Robin Murphy > ; linux-arm-ker...@lists.infradead.org; > linux-a...@vger.kernel.org; iommu@lists.linux-foundation.org; >