Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-09-09 Thread Kai-Heng Feng
On Wed, Jul 14, 2021 at 6:25 PM Joerg Roedel wrote: > > On Tue, Jul 13, 2021 at 07:57:40PM -0400, Konrad Rzeszutek Wilk wrote: > > The SWIOTLB does have support to do late initialization (xen-pcifront > > does that for example - so if you add devices that can't do 64-bit it > > will allocate

Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-13 Thread Kai-Heng Feng
On Wed, Jul 14, 2021 at 7:57 AM Konrad Rzeszutek Wilk wrote: > > On Thu, Jul 08, 2021 at 03:43:42PM +0100, Robin Murphy wrote: > > On 2021-07-08 14:57, Kai-Heng Feng wrote: > > > On Thu, Jul 8, 2021 at 6:18 PM Robin Murphy wrote: > > > > > > >

[PATCH v2] iommu/amd: Keep swiotlb enabled to ensure devices with 32bit DMA still work

2021-07-08 Thread Kai-Heng Feng
Cc: Robin Murphy Signed-off-by: Kai-Heng Feng --- v2: - Keep swiotlb enabled if it's already set. - Some wording change. drivers/iommu/amd/iommu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 811a49a95d04..a89

Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-08 Thread Kai-Heng Feng
On Thu, Jul 8, 2021 at 6:18 PM Robin Murphy wrote: > > On 2021-07-08 10:28, Joerg Roedel wrote: > > On Thu, Jul 08, 2021 at 03:42:32PM +0800, Kai-Heng Feng wrote: > >> @@ -344,6 +344,9 @@ static int iommu_init_device(struct device *dev) > >> > >>

[PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-08 Thread Kai-Heng Feng
uery from amd_iommu_def_domain_type(). However, the Realtek WiFi doesn't support 64bit DMA, so we need to enable swiotlb, which was disabled by amd_iommu_init_dma_ops(), to make remapping work. Cc: Robin Murphy Signed-off-by: Kai-Heng Feng --- drivers/iommu/amd/iommu.c | 3 +++ 1 file changed, 3 insertions

Re: [PATCH] iommu: Fallback to default setting when def_domain_type() callback returns 0

2021-07-07 Thread Kai-Heng Feng
On Wed, Jul 7, 2021 at 2:03 AM Robin Murphy wrote: > > On 2021-07-06 17:21, Kai-Heng Feng wrote: > > On Tue, Jul 6, 2021 at 5:27 PM Robin Murphy wrote: > >> > >> On 2021-07-06 07:51, Kai-Heng Feng wrote: > >>> Commit 28b41e2c6aeb ("iommu: Move d

Re: [PATCH] iommu: Fallback to default setting when def_domain_type() callback returns 0

2021-07-06 Thread Kai-Heng Feng
On Tue, Jul 6, 2021 at 5:27 PM Robin Murphy wrote: > > On 2021-07-06 07:51, Kai-Heng Feng wrote: > > Commit 28b41e2c6aeb ("iommu: Move def_domain type check for untrusted > > device into core") not only moved the check for untrusted device to > > IOMMU core, it a

[PATCH] iommu: Fallback to default setting when def_domain_type() callback returns 0

2021-07-06 Thread Kai-Heng Feng
no longer use the default IOMMU setting. So revert back to the old behavior which defaults to iommu_def_domain_type when driver callback returns 0. Fixes: 28b41e2c6aeb ("iommu: Move def_domain type check for untrusted device into core") Signed-off-by: Kai-Heng Feng --- drivers/iommu/

Re: [bugzilla-dae...@bugzilla.kernel.org: [Bug 209149] New: "iommu/vt-d: Enable PCI ACS for platform opt in hint" makes NVMe config space not accessible after S3]

2020-09-25 Thread Kai-Heng Feng
Raj, > On Sep 25, 2020, at 03:44, Raj, Ashok wrote: > > Hi Alex > >>> Apparently it also requires to disable RR, and I'm not able to confirm if >>> CML requires that as well. >>> >>> pci_quirk_disable_intel_spt_pch_acs_redir() also seems to consult the same >>> table, so i'm not sure why we

Re: [bugzilla-dae...@bugzilla.kernel.org: [Bug 209149] New: "iommu/vt-d: Enable PCI ACS for platform opt in hint" makes NVMe config space not accessible after S3]

2020-09-23 Thread Kai-Heng Feng
[+Cc Christoph] > On Sep 24, 2020, at 00:03, Bjorn Helgaas wrote: > > [+cc IOMMU and NVMe folks] > > Sorry, I forgot to forward this to linux-pci when it was first > reported. > > Apparently this happens with v5.9-rc3, and may be related to > 50310600ebda ("iommu/vt-d: Enable PCI ACS for

Re: [Regression] "iommu/amd: Relax locking in dma_ops path" makes tg3 ethernet transmit queue timeout

2020-08-21 Thread Kai-Heng Feng
Hi Joerg, > On Aug 21, 2020, at 21:43, Joerg Roedel wrote: > > Hi Kai, > > On Mon, Jun 29, 2020 at 08:33:22PM +0800, Kai-Heng Feng wrote: >> I am still seeing the issue on v5.8-rc3. The issue goes away as soon >> as "iommu=off" is added. > > Can

[BUG] "Pre-boot DMA Protection" makes AMDGPU stop working

2020-07-02 Thread Kai-Heng Feng
Hi, A more detailed bug report can be found at [1]. I have a AMD Renoir system that can't enter graphical session because there are many IOMMU splat. Alex suggested to disable "Pre-boot DMA Protection", I can confirm once it's disabled, AMDGPU starts working with IOMMU enabled. So raise the

Re: [Regression] "iommu/amd: Relax locking in dma_ops path" makes tg3 ethernet transmit queue timeout

2020-06-29 Thread Kai-Heng Feng
> On May 18, 2020, at 23:32, Kai-Heng Feng wrote: > > > >> On May 18, 2020, at 22:05, Kai-Heng Feng wrote: >> >> >> >>> On May 18, 2020, at 21:32, Joerg Roedel wrote: >>> >>> On Mon, May 18, 2020 at 05:06:45PM +0800,

Re: [Regression] "iommu/amd: Relax locking in dma_ops path" makes tg3 ethernet transmit queue timeout

2020-05-18 Thread Kai-Heng Feng
> On May 18, 2020, at 22:05, Kai-Heng Feng wrote: > > > >> On May 18, 2020, at 21:32, Joerg Roedel wrote: >> >> On Mon, May 18, 2020 at 05:06:45PM +0800, Kai-Heng Feng wrote: >>> Particularly, as soon as the spinlock is removed, the iss

Re: [Regression] "iommu/amd: Relax locking in dma_ops path" makes tg3 ethernet transmit queue timeout

2020-05-18 Thread Kai-Heng Feng
> On May 18, 2020, at 21:32, Joerg Roedel wrote: > > On Mon, May 18, 2020 at 05:06:45PM +0800, Kai-Heng Feng wrote: >> Particularly, as soon as the spinlock is removed, the issue can be >> reproduced. >> Function domain_flush_complete() doesn't seem to affect

[Regression] "iommu/amd: Relax locking in dma_ops path" makes tg3 ethernet transmit queue timeout

2020-05-18 Thread Kai-Heng Feng
Hi, Broadcom ethernet tg3 unusable after commit 92d420ec028d ("iommu/amd: Relax locking in dma_ops path"). After a short period it stops: [ 122.717144] WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:303 dev_watchdog+0x237/0x240() [ 122.717152] NETDEV WATCHDOG: enp3s0 (tg3): transmit queue

Re: [PATCH v2] iommu/amd: Disable IOMMU on Stoney Ridge systems

2020-02-05 Thread Kai-Heng Feng
Hi Joerg, > On Jan 6, 2020, at 16:37, Kai-Heng Feng wrote: > > > >> On Dec 20, 2019, at 10:13, Kai-Heng Feng wrote: >> >> >> >>> On Dec 20, 2019, at 03:15, Deucher, Alexander >>> wrote: >>> >>>> -Origin

Re: [PATCH v2] iommu/amd: Disable IOMMU on Stoney Ridge systems

2020-01-06 Thread Kai-Heng Feng
> On Dec 20, 2019, at 10:13, Kai-Heng Feng wrote: > > > >> On Dec 20, 2019, at 03:15, Deucher, Alexander >> wrote: >> >>> -----Original Message- >>> From: Kai-Heng Feng >>> Sent: Wednesday, December 18, 2019 12:45 PM

Re: [PATCH v2] iommu/amd: Disable IOMMU on Stoney Ridge systems

2019-12-19 Thread Kai-Heng Feng
> On Dec 20, 2019, at 03:15, Deucher, Alexander > wrote: > >> -Original Message----- >> From: Kai-Heng Feng >> Sent: Wednesday, December 18, 2019 12:45 PM >> To: Joerg Roedel >> Cc: Christoph Hellwig ; Deucher, Alexander >> ; iommu@lists.lin

Re: [PATCH v2] iommu/amd: Disable IOMMU on Stoney Ridge systems

2019-12-18 Thread Kai-Heng Feng
> On Dec 17, 2019, at 17:53, Joerg Roedel wrote: > > On Fri, Dec 06, 2019 at 01:57:41PM +0800, Kai-Heng Feng wrote: >> Hi Joerg, >> >>> On Dec 3, 2019, at 01:00, Christoph Hellwig wrote: >>> >>> On Fri, Nov 29, 2019 at 10:21:54PM +0800, Kai

Re: [PATCH v2] iommu/amd: Disable IOMMU on Stoney Ridge systems

2019-12-05 Thread Kai-Heng Feng
> On Dec 5, 2019, at 00:08, Deucher, Alexander > wrote: > >> -Original Message- >> From: Deucher, Alexander >> Sent: Monday, December 2, 2019 11:37 AM >> To: Lucas Stach ; Kai-Heng Feng >> ; j...@8bytes.org; Koenig, Christian >> (christ

Re: [PATCH v2] iommu/amd: Disable IOMMU on Stoney Ridge systems

2019-12-05 Thread Kai-Heng Feng
Hi Joerg, > On Dec 3, 2019, at 01:00, Christoph Hellwig wrote: > > On Fri, Nov 29, 2019 at 10:21:54PM +0800, Kai-Heng Feng wrote: >> Serious screen flickering when Stoney Ridge outputs to a 4K monitor. >> >> According to Alex Deucher, IOMMU isn't enabled on Windo

[PATCH v2] iommu/amd: Disable IOMMU on Stoney Ridge systems

2019-11-29 Thread Kai-Heng Feng
Serious screen flickering when Stoney Ridge outputs to a 4K monitor. According to Alex Deucher, IOMMU isn't enabled on Windows, so let's do the same here to avoid screen flickering on 4K monitor. Cc: Alex Deucher Bug: https://gitlab.freedesktop.org/drm/amd/issues/961 Signed-off-by: Kai-Heng

[PATCH v3] iommu/amd: Override wrong IVRS IOAPIC on Raven Ridge systems

2019-08-20 Thread Kai-Heng Feng
ink: https://bugs.launchpad.net/bugs/1837688 Reported-by: kbuild test robot Signed-off-by: Kai-Heng Feng --- v3: Fix compilation error when CONFIG_DMI is not enabled. v2: Split the quirk to another file. drivers/iommu/Makefile | 2 +- drivers/iommu/amd_iommu.h| 14 + dri

[PATCH v2] iommu/amd: Override wrong IVRS IOAPIC on Raven Ridge systems

2019-08-17 Thread Kai-Heng Feng
ink: https://bugs.launchpad.net/bugs/1837688 Signed-off-by: Kai-Heng Feng --- v2: Split the quirk to another file. drivers/iommu/Makefile | 2 +- drivers/iommu/amd_iommu.h| 14 + drivers/iommu/amd_iommu_init.c | 5 +- drivers/iommu/amd_iommu_quirks.c | 90 +

Re: [PATCH] iommu/amd: Override wrong IVRS IOAPIC on Raven Ridge systems

2019-08-12 Thread Kai-Heng Feng
at 23:39, Joerg Roedel wrote: On Thu, Aug 08, 2019 at 06:17:07PM +0800, Kai-Heng Feng wrote: Raven Ridge systems may have malfunction touchpad or hang at boot if incorrect IVRS IOAPIC is provided by BIOS. Users already found correct "ivrs_ioapic=" values, let's put them ins

[PATCH] iommu/amd: Override wrong IVRS IOAPIC on Raven Ridge systems

2019-08-08 Thread Kai-Heng Feng
ink: https://bugs.launchpad.net/bugs/1837688 Signed-off-by: Kai-Heng Feng --- drivers/iommu/amd_iommu_init.c | 75 ++ 1 file changed, 75 insertions(+) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 4413aa67000e..06fd008281e5 100644 --- a/dri