Public bug reported:

Linux kernel upstream Commit 47c8846a49ba ("PCI: Extend ACS
configurability") introduced bugs  that fail to configure ACS ctrl to
the value specified by the kernel parameter. Essentially there are two
bugs:


1) When ACS is configured for multiple PCI devices using 'config_acs'
   kernel parameter, it results into error "PCI: Can't parse ACS command
   line parameter". This is due to a bug that doesn't preserve the ACS
   mask, but instead overwrites the mask with value 0.

   For example, using 'config_acs' to configure ACS ctrl for multiple BDFs
   fails:

      Kernel command line: 
pci=config_acs=1111011@0020:02:00.0;101xxxx@0039:00:00.0 "dyndbg=file 
drivers/pci/pci.c +p"
      PCI: Can't parse ACS command line parameter
      pci 0020:02:00.0: ACS mask  = 0x007f
      pci 0020:02:00.0: ACS flags = 0x007b
      pci 0020:02:00.0: Configured ACS to 0x007b

   After this fix:

      Kernel command line: 
pci=config_acs=1111011@0020:02:00.0;101xxxx@0039:00:00.0 "dyndbg=file 
drivers/pci/pci.c +p"
      pci 0020:02:00.0: ACS mask  = 0x007f
      pci 0020:02:00.0: ACS flags = 0x007b
      pci 0020:02:00.0: ACS control = 0x005f
      pci 0020:02:00.0: ACS fw_ctrl = 0x0053
      pci 0020:02:00.0: Configured ACS to 0x007b
      pci 0039:00:00.0: ACS mask  = 0x0070
      pci 0039:00:00.0: ACS flags = 0x0050
      pci 0039:00:00.0: ACS control = 0x001d
      pci 0039:00:00.0: ACS fw_ctrl = 0x0000
      pci 0039:00:00.0: Configured ACS to 0x0050

2) In the bit manipulation logic, we copy the bit from the firmware
   settings when mask bit 0.

   For example, 'disable_acs_redir' fails to clear all three ACS P2P redir
   bits due to the wrong bit fiddling:

      Kernel command line: 
pci=disable_acs_redir=0020:02:00.0;0030:02:00.0;0039:00:00.0 "dyndbg=file 
drivers/pci/pci.c +p"
      pci 0020:02:00.0: ACS mask  = 0x002c
      pci 0020:02:00.0: ACS flags = 0xffd3
      pci 0020:02:00.0: Configured ACS to 0xfffb
      pci 0030:02:00.0: ACS mask  = 0x002c
      pci 0030:02:00.0: ACS flags = 0xffd3
      pci 0030:02:00.0: Configured ACS to 0xffdf
      pci 0039:00:00.0: ACS mask  = 0x002c
      pci 0039:00:00.0: ACS flags = 0xffd3
      pci 0039:00:00.0: Configured ACS to 0xffd3

   After this fix:

      Kernel command line: 
pci=disable_acs_redir=0020:02:00.0;0030:02:00.0;0039:00:00.0 "dyndbg=file 
drivers/pci/pci.c +p"
      pci 0020:02:00.0: ACS mask  = 0x002c
      pci 0020:02:00.0: ACS flags = 0xffd3
      pci 0020:02:00.0: ACS control = 0x007f
      pci 0020:02:00.0: ACS fw_ctrl = 0x007b
      pci 0020:02:00.0: Configured ACS to 0x0053
      pci 0030:02:00.0: ACS mask  = 0x002c
      pci 0030:02:00.0: ACS flags = 0xffd3
      pci 0030:02:00.0: ACS control = 0x005f
      pci 0030:02:00.0: ACS fw_ctrl = 0x005f
      pci 0030:02:00.0: Configured ACS to 0x0053
      pci 0039:00:00.0: ACS mask  = 0x002c
      pci 0039:00:00.0: ACS flags = 0xffd3
      pci 0039:00:00.0: ACS control = 0x001d
      pci 0039:00:00.0: ACS fw_ctrl = 0x0000
      pci 0039:00:00.0: Configured ACS to 0x0000

** Affects: linux-nvidia (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

-  Linux kernel upstream Commit 47c8846a49ba ("PCI: Extend ACS 
configurability") introduced bugs
-  that fail to configure ACS ctrl to the value specified by the kernel 
parameter.
+ Linux kernel upstream Commit 47c8846a49ba ("PCI: Extend ACS
+ configurability") introduced bugs  that fail to configure ACS ctrl to
+ the value specified by the kernel parameter. Essentially there are two
+ bugs:
+ 
+ 
+ 1) When ACS is configured for multiple PCI devices using 'config_acs'
+    kernel parameter, it results into error "PCI: Can't parse ACS command
+    line parameter". This is due to a bug that doesn't preserve the ACS
+    mask, but instead overwrites the mask with value 0.
+ 
+    For example, using 'config_acs' to configure ACS ctrl for multiple BDFs
+    fails:
+ 
+       Kernel command line: 
pci=config_acs=1111011@0020:02:00.0;101xxxx@0039:00:00.0 "dyndbg=file 
drivers/pci/pci.c +p"
+       PCI: Can't parse ACS command line parameter
+       pci 0020:02:00.0: ACS mask  = 0x007f
+       pci 0020:02:00.0: ACS flags = 0x007b
+       pci 0020:02:00.0: Configured ACS to 0x007b
+ 
+    After this fix:
+ 
+       Kernel command line: 
pci=config_acs=1111011@0020:02:00.0;101xxxx@0039:00:00.0 "dyndbg=file 
drivers/pci/pci.c +p"
+       pci 0020:02:00.0: ACS mask  = 0x007f
+       pci 0020:02:00.0: ACS flags = 0x007b
+       pci 0020:02:00.0: ACS control = 0x005f
+       pci 0020:02:00.0: ACS fw_ctrl = 0x0053
+       pci 0020:02:00.0: Configured ACS to 0x007b
+       pci 0039:00:00.0: ACS mask  = 0x0070
+       pci 0039:00:00.0: ACS flags = 0x0050
+       pci 0039:00:00.0: ACS control = 0x001d
+       pci 0039:00:00.0: ACS fw_ctrl = 0x0000
+       pci 0039:00:00.0: Configured ACS to 0x0050
+ 
+ 2) In the bit manipulation logic, we copy the bit from the firmware
+    settings when mask bit 0.
+ 
+    For example, 'disable_acs_redir' fails to clear all three ACS P2P redir
+    bits due to the wrong bit fiddling:
+ 
+       Kernel command line: 
pci=disable_acs_redir=0020:02:00.0;0030:02:00.0;0039:00:00.0 "dyndbg=file 
drivers/pci/pci.c +p"
+       pci 0020:02:00.0: ACS mask  = 0x002c
+       pci 0020:02:00.0: ACS flags = 0xffd3
+       pci 0020:02:00.0: Configured ACS to 0xfffb
+       pci 0030:02:00.0: ACS mask  = 0x002c
+       pci 0030:02:00.0: ACS flags = 0xffd3
+       pci 0030:02:00.0: Configured ACS to 0xffdf
+       pci 0039:00:00.0: ACS mask  = 0x002c
+       pci 0039:00:00.0: ACS flags = 0xffd3
+       pci 0039:00:00.0: Configured ACS to 0xffd3
+ 
+    After this fix:
+ 
+       Kernel command line: 
pci=disable_acs_redir=0020:02:00.0;0030:02:00.0;0039:00:00.0 "dyndbg=file 
drivers/pci/pci.c +p"
+       pci 0020:02:00.0: ACS mask  = 0x002c
+       pci 0020:02:00.0: ACS flags = 0xffd3
+       pci 0020:02:00.0: ACS control = 0x007f
+       pci 0020:02:00.0: ACS fw_ctrl = 0x007b
+       pci 0020:02:00.0: Configured ACS to 0x0053
+       pci 0030:02:00.0: ACS mask  = 0x002c
+       pci 0030:02:00.0: ACS flags = 0xffd3
+       pci 0030:02:00.0: ACS control = 0x005f
+       pci 0030:02:00.0: ACS fw_ctrl = 0x005f
+       pci 0030:02:00.0: Configured ACS to 0x0053
+       pci 0039:00:00.0: ACS mask  = 0x002c
+       pci 0039:00:00.0: ACS flags = 0xffd3
+       pci 0039:00:00.0: ACS control = 0x001d
+       pci 0039:00:00.0: ACS fw_ctrl = 0x0000
+       pci 0039:00:00.0: Configured ACS to 0x0000

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2100340

Title:
   PCI/ACS: Fix 'pci=config_acs=' parameter

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-nvidia/+bug/2100340/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to