Skip to content

Commit 64bc116

Browse files
roottdavenvidia
authored andcommitted
Revert "NVIDIA: SAUCE: PCI: Move REQ_ACS_FLAGS into pci_regs.h as PCI_ACS_ISOLATED"
This reverts commit 273d223. Signed-off-by: Tushar Dave <[email protected]>
1 parent a2f03a9 commit 64bc116

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

drivers/iommu/iommu.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,16 @@ EXPORT_SYMBOL_GPL(iommu_group_id);
13841384
static struct iommu_group *get_pci_alias_group(struct pci_dev *pdev,
13851385
unsigned long *devfns);
13861386

1387+
/*
1388+
* To consider a PCI device isolated, we require ACS to support Source
1389+
* Validation, Request Redirection, Completer Redirection, and Upstream
1390+
* Forwarding. This effectively means that devices cannot spoof their
1391+
* requester ID, requests and completions cannot be redirected, and all
1392+
* transactions are forwarded upstream, even as it passes through a
1393+
* bridge where the target device is downstream.
1394+
*/
1395+
#define REQ_ACS_FLAGS (PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF)
1396+
13871397
/*
13881398
* For multifunction devices which are not isolated from each other, find
13891399
* all the other non-isolated functions and look for existing groups. For
@@ -1396,13 +1406,13 @@ static struct iommu_group *get_pci_function_alias_group(struct pci_dev *pdev,
13961406
struct pci_dev *tmp = NULL;
13971407
struct iommu_group *group;
13981408

1399-
if (!pdev->multifunction || pci_acs_enabled(pdev, PCI_ACS_ISOLATED))
1409+
if (!pdev->multifunction || pci_acs_enabled(pdev, REQ_ACS_FLAGS))
14001410
return NULL;
14011411

14021412
for_each_pci_dev(tmp) {
14031413
if (tmp == pdev || tmp->bus != pdev->bus ||
14041414
PCI_SLOT(tmp->devfn) != PCI_SLOT(pdev->devfn) ||
1405-
pci_acs_enabled(tmp, PCI_ACS_ISOLATED))
1415+
pci_acs_enabled(tmp, REQ_ACS_FLAGS))
14061416
continue;
14071417

14081418
group = get_pci_alias_group(tmp, devfns);
@@ -1546,7 +1556,7 @@ struct iommu_group *pci_device_group(struct device *dev)
15461556
if (!bus->self)
15471557
continue;
15481558

1549-
if (pci_acs_path_enabled(bus->self, NULL, PCI_ACS_ISOLATED))
1559+
if (pci_acs_path_enabled(bus->self, NULL, REQ_ACS_FLAGS))
15501560
break;
15511561

15521562
pdev = bus->self;

include/uapi/linux/pci_regs.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,16 +1004,6 @@
10041004
#define PCI_ACS_CTRL 0x06 /* ACS Control Register */
10051005
#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */
10061006

1007-
/*
1008-
* To consider a PCI device isolated, we require ACS to support Source
1009-
* Validation, Request Redirection, Completer Redirection, and Upstream
1010-
* Forwarding. This effectively means that devices cannot spoof their
1011-
* requester ID, requests and completions cannot be redirected, and all
1012-
* transactions are forwarded upstream, even as it passes through a
1013-
* bridge where the target device is downstream.
1014-
*/
1015-
#define PCI_ACS_ISOLATED (PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF)
1016-
10171007
/* SATA capability */
10181008
#define PCI_SATA_REGS 4 /* SATA REGs specifier */
10191009
#define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */

0 commit comments

Comments
 (0)