<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - Buffer Object corruption with multiple processes"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=62191#c23">Comment # 23</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - Buffer Object corruption with multiple processes"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=62191">bug 62191</a>
              from <span class="vcard"><a class="email" href="mailto:jon.bloomfield@intel.com" title="jon.bloomfield@intel.com">jon.bloomfield@intel.com</a>
</span></b>
        <pre>We tried two stop_machine() experiments on VLV - The first just called wbinvd()
from stop machine, instead of on_each_cpu(). This made no difference.

However, reverting to the v2 patch, and calling i915_gem_write_fence(), from
stop_machine, appears to have resolved the problem. We ran 1000 iterations of
the selftest bug-demo with no failures. We also had to remove the HAS_LLC test,
since VLV has no LLC.

Note that we surrounded the call to i915_gem_write_fence() with wbinvd(). We
didn't have time to see if it was possible to remove these invalidate
operations.

The relevant code-portions are shown below...

static int i915_gem_write_fence__ipi(void *data)
{
    struct write_fence *args = data;
    wbinvd();
    i915_gem_write_fence(args->dev, args->fence, args->obj);
    wbinvd();
    return 0;
}

static void i915_gem_object_update_fence(struct drm_i915_gem_object *obj,
                     struct drm_i915_fence_reg *fence,
                     bool enable)
{
    struct drm_i915_private *dev_priv = obj->base.dev->dev_private;
    struct write_fence args = {
        .dev = obj->base.dev,
        .fence = fence_number(dev_priv, fence),
        .obj = enable ? obj : NULL,
    };

    stop_machine(i915_gem_write_fence__ipi, &args, cpu_possible_mask);

    if (enable) {
        obj->fence_reg = args.fence;
        fence->obj = obj;
        list_move_tail(&fence->lru_list, &dev_priv->mm.fence_list);
    } else {
        obj->fence_reg = I915_FENCE_REG_NONE;
        fence->obj = NULL;
        list_del_init(&fence->lru_list);
    }
}</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>