RE: [PATCH] iommu/amd: Fix for L2 race with VM invalidation

From: Cornwall, Jay
Date: Wed May 14 2014 - 10:12:23 EST


Hi,

I'm not sure why you're submitting this, Suravee?

We already agreed that we need the extra mmu_notifier point, proposed by Joerg back in 2011, to eliminate the race. I had thought we were waiting on that to be implemented.

________________________________________
From: Joerg Roedel [joro@xxxxxxxxxx]
Sent: Wednesday, May 14, 2014 4:29 AM
To: Suthikulpanit, Suravee
Cc: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx; Hurwitz, Sherry; Naru, Kim; linux-kernel@xxxxxxxxxxxxxxx; Cornwall, Jay
Subject: Re: [PATCH] iommu/amd: Fix for L2 race with VM invalidation

On Wed, May 14, 2014 at 01:34:12AM -0500, suravee.suthikulpanit@xxxxxxx wrote:
> A low probability race exists with this fix. Translations received
> within the critical section to PTEs which are concurrently being
> invalidated may resolve to stale mappings.

Sorry, no. This patch can cause silent data corruption when the pages in
these stale mappings get reused. I understand that the current way does
not work either and can cause failures in the GPU, but silent data
corruption is worse than that.

How about putting the page-fault requests on hold between
invalidate_range_start/end()? The GPU will not see the failures, just a
longer delay until the page faults are handled.


Joerg


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/