]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/vt-d: Clear PRQ overflow only when PRQ is empty
authorLu Baolu <baolu.lu@linux.intel.com>
Tue, 26 Jan 2021 08:07:29 +0000 (16:07 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 29 Jan 2021 08:25:24 +0000 (09:25 +0100)
commitf2baf9dd3e39ab531dd38695d9754c9d4b3fbb1c
tree8c6b2fff157125ce3fbd1c991a817f227a68543f
parent4fbd2b16ba97a56b4be65c402f1bacbf635d1bdb
iommu/vt-d: Clear PRQ overflow only when PRQ is empty

It is incorrect to always clear PRO when it's set w/o first checking
whether the overflow condition has been cleared. Current code assumes
that if an overflow condition occurs it must have been cleared by earlier
loop. However since the code runs in a threaded context, the overflow
condition could occur even after setting the head to the tail under some
extreme condition. To be sane, we should read both head/tail again when
seeing a pending PRO and only clear PRO after all pending PRs have been
handled.

Suggested-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/linux-iommu/MWHPR11MB18862D2EA5BD432BF22D99A48CA09@MWHPR11MB1886.namprd11.prod.outlook.com/
Link: https://lore.kernel.org/r/20210126080730.2232859-2-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/svm.c