From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>,
<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v5 5/6] drm/xe/vf: Add bounds checking for queried VRAM size
Date: Tue, 11 Aug 2026 11:48:07 +0200 [thread overview]
Message-ID: <cd8aecc0-b9e3-42e8-bb4f-b29448cfd790@intel.com> (raw)
In-Reply-To: <20260810101428.1009573-13-satyanarayana.k.v.p@intel.com>
On 8/10/2026 12:14 PM, Satyanarayana K V P wrote:
> Add explicit bounds checks for VRAM size which can detect and reject
> invalid configuration data from a misconfigured or malfunctioning PF,
> preventing protocol violations and protecting VF initialization.
>
> Signed-off-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> V4 -> V5:
> - New commit.
> ---
> drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> index 65e48f135801..6c1878e4b1b2 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> @@ -575,7 +575,7 @@ static int vf_get_lmem_info(struct xe_gt *gt)
> return err;
>
> lmem_size = xe_tile_sriov_vf_lmem(tile);
> - if (lmem_size && lmem_size != size) {
> + if ((lmem_size && lmem_size != size) || (size % SZ_2M)) {
IS_ALIGNED(size, SZ_2M)
and since those are two different conditions, they deserve different
error codes and different message (-EREMCHG for reassignment and
-EPROTO or maybe better -EINVAL if unaligned)
> xe_gt_sriov_err(gt, "Unexpected LMEM reassignment: %lluM != %lluM\n",
> size / SZ_1M, lmem_size / SZ_1M);
> return -EREMCHG;
next prev parent reply other threads:[~2026-08-11 9:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 10:14 [PATCH v5 0/6] KUnit test for VF provisioning error handling Satyanarayana K V P
2026-08-10 10:14 ` [PATCH v5 1/6] drm/xe/guc: Allow to replace xe_guc_mmio_send_recv() with KUNIT stub Satyanarayana K V P
2026-08-11 8:54 ` Michal Wajdeczko
2026-08-10 10:14 ` [PATCH v5 2/6] drm/xe/vf: Split submission config query helpers Satyanarayana K V P
2026-08-11 9:02 ` Michal Wajdeczko
2026-08-10 10:14 ` [PATCH v5 3/6] drm/xe/vf: Add bounds checking for queried context and doorbell counts Satyanarayana K V P
2026-08-11 9:04 ` Michal Wajdeczko
2026-08-10 10:14 ` [PATCH v5 4/6] drm/xe/vf: Add bounds checking for queried GGTT base and size Satyanarayana K V P
2026-08-11 9:43 ` Michal Wajdeczko
2026-08-10 10:14 ` [PATCH v5 5/6] drm/xe/vf: Add bounds checking for queried VRAM size Satyanarayana K V P
2026-08-11 9:48 ` Michal Wajdeczko [this message]
2026-08-10 10:14 ` [PATCH v5 6/6] drm/xe/tests: Add KUnit tests for VF provisioning error handling Satyanarayana K V P
2026-08-11 10:12 ` Michal Wajdeczko
2026-08-10 10:18 ` ✗ CI.checkpatch: warning for KUnit test for VF provisioning error handling (rev5) Patchwork
2026-08-10 10:19 ` ✓ CI.KUnit: success " Patchwork
2026-08-10 11:01 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-10 13:16 ` ✗ Xe.CI.FULL: failure " 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=cd8aecc0-b9e3-42e8-bb4f-b29448cfd790@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--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