From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Michal Wajdeczko" <michal.wajdeczko@intel.com>,
"Michał Winiarski" <michal.winiarski@intel.com>
Subject: [PATCH v2 07/13] drm/xe/guc: Formalize Reserved KLVs
Date: Wed, 8 Jul 2026 00:08:09 +0200 [thread overview]
Message-ID: <20260707220816.677-8-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20260707220816.677-1-michal.wajdeczko@intel.com>
We have already started using few KLV keys from the 0xF000 range
that, as we have agreed with the GuC team, will not be used in any
GuC ABI actions. Add definitions for that reserved range and move
our migration KLVs to new ABI header.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
---
drivers/gpu/drm/xe/abi/guc_klvs_abi.h | 17 +++++++++++++
drivers/gpu/drm/xe/abi/xe_driver_klvs_abi.h | 27 +++++++++++++++++++++
drivers/gpu/drm/xe/xe_guc_klv_helpers.c | 14 +++++++++++
drivers/gpu/drm/xe/xe_sriov_packet.c | 7 ++----
4 files changed, 60 insertions(+), 5 deletions(-)
create mode 100644 drivers/gpu/drm/xe/abi/xe_driver_klvs_abi.h
diff --git a/drivers/gpu/drm/xe/abi/guc_klvs_abi.h b/drivers/gpu/drm/xe/abi/guc_klvs_abi.h
index 644f5a4226d7..2a313eb399e2 100644
--- a/drivers/gpu/drm/xe/abi/guc_klvs_abi.h
+++ b/drivers/gpu/drm/xe/abi/guc_klvs_abi.h
@@ -22,6 +22,7 @@
* | | | - `GuC Scheduling Policies KLVs`_ |
* | | | - `GuC VGT Policy KLVs`_ |
* | | | - `GuC VF Configuration KLVs`_ |
+ * | | | - `GuC Reserved KLVs`_ |
* | | | |
* | +-------+--------------------------------------------------------------+
* | | 15:0 | **LEN** - length of VALUE (in 32bit dwords) |
@@ -506,4 +507,20 @@ enum xe_guc_klv_ids {
GUC_WA_KLV_CLR_CS_INDIRECT_RING_STATE_IF_IDLE_AT_CTX_REG = 0x900e,
};
+/**
+ * DOC: GuC Reserved KLVs
+ *
+ * Range of `GuC KLV`_ keys reserved for internal use by the GuC that will
+ * never be part of the offcial GuC ABI and can be reused by the drivers.
+ *
+ * Currently this range includes 1024 keys starting from:
+ *
+ * _`GUC_KLV_RESERVED_RANGE_START` : 0xF000
+ *
+ * See `Xe Driver KLVs`_ for the KLVs that the Xe driver is currently using.
+ */
+
+#define GUC_KLV_RESERVED_RANGE_START 0xf000u
+#define GUC_KLV_RESERVED_RANGE_LEN 1024u
+
#endif
diff --git a/drivers/gpu/drm/xe/abi/xe_driver_klvs_abi.h b/drivers/gpu/drm/xe/abi/xe_driver_klvs_abi.h
new file mode 100644
index 000000000000..3b557e56892a
--- /dev/null
+++ b/drivers/gpu/drm/xe/abi/xe_driver_klvs_abi.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#ifndef _ABI_XE_DRIVER_KLVS_ABI_H
+#define _ABI_XE_DRIVER_KLVS_ABI_H
+
+#include "abi/guc_klvs_abi.h"
+
+/**
+ * DOC: Xe Driver KLVs
+ *
+ * The Xe driver uses the following keys from the `GuC Reserved KLVs`_ range:
+ *
+ * _`MIGRATION_KLV_DEVICE_DEVID_KEY` :
+ * PCI device ID of the migrated VF.
+ * _`MIGRATION_KLV_DEVICE_REVID_KEY` :
+ * PCI device revision ID of the migrated VF.
+ */
+
+#define MIGRATION_KLV_DEVICE_DEVID_KEY 0xf001u
+#define MIGRATION_KLV_DEVICE_DEVID_LEN 1u
+#define MIGRATION_KLV_DEVICE_REVID_KEY 0xf002u
+#define MIGRATION_KLV_DEVICE_REVID_LEN 1u
+
+#endif
diff --git a/drivers/gpu/drm/xe/xe_guc_klv_helpers.c b/drivers/gpu/drm/xe/xe_guc_klv_helpers.c
index 723fc6894c37..9225a9066b8a 100644
--- a/drivers/gpu/drm/xe/xe_guc_klv_helpers.c
+++ b/drivers/gpu/drm/xe/xe_guc_klv_helpers.c
@@ -8,6 +8,7 @@
#include <drm/drm_print.h>
#include "abi/guc_klvs_abi.h"
+#include "abi/xe_driver_klvs_abi.h"
#include "xe_guc_klv_helpers.h"
#include "xe_guc_klv_thresholds_set.h"
@@ -19,6 +20,11 @@ static bool is_group_key(u16 key)
return false;
}
+static bool is_reserved_key(u16 key)
+{
+ return in_range(key, GUC_KLV_RESERVED_RANGE_START, GUC_KLV_RESERVED_RANGE_LEN);
+}
+
/**
* xe_guc_klv_key_to_string - Convert KLV key into friendly name.
* @key: the `GuC KLV`_ key
@@ -78,7 +84,15 @@ const char *xe_guc_klv_key_to_string(u16 key)
MAKE_XE_GUC_KLV_THRESHOLDS_SET(define_threshold_key_to_string_case)
#undef define_threshold_key_to_string_case
+ /* driver KLVs */
+ case MIGRATION_KLV_DEVICE_DEVID_KEY:
+ return "migration_devid";
+ case MIGRATION_KLV_DEVICE_REVID_KEY:
+ return "migration_revid";
+
default:
+ if (is_reserved_key(key))
+ return "(reserved)";
return "(unknown)";
}
}
diff --git a/drivers/gpu/drm/xe/xe_sriov_packet.c b/drivers/gpu/drm/xe/xe_sriov_packet.c
index 2ae9eff2a7c0..e581e8e6c1d1 100644
--- a/drivers/gpu/drm/xe/xe_sriov_packet.c
+++ b/drivers/gpu/drm/xe/xe_sriov_packet.c
@@ -3,6 +3,8 @@
* Copyright © 2025 Intel Corporation
*/
+#include "abi/xe_driver_klvs_abi.h"
+
#include "xe_bo.h"
#include "xe_device.h"
#include "xe_guc_klv_helpers.h"
@@ -352,11 +354,6 @@ ssize_t xe_sriov_packet_write_single(struct xe_device *xe, unsigned int vfid,
return copied;
}
-#define MIGRATION_KLV_DEVICE_DEVID_KEY 0xf001u
-#define MIGRATION_KLV_DEVICE_DEVID_LEN 1u
-#define MIGRATION_KLV_DEVICE_REVID_KEY 0xf002u
-#define MIGRATION_KLV_DEVICE_REVID_LEN 1u
-
#define MIGRATION_DESCRIPTOR_DWORDS (GUC_KLV_LEN_MIN + MIGRATION_KLV_DEVICE_DEVID_LEN + \
GUC_KLV_LEN_MIN + MIGRATION_KLV_DEVICE_REVID_LEN)
static int pf_descriptor_init(struct xe_device *xe, unsigned int vfid)
--
2.47.1
next prev parent reply other threads:[~2026-07-07 22:08 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 22:08 [PATCH v2 00/13] drm/xe: Add and use more KLV helpers Michal Wajdeczko
2026-07-07 22:08 ` [PATCH v2 01/13] drm/xe/guc: Allow to print single KLV Michal Wajdeczko
2026-07-07 22:08 ` [PATCH v2 02/13] drm/xe/guc: Prepare to print group KLVs Michal Wajdeczko
2026-07-07 22:08 ` [PATCH v2 03/13] drm/xe/guc: Add basic KLV encoding helpers Michal Wajdeczko
2026-07-07 22:08 ` [PATCH v2 04/13] drm/xe/guc: Add string KLV encoding helper Michal Wajdeczko
2026-07-09 12:51 ` Michał Winiarski
2026-07-07 22:08 ` [PATCH v2 05/13] drm/xe/guc: Add object " Michal Wajdeczko
2026-07-09 12:53 ` Michał Winiarski
2026-07-07 22:08 ` [PATCH v2 06/13] drm/xe/guc: Add KLV parsing helper Michal Wajdeczko
2026-07-07 22:08 ` Michal Wajdeczko [this message]
2026-07-10 17:25 ` [PATCH v3 07/13] drm/xe/guc: Formalize Reserved KLVs Michal Wajdeczko
2026-07-07 22:08 ` [PATCH v2 08/13] drm/xe/tests: Add GuC KLV helpers basic tests Michal Wajdeczko
2026-07-07 22:08 ` [PATCH v2 09/13] drm/xe/tests: Add string encoding helper test Michal Wajdeczko
2026-07-08 18:07 ` [PATCH v3 " Michal Wajdeczko
2026-07-07 22:08 ` [PATCH v2 10/13] drm/xe/tests: Add object " Michal Wajdeczko
2026-07-10 19:59 ` [PATCH v3 " Michal Wajdeczko
2026-07-07 22:08 ` [PATCH v2 11/13] drm/xe/tests: Add GuC KLV printer test Michal Wajdeczko
2026-07-11 7:36 ` [PATCH v3 " Michal Wajdeczko
2026-07-07 22:08 ` [PATCH v2 12/13] drm/xe/tests: Add migration packet test Michal Wajdeczko
2026-07-08 18:09 ` [PATCH v3 " Michal Wajdeczko
2026-07-07 22:08 ` [PATCH v2 13/13] drm/xe/pf: Handle migration descriptor using KLV helpers Michal Wajdeczko
2026-07-07 22:16 ` ✗ CI.checkpatch: warning for drm/xe: Add and use more KLV helpers (rev2) Patchwork
2026-07-07 22:18 ` ✓ CI.KUnit: success " Patchwork
2026-07-07 23:04 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-08 0:20 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-08 19:04 ` ✗ CI.checkpatch: warning for drm/xe: Add and use more KLV helpers (rev4) Patchwork
2026-07-08 19:05 ` ✓ CI.KUnit: success " Patchwork
2026-07-08 19:55 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-08 23:56 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-10 17:31 ` ✗ CI.checkpatch: warning for drm/xe: Add and use more KLV helpers (rev5) Patchwork
2026-07-10 17:32 ` ✓ CI.KUnit: success " Patchwork
2026-07-10 18:22 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-11 4:04 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-11 7:42 ` ✗ CI.checkpatch: warning for drm/xe: Add and use more KLV helpers (rev7) Patchwork
2026-07-11 7:43 ` ✓ CI.KUnit: success " Patchwork
2026-07-11 8:18 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-11 11:12 ` ✓ Xe.CI.FULL: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260707220816.677-8-michal.wajdeczko@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.winiarski@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox