All of lore.kernel.org
 help / color / mirror / Atom feed
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 v6 7/7] drm/xe/tests: Add KUnit tests for VF provisioning error handling
Date: Wed, 12 Aug 2026 13:00:53 +0000	[thread overview]
Message-ID: <20260812130053.EFABB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812124313.1377582-16-satyanarayana.k.v.p@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The GGTT initialization path skips alignment validation and performs partial state updates before validation completes, which the new KUnit tests fail to detect.
--

--- Patch [7]: [PATCH v6 7/7] drm/xe/tests: Add KUnit tests for VF provisioning error handling ---
commit 5074ef2c8cf15b0dd4c9cdf94819ab386e4100b7
Author: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>

drm/xe/tests: Add KUnit tests for VF provisioning error handling

This commit adds KUnit test cases for VF provisioning error handling. It
uses the xe_guc_mmio_send_recv() stub to inject bad KLV responses and
verifies that the VF can handle invalid configuration data.

> 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..8cb7f3cebb311
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/tests/xe_gt_sriov_vf_kunit.c
[ ... ]
> +struct config_ggtt {
> +	u64 start_orig;
> +	u64 start_query;
> +	u64 size_orig;
> +	u64 size_query;
> +	int expected_ret;
> +	int ret;
> +	int flags;
> +	const char *name;
> +} vf_ggtt_testcase[] = {
[ ... ]
> +	{
> +		.start_orig = TEST_GGTT_START,		.start_query = TEST_GGTT_START,
> +		.size_orig = TEST_GGTT_SIZE - SZ_2K,	.size_query = TEST_GGTT_SIZE - SZ_2K,
> +		.expected_ret = -EINVAL,		.flags = 0,
> +		.name = "unaligned_size_4K",
> +
> +	},

[Severity: High]
This is a pre-existing issue, but the new KUnit tests unintentionally mask
a bug in the early return path of vf_get_ggtt_info().

By setting size_orig to a non-zero value (TEST_GGTT_SIZE - SZ_2K) in this
unaligned test case, the test avoids the initial provisioning path. If
size_orig was set to 0 (which reflects the actual initial provisioning state),
the test would fail because vf_get_ggtt_info() incorrectly returns 0 instead
of -EINVAL.

Looking at vf_get_ggtt_info() in drivers/gpu/drm/xe/xe_gt_sriov_vf.c:

	xe_tile_sriov_vf_ggtt_base_store(tile, start);
	ggtt_size = xe_tile_sriov_vf_ggtt(tile);
	if (!ggtt_size) {
		/* ... */
		xe_tile_sriov_vf_ggtt_store(tile, size);
		return 0;
	}

During initial provisioning (when ggtt_size is 0), unvalidated start and size
values are stored and the function returns early, completely bypassing the
IS_ALIGNED validation checks that occur later in the function.

Should the alignment checks in vf_get_ggtt_info() be moved before this early
return, and should these KUnit tests be updated to include scenarios where
size_orig is 0 to verify the initial provisioning path?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812124313.1377582-9-satyanarayana.k.v.p@intel.com?part=7

  reply	other threads:[~2026-08-12 17:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 12:43 [PATCH v6 0/7] KUnit test for VF provisioning error handling Satyanarayana K V P
2026-08-12 12:43 ` [PATCH v6 1/7] drm/xe/guc: Allow to replace xe_guc_mmio_send_recv() with KUNIT stub Satyanarayana K V P
2026-08-12 12:43 ` [PATCH v6 2/7] drm/xe/vf: Split submission config query helpers Satyanarayana K V P
2026-08-12 12:43 ` [PATCH v6 3/7] drm/xe/vf: Add bounds checking for queried context and doorbell counts Satyanarayana K V P
2026-08-12 12:43 ` [PATCH v6 4/7] drm/xe: Introduce helpers for xe_vram size Satyanarayana K V P
2026-08-12 12:55   ` sashiko-bot
2026-08-12 12:43 ` [PATCH v6 5/7] drm/xe/vf: Add bounds checking for queried GGTT base and size Satyanarayana K V P
2026-08-12 12:55   ` sashiko-bot
2026-08-12 12:43 ` [PATCH v6 6/7] drm/xe/vf: Add bounds checking for queried VRAM size Satyanarayana K V P
2026-08-12 13:02   ` sashiko-bot
2026-08-12 12:43 ` [PATCH v6 7/7] drm/xe/tests: Add KUnit tests for VF provisioning error handling Satyanarayana K V P
2026-08-12 13:00   ` sashiko-bot [this message]
2026-08-12 13:18 ` ✗ CI.checkpatch: warning for KUnit test for VF provisioning error handling (rev6) Patchwork
2026-08-12 13:19 ` ✓ CI.KUnit: success " Patchwork
2026-08-12 14:20 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-12 18:27 ` ✓ 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=20260812130053.EFABB1F000E9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.