Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Piórkowski, Piotr" <piotr.piorkowski@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 1/4] drm/xe/vram: Add binding information to VRAM regions
Date: Fri, 21 Aug 2026 09:54:26 +0000	[thread overview]
Message-ID: <20260821095426.B6F161F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260821094601.607060-2-piotr.piorkowski@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The device-level aggregate VRAM region (`xe->mem.vram`) is left with an implicitly zeroed `binding` field, causing it to incorrectly identify as a tile-bound region for tile 0 and violating uniqueness constraints.
--

--- Patch [1]: [PATCH v2 1/4] drm/xe/vram: Add binding information to VRAM regions ---
commit c73dc6ee289feb3d1e22f53db84480b8a5bc094f
Author: Piotr Piórkowski <piotr.piorkowski@intel.com>
Subject: drm/xe/vram: Add binding information to VRAM regions

Add a binding field to VRAM regions and pass it at allocation time.
This allows distinguishing VRAM regions serving different purposes. It is
needed for future patches where different VRAM regions serve different
purposes, such as dedicated VRAM for kernel allocations.

> diff --git a/drivers/gpu/drm/xe/xe_vram_types.h b/drivers/gpu/drm/xe/xe_vram_types.h
> index 646e3c12ae9f7..51884e7a679d1 100644
> --- a/drivers/gpu/drm/xe/xe_vram_types.h
> +++ b/drivers/gpu/drm/xe/xe_vram_types.h
[ ... ]
> @@ -26,9 +34,11 @@ struct xe_vram_region {
>  	/**
>  	 * @id: VRAM region instance id
>  	 *
> -	 * The value should be unique for VRAM region.
> +	 * The value should be unique within a given binding.
>  	 */
>  	u8 id;
> +	/** @binding: VRAM region instance binding */
> +	enum xe_vram_binding binding;

[Severity: Medium]
Will this default initialization cause duplicate IDs for the aggregate device
VRAM region?

The aggregate VRAM region is allocated in
drivers/gpu/drm/xe/xe_device.c:xe_device_vram_alloc() using drmm_kzalloc(),
which zeroes the memory but doesn't explicitly initialize the binding or id
fields. Because XE_VRAM_BINDING_TILE is 0, xe->mem.vram implicitly defaults
to XE_VRAM_BINDING_TILE with an id of 0.

This appears to violate the new struct documentation stating that id should be
unique within a given binding, since both the aggregate region and the actual
tile 0 region will have id 0 and XE_VRAM_BINDING_TILE.

> diff --git a/drivers/gpu/drm/xe/xe_vram.c b/drivers/gpu/drm/xe/xe_vram.c
> index 23eb7edbdd572..e5f83df988263 100644
> --- a/drivers/gpu/drm/xe/xe_vram.c
> +++ b/drivers/gpu/drm/xe/xe_vram.c
[ ... ]
> @@ -217,11 +241,13 @@ static void print_vram_region_info(struct xe_device *xe, struct xe_vram_region *
>  		drm_info(drm, "Small BAR device\n");
>  
>  	drm_info(drm,
> -		 "VRAM[%u]: Actual physical size %pa, usable size exclude stolen %pa, CPU accessible size %pa\n",
> -		 vram->id, &vram->actual_physical_size, &vram->usable_size, &vram->io_size);
> -	drm_info(drm, "VRAM[%u]: DPA range: [%pa-%llx], io range: [%pa-%llx]\n",
> -		 vram->id, &vram->dpa_base, vram->dpa_base + (u64)vram->actual_physical_size,
> -		 &vram->io_start, vram->io_start + (u64)vram->io_size);
> +		 "%s[%u] VRAM region: Actual physical size %pa, usable size exclude stolen %pa, CPU accessible size %pa\n",
> +		 stringify_vram_binding(vram->binding), vram->id, &vram->actual_physical_size,
> +		 &vram->usable_size, &vram->io_size);

[Severity: Medium]
Will this cause print_vram_region_info() to print two identical
"Tile[0] VRAM region:" messages?

Since xe->mem.vram defaults to XE_VRAM_BINDING_TILE and id 0, it seems like we
would get one log for the actual tile and one for the device-level aggregated
sizes, both labeled as "Tile[0]".

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260821094601.607060-1-piotr.piorkowski@intel.com?part=1

  reply	other threads:[~2026-08-21  9:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  9:45 [PATCH v2 0/4] Introduce PF-mem VRAM regions Piórkowski, Piotr
2026-08-21  9:45 ` [PATCH v2 1/4] drm/xe/vram: Add binding information to " Piórkowski, Piotr
2026-08-21  9:54   ` sashiko-bot [this message]
2026-08-21  9:45 ` [PATCH v2 2/4] drm/xe/ttm: Add PF-mem VRAM placement types for TTM Piórkowski, Piotr
2026-08-21  9:46 ` [PATCH v2 3/4] drm/xe/vram: Add initial support for PF-mem regions Piórkowski, Piotr
2026-08-21  9:46 ` [PATCH v2 4/4] drm/xe/kunit: Add tests " Piórkowski, Piotr
2026-08-21  9:54   ` sashiko-bot
2026-08-21  9:52 ` ✗ CI.checkpatch: warning for Introduce PF-mem VRAM regions (rev2) Patchwork
2026-08-21  9:53 ` ✓ CI.KUnit: success " Patchwork
2026-08-21 10:16 ` [PATCH v2 0/4] Introduce PF-mem VRAM regions Matthew Auld
2026-08-21 10:33 ` ✓ Xe.CI.BAT: success for Introduce PF-mem VRAM regions (rev2) Patchwork
2026-08-21 11: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=20260821095426.B6F161F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=piotr.piorkowski@intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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