From: Ian Rogers <irogers@google.com>
To: "Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
Elkin Cruz <elkin@google.com>, Ian Rogers <irogers@google.com>
Subject: [PATCH] drm/xe/svm: Initialize xpagemap to NULL in xe_svm_get_pagemaps()
Date: Thu, 19 Nov 2026 09:07:16 -0800 [thread overview]
Message-ID: <20261119170716.1523667-1-irogers@google.com> (raw)
On integrated Intel Xe GPUs (!IS_DGFX), xe->info.mem_region_mask has no
per-tile VRAM bits set, so every iteration of for_each_tile() in
xe_svm_get_pagemaps() hits 'continue' without assigning 'xpagemap'. The
post-loop IS_ERR(xpagemap) check then evaluates an uninitialized stack
pointer on every fault/SVM VM creation.
Initialize 'xpagemap' to NULL so IS_ERR(xpagemap) evaluates false when no
VRAM regions exist.
Found via an x86_64 LLVM=1 (Clang 21.1.8) allyesconfig audit with
-Wconditional-uninitialized enabled; fix and changelog drafted with an AI
coding assistant. Build-tested under LLVM=1 W=1 (-Werror) and
-Wconditional-uninitialized; not runtime-tested on Intel Xe hardware.
Fixes: 8a52f4d9b1ef ("drm/xe: Use the drm_pagemap cache and shrinker")
Signed-off-by: Ian Rogers <irogers@google.com>
---
drivers/gpu/drm/xe/xe_svm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c
index bc6902b5bf57..22cc7ed19d8a 100644
--- a/drivers/gpu/drm/xe/xe_svm.c
+++ b/drivers/gpu/drm/xe/xe_svm.c
@@ -2055,7 +2055,7 @@ xe_pagemap_find_or_create(struct xe_device *xe, struct drm_pagemap_cache *cache,
static int xe_svm_get_pagemaps(struct xe_vm *vm)
{
struct xe_device *xe = vm->xe;
- struct xe_pagemap *xpagemap;
+ struct xe_pagemap *xpagemap = NULL;
struct xe_tile *tile;
int id;
--
2.56.1.708.g77570a6a1d-goog
next reply other threads:[~2026-11-19 17:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 17:07 Ian Rogers [this message]
2026-11-19 17:24 ` Thomas Hellström
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=20261119170716.1523667-1-irogers@google.com \
--to=irogers@google.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=elkin@google.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.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
all inboxes | Powered by JetHome®