6:
https://patchwork.kernel.org/project/linux-pci/patch/20200728194945.14126-7-jonathan.derr...@intel.com/
Jon Derrick (2):
iommu/vt-d: Use Real PCI DMA device for IRTE
PCI: vmd: Disable MSI-X remapping when possible
drivers/iommu/intel/irq_remapping.c | 3 +-
drivers/pci/controller/vmd.c
WilczyĆski
Signed-off-by: Jon Derrick
---
drivers/pci/controller/vmd.c | 63 +---
1 file changed, 51 insertions(+), 12 deletions(-)
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 5e80f28f0119..e3fcdfec58b3 100644
--- a/drivers/pci
-by: Jon Derrick
---
drivers/iommu/intel/irq_remapping.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/intel/irq_remapping.c
b/drivers/iommu/intel/irq_remapping.c
index 685200a5cff0..1939e070eec8 100644
--- a/drivers/iommu/intel/irq_remapping.c
+++ b/drivers
to properly set IRTE for child
device interrupts to the VMD endpoint's context.
Some VMD platforms have existing production BIOS which rely on MSI-X
remapping and won't explicitly program the MSI-X remapping bit. This
re-enables MSI-X remapping on unload.
Acked-by: Joerg Roedel
Signed-off-by: Jon Derrick
.14126-7-jonathan.derr...@intel.com/
Jon Derrick (2):
iommu/vt-d: Use Real PCI DMA device for IRTE
PCI: vmd: Disable MSI-X remapping when possible
drivers/iommu/intel/irq_remapping.c | 3 +-
drivers/pci/controller/vmd.c| 61 +++--
2 files changed, 51 inse
-by: Jon Derrick
---
drivers/iommu/intel/irq_remapping.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/intel/irq_remapping.c
b/drivers/iommu/intel/irq_remapping.c
index 685200a5cff0..1939e070eec8 100644
--- a/drivers/iommu/intel/irq_remapping.c
+++ b/drivers
VMD retransmits child device MSI/X with the VMD endpoint's requester-id.
In order to support direct interrupt remapping of VMD child devices,
ensure that the IRTE is programmed with the VMD endpoint's requester-id
using pci_real_dma_dev().
Signed-off-by: Jon Derrick
---
drivers/iommu/intel
to properly set IRTE for child
device interrupts to the VMD endpoint's context.
Some VMD platforms have existing production BIOS which rely on MSI/X
remapping and won't explicitly program the MSI/X remapping bit. This
re-enables MSI/X remapping on unload.
Signed-off-by: Jon Derrick
---
drivers/pci
ble to a more logical location
V1 patches 1-4 were already merged
V1, 5/6:
https://patchwork.kernel.org/project/linux-pci/patch/20200728194945.14126-6-jonathan.derr...@intel.com/
V1, 6/6:
https://patchwork.kernel.org/project/linux-pci/patch/20200728194945.14126-7-jonathan.derr...@intel.com/
Jon Derr
_mapping() paths.
[1] https://bugzilla.kernel.org/show_bug.cgi?id=207575
Jon Derrick (3):
iommu/vt-d: Only clear real DMA device's context entries
iommu/vt-d: Allocate domain info for real DMA sub-devices
iommu/vt-d: Remove real DMA lookup in find_domain
drivers/iommu/intel-iommu.c | 31
a_dev() for mapping")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207575
Signed-off-by: Jon Derrick
---
drivers/iommu/intel-iommu.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 6d39b9b..5767882 100644
--- a/drivers/i
device_domain_info and uses
the sub-device's BDF so that these sub-devices won't alias to other
devices.
Signed-off-by: Jon Derrick
---
drivers/iommu/intel-iommu.c | 19 +++
include/linux/intel-iommu.h | 1 +
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/iommu/intel
a helper to determine if a struct device is a
sub-device of a real DMA device.
Signed-off-by: Jon Derrick
---
drivers/iommu/intel-iommu.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index ff5a30a..1ff45b2 100644
Sorry for the late patch here, but I hit the issue Baolu and Daniel
pointed out could occur, and requires this fix (or iommu=nopt).
Hoping to get it into an rc
Jon Derrick (1):
iommu/vt-d: use DMA domain for real DMA devices and subdevices
drivers/iommu/intel-iommu.c | 56
0140c69637e ("iommu/vt-d: Use pci_real_dma_dev() for mapping")
Signed-off-by: Jon Derrick
Signed-off-by: Daniel Drake
---
drivers/iommu/intel-iommu.c | 56 -
1 file changed, 43 insertions(+), 13 deletions(-)
diff --git a/drivers/iommu/intel-iommu
From: Christoph Hellwig
There are no users of X86_DEV_DMA_OPS left, so remove the code.
Reviewed-by: Jon Derrick
Signed-off-by: Christoph Hellwig
---
arch/x86/Kconfig | 3 ---
arch/x86/include/asm/device.h | 10 --
arch/x86/pci/common.c | 38
x86/PCI: Remove X86_DEV_DMA_OPS
Jon Derrick (5):
x86/PCI: Expose VMD's PCI Device in pci_sysdata
PCI: Introduce pci_real_dma_dev()
iommu/vt-d: Use pci_real_dma_dev() for mapping
iommu/vt-d: Remove VMD child device sanity check
PCI: vmd: Stop overriding dma_map_ops
arch/x86/Kco
from the hierarchy.
Signed-off-by: Jon Derrick
---
drivers/iommu/intel-iommu.c | 10 +-
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 72f26e8..7e2c492f 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers
To be used by Intel-IOMMU code to find the correct domain.
CC: Christoph Hellwig
Signed-off-by: Jon Derrick
---
arch/x86/include/asm/pci.h | 4 ++--
drivers/pci/controller/vmd.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/pci.h b/arch/x86
Signed-off-by: Jon Derrick
---
arch/x86/pci/common.c | 10 ++
drivers/pci/pci.c | 19 ++-
drivers/pci/search.c | 6 ++
include/linux/pci.h | 1 +
4 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index
endpoint when mapping and providing the correct child device's
attributes during DMA operations.
This patch removes the dma_map_ops redirect.
Signed-off-by: Jon Derrick
---
drivers/pci/controller/Kconfig | 1 -
drivers/pci/controller/vmd.c | 150 -
2
The PCI device may have a DMA requester on another bus, such as VMD
subdevices needing to use the VMD endpoint. This case requires the real
DMA device when mapping to IOMMU.
Signed-off-by: Jon Derrick
---
drivers/iommu/intel-iommu.c | 5 +
1 file changed, 5 insertions(+)
diff --git
argument]
Signed-off-by: Jon Derrick
---
arch/x86/include/asm/pci.h | 29 +
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 90d0731..a4e09db60 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86
from the hierarchy.
Signed-off-by: Jon Derrick
---
drivers/iommu/intel-iommu.c | 10 +-
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 01a1b0f..c055699 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu
The PCI device may have a DMA requester on another bus, such as VMD
subdevices needing to use the VMD endpoint. This case requires the real
DMA device when mapping to IOMMU.
Signed-off-by: Jon Derrick
---
drivers/iommu/intel-iommu.c | 9 +
1 file changed, 9 insertions(+)
diff --git
To be used by Intel-IOMMU code to find the correct domain.
CC: Christoph Hellwig
Signed-off-by: Jon Derrick
---
arch/x86/include/asm/pci.h | 4 ++--
drivers/pci/controller/vmd.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/pci.h b/arch/x86
argument]
Signed-off-by: Jon Derrick
---
arch/x86/include/asm/pci.h | 29 +
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 90d0731..a4e09db60 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86
Signed-off-by: Jon Derrick
---
arch/x86/pci/common.c | 10 ++
drivers/pci/pci.c | 19 ++-
drivers/pci/search.c | 6 ++
include/linux/pci.h | 1 +
4 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index
From: Christoph Hellwig
There are no users of X86_DEV_DMA_OPS left, so remove the code.
Reviewed-by: Jon Derrick
Signed-off-by: Christoph Hellwig
---
arch/x86/Kconfig | 3 ---
arch/x86/include/asm/device.h | 10 --
arch/x86/pci/common.c | 38
ding pointer in struct device or
pci_dev.
Based on Bjorn's next:
https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/log/?h=next
Christoph Hellwig (2):
x86/PCI: Add a to_pci_sysdata helper
x86/PCI: Remove X86_DEV_DMA_OPS
Jon Derrick (5):
x86/PCI: Expose VMD's PCI De
endpoint when mapping and providing the correct child device's
attributes during DMA operations.
This patch removes the dma_map_ops redirect.
Signed-off-by: Jon Derrick
---
drivers/pci/controller/Kconfig | 1 -
drivers/pci/controller/vmd.c | 150 -
2
The current DMA alias implementation requires the aliased device be on
the same PCI bus as the requester ID. This introduces an arch-specific
mechanism to point to another PCI device when doing mapping and
PCI DMA alias search.
Signed-off-by: Jon Derrick
---
arch/x86/pci/common.c | 7
-off-by: Jon Derrick
---
arch/x86/include/asm/pci.h | 28 +---
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 90d0731..cf680c5 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm
endpoint when mapping and providing the correct child device's
attributes during DMA operations.
This patch modifies Intel-IOMMU to check for a 'Direct DMA Alias' and
refer to it for mapping.
Signed-off-by: Jon Derrick
---
drivers/iommu/intel-iommu.c| 18 +++--
drivers/pci/controller/Kconfig
'
Changes from v1:
Removed 1/5 & 2/5 misc fix patches that were merged
Uses Christoph's staging/cleanup patches
Introduce weak function rather than including pointer in struct device or
pci_dev.
Based on Joerg's next:
https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git/
Jon Derric
To be used by Intel-IOMMU code to find the correct domain.
CC: Christoph Hellwig
Signed-off-by: Jon Derrick
---
arch/x86/include/asm/pci.h | 5 ++---
drivers/pci/controller/vmd.c | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/pci.h b/arch/x86
From: Christoph Hellwig
There are no users of X86_DEV_DMA_OPS left, so remove the code.
Reviewed-by: Jon Derrick
Signed-off-by: Christoph Hellwig
---
arch/x86/Kconfig | 3 ---
arch/x86/include/asm/device.h | 10 --
arch/x86/pci/common.c | 38
: added un-const cast]
Signed-off-by: Jon Derrick
---
arch/x86/include/asm/pci.h | 28 +---
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 90d0731..cf680c5 100644
--- a/arch/x86/include/asm/pci.h
endpoint when mapping and providing the correct child device's
attributes during dma operations.
This patch modifies intel-iommu to check for a 'direct dma alias' and
refer to it for mapping.
Signed-off-by: Jon Derrick
---
drivers/iommu/intel-iommu.c| 17 +++--
drivers/pci/controller/Kconfig
Add a to_pci_sysdata helper
x86/pci: Replace the vmd_domain field with a vmd_dev pointer
Jon Derrick (3):
PCI: Introduce direct dma alias
PCI: vmd: Stop overriding dma_map_ops
x86/pci: Remove X86_DEV_DMA_OPS
arch/x86/Kconfig | 3 -
arch/x86/include/asm/device.h | 10 ---
From: Christoph Hellwig
From: Christoph Hellwig
Store the actual VMD device in struct pci_sysdata, so that we can later
use it directly for DMA mappings.
Reviewed-by: Jon Derrick
Signed-off-by: Christoph Hellwig
---
arch/x86/include/asm/pci.h | 5 ++---
drivers/pci/controller/vmd.c | 2
From: Christoph Hellwig
There are no users of X86_DEV_DMA_OPS left, so remove the code.
Reviewed-by: Jon Derrick
Signed-off-by: Christoph Hellwig
---
arch/x86/Kconfig | 3 ---
arch/x86/include/asm/device.h | 10 --
arch/x86/pci/common.c | 38
The current dma alias implementation requires the aliased device be on
the same bus as the dma parent. This introduces an arch-specific
mechanism to point to an arbitrary struct device when doing mapping and
pci alias search.
Signed-off-by: Jon Derrick
---
arch/x86/pci/common.c | 7
VMD was the only user of device dma operations. Now that the IOMMU has
been made aware of direct DMA aliases, VMD domain devices can reference
the VMD endpoint directly and the VMD device dma operations has been
made obsolete.
Signed-off-by: Jon Derrick
---
arch/x86/Kconfig | 3
If the device fails to be added to the group, make sure to unlink the
reference before returning.
Signed-off-by: Jon Derrick
---
drivers/iommu/intel-iommu.c | 13 ++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel
To be used by intel-iommu code to find the correct domain.
Signed-off-by: Jon Derrick
---
arch/x86/include/asm/pci.h | 4 ++--
drivers/pci/controller/vmd.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index
This adds the missing teardown step that removes the device link from
the group when the device addition fails.
Signed-off-by: Jon Derrick
---
drivers/iommu/iommu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index d5174f0..3e35284 100644
far enough for proper teardown on
addition failure.
Jon Derrick (5):
iommu: Remove device link to group on failure
iommu/vt-d: Unlink device if failed to add to group
x86/PCI: Expose VMD's device in pci_sysdata
PCI: vmd: Stop overriding dma_map_ops
x86/PCI: Remove unused X86_DEV_DMA_OPS
of the changes
required to support this mode.
Signed-off-by: Jon Derrick
---
arch/x86/pci/common.c | 6 +-
drivers/iommu/intel-iommu.c| 13 ++--
drivers/pci/controller/Kconfig | 1 -
drivers/pci/controller/vmd.c | 150 -
drivers/pci/pci.c
an IOMMU, which
prevents it from exposing an iommu_group sysfs directories and allowing
subsequent binding by userspace-access drivers such as VFIO.
Signed-off-by: Jon Derrick <jonathan.derr...@intel.com>
---
v2->3, wrapped in x86 ifdef to avoid ia64 compilation errors
drivers/iommu/intel-io
an IOMMU, which
prevents it from exposing an iommu_group sysfs directories and allowing
subsequent binding by userspace-access drivers such as VFIO.
Signed-off-by: Jon Derrick <jonathan.derr...@intel.com>
---
drivers/iommu/intel-iommu.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/d
Mostly just cleanup in this revision, eg, trying to limit scope of vmd code to
x86
Previous:
https://patchwork.kernel.org/patch/9886095/
https://patchwork.kernel.org/patch/9886097/
https://patchwork.kernel.org/patch/9886101/
Jon Derrick (4):
MAINTAINERS: Add Jonathan Derrick as VMD maintainer
Signed-off-by: Jon Derrick <jonathan.derr...@intel.com>
---
arch/x86/pci/fixup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index ca4b02e5..1ed2fbf 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -628,7
VMD currently only exists for Intel x86 products
Signed-off-by: Jon Derrick <jonathan.derr...@intel.com>
---
arch/x86/pci/fixup.c | 18 ++
drivers/pci/quirks.c | 17 -
2 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/arch/x86/pci/fixup.c b/ar
Add myself as VMD maintainer
Signed-off-by: Jon Derrick <jonathan.derr...@intel.com>
Acked-by: Keith Busch <keith.bu...@intel.com>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index f66488d..3ec39df 100644
--- a/MAINTAINERS
+++ b
Hi Robin, thanks for the reply.
On 08/11/2017 12:25 PM, Robin Murphy wrote:
> On 07/08/17 20:57, Jon Derrick wrote:
>> VMD child devices must use the VMD endpoint's ID as the DMA source.
>> Because of this, there needs to be a way to link the parent VMD
>> endpoint's DMAR do
On 08/11/2017 11:03 AM, Bjorn Helgaas wrote:
> On Mon, Aug 07, 2017 at 01:57:12PM -0600, Jon Derrick wrote:
>> Generalize is_vmd behavior to remove dependency on domain number
>> checking in pci quirks.
>>
>> Signed-off-by: Jon Derrick <jonathan.derr...@intel.com>
binding by userspace-access drivers such as VFIO.
Signed-off-by: Jon Derrick <jonathan.derr...@intel.com>
---
drivers/iommu/intel-iommu.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 687f18f..651a6cd 100644
--- a/d
Add myself as VMD maintainer
Signed-off-by: Jon Derrick <jonathan.derr...@intel.com>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index f66488d..3ec39df 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10090,6 +10090,7 @@ F: drivers/p
Generalize is_vmd behavior to remove dependency on domain number
checking in pci quirks.
Signed-off-by: Jon Derrick <jonathan.derr...@intel.com>
---
arch/x86/include/asm/pci.h | 8 +++-
arch/x86/pci/common.c | 2 +-
drivers/pci/quirks.c | 2 +-
include/linux/pci.h
60 matches
Mail list logo