Re: [RFC PATCH] iommu/amd: fix a race in fetch_pte()

From: Qian Cai
Date: Sun Apr 19 2020 - 22:07:26 EST




> On Apr 18, 2020, at 2:34 PM, Joerg Roedel <joro@xxxxxxxxxx> wrote:
>
> On Sat, Apr 18, 2020 at 09:01:35AM -0400, Qian Cai wrote:
>> Hard to tell without testing further. Iâll leave that optimization in
>> the future, and focus on fixing those races first.
>
> Yeah right, we should fix the existing races first before introducing
> new ones ;)
>
> Btw, THANKS A LOT for tracking down all these race condition bugs, I am
> not even remotely able to trigger them with the hardware I have around.
>
> I did some hacking and the attached diff shows how I think this race
> condition needs to be fixed. I boot-tested this fix on-top of v5.7-rc1,
> but did no further testing. Can you test it please?

Sure, give it a few days to see if it could survive.