Commit 55a271a0 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'topic/xe-vfio-2025-12-01' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next



Cross-subsystem Changes:
- Add device specific vfio_pci driver variant for intel graphics (Michal Winiarski)

Driver Changes:
- Add scope-based cleanup helper for runtime PM (Matt Roper)
- Additional xe driver prerequisites and exports (Michal Winiarski)

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Link: https://patch.msgid.link/aS1bNpqeem6PIHrA@fedora
parents 0692602d 1f5556ec
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -27022,6 +27022,13 @@ L: virtualization@lists.linux.dev
S:	Maintained
F:	drivers/vfio/pci/virtio
VFIO XE PCI DRIVER
M:	Michał Winiarski <michal.winiarski@intel.com>
L:	kvm@vger.kernel.org
L:	intel-xe@lists.freedesktop.org
S:	Supported
F:	drivers/vfio/pci/xe
VGA_SWITCHEROO
R:	Lukas Wunner <lukas@wunner.de>
S:	Maintained
+4 −0
Original line number Diff line number Diff line
@@ -184,6 +184,10 @@ xe-$(CONFIG_PCI_IOV) += \
	xe_sriov_pf_sysfs.o \
	xe_tile_sriov_pf_debugfs.o

ifeq ($(CONFIG_PCI_IOV),y)
	xe-$(CONFIG_XE_VFIO_PCI) += xe_sriov_vfio.o
endif

# include helpers for tests even when XE is built-in
ifdef CONFIG_DRM_XE_KUNIT_TEST
xe-y += tests/xe_kunit_helpers.o
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include "xe_gt_sriov_pf_helpers.h"
#include "xe_gt_sriov_pf_migration.h"
#include "xe_gt_sriov_printk.h"
#include "xe_guc.h"
#include "xe_guc_buf.h"
#include "xe_guc_ct.h"
#include "xe_migrate.h"
@@ -1023,6 +1024,12 @@ static void action_ring_cleanup(void *arg)
	ptr_ring_cleanup(r, destroy_pf_packet);
}

static void pf_gt_migration_check_support(struct xe_gt *gt)
{
	if (GUC_FIRMWARE_VER(&gt->uc.guc) < MAKE_GUC_VER(70, 54, 0))
		xe_sriov_pf_migration_disable(gt_to_xe(gt), "requires GuC version >= 70.54.0");
}

/**
 * xe_gt_sriov_pf_migration_init() - Initialize support for VF migration.
 * @gt: the &xe_gt
@@ -1039,6 +1046,8 @@ int xe_gt_sriov_pf_migration_init(struct xe_gt *gt)

	xe_gt_assert(gt, IS_SRIOV_PF(xe));

	pf_gt_migration_check_support(gt);

	if (!pf_migration_supported(gt))
		return 0;

+17 −0
Original line number Diff line number Diff line
@@ -1223,6 +1223,23 @@ static struct pci_driver xe_pci_driver = {
#endif
};

/**
 * xe_pci_to_pf_device() - Get PF &xe_device.
 * @pdev: the VF &pci_dev device
 *
 * Return: pointer to PF &xe_device, NULL otherwise.
 */
struct xe_device *xe_pci_to_pf_device(struct pci_dev *pdev)
{
	struct drm_device *drm;

	drm = pci_iov_get_pf_drvdata(pdev, &xe_pci_driver);
	if (IS_ERR(drm))
		return NULL;

	return to_xe_device(drm);
}

int xe_register_pci_driver(void)
{
	return pci_register_driver(&xe_pci_driver);
+3 −0
Original line number Diff line number Diff line
@@ -6,7 +6,10 @@
#ifndef _XE_PCI_H_
#define _XE_PCI_H_

struct pci_dev;

int xe_register_pci_driver(void);
void xe_unregister_pci_driver(void);
struct xe_device *xe_pci_to_pf_device(struct pci_dev *pdev);

#endif
Loading