Package Details: linux-vfio-headers 6.12.5-1

Git Clone URL: https://aur.archlinux.org/linux-vfio.git (read-only, click to copy)
Package Base: linux-vfio
Description: Headers and scripts for building modules for the Linux kernel (ACS override and i915 VGA arbiter patches)
Upstream URL: https://www.kernel.org
Keywords: acs arbiter assignment gpu i915 kvm override passthrough pci qemu vfio vga
Licenses: GPL-2.0-or-later
Submitter: zman0900
Maintainer: xiota
Last Packager: xiota
Votes: 73
Popularity: 0.000157
First Submitted: 2015-01-30 06:41 (UTC)
Last Updated: 2024-12-18 23:01 (UTC)

Pinned Comments

xiota commented on 2024-01-09 18:43 (UTC) (edited on 2024-01-11 16:53 (UTC) by xiota)

  • Leaving eclairvoyant's comment pinned because it contains some useful information.
  • Patch policy is different, but similar.
    • Primary purpose of this package are the ACS override and i915 VGA arbiter patches.
    • Upstream Arch patches will be applied to maintain parity with the standard kernel.
    • No other patches will be added.
  • Package does have options that can be changed, like building with clang or disabling Arch patches.
    • Defaults will match Arch packages, except when incompatible with this package's primary patches.
    • Options are subject to change. Read PKGBUILD for details.
  • Avoid commenting and flagging at the same time for the same issue.
    • Flag for common issues with standard solutions, like new releases, key changes, etc.
    • Comment for issues requiring explanation or debugging.
      • Use a pastebin for blocks of text more than a few lines.

eclairevoyant commented on 2023-04-06 21:24 (UTC) (edited on 2023-04-06 21:31 (UTC) by eclairevoyant)

This package exists for the specific purpose of adding ported patches based on those originally created by Alex Williamson for:

Arbitrary patches will not be added.

Refer to the wiki on PCI passthrough and this blog post on IOMMU groups for risks/caveats before using this package.

Regular AUR etiquette applies as well (knowledge of makepkg and searching the wiki/Arch forums is expected, and AUR helpers or Arch-based distros that are not Arch Linux are unsupported).

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 .. 32 Next › Last »

cypressRU commented on 2024-07-22 23:34 (UTC) (edited on 2024-07-22 23:56 (UTC) by cypressRU)

Hello. I made an account here just so I can ask this question. When I run this through Yay, it just crashes my system.

Is this expected behavior?

Edit: It looks like the crashes were due to the use of the Yay aur package manager thing. Apologies.

xiota commented on 2024-06-11 02:34 (UTC)

I'm guessing you missed makepkg. The commands should be similar to the following:

sudo pacman -S base-devel git
git clone https://aur.archlinux.org/linux-vfio.git
cd linux-vfio
makepkg -s --skippgpcheck
# wait a long time for build
sudo pacman -U linux-vfio-6.9.3-1-x86_64.pkg.tar.zst linux-vfio-headers-6.9.3-1-x86_64.pkg.tar.zst

Joeythe_fish commented on 2024-06-11 02:26 (UTC)

@xiota I'm following this guide https://wiki.archlinux.org/title/Arch_User_Repository and got down to the install phase. The file you're describing isn't in the current directory. Can you point out what I've done wrong? I used git clone and PKGBUILD. PS. Thank you so much for your work maintaining this package.

xiota commented on 2024-06-11 02:16 (UTC)

@Joeythe_fish You're trying to install the wrong file. The correct files should be named similar to linux-vfio-6.9.3-1-x86_64.pkg.tar.zst and linux-vfio-headers-6.9.3-1-x86_64.pkg.tar.zst.

Joeythe_fish commented on 2024-06-11 01:49 (UTC)

When I try to run pacman -U linux-6.9.3.tar.xz, I get an error saying it's an invalid or corrupted package: [mau@archlinux linux-vfio]$ sudo pacman -U linux-6.9.3.tar.xz loading packages... error: missing package metadata in linux-6.9.3.tar.xz error: 'linux-6.9.3.tar.xz': invalid or corrupted package

Is this on me or on the package? I've attempted to build it a few times and I keep hitting that wall.

xiota commented on 2024-01-09 18:43 (UTC) (edited on 2024-01-11 16:53 (UTC) by xiota)

  • Leaving eclairvoyant's comment pinned because it contains some useful information.
  • Patch policy is different, but similar.
    • Primary purpose of this package are the ACS override and i915 VGA arbiter patches.
    • Upstream Arch patches will be applied to maintain parity with the standard kernel.
    • No other patches will be added.
  • Package does have options that can be changed, like building with clang or disabling Arch patches.
    • Defaults will match Arch packages, except when incompatible with this package's primary patches.
    • Options are subject to change. Read PKGBUILD for details.
  • Avoid commenting and flagging at the same time for the same issue.
    • Flag for common issues with standard solutions, like new releases, key changes, etc.
    • Comment for issues requiring explanation or debugging.
      • Use a pastebin for blocks of text more than a few lines.

fmorgner commented on 2023-12-31 13:55 (UTC)

I believe the PKGBUILD is missing Jan Alexander Steffens' key (A2FF3A36AAA56654109064AB19802F8B0D70FC30) in "validpgpkeys", causing an "invalid public key" error when trying to build it.

TieMajor commented on 2023-12-22 16:33 (UTC)

eclairevoyant I am willing to take over the package if you are not supporting it anymore.

markzz commented on 2023-10-10 23:26 (UTC)

From 488b6a80e1df6253e0c5c53453c74c9ea87c76da Mon Sep 17 00:00:00 2001
From: Mark King <mark.king@markzz.com>
Date: Tue, 10 Oct 2023 19:18:13 -0400
Subject: [PATCH] i915: Add module option to support VGA arbiter on HD devices 
 (6.5)

This is an updated version of Alex Williamson's patch from:
https://lkml.org/lkml/2014/5/9/517

I don't have i915 graphics, so this is completely untested.

Original commit message follows:
---
Commit 81b5c7bc found that the current VGA arbiter support in i915
only works for ancient GMCH-based IGD devices and attempted to update
support for newer HD devices.  Unfortunately newer devices cannot
completely opt-out of VGA arbitration like the old devices could.
The VGA I/O space cannot be disabled internally.  The only way to
route VGA I/O elsewhere is by disabling I/O at the device PCI command
register.  This means that with commit 81b5c7bc and multiple VGA
adapters, the VGA arbiter will report that multiple VGA devices are
participating in arbitration, Xorg will notice this and disable DRI.
Therefore, 81b5c7bc was reverted because DRI is more important than
being correct.

There is however an actual need for i915 to correctly participate in
VGA arbitration; VGA device assignment.  If we want to use VFIO to
assign a VGA device to a virtual machine, we need to be able to
access the VGA resources of that device.  By adding an i915 module
option we can allow i915 to continue with its charade by default, but
also allow an easy path for users who require working VGA arbitration.
Hopefully Xorg can someday be taught to behave better with multiple
VGA devices.

This also rolls in reverted commit 6e1b4fda, which corrected an
ordering issue with 81b5c7bc by delaying the disabling of VGA memory
until after vgacon->fbcon handoff.
---
 drivers/gpu/drm/i915/display/intel_display.h  |  1 +
 .../drm/i915/display/intel_display_driver.c   | 15 +++++++--
 drivers/gpu/drm/i915/display/intel_vga.c      | 31 +++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_vga.h      |  4 +++
 drivers/gpu/drm/i915/i915_params.c            |  3 ++
 drivers/gpu/drm/i915/i915_params.h            |  1 +
 6 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
index c744c021af23..0e0ad65b359c 100644
--- a/drivers/gpu/drm/i915/display/intel_display.h
+++ b/drivers/gpu/drm/i915/display/intel_display.h
@@ -427,6 +427,7 @@ void i830_disable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe);
 int vlv_get_hpll_vco(struct drm_i915_private *dev_priv);
 int vlv_get_cck_clock(struct drm_i915_private *dev_priv,
              const char *name, u32 reg, int ref_freq);
+extern void intel_vga_disable_mem(struct drm_i915_private *dev_priv);
 int vlv_get_cck_clock_hpll(struct drm_i915_private *dev_priv,
               const char *name, u32 reg);
 void intel_init_display_hooks(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
index b909814ae02b..ee5c3c17a32d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_driver.c
+++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
@@ -203,9 +203,11 @@ int intel_display_driver_probe_noirq(struct drm_i915_private *i915)

    intel_bios_init(i915);

-   ret = intel_vga_register(i915);
-   if (ret)
-       goto cleanup_bios;
+   if (!i915_modparams.enable_hd_vgaarb || !HAS_PCH_SPLIT(i915)) {
+       ret = intel_vga_register(i915);
+       if (ret)
+           goto cleanup_bios;
+   }

    /* FIXME: completely on the wrong abstraction layer */
    ret = intel_power_domains_init(i915);
@@ -364,6 +366,12 @@ int intel_display_driver_probe(struct drm_i915_private *i915)
    if (ret)
        return ret;

+   /*
+    * Must do this after fbcon init so that
+    * vgacon_save_screen() works during the handover.
+    */
+   intel_vga_disable_mem(i915);
+
    /* Only enable hotplug handling once the fbdev is fully set up. */
    intel_hpd_init(i915);
    intel_hpd_poll_disable(i915);
@@ -410,6 +418,7 @@ void intel_display_driver_remove(struct drm_i915_private *i915)
    if (!HAS_DISPLAY(i915))
        return;

+   intel_vga_enable_mem(i915);
    flush_workqueue(i915->display.wq.flip);
    flush_workqueue(i915->display.wq.modeset);

diff --git a/drivers/gpu/drm/i915/display/intel_vga.c b/drivers/gpu/drm/i915/display/intel_vga.c
index 286a0bdd28c6..18d30ee84c04 100644
--- a/drivers/gpu/drm/i915/display/intel_vga.c
+++ b/drivers/gpu/drm/i915/display/intel_vga.c
@@ -47,6 +47,36 @@ void intel_vga_disable(struct drm_i915_private *dev_priv)
    intel_de_posting_read(dev_priv, vga_reg);
 }

+void intel_vga_enable_mem(struct drm_i915_private *dev_priv)
+{
+   struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
+
+   /* Enable VGA memory on Intel HD */
+   if (i915_modparams.enable_hd_vgaarb && HAS_PCH_SPLIT(dev_priv)) {
+       vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
+       outb(inb(VGA_MIS_R) | (1 << 1), VGA_MIS_W);
+       vga_set_legacy_decoding(pdev, VGA_RSRC_LEGACY_IO |
+                       VGA_RSRC_LEGACY_MEM |
+                       VGA_RSRC_NORMAL_IO |
+                       VGA_RSRC_NORMAL_MEM);
+       vga_put(pdev, VGA_RSRC_LEGACY_IO);
+   }
+}
+
+void intel_vga_disable_mem(struct drm_i915_private *dev_priv)
+{
+   struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
+   /* Disable VGA memory on Intel HD */
+   if (i915_modparams.enable_hd_vgaarb && HAS_PCH_SPLIT(dev_priv)) {
+       vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
+       outb(inb(VGA_MIS_R) & ~(1 << 1), VGA_MIS_W);
+       vga_set_legacy_decoding(pdev, VGA_RSRC_LEGACY_IO |
+                          VGA_RSRC_NORMAL_IO |
+                          VGA_RSRC_NORMAL_MEM);
+       vga_put(pdev, VGA_RSRC_LEGACY_IO);
+   }
+}
+
 void intel_vga_redisable_power_on(struct drm_i915_private *dev_priv)
 {
    i915_reg_t vga_reg = intel_vga_cntrl_reg(dev_priv);
@@ -55,6 +85,7 @@ void intel_vga_redisable_power_on(struct drm_i915_private *dev_priv)
        drm_dbg_kms(&dev_priv->drm,
                "Something enabled VGA plane, disabling it\n");
        intel_vga_disable(dev_priv);
+       intel_vga_disable_mem(dev_priv);
    }
 }

diff --git a/drivers/gpu/drm/i915/display/intel_vga.h b/drivers/gpu/drm/i915/display/intel_vga.h
index ba5b55b917f0..7e2af7924e99 100644
--- a/drivers/gpu/drm/i915/display/intel_vga.h
+++ b/drivers/gpu/drm/i915/display/intel_vga.h
@@ -15,4 +15,8 @@ void intel_vga_redisable_power_on(struct drm_i915_private *i915);
 int intel_vga_register(struct drm_i915_private *i915);
 void intel_vga_unregister(struct drm_i915_private *i915);

+/* i915 vga arb patch */
+void intel_vga_enable_mem(struct drm_i915_private *i915);
+void intel_vga_disable_mem(struct drm_i915_private *i915);
+
 #endif /* __INTEL_VGA_H__ */
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 0a171b57fd8f..739d31067b6b 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -160,6 +160,9 @@ i915_param_named_unsafe(invert_brightness, int, 0400,
 i915_param_named(disable_display, bool, 0400,
    "Disable display (default: false)");

+i915_param_named(enable_hd_vgaarb, bool, 0444,
+   "Enable support for VGA arbitration on Intel HD IGD. (default: false)");
+
 i915_param_named(memtest, bool, 0400,
    "Perform a read/write test of all device memory on module load (default: off)");

diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 68abf0ad6c00..507d29c52f61 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -79,6 +79,7 @@ struct drm_printer;
    param(unsigned int, lmem_size, 0, 0400) \
    param(unsigned int, lmem_bar_size, 0, 0400) \
    /* leave bools at the end to not create holes */ \
+   param(bool, enable_hd_vgaarb, false, 0600) \
    param(bool, enable_hangcheck, true, 0600) \
    param(bool, load_detect_test, false, 0600) \
    param(bool, force_reset_modeset_test, false, 0600) \
-- 
2.42.0