From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Sanity check the computed size and base of stolen memory
Date: Mon, 30 Jan 2017 15:45:55 +0200 [thread overview]
Message-ID: <1485783955.2893.11.camel@linux.intel.com> (raw)
In-Reply-To: <20170130131545.GP24154@nuc-i3427.alporthouse.com>
On ma, 2017-01-30 at 13:15 +0000, Chris Wilson wrote:
>
> if (base == 0 || range_overflows(base, ggtt->stolen_size, U64_MAX /* DMA_ADDR_MAX */))
>
> Bleh.
>
> #define add_overflows(A, B) __builtin_add_overflow_p((A), (B), (typeof((A) + (B)))0)
>
> if (base == 0 || add_overflows(base, ggtt->stolen_size))
Looks good.
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-01-30 13:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 16:55 [PATCH 1/2] drm/i915: Treat stolen memory as DMA addresses Chris Wilson
2017-01-27 16:55 ` [PATCH 2/2] drm/i915: Check that the DMA address for stolen fits within dma_addr_t Chris Wilson
2017-01-27 17:05 ` Ville Syrjälä
2017-01-27 17:18 ` Chris Wilson
2017-01-27 17:20 ` [PATCH] drm/i915: Sanity check the computed size and base of stolen memory Chris Wilson
2017-01-27 20:57 ` Paulo Zanoni
2017-01-30 12:41 ` Joonas Lahtinen
2017-01-30 13:15 ` Chris Wilson
2017-01-30 13:45 ` Joonas Lahtinen [this message]
2017-01-30 13:47 ` [PATCH v2] " Chris Wilson
2017-01-31 10:13 ` Joonas Lahtinen
2017-01-31 16:08 ` Chris Wilson
2017-01-27 20:50 ` [PATCH 1/2] drm/i915: Treat stolen memory as DMA addresses Paulo Zanoni
2017-01-27 21:12 ` Chris Wilson
2017-01-30 21:24 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Treat stolen memory as DMA addresses (rev4) 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=1485783955.2893.11.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).