<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/pci/controller/vmd.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/pci/controller/vmd.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/pci/controller/vmd.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-05-12T14:54:14Z</updated>
<entry>
<title>PCI: vmd: Revert 2565e5b69c44 ("PCI: vmd: Do not disable MSI-X remapping if interrupt remapping is enabled by IOMMU.")</title>
<updated>2022-05-12T14:54:14Z</updated>
<author>
<name>Nirmal Patel</name>
<email>nirmal.patel@linux.intel.com</email>
</author>
<published>2022-05-11T09:57:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c94f732e8001a860b42aa740b0a178a29907463c'/>
<id>urn:sha1:c94f732e8001a860b42aa740b0a178a29907463c</id>
<content type='text'>
Revert 2565e5b69c44 ("PCI: vmd: Do not disable MSI-X remapping if
interrupt remapping is enabled by IOMMU.")

The commit 2565e5b69c44 was added as a workaround to keep MSI-X
remapping enabled if IOMMU enables interrupt remapping. VMD would keep
running in low performance mode. There is no dependency between MSI-X
remapping by VMD and interrupt remapping by IOMMU.

Link: https://lore.kernel.org/r/20220511095707.25403-3-nirmal.patel@linux.intel.com
Signed-off-by: Nirmal Patel &lt;nirmal.patel@linux.intel.com&gt;
Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
</content>
</entry>
<entry>
<title>PCI: vmd: Assign VMD IRQ domain before enumeration</title>
<updated>2022-05-12T14:54:14Z</updated>
<author>
<name>Nirmal Patel</name>
<email>nirmal.patel@linux.intel.com</email>
</author>
<published>2022-05-11T09:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=886e67100b904cb1b106ed1dfa8a60696aff519a'/>
<id>urn:sha1:886e67100b904cb1b106ed1dfa8a60696aff519a</id>
<content type='text'>
During the boot process all the PCI devices are assigned default PCI-MSI
IRQ domain including VMD endpoint devices. If interrupt-remapping is
enabled by IOMMU, the PCI devices except VMD get new INTEL-IR-MSI IRQ
domain. And VMD is supposed to create and assign a separate VMD-MSI IRQ
domain for its child devices in order to support MSI-X remapping
capabilities.

Now when MSI-X remapping in VMD is disabled in order to improve
performance, VMD skips VMD-MSI IRQ domain assignment process to its
child devices. Thus the devices behind VMD get default PCI-MSI IRQ
domain instead of INTEL-IR-MSI IRQ domain when VMD creates root bus and
configures child devices.

As a result host OS fails to boot and DMAR errors were observed when
interrupt remapping was enabled on Intel Icelake CPUs. For instance:

  DMAR: DRHD: handling fault status reg 2
  DMAR: [INTR-REMAP] Request device [0xe2:0x00.0] fault index 0xa00 [fault reason 0x25] Blocked a compatibility format interrupt request

To fix this issue, dev_msi_info struct in dev struct maintains correct
value of IRQ domain. VMD will use this information to assign proper IRQ
domain to its child devices when it doesn't create a separate IRQ domain.

Link: https://lore.kernel.org/r/20220511095707.25403-2-nirmal.patel@linux.intel.com
Signed-off-by: Nirmal Patel &lt;nirmal.patel@linux.intel.com&gt;
Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
</content>
</entry>
<entry>
<title>PCI: vmd: Prevent recursive locking on interrupt allocation</title>
<updated>2022-02-21T07:26:53Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-02-13T13:54:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ba1366f3d039e7c3ca1fc29ed00ce3ed2b8fd32f'/>
<id>urn:sha1:ba1366f3d039e7c3ca1fc29ed00ce3ed2b8fd32f</id>
<content type='text'>
Tejas reported the following recursive locking issue:

 swapper/0/1 is trying to acquire lock:
 ffff8881074fd0a0 (&amp;md-&gt;mutex){+.+.}-{3:3}, at: msi_get_virq+0x30/0xc0
 
 but task is already holding lock:
 ffff8881017cd6a0 (&amp;md-&gt;mutex){+.+.}-{3:3}, at: __pci_enable_msi_range+0xf2/0x290
 
 stack backtrace:
  __mutex_lock+0x9d/0x920
  msi_get_virq+0x30/0xc0
  pci_irq_vector+0x26/0x30
  vmd_msi_init+0xcc/0x210
  msi_domain_alloc+0xbf/0x150
  msi_domain_alloc_irqs_descs_locked+0x3e/0xb0
  __pci_enable_msi_range+0x155/0x290
  pci_alloc_irq_vectors_affinity+0xba/0x100
  pcie_port_device_register+0x307/0x550
  pcie_portdrv_probe+0x3c/0xd0
  pci_device_probe+0x95/0x110

This is caused by the VMD MSI code which does a lookup of the Linux
interrupt number for an VMD managed MSI[X] vector. The lookup function
tries to acquire the already held mutex.

Avoid that by caching the Linux interrupt number at initialization time
instead of looking it up over and over.

Fixes: 82ff8e6b78fc ("PCI/MSI: Use msi_get_virq() in pci_get_vector()")
Reported-by: "Surendrakumar Upadhyay, TejaskumarX" &lt;tejaskumarx.surendrakumar.upadhyay@intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: "Surendrakumar Upadhyay, TejaskumarX" &lt;tejaskumarx.surendrakumar.upadhyay@intel.com&gt;
Cc: linux-pci@vger.kernel.org
Link: https://lore.kernel.org/r/87a6euub2a.ffs@tglx

</content>
</entry>
<entry>
<title>Merge branch 'pci/errors'</title>
<updated>2022-01-13T15:57:52Z</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2022-01-13T15:57:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f5d3ca6fffeb71f304a7accae229c279e70b2216'/>
<id>urn:sha1:f5d3ca6fffeb71f304a7accae229c279e70b2216</id>
<content type='text'>
- Add PCI_ERROR_RESPONSE and related definitions for signaling and checking
  for transaction errors on PCI (Naveen Naidu)

- Fabricate PCI_ERROR_RESPONSE data (~0) in config read wrappers, instead
  of in host controller drivers, when transactions fail on PCI (Naveen
  Naidu)

- Use PCI_POSSIBLE_ERROR() to check for possible failure of config reads
  (Naveen Naidu)

* pci/errors:
  PCI: xgene: Use PCI_ERROR_RESPONSE to identify config read errors
  PCI: hv: Use PCI_ERROR_RESPONSE to identify config read errors
  PCI: keystone: Use PCI_ERROR_RESPONSE to identify config read errors
  PCI: Use PCI_ERROR_RESPONSE to identify config read errors
  PCI: cpqphp: Use PCI_POSSIBLE_ERROR() to check config reads
  PCI/PME: Use PCI_POSSIBLE_ERROR() to check config reads
  PCI/DPC: Use PCI_POSSIBLE_ERROR() to check config reads
  PCI: pciehp: Use PCI_POSSIBLE_ERROR() to check config reads
  PCI: vmd: Use PCI_POSSIBLE_ERROR() to check config reads
  PCI/ERR: Use PCI_POSSIBLE_ERROR() to check config reads
  PCI: rockchip-host: Drop error data fabrication when config read fails
  PCI: rcar-host: Drop error data fabrication when config read fails
  PCI: altera: Drop error data fabrication when config read fails
  PCI: mvebu: Drop error data fabrication when config read fails
  PCI: aardvark: Drop error data fabrication when config read fails
  PCI: kirin: Drop error data fabrication when config read fails
  PCI: histb: Drop error data fabrication when config read fails
  PCI: exynos: Drop error data fabrication when config read fails
  PCI: mediatek: Drop error data fabrication when config read fails
  PCI: iproc: Drop error data fabrication when config read fails
  PCI: thunder: Drop error data fabrication when config read fails
  PCI: Drop error data fabrication when config read fails
  PCI: Use PCI_SET_ERROR_RESPONSE() for disconnected devices
  PCI: Set error response data when config read fails
  PCI: Add PCI_ERROR_RESPONSE and related definitions
</content>
</entry>
<entry>
<title>PCI: vmd: Add DID 8086:A77F for all Intel Raptor Lake SKU's</title>
<updated>2022-01-05T16:24:45Z</updated>
<author>
<name>Karthik L Gopalakrishnan</name>
<email>karthik.l.gopalakrishnan@intel.com</email>
</author>
<published>2021-12-17T23:12:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=922bfd001d1ac02111ebbe0524aaab6ca7925521'/>
<id>urn:sha1:922bfd001d1ac02111ebbe0524aaab6ca7925521</id>
<content type='text'>
Add support for this VMD device which supports the bus restriction mode.
The feature that turns off vector 0 for MSI-X remapping is also enabled.

Link: https://lore.kernel.org/r/20211217231211.46018-1-francisco.munoz.ruiz@linux.intel.com
Signed-off-by: Karthik L Gopalakrishnan &lt;karthik.l.gopalakrishnan@intel.com&gt;
Signed-off-by: Francisco Munoz &lt;francisco.munoz.ruiz@linux.intel.com&gt;
Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Reviewed-by: Jon Derrick &lt;jonathan.derrick@linux.dev&gt;
</content>
</entry>
<entry>
<title>PCI: vmd: Honor ACPI _OSC on PCIe features</title>
<updated>2022-01-04T15:25:27Z</updated>
<author>
<name>Kai-Heng Feng</name>
<email>kai.heng.feng@canonical.com</email>
</author>
<published>2021-12-03T03:15:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=04b12ef163d10e348db664900ae7f611b83c7a0e'/>
<id>urn:sha1:04b12ef163d10e348db664900ae7f611b83c7a0e</id>
<content type='text'>
When Samsung PCIe Gen4 NVMe is connected to Intel ADL VMD, the
combination causes AER message flood and drags the system performance
down.

The issue doesn't happen when VMD mode is disabled in BIOS, since AER
isn't enabled by acpi_pci_root_create() . When VMD mode is enabled, AER
is enabled regardless of _OSC:
[    0.410076] acpi PNP0A08:00: _OSC: platform does not support [AER]
...
[    1.486704] pcieport 10000:e0:06.0: AER: enabled with IRQ 146

Since VMD is an aperture to regular PCIe root ports, honor ACPI _OSC to
disable PCIe features accordingly to resolve the issue.

Suggested-by: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215027
Link: https://lore.kernel.org/r/20211203031541.1428904-1-kai.heng.feng@canonical.com
Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PCI: vmd: Clean up domain before enumeration</title>
<updated>2021-12-01T12:00:07Z</updated>
<author>
<name>Nirmal Patel</name>
<email>nirmal.patel@linux.intel.com</email>
</author>
<published>2021-11-16T22:11:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=6aab5622296b990024ee67dd7efa7d143e7558d0'/>
<id>urn:sha1:6aab5622296b990024ee67dd7efa7d143e7558d0</id>
<content type='text'>
During VT-d pass-through, the VMD driver occasionally fails to
enumerate underlying NVMe devices when repetitive reboots are
performed in the guest OS. The issue can be resolved by resetting
VMD root ports for proper enumeration and triggering secondary bus
reset which will also propagate reset through downstream bridges.

Link: https://lore.kernel.org/r/20211116221136.85134-1-nirmal.patel@linux.intel.com
Signed-off-by: Nirmal Patel &lt;nirmal.patel@linux.intel.com&gt;
Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Reviewed-by: Jon Derrick &lt;jonathan.derrick@linux.dev&gt;
</content>
</entry>
<entry>
<title>PCI: vmd: Use PCI_POSSIBLE_ERROR() to check config reads</title>
<updated>2021-11-18T20:13:18Z</updated>
<author>
<name>Naveen Naidu</name>
<email>naveennaidu479@gmail.com</email>
</author>
<published>2021-11-18T14:03:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=242f288e82a34b4c10f87e121b0755056675e55d'/>
<id>urn:sha1:242f288e82a34b4c10f87e121b0755056675e55d</id>
<content type='text'>
When config pci_ops.read() can detect failed PCI transactions, the data
returned to the CPU is PCI_ERROR_RESPONSE (~0 or 0xffffffff).

Obviously a successful PCI config read may *also* return that data if a
config register happens to contain ~0, so it doesn't definitively indicate
an error unless we know the register cannot contain ~0.

Use PCI_POSSIBLE_ERROR() to check the response we get when we read data
from hardware.  This unifies PCI error response checking and makes error
checks consistent and easier to find.

Link: https://lore.kernel.org/r/ed01cad87a2e35f3865275b5fb34290817a1ebf8.1637243717.git.naveennaidu479@gmail.com
Signed-off-by: Naveen Naidu &lt;naveennaidu479@gmail.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Jonathan Derrick &lt;jonathan.derrick@linux.dev&gt;
</content>
</entry>
<entry>
<title>Merge branch 'remotes/lorenzo/pci/vmd'</title>
<updated>2021-11-05T16:28:53Z</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2021-11-05T16:28:53Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7b4bc1011182bacd5bec8bf6c2c5096ecbb80061'/>
<id>urn:sha1:7b4bc1011182bacd5bec8bf6c2c5096ecbb80061</id>
<content type='text'>
- Assign a number to each VMD controller to distinguish them in
  /proc/interrupts (Chunguang Xu)

- Don't disable VMD MSI-X remapping if IOMMU remapping is enabled (Adrian
  Huang)

- Add Kconfig dependency on !UML for allyesconfig build issue (Johannes
  Berg)

* remotes/lorenzo/pci/vmd:
  PCI: vmd: depend on !UML
  PCI: vmd: Do not disable MSI-X remapping if interrupt remapping is enabled by IOMMU
  PCI: vmd: Assign a number to each VMD controller
</content>
</entry>
<entry>
<title>PCI: vmd: Drop redundant includes of &lt;asm/device.h&gt;, &lt;asm/msi.h&gt;</title>
<updated>2021-11-04T14:14:51Z</updated>
<author>
<name>Krzysztof Wilczyński</name>
<email>kw@linux.com</email>
</author>
<published>2021-10-13T00:31:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ca25c63779ca966ff3dd4ea20af1401452dbbe75'/>
<id>urn:sha1:ca25c63779ca966ff3dd4ea20af1401452dbbe75</id>
<content type='text'>
We already include &lt;linux/device.h&gt; and &lt;linux/msi.h&gt;, which
include &lt;asm/device.h&gt; and &lt;asm/msi.h&gt;.

Drop the redundant includes of &lt;asm/device.h&gt; and &lt;asm/msi.h&gt;.

[bhelgaas: squash in fix from Wan Jiabing &lt;wanjiabing@vivo.com&gt;:
https://lore.kernel.org/r/20211104063720.29375-1-wanjiabing@vivo.com]
Link: https://lore.kernel.org/r/20211013003145.1107148-1-kw@linux.com
Signed-off-by: Krzysztof Wilczyński &lt;kw@linux.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Jonathan Derrick &lt;jonathan.derrick@linux.dev&gt;
</content>
</entry>
</feed>
