Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60fe8238 authored by Alex Williamson's avatar Alex Williamson Committed by Jesse Barnes
Browse files

PCI: Enable is not exposed as a PASID capability



The PASID ECN indicates bit 0 is reserved in the capability register.
Switch pci_enable_pasid() to error if PASID is already enabled and
don't expose enable as a feature in pci_pasid_features().

Reviewed-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
Tested-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent a776c491
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ int pci_enable_pasid(struct pci_dev *pdev, int features)
	pci_read_config_word(pdev, pos + PCI_PASID_CONTROL_OFF, &control);
	pci_read_config_word(pdev, pos + PCI_PASID_CAP_OFF,     &supported);

	if (!(supported & PCI_PASID_ENABLE))
	if (control & PCI_PASID_ENABLE)
		return -EINVAL;

	supported &= PCI_PASID_EXEC | PCI_PASID_PRIV;
@@ -390,7 +390,6 @@ EXPORT_SYMBOL_GPL(pci_disable_pasid);
 * Returns a negative value when no PASI capability is present.
 * Otherwise is returns a bitmask with supported features. Current
 * features reported are:
 * PCI_PASID_ENABLE - PASID capability can be enabled
 * PCI_PASID_EXEC - Execute permission supported
 * PCI_PASID_PRIV - Priviledged mode supported
 */
@@ -405,7 +404,7 @@ int pci_pasid_features(struct pci_dev *pdev)

	pci_read_config_word(pdev, pos + PCI_PASID_CAP_OFF, &supported);

	supported &= PCI_PASID_ENABLE | PCI_PASID_EXEC | PCI_PASID_PRIV;
	supported &= PCI_PASID_EXEC | PCI_PASID_PRIV;

	return supported;
}