All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>,
	Lukasz Laguna <lukasz.laguna@intel.com>,
	Matthew Auld <matthew.auld@intel.com>
Subject: [PATCH i-g-t] tests/intel/xe_mmap: Fix truncation of visible VRAM size
Date: Mon, 29 Sep 2025 16:25:23 +0200	[thread overview]
Message-ID: <20250929142523.525117-1-marcin.bernatowicz@linux.intel.com> (raw)

xe_visible_vram_size() returns a 64-bit value. Storing it in 32-bit
truncated sizes above 4 GiB and led to false positives.

Fixes: c93b4e6ff2f3 ("tests/xe/mmap: sanity check small-bar")
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
---
 tests/intel/xe_mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/intel/xe_mmap.c b/tests/intel/xe_mmap.c
index 9b87a9534..79c611f52 100644
--- a/tests/intel/xe_mmap.c
+++ b/tests/intel/xe_mmap.c
@@ -291,7 +291,7 @@ static void trap_sigbus(uint32_t *ptr)
 static void test_small_bar(int fd)
 {
 	size_t page_size = xe_get_default_alignment(fd);
-	uint32_t visible_size = xe_visible_vram_size(fd, 0);
+	uint64_t visible_size = xe_visible_vram_size(fd, 0);
 	uint32_t bo;
 	uint64_t mmo;
 	uint32_t *map;
-- 
2.31.1


             reply	other threads:[~2025-09-29 14:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29 14:25 Marcin Bernatowicz [this message]
2025-09-29 14:58 ` [PATCH i-g-t] tests/intel/xe_mmap: Fix truncation of visible VRAM size Matthew Auld
2025-09-29 17:44 ` ✓ i915.CI.BAT: success for " Patchwork
2025-09-29 17:49 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-29 19:01 ` ✓ Xe.CI.Full: " Patchwork
2025-09-29 22:12 ` ✗ i915.CI.Full: failure " Patchwork
2025-09-30  8:05   ` Bernatowicz, Marcin

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=20250929142523.525117-1-marcin.bernatowicz@linux.intel.com \
    --to=marcin.bernatowicz@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lukasz.laguna@intel.com \
    --cc=matthew.auld@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.