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 4/7] drm/xe: Introduce helpers for xe_vram size
Date: Wed, 12 Aug 2026 12:55:15 +0000	[thread overview]
Message-ID: <20260812125516.1C9CC1F00ACA@smtp.kernel.org> (raw)
In-Reply-To: <20260812124313.1377582-13-satyanarayana.k.v.p@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] `query_mem_regions()` now reports VRAM `min_page_size` as `SZ_4K` instead of `PAGE_SIZE` on architectures with `PAGE_SIZE > 4K`, leading to userspace allocation failures.
--

--- Patch [4]: [PATCH v6 4/7] drm/xe: Introduce helpers for xe_vram size ---
commit 8d2aa91dbef321fc3453eaed963150727bdc7dd0
Author: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>

drm/xe: Introduce helpers for xe_vram size

This commit introduces xe_vram_alignment() and xe_vram_needs_64k() helpers.
It updates various files in the xe driver to use these new helpers instead of
directly checking the XE_VRAM_FLAGS_NEED64K flag.

> diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
> index dc975f5953683..9af98f08b0e59 100644
> --- a/drivers/gpu/drm/xe/xe_query.c
> +++ b/drivers/gpu/drm/xe/xe_query.c
> @@ -289,8 +289,7 @@ static int query_mem_regions(struct xe_device *xe,
>  			mem_regions->mem_regions[mem_regions->num_mem_regions].instance =
>  				mem_regions->num_mem_regions;
>  			mem_regions->mem_regions[mem_regions->num_mem_regions].min_page_size =
> -				xe->info.vram_flags & XE_VRAM_FLAGS_NEED64K ?
> -				SZ_64K : PAGE_SIZE;
> +				xe_vram_alignment(xe);

[Severity: High]
Does this code report the minimum page size correctly on architectures where
PAGE_SIZE is greater than 4K?

The previous code returned PAGE_SIZE when 64K alignment was not needed, but
xe_vram_alignment() now always returns SZ_4K in that case.

If userspace uses this 4K value to size its allocations, could those
allocations be rejected in xe_gem_create_ioctl()?

drivers/gpu/drm/xe/xe_bo.c:xe_gem_create_ioctl() {
        ...
        if (XE_IOCTL_DBG(xe, args->size & ~PAGE_MASK))
                return -EINVAL;
        ...
}

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

  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 [this message]
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
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=20260812125516.1C9CC1F00ACA@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.