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

2019-09-05 Thread Qian Cai
On Thu, 2019-09-05 at 13:43 +0200, Joerg Roedel wrote: > Hi Qian, > > On Wed, Sep 04, 2019 at 05:24:22PM -0400, Qian Cai wrote: > > if (domain->mode == PAGE_MODE_6_LEVEL) > > /* address space already 64 bit large */ > > return false; > > > > This gives a clue that ther

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

2019-09-05 Thread Joerg Roedel
Hi Qian, On Wed, Sep 04, 2019 at 05:24:22PM -0400, Qian Cai wrote: > if (domain->mode == PAGE_MODE_6_LEVEL) > /* address space already 64 bit large */ > return false; > > This gives a clue that there must be a race between multiple concurrent > threads in increas

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

2019-09-04 Thread Qian Cai
When the system is under some memory pressure, it could cause disks on the "smartpqi" driver going offline below. From the UBSAN report, it indicates that "domain->mode" becomes 7. Further investigation indicates that the only place that would increase "domain->mode" is increase_address_space() but