Skip to content

Instantly share code, notes, and snippets.

@cspicer
cspicer / i915_4.2.patch
Created Nov 3, 2015
i915 VGA arbitration patch for Kernel 4.2+
View i915_4.2.patch
diff -uNr linux-4.2.5/drivers/gpu/drm/i915/i915_dma.c linux-4.2.5-i915/drivers/gpu/drm/i915/i915_dma.c
--- linux-4.2.5/drivers/gpu/drm/i915/i915_dma.c 2015-10-26 17:53:59.000000000 -0700
+++ linux-4.2.5-i915/drivers/gpu/drm/i915/i915_dma.c 2015-11-02 17:45:10.431542620 -0800
@@ -400,10 +400,20 @@
* If we are a secondary display controller (!PCI_DISPLAY_CLASS_VGA),
* then we do not take part in VGA arbitration and the
* vga_client_register() fails with -ENODEV.
+ *
+ * NB. The set_decode callback here actually only works on GMCH
+ * devices, on newer HD devices we can only disable VGA MMIO space.
@cspicer
cspicer / i915_317.patch
Created Jan 19, 2015
i195 VGA arbitration patch for 3.16+
View i915_317.patch
diff -rupN linux-3.17.old/drivers/gpu/drm/i915/i915_dma.c linux-3.17/drivers/gpu/drm/i915/i915_dma.c
--- linux-3.17.old/drivers/gpu/drm/i915/i915_dma.c 2014-10-05 17:23:04.000000000 -0200
+++ linux-3.17/drivers/gpu/drm/i915/i915_dma.c 2014-10-08 13:25:35.261920170 -0200
@@ -1316,10 +1316,20 @@ static int i915_load_modeset_init(struct
* If we are a secondary display controller (!PCI_DISPLAY_CLASS_VGA),
* then we do not take part in VGA arbitration and the
* vga_client_register() fails with -ENODEV.
+ *
+ * NB. The set_decode callback here actually only works on GMCH
+ * devices, on newer HD devices we can only disable VGA MMIO space.
View override_for_missing_acs_capabilities.patch
diff -uNr linux-4.2.5/Documentation/kernel-parameters.txt linux-4.2.5-acs/Documentation/kernel-parameters.txt
--- linux-4.2.5/Documentation/kernel-parameters.txt 2015-10-26 17:53:59.000000000 -0700
+++ linux-4.2.5-acs/Documentation/kernel-parameters.txt 2015-11-02 18:02:28.643526086 -0800
@@ -2850,6 +2850,16 @@
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
@cspicer
cspicer / vfio-bind
Created Jun 14, 2014
vfio-bind for KVM passthrough
View vfio-bind
#!/bin/bash
modprobe vfio-pci
for dev in "$@"; do
vendor=$(cat /sys/bus/pci/devices/$dev/vendor)
device=$(cat /sys/bus/pci/devices/$dev/device)
if [ -e /sys/bus/pci/devices/$dev/driver ]; then
echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
fi
View gist:9d2879c3c138d14bdb06
### Keybase proof
I hereby claim:
* I am cspicer on github.
* I am cspicer (https://keybase.io/cspicer) on keybase.
* I have a public key whose fingerprint is 5DE1 6F19 C768 3B40 E2C5 2D7B 9092 1AF8 9D7F 0D30
To claim this, I am signing this object: