All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/selftests: Ensure we don't clamp a random offset to 32b
Date: Wed, 10 Jul 2019 16:37:30 +0100	[thread overview]
Message-ID: <156277305018.4055.17406529760725408398@skylake-alporthouse-com> (raw)
In-Reply-To: <874l3trji8.fsf@gaia.fi.intel.com>

Quoting Mika Kuoppala (2019-07-10 16:34:23)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Specify that we do want a 64b value for sizeof(u32) as we want to
> > compute the mask of the upper 62bits.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> > index 3abe15a08b6d..275ec1bfc2be 100644
> > --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> > +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> > @@ -1539,7 +1539,7 @@ static int igt_vm_isolation(void *arg)
> >  
> >                       div64_u64_rem(i915_prandom_u64_state(&prng),
> >                                     vm_total, &offset);
> > -                     offset &= -sizeof(u32);
> > +                     offset &= -(u64)sizeof(u32);
> 
> Taking a sizeof of something we know the size of.

u32 is a proxy for dword, and I was just trying to be more expressive
that we want the address aligned to a dword for the MI_STORE_DWORD_IMM
used. alignof_dword maybe?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-07-10 15:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 14:30 [PATCH] drm/i915/selftests: Ensure we don't clamp a random offset to 32b Chris Wilson
2019-07-10 15:34 ` Mika Kuoppala
2019-07-10 15:37   ` Chris Wilson [this message]
2019-07-10 15:45     ` Mika Kuoppala
2019-07-10 16:14 ` [PATCH v2] " Chris Wilson
2019-07-11  8:58 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-07-11  9:50 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Ensure we don't clamp a random offset to 32b (rev2) Patchwork
2019-07-11 17:54 ` ✓ 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=156277305018.4055.17406529760725408398@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.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.