From: sashiko-bot@kernel.org
To: "Satyanarayana K V P" <satyanarayana.k.v.p@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v9 10/10] drm/xe/tests: Add KUnit tests for VF provisioning error handling
Date: Fri, 18 Sep 2026 10:37:35 +0000 [thread overview]
Message-ID: <20260918103735.894931F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260918100533.567225-22-satyanarayana.k.v.p@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] xe/tests: incorrect ABI macros used for KLV response length in stubs
--
commit c0ab3b2485a7858871113ee1bceb9e8d26f059a2
Author: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
drm/xe/tests: Add KUnit tests for VF provisioning error handling
VF relies on the PF to provide a valid hardware configuration via GuC
KLV responses. This commit adds KUnit test cases that use the
xe_guc_mmio_send_recv() stub to inject bad KLV responses to verify the
VF error handling.
> diff --git a/drivers/gpu/drm/xe/tests/xe_gt_sriov_vf_kunit.c b/drivers/gpu/drm/xe/tests/xe_gt_sriov_vf_kunit.c
> new file mode 100644
> index 0000000000000..5202ef804240c
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/tests/xe_gt_sriov_vf_kunit.c
> @@ -0,0 +1,666 @@
[ ... ]
> +static inline void fill_resp_buff(u32 *response, u64 query, size_t type)
> +{
> + if (type == sizeof(u32)) {
> + response[0] = sizeof(u32) / sizeof(u32);
> + response[1] = query;
> + } else if (type == sizeof(u64)) {
> + response[0] = sizeof(u64) / sizeof(u32);
[Severity: Low]
Does this code bypass the ABI bitfield macros? Direct integer assignment
circumvents the VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_0_LENGTH and MBZ
macros for constructing the response header, which might make the test
fragile to future ABI changes.
> + response[1] = lower_32_bits(query);
> + response[2] = upper_32_bits(query);
> + }
> +}
[ ... ]
> +static int xe_guc_mmio_send_recv_stub_ggtt(struct xe_guc *guc, const u32 *request,
> + u32 len, u32 *response_buf)
> +{
> + struct kunit *test = kunit_get_current_test();
> + const struct config_ggtt *c = test->param_value;
> + u32 key;
> +
> + if (c->ret)
> + return c->ret;
> +
> + KUNIT_ASSERT_EQ(test, FIELD_GET(GUC_HXG_REQUEST_MSG_0_ACTION, request[0]),
> + GUC_ACTION_VF2GUC_QUERY_SINGLE_KLV);
> + KUNIT_ASSERT_EQ(test, len, VF2GUC_QUERY_SINGLE_KLV_REQUEST_MSG_LEN);
> + key = FIELD_GET(VF2GUC_QUERY_SINGLE_KLV_REQUEST_MSG_1_KEY, request[1]);
> + KUNIT_ASSERT_TRUE(test,
> + key == GUC_KLV_VF_CFG_GGTT_START_KEY ||
> + key == GUC_KLV_VF_CFG_GGTT_SIZE_KEY);
> +
> + response_buf[0] = FIELD_PREP(GUC_HXG_RESPONSE_MSG_0_DATA0,
> + sizeof(u64) / sizeof(u32));
[Severity: Low]
Does this code use the correct macro for the KLV length field? It uses
GUC_HXG_RESPONSE_MSG_0_DATA0, which appears to belong to a different message
type (HXG AUX data) instead of VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_0_LENGTH.
While it happens to work, it seems to bypass the ABI definition.
> + if (key == GUC_KLV_VF_CFG_GGTT_START_KEY) {
> + response_buf[1] = lower_32_bits(c->query.start);
> + response_buf[2] = upper_32_bits(c->query.start);
> + } else if (key == GUC_KLV_VF_CFG_GGTT_SIZE_KEY) {
> + response_buf[1] = lower_32_bits(c->query.size);
> + response_buf[2] = upper_32_bits(c->query.size);
> + }
> +
> + return 0;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260918100533.567225-12-satyanarayana.k.v.p@intel.com?part=10
next prev parent reply other threads:[~2026-09-18 10:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 10:05 [PATCH v9 00/10] KUnit test for VF provisioning error handling Satyanarayana K V P
2026-09-18 10:05 ` [PATCH v9 01/10] drm/xe/guc: Allow to replace xe_guc_mmio_send_recv() with KUNIT stub Satyanarayana K V P
2026-09-18 10:05 ` [PATCH v9 02/10] drm/xe/vf: Split submission config query helpers Satyanarayana K V P
2026-09-18 10:05 ` [PATCH v9 03/10] drm/xe/vf: Add bounds checking for queried context and doorbell counts Satyanarayana K V P
2026-09-18 10:05 ` [PATCH v9 04/10] drm/xe: Introduce helpers for VRAM alignment Satyanarayana K V P
2026-09-18 10:05 ` [PATCH v9 05/10] drm/xe/ggtt: Avoid integer overflow when validating VF GGTT range Satyanarayana K V P
2026-09-18 10:05 ` [PATCH v9 06/10] drm/xe/vf: Add bounds checking for queried GGTT base and size Satyanarayana K V P
2026-09-18 10:05 ` [PATCH v9 07/10] drm/xe/pf: Align VF GGTT allocations to PAGE_SIZE Satyanarayana K V P
2026-09-18 10:41 ` sashiko-bot
2026-09-18 10:05 ` [PATCH v9 08/10] drm/xe/vf: Add alignment check for queried VRAM size Satyanarayana K V P
2026-09-18 10:05 ` [PATCH v9 09/10] drm/xe/ggtt: Add KUNIT stub for xe_ggtt_shift_nodes() Satyanarayana K V P
2026-09-18 10:05 ` [PATCH v9 10/10] drm/xe/tests: Add KUnit tests for VF provisioning error handling Satyanarayana K V P
2026-09-18 10:37 ` sashiko-bot [this message]
2026-09-18 10:12 ` ✗ CI.checkpatch: warning for KUnit test for VF provisioning error handling (rev9) Patchwork
2026-09-18 10:14 ` ✓ CI.KUnit: success " Patchwork
2026-09-18 10:53 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-18 19:43 ` ✓ 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=20260918103735.894931F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=satyanarayana.k.v.p@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