<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 4, 2017 at 1:17 AM, Juan A. Suarez Romero <span dir="ltr"><<a href="mailto:jasuarez@igalia.com" target="_blank">jasuarez@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, 2017-05-03 at 09:44 -0700, Jason Ekstrand wrote:<br>
> ---<br>
> src/intel/vulkan/anv_<wbr>allocator.c | 11 +++++------<br>
> 1 file changed, 5 insertions(+), 6 deletions(-)<br>
><br>
> diff --git a/src/intel/vulkan/anv_<wbr>allocator.c b/src/intel/vulkan/anv_<wbr>allocator.c<br>
> index d7b86c8..40913ec 100644<br>
> --- a/src/intel/vulkan/anv_<wbr>allocator.c<br>
> +++ b/src/intel/vulkan/anv_<wbr>allocator.c<br>
> @@ -338,6 +338,11 @@ anv_block_pool_expand_range(<wbr>struct anv_block_pool *pool,<br>
> assert(center_bo_offset >= pool->back_state.end);<br>
> assert(size - center_bo_offset >= pool->state.end);<br>
><br>
> + /* Assert that we don't go outside the bounds of the memfd */<br>
> + assert(center_bo_offset <= BLOCK_POOL_MEMFD_CENTER);<br>
> + assert(size - center_bo_offset <=<br>
> + BLOCK_POOL_MEMFD_SIZE - BLOCK_POOL_MEMFD_CENTER);<br>
> +<br>
<br>
</span>Some lines below, we change the value of size and center_bo_offset.<br>
Shouldn't we put those assertions afterwards?<br></blockquote><div><br></div><div>No, in block_pool_expand_range, these are never changed. At least, if they are, I don't see the change.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
J.A.<br>
<span class=""><br>
> cleanup = u_vector_add(&pool->mmap_<wbr>cleanups);<br>
> if (!cleanup)<br>
> return vk_error(VK_ERROR_OUT_OF_HOST_<wbr>MEMORY);<br>
> @@ -493,12 +498,6 @@ anv_block_pool_grow(struct anv_block_pool *pool, struct anv_block_state *state)<br>
><br>
> assert(size > pool->bo.size);<br>
><br>
> - /* We can't have a block pool bigger than 1GB because we use signed<br>
> - * 32-bit offsets in the free list and we don't want overflow. We<br>
> - * should never need a block pool bigger than 1GB anyway.<br>
> - */<br>
> - assert(size <= (1u << 31));<br>
> -<br>
> /* We compute a new center_bo_offset such that, when we double the size<br>
> * of the pool, we maintain the ratio of how much is used by each side.<br>
> * This way things should remain more-or-less balanced.<br>
</span>______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div>