On Fri, Aug 2, 2024 at 10:39 AM Andi Shyti <[email protected]> wrote:
> Calculating the size of the mapped area as the lesser value
> between the requested size and the actual size does not consider
> the partial mapping offset. This can cause page fault access.
>
> Fix the calculation of the starting and ending addresses, the
> total size is now deduced from the difference between the end and
> start addresses.
>
> Additionally, the calculations have been rewritten in a clearer
> and more understandable form.
>
> Fixes: c58305af1835 ("drm/i915: Use remap_io_mapping() to prefault all PTE in 
> a single pass")
> Reported-by: Jann Horn <[email protected]>
> Co-developed-by: Chris Wilson <[email protected]>
> Signed-off-by: Chris Wilson <[email protected]>
> Signed-off-by: Andi Shyti <[email protected]>
> Cc: Joonas Lahtinen <[email protected]>
> Cc: Matthew Auld <[email protected]>
> Cc: Rodrigo Vivi <[email protected]>
> Cc: <[email protected]> # v4.9+

Reviewed-by: Jann Horn <[email protected]>

Reply via email to