Malformed "pci-Enable-overrides-for-missing-ACS-capabilities-4..patch" File

DeMoB

Member
Nov 22, 2017
6
2
21
37
When trying to build an updated Kernel for Proxmox, using the latest (v2.14.2) "0003-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch" file pulled from git I get an error on the makefile output when it runs through the patch:

Code:
patching file drivers/pci/quirks.c
Using Plan A...
patch: **** malformed patch at line 187: @@ -4514,6 +4615,7 @@ static const struct pci_dev_acs_enabled {

My ACS override isn't working with "pcie_acs_override=downstream,multifunction" might this be the reason why?
 
Hi,

Quilt is a bit awkward with changes in the source.
So you have to edit (fix) the patch.
 
So the relevant patch section is:

Code:
@@ -4514,6 +4615,7 @@ static const struct pci_dev_acs_enabled {
        { 0x10df, 0x720, pci_quirk_mf_endpoint_acs }, /* Emulex Skyhawk-R */
        /* Cavium ThunderX */
        { PCI_VENDOR_ID_CAVIUM, PCI_ANY_ID, pci_quirk_cavium_acs },
+       { PCI_ANY_ID, PCI_ANY_ID, pcie_acs_overrides },
        { 0 }
 };

--
2.14.2

On line 187 shouldn't the second file range of +4615,7 actually be +4514,7?


Edit: I believe that correction is needed in combination with another fix for the original error being caused by the previous hunk being over-extended by an extra line.

Line 80:

Code:
@@ -3687,6 +3687,107 @@ static int __init pci_apply_final_quirks(void)

needs changing to

Code:
@@ -3687,6 +3687,106 @@ static int __init pci_apply_final_quirks(void)
 
Last edited:
I think I stumbled upon the same problem. @DeMoB Can you be more specific which terminal commands I do have to execute in order to get the compilation working?
 
Last edited:
@tristank, I've also answered this in your other post, but for anyone else that also stumbles across this thread in the future, presumably on the back of an J3455 ACS IOMMU quirks edit the answer to my original post is as follows.

This malformed patch issue was the result of my removing a whole line in the ACS patch file. Editing the initial patch references caused chain issues further down the patch file with expected line references from the original patch no longer being correct.

The workaround for me was when editing the patches/kernel/0003-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch to not remove the whole pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS) line.

i.e. from (line 159ish):

Code:
+        if (!pci_is_pcie(dev) ||
+                pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS))
+                                return -ENOTTY;

change to:

Code:
+ if (!pci_is_pcie(dev)
+                )
+                                return -ENOTTY;
[/CODE]
 
Last edited:
  • Like
Reactions: tristank

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!