Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 913028 Details for
Bug 1113399
[PATCH] ACS override patch required to assign PCIe devices to VMs using VFIO-PCI
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
ACS override patch for 3.14.8-200.fc20.x86_64
linux-3.14.fc20-override-acs.patch (text/plain), 4.26 KB, created by
oakwhiz
on 2014-06-28 16:08:10 UTC
(
hide
)
Description:
ACS override patch for 3.14.8-200.fc20.x86_64
Filename:
MIME Type:
Creator:
oakwhiz
Created:
2014-06-28 16:08:10 UTC
Size:
4.26 KB
patch
obsolete
>diff -uNrp kernel-3.14.fc20.orig/linux-3.14.8-200.fc20.x86_64/Documentation/kernel-parameters.txt kernel-3.14.fc20.new/linux-3.14.8-200.fc20.x86_64/Documentation/kernel-parameters.txt >--- kernel-3.14.fc20.orig/linux-3.14.8-200.fc20.x86_64/Documentation/kernel-parameters.txt 2014-06-28 07:49:18.511138111 -0700 >+++ kernel-3.14.fc20.new/linux-3.14.8-200.fc20.x86_64/Documentation/kernel-parameters.txt 2014-06-28 08:43:14.404892394 -0700 >@@ -2535,6 +2535,16 @@ bytes respectively. Such letter suffixes > nomsi Do not use MSI for native PCIe PME signaling (this makes > all PCIe root ports use INTx for all services). > >+ pcie_acs_override = >+ [PCIE] Override missing PCIe ACS support for: >+ downstream >+ All downstream ports - full ACS capabilties >+ multifunction >+ All multifunction devices - multifunction ACS subset >+ id:nnnn:nnnn >+ Specfic device - full ACS capabilities >+ Specified as vid:did (vendor/device ID) in hex >+ > pcmv= [HW,PCMCIA] BadgePAD 4 > > pd. [PARIDE] >diff -uNrp kernel-3.14.fc20.orig/linux-3.14.8-200.fc20.x86_64/drivers/pci/quirks.c kernel-3.14.fc20.new/linux-3.14.8-200.fc20.x86_64/drivers/pci/quirks.c >--- kernel-3.14.fc20.orig/linux-3.14.8-200.fc20.x86_64/drivers/pci/quirks.c 2014-06-28 07:49:19.579105395 -0700 >+++ kernel-3.14.fc20.new/linux-3.14.8-200.fc20.x86_64/drivers/pci/quirks.c 2014-06-28 08:47:56.787242603 -0700 >@@ -3379,6 +3379,107 @@ struct pci_dev *pci_get_dma_source(struc > return pci_dev_get(dev); > } > >+static bool acs_on_downstream; >+static bool acs_on_multifunction; >+ >+#define NUM_ACS_IDS 16 >+struct acs_on_id { >+ unsigned short vendor; >+ unsigned short device; >+}; >+static struct acs_on_id acs_on_ids[NUM_ACS_IDS]; >+static u8 max_acs_id; >+ >+static __init int pcie_acs_override_setup(char *p) >+{ >+ if (!p) >+ return -EINVAL; >+ >+ while (*p) { >+ if (!strncmp(p, "downstream", 10)) >+ acs_on_downstream = true; >+ if (!strncmp(p, "multifunction", 13)) >+ acs_on_multifunction = true; >+ if (!strncmp(p, "id:", 3)) { >+ char opt[5]; >+ int ret; >+ long val; >+ >+ if (max_acs_id >= NUM_ACS_IDS - 1) { >+ pr_warn("Out of PCIe ACS override slots (%d)\n", >+ NUM_ACS_IDS); >+ goto next; >+ } >+ >+ p += 3; >+ snprintf(opt, 5, "%s", p); >+ ret = kstrtol(opt, 16, &val); >+ if (ret) { >+ pr_warn("PCIe ACS ID parse error %d\n", ret); >+ goto next; >+ } >+ acs_on_ids[max_acs_id].vendor = val; >+ >+ p += strcspn(p, ":"); >+ if (*p != ':') { >+ pr_warn("PCIe ACS invalid ID\n"); >+ goto next; >+ } >+ >+ p++; >+ snprintf(opt, 5, "%s", p); >+ ret = kstrtol(opt, 16, &val); >+ if (ret) { >+ pr_warn("PCIe ACS ID parse error %d\n", ret); >+ goto next; >+ } >+ acs_on_ids[max_acs_id].device = val; >+ max_acs_id++; >+ } >+next: >+ p += strcspn(p, ","); >+ if (*p == ',') >+ p++; >+ } >+ >+ if (acs_on_downstream || acs_on_multifunction || max_acs_id) >+ pr_warn("Warning: PCIe ACS overrides enabled; This may allow non-IOMMU protected peer-to-peer DMA\n"); >+ >+ return 0; >+} >+early_param("pcie_acs_override", pcie_acs_override_setup); >+ >+static int pcie_acs_overrides(struct pci_dev *dev, u16 acs_flags) >+{ >+ int i; >+ >+ /* Never override ACS for legacy devices or devices with ACS caps */ >+ if (!pci_is_pcie(dev) || >+ pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS)) >+ return -ENOTTY; >+ >+ for (i = 0; i < max_acs_id; i++) >+ if (acs_on_ids[i].vendor == dev->vendor && >+ acs_on_ids[i].device == dev->device) >+ return 1; >+ >+ switch (pci_pcie_type(dev)) { >+ case PCI_EXP_TYPE_DOWNSTREAM: >+ case PCI_EXP_TYPE_ROOT_PORT: >+ if (acs_on_downstream) >+ return 1; >+ break; >+ case PCI_EXP_TYPE_ENDPOINT: >+ case PCI_EXP_TYPE_UPSTREAM: >+ case PCI_EXP_TYPE_LEG_END: >+ case PCI_EXP_TYPE_RC_END: >+ if (acs_on_multifunction && dev->multifunction) >+ return 1; >+ } >+ >+ return -ENOTTY; >+} >+ > /* > * AMD has indicated that the devices below do not support peer-to-peer > * in any system where they are found in the southbridge with an AMD >@@ -3423,6 +3524,7 @@ static int pci_quirk_amd_sb_acs(struct p > #endif > } > >+ > static const struct pci_dev_acs_enabled { > u16 vendor; > u16 device; >@@ -3434,6 +3536,7 @@ static const struct pci_dev_acs_enabled > { PCI_VENDOR_ID_ATI, 0x439d, pci_quirk_amd_sb_acs }, > { PCI_VENDOR_ID_ATI, 0x4384, pci_quirk_amd_sb_acs }, > { PCI_VENDOR_ID_ATI, 0x4399, pci_quirk_amd_sb_acs }, >+ { PCI_ANY_ID, PCI_ANY_ID, pcie_acs_overrides }, > { 0 } > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1113399
: 913028 |
977932