diff options
| author | Joerg Roedel <joerg.roedel@amd.com> | 2011-09-27 09:57:16 -0400 |
|---|---|---|
| committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-10-14 12:05:35 -0400 |
| commit | 086ac11f6435c9dc2fe5025fc8ea3a1dbca273d6 (patch) | |
| tree | 29e9445f029b73bac174900cb68d5e1fd2748cef /include/linux | |
| parent | c320b976d7837c561ce4aa49dfe0a64f0e527ce4 (diff) | |
PCI: Add support for PASID capability
Devices supporting Process Address Space Identifiers
(PASIDs) can use an IOMMU to access multiple IO address
spaces at the same time. A PCIe device indicates support for
this feature by implementing the PASID capability. This
patch adds support for the capability to the Linux kernel.
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/pci-ats.h | 31 | ||||
| -rw-r--r-- | include/linux/pci_regs.h | 8 |
2 files changed, 39 insertions, 0 deletions
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 071395251abf..e3d0b3890249 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h | |||
| @@ -93,4 +93,35 @@ static inline int pci_pri_status(struct pci_dev *pdev) | |||
| 93 | } | 93 | } |
| 94 | #endif /* CONFIG_PCI_PRI */ | 94 | #endif /* CONFIG_PCI_PRI */ |
| 95 | 95 | ||
| 96 | #ifdef CONFIG_PCI_PASID | ||
| 97 | |||
| 98 | extern int pci_enable_pasid(struct pci_dev *pdev, int features); | ||
| 99 | extern void pci_disable_pasid(struct pci_dev *pdev); | ||
| 100 | extern int pci_pasid_features(struct pci_dev *pdev); | ||
| 101 | extern int pci_max_pasids(struct pci_dev *pdev); | ||
| 102 | |||
| 103 | #else /* CONFIG_PCI_PASID */ | ||
| 104 | |||
| 105 | static inline int pci_enable_pasid(struct pci_dev *pdev, int features) | ||
| 106 | { | ||
| 107 | return -EINVAL; | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline void pci_disable_pasid(struct pci_dev *pdev) | ||
| 111 | { | ||
| 112 | } | ||
| 113 | |||
| 114 | static inline int pci_pasid_features(struct pci_dev *pdev) | ||
| 115 | { | ||
| 116 | return -EINVAL; | ||
| 117 | } | ||
| 118 | |||
| 119 | static inline int pci_max_pasids(struct pci_dev *pdev) | ||
| 120 | { | ||
| 121 | return -EINVAL; | ||
| 122 | } | ||
| 123 | |||
| 124 | #endif /* CONFIG_PCI_PASID */ | ||
| 125 | |||
| 126 | |||
| 96 | #endif /* LINUX_PCI_ATS_H*/ | 127 | #endif /* LINUX_PCI_ATS_H*/ |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 7fc32aff94d2..b5d9657f3100 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -675,6 +675,14 @@ | |||
| 675 | #define PCI_PRI_MAX_REQ_OFF 0x08 /* Cap offset for max reqs supported */ | 675 | #define PCI_PRI_MAX_REQ_OFF 0x08 /* Cap offset for max reqs supported */ |
| 676 | #define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */ | 676 | #define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */ |
| 677 | 677 | ||
| 678 | /* PASID capability */ | ||
| 679 | #define PCI_PASID_CAP 0x1b /* PASID capability ID */ | ||
| 680 | #define PCI_PASID_CAP_OFF 0x04 /* PASID feature register */ | ||
| 681 | #define PCI_PASID_CONTROL_OFF 0x06 /* PASID control register */ | ||
| 682 | #define PCI_PASID_ENABLE 0x01 /* Enable/Supported bit */ | ||
| 683 | #define PCI_PASID_EXEC 0x02 /* Exec permissions Enable/Supported */ | ||
| 684 | #define PCI_PASID_PRIV 0x04 /* Priviledge Mode Enable/Support */ | ||
| 685 | |||
| 678 | /* Single Root I/O Virtualization */ | 686 | /* Single Root I/O Virtualization */ |
| 679 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ | 687 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ |
| 680 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ | 688 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ |
