linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-08-16 17:21 [PATCH 0/2] " Bartosz Pawlowski
@ 2023-08-16 17:21 ` Bartosz Pawlowski
  2023-08-16 17:39   ` Bjorn Helgaas
  2023-09-06 19:06   ` Bjorn Helgaas
  0 siblings, 2 replies; 12+ messages in thread
From: Bartosz Pawlowski @ 2023-08-16 17:21 UTC (permalink / raw)
  To: linux-pci, bhelgaas
  Cc: sheenamo, justai, andriy.shevchenko, joel.a.gibson,
	emil.s.tantilov, gaurav.s.emmanuel, mike.conover, shaopeng.he,
	anthony.l.nguyen, pavan.kumar.linga, Bartosz Pawlowski,
	Andy Shevchenko, Alexander Lobakin

There is a HW issue in A and B steppings of Intel IPU E2000 that it
expects wrong endianness in ATS invalidation message body. This problem
can lead to outdated translations being returned as valid and finally
cause system instability.

In order to prevent such issues introduce quirk_intel_e2000_no_ats()
function to disable ATS for vulnerable IPU E2000 devices.

Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
---
 drivers/pci/quirks.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index a900546d8d45..9aa1e0148ed2 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5550,6 +5550,28 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7347, quirk_amd_harvest_no_ats);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x734f, quirk_amd_harvest_no_ats);
 /* AMD Raven platform iGPU */
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x15d8, quirk_amd_harvest_no_ats);
+
+/*
+ * Intel IPU E2000 revisions before C0 implement incorrect endianness
+ * in ATS Invalidate Request message body. Although there is existing software
+ * workaround for this issue, it is not functionally complete (no 5-lvl paging
+ * support) and it requires changes in all IOMMU implementations supporting
+ * ATS. Therefore, disabling ATS seems to be more reasonable.
+ */
+static void quirk_intel_e2000_no_ats(struct pci_dev *pdev)
+{
+	if (pdev->revision < 0x20)
+		quirk_no_ats(pdev);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1451, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1452, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1453, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1454, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1455, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1457, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1459, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145a, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145c, quirk_intel_e2000_no_ats);
 #endif /* CONFIG_PCI_ATS */
 
 /* Freescale PCIe doesn't support MSI in RC mode */
-- 
2.41.0

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-08-16 17:21 ` [PATCH 2/2] " Bartosz Pawlowski
@ 2023-08-16 17:39   ` Bjorn Helgaas
  2023-08-17  9:52     ` Andy Shevchenko
  2023-09-06 19:06   ` Bjorn Helgaas
  1 sibling, 1 reply; 12+ messages in thread
From: Bjorn Helgaas @ 2023-08-16 17:39 UTC (permalink / raw)
  To: Bartosz Pawlowski, Andy Shevchenko, Alexander Lobakin
  Cc: linux-pci, bhelgaas, sheenamo, justai, andriy.shevchenko,
	joel.a.gibson, emil.s.tantilov, gaurav.s.emmanuel, mike.conover,
	shaopeng.he, anthony.l.nguyen, pavan.kumar.linga

On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:
> There is a HW issue in A and B steppings of Intel IPU E2000 that it
> expects wrong endianness in ATS invalidation message body. This problem
> can lead to outdated translations being returned as valid and finally
> cause system instability.
> 
> In order to prevent such issues introduce quirk_intel_e2000_no_ats()
> function to disable ATS for vulnerable IPU E2000 devices.
> 
> Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>

Andy, Alexander, would you please reiterate your reviewed-by on the
mailing list?  I try to avoid relying on internal reviews collected by
the author.  Those are great and I'm glad they happen, but it's good
if they also appear as part of the public conversation on the mailing
list.

> ---
>  drivers/pci/quirks.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index a900546d8d45..9aa1e0148ed2 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -5550,6 +5550,28 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7347, quirk_amd_harvest_no_ats);
>  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x734f, quirk_amd_harvest_no_ats);
>  /* AMD Raven platform iGPU */
>  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x15d8, quirk_amd_harvest_no_ats);
> +
> +/*
> + * Intel IPU E2000 revisions before C0 implement incorrect endianness
> + * in ATS Invalidate Request message body. Although there is existing software
> + * workaround for this issue, it is not functionally complete (no 5-lvl paging
> + * support) and it requires changes in all IOMMU implementations supporting
> + * ATS. Therefore, disabling ATS seems to be more reasonable.
> + */
> +static void quirk_intel_e2000_no_ats(struct pci_dev *pdev)
> +{
> +	if (pdev->revision < 0x20)
> +		quirk_no_ats(pdev);
> +}
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1451, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1452, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1453, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1454, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1455, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1457, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1459, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145a, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145c, quirk_intel_e2000_no_ats);
>  #endif /* CONFIG_PCI_ATS */
>  
>  /* Freescale PCIe doesn't support MSI in RC mode */
> -- 
> 2.41.0
> 
> ---------------------------------------------------------------------
> Intel Technology Poland sp. z o.o.
> ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
> Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
> 
> Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
> This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
       [not found] <CADWJPTsm7XUMR94aLAg_o5TyMPQxXGwi++_9LtQVbhsi7A0_QA@mail.gmail.com>
@ 2023-08-16 20:17 ` Bjorn Helgaas
  0 siblings, 0 replies; 12+ messages in thread
From: Bjorn Helgaas @ 2023-08-16 20:17 UTC (permalink / raw)
  To: Sheena Mohan
  Cc: Bartosz Pawlowski, Andy Shevchenko, Alexander Lobakin, linux-pci,
	bhelgaas, andriy.shevchenko, joel.a.gibson, emil.s.tantilov,
	gaurav.s.emmanuel, mike.conover, shaopeng.he, anthony.l.nguyen,
	pavan.kumar.linga, Aahil Awatramani

On Wed, Aug 16, 2023 at 12:50:28PM -0700, Sheena Mohan wrote:
> It is good to have the SW fix for backward compatibility rather than
> disabling ATS on previous revisions. Maybe adding a flag to toggle the
> feature will be useful.

FYI, I received this (and probably the other direct recipients did,
too), but I think the mailing lists rejected it, probably because it
was a multi-part message (see
http://vger.kernel.org/majordomo-info.html).

The list archive is https://lore.kernel.org/linux-pci/20230816172115.1375716-1-bartosz.pawlowski@intel.com/

> On Wed, Aug 16, 2023 at 10:39 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
> 
> > On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:
> > > There is a HW issue in A and B steppings of Intel IPU E2000 that it
> > > expects wrong endianness in ATS invalidation message body. This problem
> > > can lead to outdated translations being returned as valid and finally
> > > cause system instability.
> > >
> > > In order to prevent such issues introduce quirk_intel_e2000_no_ats()
> > > function to disable ATS for vulnerable IPU E2000 devices.
> > >
> > > Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
> > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> >
> > Andy, Alexander, would you please reiterate your reviewed-by on the
> > mailing list?  I try to avoid relying on internal reviews collected by
> > the author.  Those are great and I'm glad they happen, but it's good
> > if they also appear as part of the public conversation on the mailing
> > list.
> >
> > > ---
> > >  drivers/pci/quirks.c | 22 ++++++++++++++++++++++
> > >  1 file changed, 22 insertions(+)
> > >
> > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> > > index a900546d8d45..9aa1e0148ed2 100644
> > > --- a/drivers/pci/quirks.c
> > > +++ b/drivers/pci/quirks.c
> > > @@ -5550,6 +5550,28 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI,
> > 0x7347, quirk_amd_harvest_no_ats);
> > >  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x734f,
> > quirk_amd_harvest_no_ats);
> > >  /* AMD Raven platform iGPU */
> > >  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x15d8,
> > quirk_amd_harvest_no_ats);
> > > +
> > > +/*
> > > + * Intel IPU E2000 revisions before C0 implement incorrect endianness
> > > + * in ATS Invalidate Request message body. Although there is existing
> > software
> > > + * workaround for this issue, it is not functionally complete (no 5-lvl
> > paging
> > > + * support) and it requires changes in all IOMMU implementations
> > supporting
> > > + * ATS. Therefore, disabling ATS seems to be more reasonable.
> > > + */
> > > +static void quirk_intel_e2000_no_ats(struct pci_dev *pdev)
> > > +{
> > > +     if (pdev->revision < 0x20)
> > > +             quirk_no_ats(pdev);
> > > +}
> > > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1451,
> > quirk_intel_e2000_no_ats);
> > > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1452,
> > quirk_intel_e2000_no_ats);
> > > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1453,
> > quirk_intel_e2000_no_ats);
> > > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1454,
> > quirk_intel_e2000_no_ats);
> > > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1455,
> > quirk_intel_e2000_no_ats);
> > > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1457,
> > quirk_intel_e2000_no_ats);
> > > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1459,
> > quirk_intel_e2000_no_ats);
> > > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145a,
> > quirk_intel_e2000_no_ats);
> > > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145c,
> > quirk_intel_e2000_no_ats);
> > >  #endif /* CONFIG_PCI_ATS */
> > >
> > >  /* Freescale PCIe doesn't support MSI in RC mode */
> > > --
> > > 2.41.0
> > >
> > > ---------------------------------------------------------------------
> > > Intel Technology Poland sp. z o.o.
> > > ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII
> > Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP
> > 957-07-52-316 | Kapital zakladowy 200.000 PLN.
> > > Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu
> > ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w
> > transakcjach handlowych.
> > >
> > > Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego
> > adresata i moze zawierac informacje poufne. W razie przypadkowego
> > otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej
> > usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
> > > This e-mail and any attachments may contain confidential material for
> > the sole use of the intended recipient(s). If you are not the intended
> > recipient, please contact the sender and delete all copies; any review or
> > distribution by others is strictly prohibited.
> > >
> >

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-08-16 17:39   ` Bjorn Helgaas
@ 2023-08-17  9:52     ` Andy Shevchenko
  2023-08-17 10:02       ` Bartosz Pawlowski
  2023-08-21 15:04       ` Alexander Lobakin
  0 siblings, 2 replies; 12+ messages in thread
From: Andy Shevchenko @ 2023-08-17  9:52 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Bartosz Pawlowski, Alexander Lobakin, linux-pci, bhelgaas,
	sheenamo, justai, joel.a.gibson, emil.s.tantilov,
	gaurav.s.emmanuel, mike.conover, shaopeng.he, anthony.l.nguyen,
	pavan.kumar.linga

On Wed, Aug 16, 2023 at 12:39:06PM -0500, Bjorn Helgaas wrote:
> On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:
> > There is a HW issue in A and B steppings of Intel IPU E2000 that it
> > expects wrong endianness in ATS invalidation message body. This problem
> > can lead to outdated translations being returned as valid and finally
> > cause system instability.
> > 
> > In order to prevent such issues introduce quirk_intel_e2000_no_ats()
> > function to disable ATS for vulnerable IPU E2000 devices.
> > 
> > Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> 
> Andy, Alexander, would you please reiterate your reviewed-by on the
> mailing list?  I try to avoid relying on internal reviews collected by
> the author.  Those are great and I'm glad they happen, but it's good
> if they also appear as part of the public conversation on the mailing
> list.

They are legit for my name, I dunno what exactly you want to hear from me.
The internal process of review requires these tags by default, it's hard
to deviate from maintainer to maintainer.

> > Intel Technology Poland sp. z o.o.
> > ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
> > Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
> > 
> > Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
> > This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.

What really needs to be dropped is the footer.
Bartosz, consult with the internal resources on how to get rid of it.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-08-17  9:52     ` Andy Shevchenko
@ 2023-08-17 10:02       ` Bartosz Pawlowski
  2023-08-21 15:04       ` Alexander Lobakin
  1 sibling, 0 replies; 12+ messages in thread
From: Bartosz Pawlowski @ 2023-08-17 10:02 UTC (permalink / raw)
  To: Andy Shevchenko, Bjorn Helgaas
  Cc: Alexander Lobakin, linux-pci, bhelgaas, sheenamo, justai,
	joel.a.gibson, emil.s.tantilov, gaurav.s.emmanuel, mike.conover,
	shaopeng.he, anthony.l.nguyen, pavan.kumar.linga


On 17.08.2023 11:52, Andy Shevchenko wrote:
> On Wed, Aug 16, 2023 at 12:39:06PM -0500, Bjorn Helgaas wrote:
>> On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:
>>> There is a HW issue in A and B steppings of Intel IPU E2000 that it
>>> expects wrong endianness in ATS invalidation message body. This problem
>>> can lead to outdated translations being returned as valid and finally
>>> cause system instability.
>>>
>>> In order to prevent such issues introduce quirk_intel_e2000_no_ats()
>>> function to disable ATS for vulnerable IPU E2000 devices.
>>>
>>> Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
>>> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
>> Andy, Alexander, would you please reiterate your reviewed-by on the
>> mailing list?  I try to avoid relying on internal reviews collected by
>> the author.  Those are great and I'm glad they happen, but it's good
>> if they also appear as part of the public conversation on the mailing
>> list.
> They are legit for my name, I dunno what exactly you want to hear from me.
> The internal process of review requires these tags by default, it's hard
> to deviate from maintainer to maintainer.
>
>>> Intel Technology Poland sp. z o.o.
>>> ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
>>> Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
>>>
>>> Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
>>> This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
> What really needs to be dropped is the footer.
> Bartosz, consult with the internal resources on how to get rid of it.
Requested already and I hope it won't appear anymore.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-08-17  9:52     ` Andy Shevchenko
  2023-08-17 10:02       ` Bartosz Pawlowski
@ 2023-08-21 15:04       ` Alexander Lobakin
  1 sibling, 0 replies; 12+ messages in thread
From: Alexander Lobakin @ 2023-08-21 15:04 UTC (permalink / raw)
  To: Andy Shevchenko, Bjorn Helgaas
  Cc: Bartosz Pawlowski, linux-pci, bhelgaas, sheenamo, justai,
	joel.a.gibson, emil.s.tantilov, gaurav.s.emmanuel, mike.conover,
	shaopeng.he, anthony.l.nguyen, pavan.kumar.linga

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Thu, 17 Aug 2023 12:52:25 +0300

> On Wed, Aug 16, 2023 at 12:39:06PM -0500, Bjorn Helgaas wrote:
>> On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:
>>> There is a HW issue in A and B steppings of Intel IPU E2000 that it
>>> expects wrong endianness in ATS invalidation message body. This problem
>>> can lead to outdated translations being returned as valid and finally
>>> cause system instability.
>>>
>>> In order to prevent such issues introduce quirk_intel_e2000_no_ats()
>>> function to disable ATS for vulnerable IPU E2000 devices.
>>>
>>> Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
>>> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
>>
>> Andy, Alexander, would you please reiterate your reviewed-by on the
>> mailing list?  I try to avoid relying on internal reviews collected by
>> the author.  Those are great and I'm glad they happen, but it's good
>> if they also appear as part of the public conversation on the mailing
>> list.
> 
> They are legit for my name, I dunno what exactly you want to hear from me.
> The internal process of review requires these tags by default, it's hard
> to deviate from maintainer to maintainer.

+1 under everything, it works the same way for me.

[...]

Thanks,
Olek

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-08-16 17:21 ` [PATCH 2/2] " Bartosz Pawlowski
  2023-08-16 17:39   ` Bjorn Helgaas
@ 2023-09-06 19:06   ` Bjorn Helgaas
  2023-09-06 19:59     ` Andy Shevchenko
  1 sibling, 1 reply; 12+ messages in thread
From: Bjorn Helgaas @ 2023-09-06 19:06 UTC (permalink / raw)
  To: Bartosz Pawlowski
  Cc: linux-pci, bhelgaas, Sheena Mohan, Aahil Awatramani, Justin Tai,
	andriy.shevchenko, joel.a.gibson, emil.s.tantilov,
	gaurav.s.emmanuel, mike.conover, shaopeng.he, anthony.l.nguyen,
	pavan.kumar.linga, Andy Shevchenko, Alexander Lobakin

On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:
> There is a HW issue in A and B steppings of Intel IPU E2000 that it
> expects wrong endianness in ATS invalidation message body. This problem
> can lead to outdated translations being returned as valid and finally
> cause system instability.

Is there a published erratum for this?  Or at least a number to
identify it?

> In order to prevent such issues introduce quirk_intel_e2000_no_ats()
> function to disable ATS for vulnerable IPU E2000 devices.
> 
> Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> ---
>  drivers/pci/quirks.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index a900546d8d45..9aa1e0148ed2 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -5550,6 +5550,28 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7347, quirk_amd_harvest_no_ats);
>  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x734f, quirk_amd_harvest_no_ats);
>  /* AMD Raven platform iGPU */
>  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x15d8, quirk_amd_harvest_no_ats);
> +
> +/*
> + * Intel IPU E2000 revisions before C0 implement incorrect endianness
> + * in ATS Invalidate Request message body. Although there is existing software
> + * workaround for this issue, it is not functionally complete (no 5-lvl paging
> + * support) and it requires changes in all IOMMU implementations supporting
> + * ATS. Therefore, disabling ATS seems to be more reasonable.

Can we reference the commit that added the existing software
workaround?

It sounds like systems that (a) don't require 5-level paging and (b)
use an IOMMU implementation that include the appropriate changes might
still be able to use ATS?  Is there a way for them to do that?

> + */
> +static void quirk_intel_e2000_no_ats(struct pci_dev *pdev)
> +{
> +	if (pdev->revision < 0x20)
> +		quirk_no_ats(pdev);
> +}
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1451, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1452, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1453, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1454, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1455, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1457, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1459, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145a, quirk_intel_e2000_no_ats);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145c, quirk_intel_e2000_no_ats);
>  #endif /* CONFIG_PCI_ATS */
>  
>  /* Freescale PCIe doesn't support MSI in RC mode */
> -- 
> 2.41.0
> 
> ---------------------------------------------------------------------
> Intel Technology Poland sp. z o.o.
> ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
> Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
> 
> Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
> This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-09-06 19:06   ` Bjorn Helgaas
@ 2023-09-06 19:59     ` Andy Shevchenko
  2023-09-06 20:00       ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2023-09-06 19:59 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Bartosz Pawlowski, linux-pci, bhelgaas, Sheena Mohan,
	Aahil Awatramani, Justin Tai, joel.a.gibson, emil.s.tantilov,
	gaurav.s.emmanuel, mike.conover, shaopeng.he, anthony.l.nguyen,
	pavan.kumar.linga, Alexander Lobakin

On Wed, Sep 06, 2023 at 02:06:23PM -0500, Bjorn Helgaas wrote:
> On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:

...

> > +/*
> > + * Intel IPU E2000 revisions before C0 implement incorrect endianness
> > + * in ATS Invalidate Request message body. Although there is existing software
> > + * workaround for this issue, it is not functionally complete (no 5-lvl paging
> > + * support) and it requires changes in all IOMMU implementations supporting
> > + * ATS. Therefore, disabling ATS seems to be more reasonable.
> 
> Can we reference the commit that added the existing software
> workaround?

See below.

> It sounds like systems that (a) don't require 5-level paging and (b)
> use an IOMMU implementation that include the appropriate changes might
> still be able to use ATS?  Is there a way for them to do that?
> 
> > + */
> > +static void quirk_intel_e2000_no_ats(struct pci_dev *pdev)
> > +{

> > +	if (pdev->revision < 0x20)

Isn't it the answer to your question?

> > +		quirk_no_ats(pdev);
> > +}

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-09-06 19:59     ` Andy Shevchenko
@ 2023-09-06 20:00       ` Andy Shevchenko
  2023-09-06 20:13         ` Bjorn Helgaas
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2023-09-06 20:00 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Bartosz Pawlowski, linux-pci, bhelgaas, Sheena Mohan,
	Aahil Awatramani, Justin Tai, joel.a.gibson, emil.s.tantilov,
	gaurav.s.emmanuel, mike.conover, shaopeng.he, anthony.l.nguyen,
	pavan.kumar.linga, Alexander Lobakin

On Wed, Sep 06, 2023 at 10:59:20PM +0300, Andy Shevchenko wrote:
> On Wed, Sep 06, 2023 at 02:06:23PM -0500, Bjorn Helgaas wrote:
> > On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:

...

> > > +/*
> > > + * Intel IPU E2000 revisions before C0 implement incorrect endianness
> > > + * in ATS Invalidate Request message body. Although there is existing software
> > > + * workaround for this issue, it is not functionally complete (no 5-lvl paging
> > > + * support) and it requires changes in all IOMMU implementations supporting
> > > + * ATS. Therefore, disabling ATS seems to be more reasonable.
> > 
> > Can we reference the commit that added the existing software
> > workaround?

> See below.

Oh, I meant the second question here, i.e.

> > It sounds like systems that (a) don't require 5-level paging and (b)
> > use an IOMMU implementation that include the appropriate changes might
> > still be able to use ATS?  Is there a way for them to do that?

^^^ this one.

> > > + */
> > > +static void quirk_intel_e2000_no_ats(struct pci_dev *pdev)
> > > +{
> 
> > > +	if (pdev->revision < 0x20)
> 
> Isn't it the answer to your question?
> 
> > > +		quirk_no_ats(pdev);
> > > +}

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-09-06 20:00       ` Andy Shevchenko
@ 2023-09-06 20:13         ` Bjorn Helgaas
  2023-09-06 20:56           ` Andy Shevchenko
  2023-09-07 14:29           ` Bartosz Pawlowski
  0 siblings, 2 replies; 12+ messages in thread
From: Bjorn Helgaas @ 2023-09-06 20:13 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Bartosz Pawlowski, linux-pci, bhelgaas, Sheena Mohan,
	Aahil Awatramani, Justin Tai, joel.a.gibson, emil.s.tantilov,
	gaurav.s.emmanuel, mike.conover, shaopeng.he, anthony.l.nguyen,
	pavan.kumar.linga, Alexander Lobakin

On Wed, Sep 06, 2023 at 11:00:19PM +0300, Andy Shevchenko wrote:
> On Wed, Sep 06, 2023 at 10:59:20PM +0300, Andy Shevchenko wrote:
> > On Wed, Sep 06, 2023 at 02:06:23PM -0500, Bjorn Helgaas wrote:
> > > On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:
> 
> ...
> 
> > > > +/*
> > > > + * Intel IPU E2000 revisions before C0 implement incorrect endianness
> > > > + * in ATS Invalidate Request message body. Although there is existing software
> > > > + * workaround for this issue, it is not functionally complete (no 5-lvl paging
> > > > + * support) and it requires changes in all IOMMU implementations supporting
> > > > + * ATS. Therefore, disabling ATS seems to be more reasonable.
> > > 
> > > Can we reference the commit that added the existing software
> > > workaround?
> 
> > See below.
> 
> Oh, I meant the second question here, i.e.
> 
> > > It sounds like systems that (a) don't require 5-level paging and (b)
> > > use an IOMMU implementation that include the appropriate changes might
> > > still be able to use ATS?  Is there a way for them to do that?
> 
> ^^^ this one.

Sorry, I'm missing your point here.

The comment mentions an existing partial software workaround.
Presumably that was added by some commit, and it would be helpful to
know which one.

The comment also suggests that if the software workaround were
completed (or if a system didn't require 5-level paging) and it had
related changes to its IOMMU driver, we could still use ATS even on
hardware with this defect.

So I'm wondering if there's a way for an IOMMU driver that has the
required changes and can tell that we're not using 5-level paging can
override this quirk that disables ATS.

Maybe we want to unconditionally disable ATS on these broken devices.
In that case, I think we should just completely drop the comments
about the software workaround and IOMMU driver changes because they
wouldn't be relevant.

> > > > + */
> > > > +static void quirk_intel_e2000_no_ats(struct pci_dev *pdev)
> > > > +{
> > 
> > > > +	if (pdev->revision < 0x20)
> > 
> > Isn't it the answer to your question?
> > 
> > > > +		quirk_no_ats(pdev);
> > > > +}
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-09-06 20:13         ` Bjorn Helgaas
@ 2023-09-06 20:56           ` Andy Shevchenko
  2023-09-07 14:29           ` Bartosz Pawlowski
  1 sibling, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2023-09-06 20:56 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Bartosz Pawlowski, linux-pci, bhelgaas, Sheena Mohan,
	Aahil Awatramani, Justin Tai, joel.a.gibson, emil.s.tantilov,
	gaurav.s.emmanuel, mike.conover, shaopeng.he, anthony.l.nguyen,
	pavan.kumar.linga, Alexander Lobakin

On Wed, Sep 06, 2023 at 03:13:29PM -0500, Bjorn Helgaas wrote:
> On Wed, Sep 06, 2023 at 11:00:19PM +0300, Andy Shevchenko wrote:
> > On Wed, Sep 06, 2023 at 10:59:20PM +0300, Andy Shevchenko wrote:
> > > On Wed, Sep 06, 2023 at 02:06:23PM -0500, Bjorn Helgaas wrote:
> > > > On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:

...

> > > > > +/*
> > > > > + * Intel IPU E2000 revisions before C0 implement incorrect endianness
> > > > > + * in ATS Invalidate Request message body. Although there is existing software
> > > > > + * workaround for this issue, it is not functionally complete (no 5-lvl paging
> > > > > + * support) and it requires changes in all IOMMU implementations supporting
> > > > > + * ATS. Therefore, disabling ATS seems to be more reasonable.
> > > > 
> > > > Can we reference the commit that added the existing software
> > > > workaround?
> > 
> > > See below.
> > 
> > Oh, I meant the second question here, i.e.
> > 
> > > > It sounds like systems that (a) don't require 5-level paging and (b)
> > > > use an IOMMU implementation that include the appropriate changes might
> > > > still be able to use ATS?  Is there a way for them to do that?
> > 
> > ^^^ this one.
> 
> Sorry, I'm missing your point here.
> 
> The comment mentions an existing partial software workaround.
> Presumably that was added by some commit, and it would be helpful to
> know which one.
> 
> The comment also suggests that if the software workaround were
> completed (or if a system didn't require 5-level paging) and it had
> related changes to its IOMMU driver, we could still use ATS even on
> hardware with this defect.
> 
> So I'm wondering if there's a way for an IOMMU driver that has the
> required changes and can tell that we're not using 5-level paging can
> override this quirk that disables ATS.
> 
> Maybe we want to unconditionally disable ATS on these broken devices.
> In that case, I think we should just completely drop the comments
> about the software workaround and IOMMU driver changes because they
> wouldn't be relevant.

I see now what you are for. Yes, I agree that if we can't provide a workaround
then probably comment is a bit bogus.

> > > > > + */
> > > > > +static void quirk_intel_e2000_no_ats(struct pci_dev *pdev)
> > > > > +{
> > > 
> > > > > +	if (pdev->revision < 0x20)
> > > 
> > > Isn't it the answer to your question?
> > > 
> > > > > +		quirk_no_ats(pdev);
> > > > > +}

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
  2023-09-06 20:13         ` Bjorn Helgaas
  2023-09-06 20:56           ` Andy Shevchenko
@ 2023-09-07 14:29           ` Bartosz Pawlowski
  1 sibling, 0 replies; 12+ messages in thread
From: Bartosz Pawlowski @ 2023-09-07 14:29 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, bhelgaas, Sheena Mohan, Aahil Awatramani, Justin Tai,
	joel.a.gibson, emil.s.tantilov, gaurav.s.emmanuel, mike.conover,
	shaopeng.he, anthony.l.nguyen, pavan.kumar.linga,
	Alexander Lobakin, Andy Shevchenko


On 06.09.2023 22:13, Bjorn Helgaas wrote:
> On Wed, Sep 06, 2023 at 11:00:19PM +0300, Andy Shevchenko wrote:
>> On Wed, Sep 06, 2023 at 10:59:20PM +0300, Andy Shevchenko wrote:
>>> On Wed, Sep 06, 2023 at 02:06:23PM -0500, Bjorn Helgaas wrote:
>>>> On Wed, Aug 16, 2023 at 05:21:15PM +0000, Bartosz Pawlowski wrote:
>> ...
>>
>>>>> +/*
>>>>> + * Intel IPU E2000 revisions before C0 implement incorrect endianness
>>>>> + * in ATS Invalidate Request message body. Although there is existing software
>>>>> + * workaround for this issue, it is not functionally complete (no 5-lvl paging
>>>>> + * support) and it requires changes in all IOMMU implementations supporting
>>>>> + * ATS. Therefore, disabling ATS seems to be more reasonable.
>>>> Can we reference the commit that added the existing software
>>>> workaround?
>>> See below.
>> Oh, I meant the second question here, i.e.
>>
>>>> It sounds like systems that (a) don't require 5-level paging and (b)
>>>> use an IOMMU implementation that include the appropriate changes might
>>>> still be able to use ATS?  Is there a way for them to do that?
>> ^^^ this one.
> Sorry, I'm missing your point here.
>
> The comment mentions an existing partial software workaround.
> Presumably that was added by some commit, and it would be helpful to
> know which one.
>
> The comment also suggests that if the software workaround were
> completed (or if a system didn't require 5-level paging) and it had
> related changes to its IOMMU driver, we could still use ATS even on
> hardware with this defect.
>
> So I'm wondering if there's a way for an IOMMU driver that has the
> required changes and can tell that we're not using 5-level paging can
> override this quirk that disables ATS.
>
> Maybe we want to unconditionally disable ATS on these broken devices.
> In that case, I think we should just completely drop the comments
> about the software workaround and IOMMU driver changes because they
> wouldn't be relevant.

This software workaround was shared only with E2000 customers and not publicly due to it's complexity and tricky design, so I think we cannot refer to it and I'll drop this comment.

Regards,
Bartosz


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-09-07 18:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CADWJPTsm7XUMR94aLAg_o5TyMPQxXGwi++_9LtQVbhsi7A0_QA@mail.gmail.com>
2023-08-16 20:17 ` [PATCH 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bjorn Helgaas
2023-08-16 17:21 [PATCH 0/2] " Bartosz Pawlowski
2023-08-16 17:21 ` [PATCH 2/2] " Bartosz Pawlowski
2023-08-16 17:39   ` Bjorn Helgaas
2023-08-17  9:52     ` Andy Shevchenko
2023-08-17 10:02       ` Bartosz Pawlowski
2023-08-21 15:04       ` Alexander Lobakin
2023-09-06 19:06   ` Bjorn Helgaas
2023-09-06 19:59     ` Andy Shevchenko
2023-09-06 20:00       ` Andy Shevchenko
2023-09-06 20:13         ` Bjorn Helgaas
2023-09-06 20:56           ` Andy Shevchenko
2023-09-07 14:29           ` Bartosz Pawlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).