From: Andi Shyti <andi.shyti@linux.intel.com>
To: Krzysztof Niemiec <krzysztof.niemiec@intel.com>
Cc: igt-dev@lists.freedesktop.org,
Kamil Konieczny <kamil.konieczny@linux.intel.com>,
Chris Wilson <chris.p.wilson@linux.intel.com>,
Andi Shyti <andi.shyti@linux.intel.com>,
Nirmoy Das <nirmoy.das@intel.com>,
Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
Jann Horn <jannh@google.com>
Subject: Re: [PATCH i-g-t v2 2/3] tests/intel/gem_mmap_offset: Introduce mmap-boundaries test
Date: Wed, 21 Aug 2024 16:22:52 +0200 [thread overview]
Message-ID: <ZsX4PDQockKH0q3A@ashyti-mobl2.lan> (raw)
In-Reply-To: <20240821135943.31340-3-krzysztof.niemiec@intel.com>
Hi Krzysztof,
few nitpicks.
On Wed, Aug 21, 2024 at 03:59:42PM +0200, Krzysztof Niemiec wrote:
> Introduce the mmap-boundaries test, which checks if mmap() correctly
> calculates memory boundaries during the mapping.
>
> Signed-off-by: Krzysztof Niemiec <krzysztof.niemiec@intel.com>
> ---
> tests/intel/gem_mmap_offset.c | 37 +++++++++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> diff --git a/tests/intel/gem_mmap_offset.c b/tests/intel/gem_mmap_offset.c
> index 80ac8dc01..73adaaa98 100644
> --- a/tests/intel/gem_mmap_offset.c
> +++ b/tests/intel/gem_mmap_offset.c
> @@ -63,6 +63,7 @@
> * SUBTEST: perf
> * SUBTEST: pf-nonblock
> * SUBTEST: ptrace
> + * SUBTEST: mmap-boundaries
I think these are sorted alphabetically.
> *
> */
>
> @@ -989,6 +990,34 @@ static void partial_remap(int i915, struct gem_memory_region *r)
> gem_close(i915, handle);
> }
>
> +/* This test's failure is detected by checking the dmesg. */
> +
please remove this blank line.
> +static void test_mmap_boundaries(int i915, struct gem_memory_region *r)
> +{
> + const uint64_t map_size = SZ_128M - SZ_512K;
> + uint32_t handle;
> +
> + handle = gem_create_in_memory_region_list(i915, SZ_2G, 0, &r->ci, 1);
> + make_resident(i915, 0, handle);
> +
> + for_each_mmap_offset_type(i915, t) {
> + uint8_t *map;
> +
> + map = __mmap_offset(i915, handle, 0, map_size,
> + PROT_READ | PROT_WRITE, t->type);
> +
Please, remove this blank line.
Rest is good. With the above:
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Thanks,
Andi
> + if (!map)
> + continue;
> +
> + memset(map + map_size - SZ_1K, 0xab, SZ_1K);
> + for (uint64_t i = 0; i < SZ_1K; i++)
> + igt_assert_eq(map[map_size - SZ_1K + i], 0xab);
> +
> + munmap(map, map_size);
> + }
> + gem_close(i915, handle);
> +}
> +
> static int mmap_gtt_version(int i915)
> {
> int gtt_version = -1;
> @@ -1082,6 +1111,14 @@ igt_main
> igt_subtest_f("blt-coherency")
> blt_coherency(i915);
>
> + igt_describe("Check for proper boundary calculation during mmap");
> + igt_subtest_with_dynamic("mmap-boundaries") {
> + for_each_memory_region(r, i915) {
> + igt_dynamic_f("%s", r->name)
> + test_mmap_boundaries(i915, r);
> + }
> + }
> +
> igt_fixture {
> drm_close_driver(i915);
> }
> --
> 2.45.2
next prev parent reply other threads:[~2024-08-21 14:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 13:59 [PATCH i-g-t v2 0/3] Introduce memory mapping tests Krzysztof Niemiec
2024-08-21 13:59 ` [PATCH i-g-t v2 1/3] tests/intel/gem_mmap_offset: Partial mmap and munmap Krzysztof Niemiec
2024-08-21 14:17 ` Andi Shyti
2024-08-21 13:59 ` [PATCH i-g-t v2 2/3] tests/intel/gem_mmap_offset: Introduce mmap-boundaries test Krzysztof Niemiec
2024-08-21 14:22 ` Andi Shyti [this message]
2024-08-21 13:59 ` [PATCH i-g-t v2 3/3] tests/intel/gem_mmap_offset: Introduce mmap-unmap test Krzysztof Niemiec
2024-08-21 14:29 ` Andi Shyti
2024-08-21 19:31 ` ✓ Fi.CI.BAT: success for Introduce memory mapping tests (rev2) Patchwork
2024-08-21 19:44 ` ✓ CI.xeBAT: " Patchwork
2024-08-22 3:33 ` ✗ CI.xeFULL: failure " Patchwork
2024-08-22 5:05 ` ✗ Fi.CI.IGT: " 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=ZsX4PDQockKH0q3A@ashyti-mobl2.lan \
--to=andi.shyti@linux.intel.com \
--cc=chris.p.wilson@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jannh@google.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=krzysztof.niemiec@intel.com \
--cc=lionel.g.landwerlin@intel.com \
--cc=nirmoy.das@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