All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Chris Wilson <chris.p.wilson@linux.intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v2 05/12] i915/gem_mmap_offset: Avoid set_domain when I915_MMAP_OFFSET_FIXED is used
Date: Fri, 2 Sep 2022 13:29:48 +0200	[thread overview]
Message-ID: <YxHpLJwjqHdBbVnd@kamilkon-desk1> (raw)
In-Reply-To: <20220902075227.50690-6-zbigniew.kempczynski@intel.com>

Hi,

On 2022-09-02 at 09:52:20 +0200, Zbigniew Kempczyński wrote:
> From: Chris Wilson <chris.p.wilson@linux.intel.com>
> 
> When OFFSET_FIXED mapping is in use avoid to set domain at all.
> 
> Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
>  tests/i915/gem_mmap_offset.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> index 5e6b19eb34..ee5e811392 100644
> --- a/tests/i915/gem_mmap_offset.c
> +++ b/tests/i915/gem_mmap_offset.c
> @@ -148,7 +148,8 @@ static void basic_uaf(int i915)
>  		}
>  
>  		expected = calloc(obj_size, sizeof(*expected));
> -		gem_set_domain(i915, handle, t->domain, 0);
> +		if (t->domain)
> +			gem_set_domain(i915, handle, t->domain, 0);
>  		igt_assert_f(memcmp(addr, expected, obj_size) == 0,
>  			     "mmap(%s) not clear on gem_create()\n",
>  			     t->name);
> @@ -157,15 +158,18 @@ static void basic_uaf(int i915)
>  		buf = calloc(obj_size, sizeof(*buf));
>  		memset(buf + 1024, 0x01, 1024);
>  		gem_write(i915, handle, 0, buf, obj_size);
> -		gem_set_domain(i915, handle, t->domain, 0);
> +		if (t->domain)
> +			gem_set_domain(i915, handle, t->domain, 0);
>  		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
>  			     "mmap(%s) not coherent with gem_write()\n",
>  			     t->name);
>  
> -		gem_set_domain(i915, handle, t->domain, t->domain);
> +		if (t->domain != -1)
----------------------------- ^
Should this be like other changes, just
		if (t->domain)

With that fixed you can add my r-b tag.

--
Kamil

> +			gem_set_domain(i915, handle, t->domain, t->domain);
>  		memset(addr + 2048, 0xff, 1024);
>  		gem_read(i915, handle, 0, buf, obj_size);
> -		gem_set_domain(i915, handle, t->domain, 0);
> +		if (t->domain)
> +			gem_set_domain(i915, handle, t->domain, 0);
>  		igt_assert_f(memcmp(buf, addr, obj_size) == 0,
>  			     "mmap(%s) not coherent with gem_read()\n",
>  			     t->name);
> -- 
> 2.34.1
> 

  reply	other threads:[~2022-09-02 11:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02  7:52 [igt-dev] [PATCH i-g-t v2 00/12] Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests Zbigniew Kempczyński
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 01/12] lib: Fix off-by-one-page in 48b obj.flags Zbigniew Kempczyński
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 02/12] lib/i915: Mark gem_create as handling const memory regions Zbigniew Kempczyński
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 03/12] i915/gem_create: Verify all regions return cleared objects Zbigniew Kempczyński
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 04/12] i915/gem_create: Stress creation with busy engines Zbigniew Kempczyński
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 05/12] i915/gem_mmap_offset: Avoid set_domain when I915_MMAP_OFFSET_FIXED is used Zbigniew Kempczyński
2022-09-02 11:29   ` Kamil Konieczny [this message]
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 06/12] i915/gem_mmap_offset: Verify all regions return clear mmaps on creation Zbigniew Kempczyński
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 07/12] i915/gem_mmap_offset: Verify all regions with ptrace Zbigniew Kempczyński
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 08/12] i915/gem_mmap_offset: Verify all regions remain in isolation Zbigniew Kempczyński
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 09/12] i915/gem_mmap_offset: Verify all regions have nonblocking pagefaults Zbigniew Kempczyński
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 10/12] i915/gem_mmap_offset: Check all mmap types reject invalid objects Zbigniew Kempczyński
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 11/12] i915/gem_mmap_offset: Exercise close race against all types/regions Zbigniew Kempczyński
2022-09-02 11:58   ` Kamil Konieczny
2022-09-02  7:52 ` [igt-dev] [PATCH i-g-t v2 12/12] i915/gem_mmap_offset: Crudely measure read/write to different mmaps Zbigniew Kempczyński
2022-09-02  8:26 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix spinner 48b + add I915_MMAP_OFFSET_FIXED tests (rev2) Patchwork
2022-09-02 18:04 ` [igt-dev] ✗ Fi.CI.IGT: 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=YxHpLJwjqHdBbVnd@kamilkon-desk1 \
    --to=kamil.konieczny@linux.intel.com \
    --cc=chris.p.wilson@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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.