From: Brajesh Gupta <brajesh.gupta@imgtec.com>
To: Development mailing list for IGT GPU Tools
<igt-dev@lists.freedesktop.org>
Cc: Alessio Belle <alessio.belle@imgtec.com>,
Brajesh Gupta <brajesh.gupta@imgtec.com>,
Luigi Santivetti <luigi.santivetti@imgtec.com>
Subject: [PATCH i-g-t 1/3] tests/imagination: Add padding field validation for map/unmap IOCTLs
Date: Wed, 2 Dec 2026 12:04:05 +0530 [thread overview]
Message-ID: <20261202-padding_test-v1-1-250ffd4c6da2@imgtec.com> (raw)
In-Reply-To: <20261202-padding_test-v1-0-250ffd4c6da2@imgtec.com>
Add a new subtest to validate map and unmap IOCTLs failure for a
non-zero padding field.
Signed-off-by: Brajesh Gupta <brajesh.gupta@imgtec.com>
---
tests/imagination/pvr_vm_map.c | 47 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/tests/imagination/pvr_vm_map.c b/tests/imagination/pvr_vm_map.c
index c74cc4f62..dc6d1d6f5 100644
--- a/tests/imagination/pvr_vm_map.c
+++ b/tests/imagination/pvr_vm_map.c
@@ -190,4 +190,51 @@ int igt_main()
remap_range(fd, addr, size, addr + size / 2, size / 4);
}
}
+
+ igt_describe("Padding field validation for map IOCTL");
+ igt_subtest("map-padding-non-zero-failure") {
+ size_t bo_size = LEAK_BO_SIZE;
+ const uint64_t addr = align_up(heap.base, SZ_2M) + SZ_1M;
+ const uint32_t handle = igt_pvr_ioctl_create_bo(fd, &bo_size);
+ const uint32_t vm_ctx = igt_pvr_ioctl_create_vm_context(fd, 0);
+
+ struct drm_pvr_ioctl_vm_map_args map_arg = {
+ .vm_context_handle = vm_ctx,
+ .flags = 0,
+ .device_addr = addr,
+ .handle = handle,
+ .offset = 0,
+ .size = bo_size,
+ ._padding_14 = 1,
+ };
+
+ do_ioctl_err(fd, DRM_IOCTL_PVR_VM_MAP, &map_arg, EINVAL);
+
+ gem_close(fd, handle);
+ igt_pvr_ioctl_destroy_vm_context(fd, vm_ctx, 0);
+ }
+
+ igt_describe("Padding field validation for unmap IOCTL");
+ igt_subtest("unmap-padding-non-zero-failure") {
+ size_t bo_size = LEAK_BO_SIZE;
+ const uint64_t addr = align_up(heap.base, SZ_2M) + SZ_1M;
+ const uint32_t handle = igt_pvr_ioctl_create_bo(fd, &bo_size);
+ const uint32_t vm_ctx = igt_pvr_ioctl_create_vm_context(fd, 0);
+
+ struct drm_pvr_ioctl_vm_unmap_args unmap_arg = {
+ .vm_context_handle = vm_ctx,
+ ._padding_4 = 1,
+ .device_addr = addr,
+ .size = bo_size,
+ };
+
+ igt_pvr_ioctl_vm_map(fd, vm_ctx, handle, addr, 0, bo_size);
+ do_ioctl_err(fd, DRM_IOCTL_PVR_VM_UNMAP, &unmap_arg, EINVAL);
+
+ /* Unmap the memory */
+ igt_pvr_ioctl_vm_unmap(fd, vm_ctx, addr, bo_size);
+
+ gem_close(fd, handle);
+ igt_pvr_ioctl_destroy_vm_context(fd, vm_ctx, 0);
+ }
}
--
2.43.0
next prev parent reply other threads:[~2026-12-02 6:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 6:34 [PATCH i-g-t 0/3] tests/imagination: Add padding field validation test for IOCTLs Brajesh Gupta
2026-12-02 6:34 ` Brajesh Gupta [this message]
2026-12-02 6:34 ` [PATCH i-g-t 2/3] tests/imagination: Add padding field validation for destroy context IOCTL Brajesh Gupta
2026-12-02 6:34 ` [PATCH i-g-t 3/3] tests/imagination: Validate padding fields in FW/GPU info IOCTLs Brajesh Gupta
2026-12-02 7:38 ` ✓ Xe.CI.BAT: success for tests/imagination: Add padding field validation test for IOCTLs Patchwork
2026-12-02 7:50 ` ✗ i915.CI.BAT: 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=20261202-padding_test-v1-1-250ffd4c6da2@imgtec.com \
--to=brajesh.gupta@imgtec.com \
--cc=alessio.belle@imgtec.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=luigi.santivetti@imgtec.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