Re: [PATCH v4 4/5] drm/panthor: Fix an off-by-one in the heap context retrieval logic

2024-05-03 Thread Liviu Dudau
On Thu, May 02, 2024 at 06:51:57PM +0200, Boris Brezillon wrote: > The heap ID is used to index the heap context pool, and allocating > in the [1:MAX_HEAPS_PER_POOL] leads to an off-by-one. This was > originally to avoid returning a zero heap handle, but given the handle > is formed with (vm_id <<

Re: [PATCH v4 4/5] drm/panthor: Fix an off-by-one in the heap context retrieval logic

2024-05-03 Thread Steven Price
On 02/05/2024 17:51, Boris Brezillon wrote: > The heap ID is used to index the heap context pool, and allocating > in the [1:MAX_HEAPS_PER_POOL] leads to an off-by-one. This was > originally to avoid returning a zero heap handle, but given the handle > is formed with (vm_id << 16) | heap_id, with

[PATCH v4 4/5] drm/panthor: Fix an off-by-one in the heap context retrieval logic

2024-05-02 Thread Boris Brezillon
The heap ID is used to index the heap context pool, and allocating in the [1:MAX_HEAPS_PER_POOL] leads to an off-by-one. This was originally to avoid returning a zero heap handle, but given the handle is formed with (vm_id << 16) | heap_id, with vm_id > 0, we already can't end up with a valid heap