Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/xe_mmap: sanity check partial munmap
@ 2023-12-07 15:25 Matthew Auld
  2023-12-07 19:42 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matthew Auld @ 2023-12-07 15:25 UTC (permalink / raw)
  To: igt-dev

Make sure we have some basic coverage for partial munmap, since this can
lead to multiple vm_close calls per mmap, and therefore anything we do
in vm_close should be mirrored in vm_open, otherwise we should expect
explosions.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Badal Nilawar <badal.nilawar@intel.com>
---
 tests/intel/xe_mmap.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/intel/xe_mmap.c b/tests/intel/xe_mmap.c
index 63fdf46a8..8faacdb5c 100644
--- a/tests/intel/xe_mmap.c
+++ b/tests/intel/xe_mmap.c
@@ -57,7 +57,12 @@ test_mmap(int fd, uint32_t placement, uint32_t flags)
 
 	map = xe_bo_map(fd, bo, bo_size);
 	strcpy(map, "Write some data to the BO!");
+	munmap(map, bo_size);
 
+	/* Also try partial munmap */
+	map = xe_bo_map(fd, bo, bo_size);
+	munmap(map, bo_size/2);
+	strcpy(map + bo_size/2, "More data to the BO!");
 	munmap(map, bo_size);
 
 	gem_close(fd, bo);
-- 
2.43.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-08  6:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-07 15:25 [PATCH i-g-t] tests/intel/xe_mmap: sanity check partial munmap Matthew Auld
2023-12-07 19:42 ` ✓ Fi.CI.BAT: success for " Patchwork
2023-12-07 21:09 ` ✗ CI.xeBAT: failure " Patchwork
2023-12-08  6:30 ` ✗ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox