[Mesa-dev] [PATCH] anv: Always set the reloc value to match the presumed_offset
Chris Wilson
chris at chris-wilson.co.uk
Wed May 10 08:07:00 UTC 2017
On Fri, May 05, 2017 at 12:33:54PM -0700, Jason Ekstrand wrote:
> On Fri, May 5, 2017 at 5:09 AM, Chris Wilson <[1]chris at chris-wilson.co.uk>
> wrote:
>
> It is a requirement, not just of using the NO_RELOC mode, that all
> relocation values in the execobjects match their reloc.presumed_offset,
> as the kernel will skip performing *any* relocation if the
> presumed_offset
> matches the target object. As anv is setting unknown relocations to -1
> irrespective of the actual value, if the kernel placed the target at -1
> (i.e. 0xfffffffff000 for 48bit GTT), it would happily skip the
> relocation.
> To prevent this, we need to always do the userspace relocations to
> ensure
> the values match. To improve further, set the unknown object offset to 0
> (a valid location) on the offchance it is available and the migration
> skipped.
>
> Is this a real issue? I specifically chose -1 because it *wasn't*
> page-aligned. I don't think the kernel whacks off the bottom 12 bits
> before doing the comparison to determine whether or not the relocation
> needs to happen.
Yes. It is real.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the mesa-dev
mailing list